feat!: verify next consensus params between nodes#550
Merged
Conversation
067e30f to
1e95c2c
Compare
shotonoff
approved these changes
Jan 5, 2023
Collaborator
shotonoff
left a comment
There was a problem hiding this comment.
LGTM
left one minor question
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.
Issue being fixed or feature implemented
Consensus params updates are not verified between nodes until they get applied.
Current process of updating consensus params is as follows:
Block.Header.ConsensusHashat height H+1.To summarize, the process described above means we delay verification consensus params update generated at height H by one block, to H+1.
However, If the state at height H caused a non-deterministic consensus params update, it should be also considered invalid, and we should not finalize it. It means that the current implementation allows the finalization of a possibly invalid state.
An alternative approach is to verify consensus params updates when they are generated - that is, at height H (instead of H+1). It means that the worst-case scenario will lead to a chain halt with finalized state H-1. Implementation of this approach involves adding the hash of NextConsensusParams into Header, increasing the size of the Header.
What was done?
How Has This Been Tested?
Breaking Changes
Checklist:
For repository code-owners and collaborators only