chore: port P2P mesh topic deflake fix to v4-next#21825
Merged
ludamad merged 1 commit intobackport-to-v4-next-stagingfrom Mar 20, 2026
Merged
Conversation
2bd13d3 to
3be84bd
Compare
spalladino
approved these changes
Mar 20, 2026
Fix flakiness in duplicate_proposal_slash and duplicate_attestation_slash e2e tests. Both tests flake at a 3-13% rate because the malicious proposer (1 of 4 validators) is never selected within the timeout window. Three root causes are addressed: 1. **GossipSub mesh checked only for TX topic** — The tests need block proposals and checkpoint proposals to propagate, but `waitForP2PMeshConnectivity` only verified the `tx` topic mesh. Added a `topics` parameter so callers can specify which topics to wait on. Both slash tests now wait on `tx`, `block_proposal`, and `checkpoint_proposal`. 2. **Proposer selection is probabilistic** — With 4 validators and 2 slots/epoch, the malicious proposer has ~25% chance per slot. Added `awaitEpochWithProposer` helper that advances epochs (via L1 time warp) until the target proposer is deterministically selected for at least one slot in the current epoch. 3. **Race between node startup and first proposal** — Nodes started sequencing immediately upon creation, potentially proposing before the P2P mesh was ready. Now all nodes are created with `dontStartSequencer: true`, and sequencers are started simultaneously only after mesh formation, committee existence, and epoch advancement are confirmed. Fixes A-593 Fixes A-595
3be84bd to
3b502b3
Compare
Collaborator
Author
Flakey Tests🤖 says: This CI run detected 1 tests that failed, but were tolerated due to a .test_patterns.yml entry. |
ludamad
approved these changes
Mar 20, 2026
AztecBot
added a commit
that referenced
this pull request
Mar 21, 2026
BEGIN_COMMIT_OVERRIDE chore: backport #21754 (feat!: make isContractInitialized a tri-state enum) to v4-next (#21792) fix(stdlib): zero-pad bufferFromFields when declared length exceeds payload (#21802) test(protocol-contracts): verify max-size bytecode fits in contract class log (#21818) chore: port P2P mesh topic deflake fix to v4-next (#21825) fix(archiver): throw on duplicate contract class or instance additions (#21799) feat: sync poseidon in the browser (#21833) chore: backport #21824 (fix(aztec-up): add sensible defaults to installer y/n prompts) to v4-next (#21844) fix(sequencer): backport wall-clock time for slot estimation to v4-next (#21769) (#21847) chore: backport PR #21788 (feat(p2p): add tx validation for contract class id verification) to v4-next (#21852) feat: sync poseidon browser (#21851) END_COMMIT_OVERRIDE
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
Ports the P2P mesh connectivity fix from
nexttov4-nextfor theduplicate_attestation_slashandduplicate_proposal_slashe2e tests.Cherry-picked commit:
8680abcca7— chore: deflake duplicate proposals and attestations (#20990)Root Cause
waitForP2PMeshConnectivityonly waited for thetxGossipSub topic mesh to form. The slash tests also needblock_proposalandcheckpoint_proposalmeshes ready before sequencers start proposing, otherwise proposals get dropped and offenses are never detected.Fix
topicsparameter towaitForP2PMeshConnectivity(defaults to[TopicType.tx]for backward compat)advanceToEpochBeforeProposerhelper so sequencers start before the target epoch arrives