-
Notifications
You must be signed in to change notification settings - Fork 258
Closed
Description
Replacement for elements of #96 more specific to Rust implementation style and architecture.
We should update the ADR with the relevant changes from here as well.
Types:
- Make
validate_vals_and_commita method on Commit (Light client: further trait impls, improvements, and tests #84 (comment)) - Use
validate_next_vals! - Introduce a
Clienttype to holdStoreandRequester(?) (Light client: bisection, store, requester #100 (comment)) - Put
trust_thresholdandtrusting_periodin the Store (?) (Light client: bisection, store, requester #100 (comment)) - Enforce off-by-one issues in the type system, eg.:
-
TrustedState::newtaking header h-1 and validators for h (Light client: bisection, store, requester #100 (comment)) -
verifytaking vals for the right height (Light client: bisection, store, requester #100)
-
- make
trust_levelsatisfy Copy or Clone and don't pass by reference (Light client: bisection, store, requester #100) - memoize results of methods that don't take args, eg.
.hash()(Light client impl followup #96 (comment)) - use an enum for height to get the latest state instead of special-casing 0 (rpc: map height=0 to no parameters in the http call #118)
- introduce a simple event type and let bisection function (or a Client structure it's a method on) take a closure that will fire events. this can be used for logging so we don't need a print statement or logger inside the functions
Module Structure:
- Remove dependency on
tenderminttypes, eg.Hash - Make it a crate ?
- Rename types.rs to interface.rs (Light client: bisection, store, requester #100 (comment))
- Add example to doc
- Simplify the public API and make it harder/impossible to use incorrectly
- Unexpose verify_single once json tests are updated (525c89f#diff-f0c5bdd887eaf26a3fd9ec5bdc93e2d9R106 and 9fbb749#diff-afc724a3f81219fadc771326ccca3a84R8)
Errors:
-
Error::RequestFailedshould wrap underlying requester errors (Light client: bisection, store, requester #100 (comment)) - Deduplicate the
Error::InvalidSignaturewithErrorKind::SignatureInvalid - Move to an error.rs file
- voting_power_in can't detect signatures from validators not in the current validator set (can't detect signatures from validators not in the current validator set)
- need two distinct errors for InsufficientVotingPower - one when it's insufficient to skip (ie. so do bisection) and one when it's insufficient to verify (ie. return error) Differentiate VotingPower errors #119
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels