test(e2e): fix race in broadcasted_invalid_block_proposal_slash under pipelining#23302
Merged
spalladino merged 1 commit intoMay 15, 2026
Conversation
spalladino
approved these changes
May 15, 2026
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
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.
Summary
Fixes the
e2e_p2p_broadcasted_invalid_block_proposal_slashfailure that has been blocking themerge-train/spartantrain (run https://github.com/AztecProtocol/aztec-packages/actions/runs/25896899879, test log http://ci.aztec-labs.com/2bf4e2cd2d9e7944).The test creates the malicious proposer first (auto-starting its sequencer) and only later creates the honest nodes and waits for P2P mesh. Under
enableProposerPipelining: true(turned on for this test by #23070), the malicious proposer is selected for the very next slot, builds + broadcasts the invalid proposal one slot ahead, and lands the broadcast before the honest validators have joined the mesh. They then reject it at the gossipsubcheckpoint_proposal_validatorwithPenalizing peer for invalid slot number(since their target slot has already moved past), so thestate_mismatchslashing path never runs. The malicious sequencer then gets stuck on the failed publish (Awaiting pending L1 payload submission) and never proposes again before the test times out onawaitOffenseDetected.This is the same race that #23070 fixed in
duplicate_proposal_slash.test.ts; the same pattern is applied here:dontStartSequencer: true.advanceToEpochBeforeProposerto land one epoch before an epoch where the invalid proposer is scheduled.advanceToEpoch(targetEpoch, { offset: -AZTEC_SLOT_DURATION })so the malicious slot fires while every node is online and at the same wall-clock slot.awaitOffenseDetectedon one node, pollgetSlashOffensesacross all nodes forBROADCASTED_INVALID_BLOCK_PROPOSAL— under pipelining a given receiver may have already advanced past the build slot when the proposal arrives, so we need to catch whichever node was still in the build slot.The on-chain slash assertion (
rollup.listenToSlash) is preserved unchanged.Full failure analysis: https://gist.github.com/AztecBot/39b69c1117f419145938ccd2c198f8e9
Test plan
e2e_p2p_broadcasted_invalid_block_proposal_slashpasses onmerge-train/spartan../bootstrap.sh ci/fast/buildare not runnable in this container (no Docker socket and$HOMEnot writable for the container UID —yarn installfails oncorepackmkdir, parallel-bootstrap can't create~/.parallel). Fix is a direct port of a pattern already shipping green onnextvia the siblingduplicate_proposal_slash.test.ts.ClaudeBox log: https://claudebox.work/s/06a4929a1971beaf?run=1