Skip to content

Drop messages delivered to an Instance before Start - #593

Merged
yacovm merged 1 commit into
mainfrom
fix/drop-messages-before-start
Sep 14, 2026
Merged

yacovm merged 1 commit into
mainfrom
fix/drop-messages-before-start

Conversation

@samliok

@samliok samliok commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Why

The test network registers a node's Instance before calling Start. 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 main the message is silently dropped by the final return nil in HandleMessage. On bootstrap-first (#573) that return became an error, which the test harness panics on, and TestNonValidatorBecomesValidator failed in CI with we are not running as a validator or not validator.

What

  • HandleMessage drops messages with a debug log when Start has not run, using the existing started flag. Any later invariant on the started state keeps working.
  • TestInstanceDropsMessagesBeforeStart drives HandleMessage on an unstarted Instance and 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

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
yacovm merged commit 9197f44 into main Sep 14, 2026
7 checks passed
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.

2 participants