Abort block building and sending upon commit of an epoch sealing block#433
Open
yacovm wants to merge 1 commit into
Open
Abort block building and sending upon commit of an epoch sealing block#433yacovm wants to merge 1 commit into
yacovm wants to merge 1 commit into
Conversation
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>
8e861fb to
ee44f7a
Compare
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.
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:
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.