Simplex reconfiguration framework - Part V (ICM epoch + authInfo)#368
Open
yacovm wants to merge 1 commit into
Open
Simplex reconfiguration framework - Part V (ICM epoch + authInfo)#368yacovm wants to merge 1 commit into
yacovm wants to merge 1 commit into
Conversation
b4939d2 to
d25b28d
Compare
3fb913f to
0a368a8
Compare
Persist ICM epoch information in block metadata and maintain it on the
StateMachine the same way the proposerVM does, so blocks encode which
P-chain height the ICM protocol should use.
Metadata / encoding:
- Add ICMEpochInfo (canoto field 7) and AuxiliaryInfo (field 6) to the
block metadata, with Equal/IsZero helpers.
ICM epoch computation:
- Add ICMEpoch, ICMEpochInput and the ICMEpochTransition function type,
exposed via Config.ComputeICMEpoch (replacing GetUpgrades).
- Add computeICMEpochInfo, which derives the next epoch from the parent
block's epoch, P-chain height and timestamps.
- Build/verify of normal, collecting-approvals and sealing blocks now
compute and carry the ICM epoch, and feed its P-chain height into
BlockBuilder.BuildBlock and InnerBlock.Verify (removing the prior
TODOs and the hard-coded pChainHeight).
Zero block:
- The zero block carries over its parent's ICM epoch unchanged (empty
when the parent predates ICM); the first epoch then begins on the
block built on top of it.
- verifyBlockZero now validates the whole block by digest instead of
comparing SimplexEpochInfo alone (bug fix!)
Timestamps:
- Add verifyTimestamp (rejects non-monotonic timestamps, timestamps too
far in the future beyond maxSkew, and values exceeding int64) and
apply it when verifying both zero and non-zero blocks.
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
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.
Re-introduce ICM epoch info
Persist ICM epoch information in block metadata and maintain it on the
StateMachine the same way the proposerVM does, so blocks encode which
P-chain height the ICM protocol should use.
Metadata / encoding:
block metadata, with Equal/IsZero helpers.
ICM epoch computation:
exposed via Config.ComputeICMEpoch (replacing GetUpgrades).
block's epoch, P-chain height and timestamps.
compute and carry the ICM epoch, and feed its P-chain height into
BlockBuilder.BuildBlock and InnerBlock.Verify (removing the prior
TODOs and the hard-coded pChainHeight).
Zero block:
when the parent predates ICM); the first epoch then begins on the
block built on top of it.
comparing SimplexEpochInfo alone (bug fix!)
Timestamps:
far in the future beyond maxSkew, and values exceeding int64) and
apply it when verifying both zero and non-zero blocks.