Light client: further trait impls, improvements, and tests#63
Closed
Light client: further trait impls, improvements, and tests#63
Conversation
This is just the simplest way to move forward implementing the traits of the lite package. There are alternatives: We do not want a create a circular dependency between lite and tendermint (which does not even compile). To avoid this we could: 1) make lite a module of tendermint, or, 2) replicate a lot of the types of the tendermint crate in the lite package (e.g. Time, Ids etc), or 3) have a dependency from tendermint to the lite package only (but then the trait impls do need to live in the lite crate instead with the types in the tendermint crate directly).
respective amino types, and, directly encode some
2DC46AD76277039F1B65FE3C7F2064788B1C12FE701CFE7EC93F751586A48781) will add a test after #42 gets merged
- Consistency: Rename encode_bytes to bytes_enc - remove redundant return statement
and the signature
- work in progress as we might want to let an inner function for the recursion - also we might simply want to use From to consume (or create a Vec) instead of changing the method signature (as suggested here: #57 (comment))
…h_from_byte_slices' into lite_impl
direct vector initialization instead of going through &[&[u8]]
Signing bytes need to encoded with encode_length_delimited
and correctly compute header hash when block id is empty. Represent empty Hash with Option
Handle empty block id
add simple rpc test for light client
Represent `last_commit` as `Option<Commit>`
Implement several utility trait
accept iff +1/3 of the voting power signed
…code (lite2) and tests: - rename former verify method to verify_header_and_commit (might be obsolete) - make the expired method public to be able to use and test it from the outside - add some helpers to be able to deal with deserialization hickups - add a bunch of tests using @Shivani912's generator code (with minor modifications)
d2b3bc1 to
a53098c
Compare
Contributor
Author
|
With the last commit the build started failing with: Probably related circle-ci catching up with the latest ed25519-dalek release? cc @tarcieri |
Contributor
Author
|
This needs rebasing onto master... |
…imple_merkle_merged # Conflicts: # tendermint/src/amino_types/block_id.rs # tendermint/src/amino_types/vote.rs # tendermint/src/block/commit.rs # tendermint/src/block/header.rs # tendermint/src/genesis.rs # tendermint/src/merkle.rs # tendermint/src/serializers.rs # tendermint/src/validator.rs # tendermint/src/vote.rs
Contributor
Author
|
replaced by #84 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#59 should be merged first
(hence a draft)ref #36
Update: Since this PR was opened (mostly to show the impact of #59), it grew to contain several further PRs added in by @yihuang (big thanks). These added 2 missing impls, resolved a few encoding edge cases and simple (json-based) tests.
Particularly:
last_commitasOption<Commit>#79Additionally this PR introduces a
TrustLeveltrait via bd26e74 and adds averifymethod that is closer to the (current) spec / go-code in 017c1ba (with a few tests from JSON).