Skip to content

Simplex reconfiguration framework - Part V (ICM epoch + authInfo)#368

Open
yacovm wants to merge 1 commit into
mainfrom
reconfig-5
Open

Simplex reconfiguration framework - Part V (ICM epoch + authInfo)#368
yacovm wants to merge 1 commit into
mainfrom
reconfig-5

Conversation

@yacovm
Copy link
Copy Markdown
Collaborator

@yacovm yacovm commented Apr 26, 2026

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:

  • 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.

@yacovm yacovm marked this pull request as draft April 26, 2026 21:52
@yacovm yacovm force-pushed the reconfig-5 branch 4 times, most recently from b4939d2 to d25b28d Compare May 29, 2026 20:36
@yacovm yacovm force-pushed the reconfig-5 branch 2 times, most recently from 3fb913f to 0a368a8 Compare June 5, 2026 19:41
@yacovm yacovm marked this pull request as ready for review June 5, 2026 19:42
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant