Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Light client impl followup #96

Closed
5 of 17 tasks
liamsi opened this issue Dec 16, 2019 · 3 comments
Closed
5 of 17 tasks

Light client impl followup #96

liamsi opened this issue Dec 16, 2019 · 3 comments

Comments

@liamsi
Copy link
Member

liamsi commented Dec 16, 2019

Tracking TODOs for the Light client impl

Feedback / Review of #84

@liamsi
Copy link
Member Author

liamsi commented Dec 18, 2019

Something else I've noticed, and we can optimize for (but later): Currently all operations on the impls of traits traits that do not take an additional argument can be "cached" in a field instead of recomputed on each call.
In particular Header::hash: https://github.com/interchainio/tendermint-rs/blob/24955d18a99f3f3a846f519b770de5887159a0fa/tendermint/src/block/header.rs#L98
and ValidatorSet hash: https://github.com/interchainio/tendermint-rs/blob/24955d18a99f3f3a846f519b770de5887159a0fa/tendermint/src/validator.rs#L33
At least currently the API does only allow to create these structs without modifying them. These hashes could be computed once instead of on every call of hash(). Same for total_power.

@liamsi liamsi removed their assignment Dec 19, 2019
@ebuchman
Copy link
Member

With respect to removing the Validator trait. I think this is something we should try to do, since these methods aren't actually used within the light client itself, they only need to be exposed so that an implementation of Commit.voting_power_in, which takes a ValidatorSet, has access to these validator internals. Perhaps we can avoid this if the ValidatorSet is somehow an associated type on Commit so it can more readily access the internals without going through a trait.

This will also make it much easier to write tests for the core light client logic without having to mock out individual validators and the verify_signature method

@ebuchman
Copy link
Member

Ok, some of these are addressed in #100 and #109, as noted in the edited opening post. The rest are split up into issues #110, #111, and #112 for things related to Rust, the spec, and the next steps, respectively :). Closing this for all those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants