Skip to content

Disseminate auxiliary info and approvals via network messages - #506

Draft
samliok wants to merge 2 commits into
instance-refactorfrom
aux-dissemination
Draft

Disseminate auxiliary info and approvals via network messages#506
samliok wants to merge 2 commits into
instance-refactorfrom
aux-dissemination

Conversation

@samliok

@samliok samliok commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Second PR of the cleanup-instance stack (2/4), on top of #505.

Auxiliary info and epoch transition approvals become network messages instead of being generated locally by the block builder:

  • New Message.AuxiliaryInfo and Message.EpochTransitionApproval fields and a common.AuxiliaryInfo type.
  • Blocks now embed an AuxiliaryInfoBatch holding one entry per contributing node. The builder collects legal entries from a new auxInfoStore mempool (populated by HandleAuxiliaryInfo) instead of calling Generate itself.
  • SignApproval is exported so the transition listener (next PR) can sign and broadcast approvals, and GetAuxiliaryHistory exposes the aux history traversal.

The new APIs are unused until the wiring PR on top of this one.

Reviewer notes:

  • The metadata aux info field keeps canoto field 7 but its nested format changed, so blocks that carried aux info are wire-incompatible with main.
  • The candidate digest for an empty aux history changed from sha256(nil) to the zero digest, which is consensus-visible.
  • InitializeApprovalStore/Approvals() currently have no consumers.
  • In computeExpectedAuxInfoForApprovalCollection, the version-mismatch branch wraps err while it is nil.
  • Clone() now shallow-copies the batch where the old struct was deep-cloned.

… VM, rework epoch transitions

Extract LastBlock and epoch/validator-set derivation into util.go with tests.
Split ParseBlock into a BlockDeserializer interface and move ICM epoch
computation to a Config field. Replace EpochAwareStorage with InstanceStorage,
which skips Telocks by block type and exposes an onIndex hook. Signal epoch
changes via EpochConfig.OnSealingBlockIndex for validators and
nonvalidator.Config.TransitionToValidator for non-validators instead of the
storage wrapper. Rework processEpochChange to honor Stop for validators and
notifyEpochChange to keep only the newest pending change.
Add Message.AuxiliaryInfo and Message.EpochTransitionApproval along with the
common.AuxiliaryInfo type. Blocks now carry an AuxiliaryInfoBatch with one
entry per contributing node instead of a single locally generated entry. The
builder collects legal entries from a new auxInfoStore mempool populated by
HandleAuxiliaryInfo, and SignApproval is exported so callers can sign and
broadcast their own approvals. GetAuxiliaryHistory exposes the aux history
traversal used to decide whether to generate info or approve.

Note: this changes the wire format of the metadata aux info field, and the
candidate digest for an empty aux history is now the zero digest instead of
sha256(nil).
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