Anton Kaliaev
86adc2c89f
lite: follow up from #3989 ( #4209 )
* rename adjusted to adjacent
Refs https://github.com/tendermint/tendermint/pull/3989#discussion_r352140829
* rename ErrTooMuchChange to ErrNotEnoughVotingPowerSigned
Refs https://github.com/tendermint/tendermint/pull/3989#discussion_r352142785
* verify commit is properly signed
* remove no longer trusted headers
* restore trustedHeader and trustedNextVals
* check trustedHeader using options
Refs https://github.com/tendermint/tendermint/pull/4209#issuecomment-562462165
* use correct var when checking if headers are adjacent
in bisection func
+ replace TODO with a comment
https://github.com/tendermint/tendermint/pull/3989#discussion_r352125455
* return header in VerifyHeaderAtHeight
because that way we avoid DB call
+ add godoc comments
+ check if there are no headers yet in AutoClient
https://github.com/tendermint/tendermint/pull/3989#pullrequestreview-315454506
* TestVerifyAdjacentHeaders: add 2 more test-cases
+ add TestVerifyReturnsErrorIfTrustLevelIsInvalid
* lite: avoid overflow when parsing key in db store!
* lite: rename AutoClient#Err to Errs
* lite: add a test for AutoClient
* lite: fix keyPattern and call itr.Next in db store
* lite: add two tests for db store
* lite: add TestClientRemovesNoLongerTrustedHeaders
* lite: test Client#Cleanup
* lite: test restoring trustedHeader
https://github.com/tendermint/tendermint/pull/4209#issuecomment-562462165
* lite: comment out unused code in test_helpers
* fix TestVerifyReturnsErrorIfTrustLevelIsInvalid after merge
* change defaultRemoveNoLongerTrustedHeadersPeriod
and add docs
* write more doc
* lite: uncomment testable examples
* use stdlog.Fatal to stop AutoClient tests
* make lll linter happy
* separate errors for 2 cases
- the validator set of a skipped header cannot be trusted, i.e. <1/3rd
of h1 validator set has signed (new error, something like
ErrNewValSetCantBeTrusted)
- the validator set is trusted but < 2/3rds has signed
(ErrNewHeaderCantBeTrusted)
https://github.com/tendermint/tendermint/pull/4209#discussion_r360331253
* remove all headers (even the last one) that are outside
of the trusting period. By doing this, we avoid checking the
trustedHeader's hash in checkTrustedHeaderUsingOptions (case #1 ).
https://github.com/tendermint/tendermint/pull/4209#discussion_r360332460
* explain restoreTrustedHeaderAndNextVals better
https://github.com/tendermint/tendermint/pull/4209#discussion_r360602328
* add ConfirmationFunction option
for optionally prompting for user input Y/n before removing headers
Refs https://github.com/tendermint/tendermint/pull/4209#discussion_r360602945
* make cleaning optional
https://github.com/tendermint/tendermint/pull/4209#discussion_r364838189
* return error when user refused to remove headers
* check for double votes in VerifyCommitTrusting
* leave only ErrNewValSetCantBeTrusted error
to differenciate between h2Vals.VerifyCommit and
h1NextVals.VerifyCommitTrusting
* fix example tests
* remove unnecessary if condition
https://github.com/tendermint/tendermint/pull/4209#discussion_r365171847
It will be handled by the above switch.
* verifyCommitBasic does not depend on vals
Co-authored-by: Marko <marbar3778@yahoo.com>
5 years ago
Ethan Buchman
de5a6010f0
fix DynamicVerifier for large validator set changes ( #3171 )
* base verifier: bc->bv and check chainid
* improve some comments
* comments in dynamic verifier
* fix comment in doc about BaseVerifier
It requires the validator set to perfectly match.
* failing test for #2862
* move errTooMuchChange to types. fixes #2862
* changelog, comments
* ic -> dv
* update comment, link to issue
6 years ago
Ethan Buchman
f36ed7e7ff
General Merkle Follow Up ( #2510 )
* tmlibs -> libs
* update changelog
* address some comments from review of #2298
6 years ago
HaoyangLiu
8dda3c3b28
lite: Add synchronization in lite verify ( #2396 )
* Implement issues 2386: add synchronization in lite verify and change all Certify to Verify
* Replace make(chan struct{}, 0) with make(chan struct{})
* Parameterize memroy cache size and add concurrent test
* Refactor import order
6 years ago
Jae Kwon
e719a93d1d
Addressed review for #1815 except those marked as 'TODO make issue'
6 years ago
Zach Ramsay
44dad6d70b
Revert "detele everything"
This reverts commit d02c5d1e30
.
6 years ago
Zach Ramsay
d02c5d1e30
detele everything
6 years ago
Ethan Buchman
9018acde5f
tmlibs -> tendermint/libs
6 years ago
Jae Kwon
37ef5485b4
Add logs to lite/*; Fix rpc status to return consensus height, not blockstore height
6 years ago
Jae Kwon
538c410bcd
Fixes from review
6 years ago
Jae Kwon
242a6037e8
Fixes from review
7 years ago
Jae Kwon
bf0ff212b9
Refactor "lite" to handle delayed validator set changes.
Also, fix consensus liveness issue.
7 years ago
Liamsi
d2c05bc5b9
Revert "delete everything" (includes everything non-go-crypto)
This reverts commit 96a3502
7 years ago
Liamsi
96a3502126
delete everything
7 years ago
Adrian Brink
32311acd01
Vulnerability in light client proxy ( #1081 )
* Vulnerability in light client proxy
When calling GetCertifiedCommit the light client proxy would call
Certify and even on error return the Commit as if it had been correctly
certified.
Now it returns the error correctly and returns an empty Commit on error.
* Improve names for clarity
The lite package now contains StaticCertifier, DynamicCertifier and
InqueringCertifier. This also changes the method receivers from one
letter to two letter names, which will make future refactoring easier
and follows the coding standards.
* Fix test failures
* Rename files
* remove dead code
7 years ago