Skip to content

Abort block building and sending upon commit of an epoch sealing block#433

Open
yacovm wants to merge 1 commit into
mainfrom
stopEpochAtEpochChange
Open

Abort block building and sending upon commit of an epoch sealing block#433
yacovm wants to merge 1 commit into
mainfrom
stopEpochAtEpochChange

Conversation

@yacovm

@yacovm yacovm commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Once a block carrying SealingBlockInfo is committed (designates a sealing block), mark the epoch as sealed and stop it from doing any further work: it no longer verifies blocks, builds/proposes blocks, or broadcasts/sends messages.

The motivation is to prevent the epoch from interacting with the VM or other nodes, as a sealed epoch is supposed to be terminated right after its sealing.

High level changes:

  • Added epochSealed (an atomic.Bool)
  • indexFinalization() now sets epochSealed and returns without progressing to the next round when the committed block is a sealing block.
  • broadcast/send now abort if sealed, and the block verification and block-building tasks abort when the epoch is sealed.

Add TestEpochStopsAtSealingBlock, which drives an epoch through a chain via block messages, finalizations and notarizations and asserts that: without a sealing block every block is verified and the epoch proposes a block for the round it leads; with a sealing block only the blocks up to and including it are verified and committed.

TestEpochBuildsInRoundAfterSealingBlock which drives an epoch through a chain via block messages and finalizations and ensures that a block is not built in the round after the epoch is sealed.

Once a block carrying SealingBlockInfo is committed (designates a sealing block),
mark the epoch as sealed and stop it from doing any further work: it no longer verifies
blocks, builds/proposes blocks, or broadcasts/sends messages.

The motivation is to prevent the epoch from interacting with the VM or other nodes,
as a sealed epoch is supposed to be terminated right after its sealing.

High level changes:

- Added epochSealed (an atomic.Bool)
- indexFinalization() now sets epochSealed and returns without progressing to
  the next round when the committed block is a sealing block.
- broadcast/send now abort if sealed, and the block
  verification and block-building tasks abort when the epoch is sealed.

Add TestEpochStopsAtSealingBlock, which drives an epoch through a chain
via block messages, finalizations and notarizations and asserts that:
without a sealing block every block is verified and the epoch proposes a
block for the round it leads; with a sealing block only the blocks up to
and including it are verified and committed.

TestEpochBuildsInRoundAfterSealingBlock which drives an epoch through a chain
via block messages and finalizations and ensures that a block is not built
in the round after the epoch is sealed.

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