https://github.com/tendermint/tendermint
Revision df3eee455c9d2a4a9698a35aa0dfe6d5d2efd53d authored by Callum Waters on 04 February 2020, 12:02:20 UTC, committed by GitHub on 04 February 2020, 12:02:20 UTC
Closes issue #4338

Uses a wrapper function around both the signedHeader and validatorSet calls to the primary provider which attempts to retrieve the information 5 times before deeming the provider unavailable and replacing the primary provider with the first alternative before trying recursively again (until all alternatives are depleted)

Employs a mutex lock for any operations involving the providers of the light client to ensure no operations occurs whilst the new primary is chosen.

Commits:

* created swapProvider function

* eliminates old primary provider after replacement. Uses a mutex when changing providers

* renamed to replaceProvider

* created wrapped functions for signed header and val set

* created test for primary provider replacement

* implemented suggested revisions

* created Witnesses() and Primary()

* modified backoffAndJitterTime

* modified backoffAndJitterTime

* changed backoff base and jitter to functional arguments

* implemented suggested changes

* removed backoff function

* changed exp function to match go version

* halved the backoff time

* removed seeding and added comments

* fixed incorrect test

* extract backoff timeout calc into a function

Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
1 parent 9b9f1be
History
Tip revision: df3eee455c9d2a4a9698a35aa0dfe6d5d2efd53d authored by Callum Waters on 04 February 2020, 12:02:20 UTC
lite2: replace primary provider with alternative when unavailable (#4354)
Tip revision: df3eee4
File Mode Size
.circleci
.github
DOCKER
abci
behaviour
blockchain
cmd
config
consensus
crypto
docs
evidence
libs
lite
lite2
mempool
mock
networks
node
p2p
privval
proxy
rpc
scripts
state
store
test
tools
types
version
.editorconfig -rw-r--r-- 280 bytes
.gitignore -rw-r--r-- 528 bytes
.golangci.yml -rw-r--r-- 1.1 KB
CHANGELOG.md -rw-r--r-- 142.2 KB
CHANGELOG_PENDING.md -rw-r--r-- 616 bytes
CODE_OF_CONDUCT.md -rw-r--r-- 4.9 KB
CONTRIBUTING.md -rw-r--r-- 10.4 KB
LICENSE -rw-r--r-- 11.1 KB
Makefile -rw-r--r-- 8.3 KB
PHILOSOPHY.md -rw-r--r-- 7.5 KB
README.md -rw-r--r-- 7.5 KB
SECURITY.md -rw-r--r-- 1.7 KB
UPGRADING.md -rw-r--r-- 18.3 KB
Vagrantfile -rw-r--r-- 2.0 KB
appveyor.yml -rw-r--r-- 251 bytes
codecov.yml -rw-r--r-- 330 bytes
docker-compose.yml -rw-r--r-- 1.3 KB
dredd.yml -rw-r--r-- 700 bytes
go.mod -rw-r--r-- 1.4 KB
go.sum -rw-r--r-- 29.6 KB
tests.mk -rw-r--r-- 3.7 KB
tools.mk -rw-r--r-- 2.8 KB

README.md

back to top