-
Notifications
You must be signed in to change notification settings - Fork 628
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
Split CheckHeaderAndUpdateState into 4 functions #668
Labels
Milestone
Comments
colin-axner
added
the
needs discussion
Issues that need discussion before they can be worked on
label
Dec 23, 2021
3 tasks
colin-axner
changed the title
Split CheckHeaderAndUpdateState into 3 functions
Split CheckHeaderAndUpdateState into 4 functions
Feb 7, 2022
3 tasks
colin-axner
removed
the
needs discussion
Issues that need discussion before they can be worked on
label
Feb 7, 2022
This was referenced Feb 7, 2022
This was referenced Feb 11, 2022
3 tasks
This was referenced Mar 29, 2022
9 tasks
Repository owner
moved this from In review
to Done
in ibc-go
Apr 1, 2022
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
The
CheckHeaderAndUpdateState
is currently overloaded in functionality. It can be easy for light-client developers to unknowingly allow bugs. We should split the functionality up such that light client developers are explicitly told what they need to account forProblem Definition
CheckHeaderAndUpdateState
requires the light client to:Detecting misbehaviour and accounting for duplicate headers are easy to overlook, but are vital to the security of a light client implementation.
## ProposalSplitCheckHeaderAndUpdateState
into:-VerifyHeader
-CheckHeaderForMisbehaviour
-UpdateStateFromHeader
Updated proposal
ref
Split
CheckHeaderAndUpdateState
into 4 functions:VerifyHeader: checks header signatures, ensuring everything is constructed correctly and is valid. Should be similar to 07-tendermint checkValidity. Should only return an error
CheckForMisbehaviour: checks to see if a header is evidence of misbehaviour. In 07-tendermint, it'd be these checks. Should return a boolean (foundMisbehaviour)
UpdateStateOnMisbehaviour: freeze the client and updates its state accordingly
UpdateState: Perform a regular update (may do a no-op for duplicate updates)
Splitting PR Recommendation
PR for each light client for each function
Make a PRs for each light client
Replace CheckHeaderAndUpdateState with new functions
Add the 4 new functions to the ClientState interface, remove CheckHeaderAndUpdateState and update 02-client code to use the new functions.
Code:
By splitting the PRs up this way, reviewers don't need to switch context on light client funcitonality or light client vs 02-client.
For Admin Use
The text was updated successfully, but these errors were encountered: