Skip to content

test(e2e): fix race in broadcasted_invalid_block_proposal_slash under pipelining#23302

Merged
spalladino merged 1 commit into
merge-train/spartanfrom
claudebox/fix-broadcasted-invalid-block-slash-race
May 15, 2026
Merged

test(e2e): fix race in broadcasted_invalid_block_proposal_slash under pipelining#23302
spalladino merged 1 commit into
merge-train/spartanfrom
claudebox/fix-broadcasted-invalid-block-slash-race

Conversation

@AztecBot
Copy link
Copy Markdown
Collaborator

Summary

Fixes the e2e_p2p_broadcasted_invalid_block_proposal_slash failure that has been blocking the merge-train/spartan train (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 gossipsub checkpoint_proposal_validator with Penalizing peer for invalid slot number (since their target slot has already moved past), so the state_mismatch slashing 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 on awaitOffenseDetected.

This is the same race that #23070 fixed in duplicate_proposal_slash.test.ts; the same pattern is applied here:

  • Create both the invalid proposer and the honest nodes with dontStartSequencer: true.
  • After P2P mesh connectivity + committee formation, use advanceToEpochBeforeProposer to land one epoch before an epoch where the invalid proposer is scheduled.
  • Start all sequencers, then advanceToEpoch(targetEpoch, { offset: -AZTEC_SLOT_DURATION }) so the malicious slot fires while every node is online and at the same wall-clock slot.
  • After awaitOffenseDetected on one node, poll getSlashOffenses across all nodes for BROADCASTED_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

  • CI: e2e_p2p_broadcasted_invalid_block_proposal_slash passes on merge-train/spartan.
  • Local ./bootstrap.sh ci / fast / build are not runnable in this container (no Docker socket and $HOME not writable for the container UID — yarn install fails on corepack mkdir, parallel-bootstrap can't create ~/.parallel). Fix is a direct port of a pattern already shipping green on next via the sibling duplicate_proposal_slash.test.ts.

ClaudeBox log: https://claudebox.work/s/06a4929a1971beaf?run=1

@AztecBot AztecBot added ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR. labels May 15, 2026
@spalladino spalladino marked this pull request as ready for review May 15, 2026 02:56
@spalladino spalladino enabled auto-merge (squash) May 15, 2026 02:56
@AztecBot
Copy link
Copy Markdown
Collaborator Author

Flakey Tests

🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry.

\033FLAKED\033 (8;;http://ci.aztec-labs.com/c3c25d160acf945b�c3c25d160acf945b8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/e2e_epochs/epochs_mbps.parallel.test.ts "builds multiple blocks per slot with L2 to L1 messages" (395s) (code: 0) group:e2e-p2p-epoch-flakes

@spalladino spalladino merged commit 3ba6dbe into merge-train/spartan May 15, 2026
38 of 47 checks passed
@spalladino spalladino deleted the claudebox/fix-broadcasted-invalid-block-slash-race branch May 15, 2026 03:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants