Drop messages delivered to an Instance before Start - #593
Merged
Merged
Conversation
A validator broadcasts a finalization only after indexing the block, so a node created on that commit can receive the message before Start has run. HandleMessage now drops such messages instead of falling through with neither an epoch nor a non-validator set.
yacovm
approved these changes
Sep 14, 2026
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.
Why
The test network registers a node's
Instancebefore callingStart. A validator broadcasts a finalization only after indexing the block, and the index is what releases the test's wait for the commit, so a node created on that commit can receive the finalization before it has started. In that state neither the epoch nor the non-validator is set.On
mainthe message is silently dropped by the finalreturn nilinHandleMessage. Onbootstrap-first(#573) that return became an error, which the test harness panics on, andTestNonValidatorBecomesValidatorfailed in CI withwe are not running as a validator or not validator.What
HandleMessagedrops messages with a debug log whenStarthas not run, using the existingstartedflag. Any later invariant on the started state keeps working.TestInstanceDropsMessagesBeforeStartdrivesHandleMessageon an unstartedInstanceand expects no error.Verification
Reproduced the CI panic by widening both sides of the race, then confirmed 16 of 16 iterations clean with the guard in place. The new test passes here and fails against the error return on #573.
🤖 Generated with Claude Code