You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 for
Problem Definition
CheckHeaderAndUpdateState requires the light client to:
verify the header
account for duplicate headers
automatically detect misbehaviour
return updated client and consensus states
Detecting misbehaviour and accounting for duplicate headers are easy to overlook, but are vital to the security of a light client implementation.
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)
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: