Skip to content

fix(e2e): resolve flaky proposer-not-found in equivocation_offenses duplicate_proposal test#24557

Merged
spalladino merged 1 commit into
merge-train/spartan-v5from
cb/fix-flake-equivocation-offenses-proposer
Jul 6, 2026
Merged

fix(e2e): resolve flaky proposer-not-found in equivocation_offenses duplicate_proposal test#24557
spalladino merged 1 commit into
merge-train/spartan-v5from
cb/fix-flake-equivocation-offenses-proposer

Conversation

@AztecBot

@AztecBot AztecBot commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

multi-node/slashing/duplicate_proposal › slashes validator who sends duplicate proposals (yarn-project/end-to-end/src/multi-node/slashing/equivocation_offenses.test.ts) flaked in CI on the unrelated PR #24556 with:

Target proposer 0x90f79bf6eb2c4f870365e785982e1f101e93b906 not found in any slot after 20 epoch attempts

Evidence: http://ci.aztec-labs.com/eb0b4e658e28440c (the sibling duplicate_attestation case in the same file passed in the same run).

Root cause

Pure statistics — no logic bug. advanceToEpochBeforeProposer (yarn-project/end-to-end/src/multi-node/slashing/setup.ts on this branch) scans upcoming epochs for one where the target validator is the proposer, giving up after maxAttempts = 20 epochs. The test calls it with the default.

This suite uses a 2-slot epoch with warmupSlots = 1, so each epoch attempt inspects exactly one candidate slot. The proposer for a slot is keccak256(abi.encode(epoch, slot, seed)) % committeeSize, and with the suite's 4-member committee (COMMITTEE_SIZE = NUM_VALIDATORS = 4 in setup.ts) each attempt is an independent 1/4 draw. Miss probability over 20 attempts: (3/4)^20 ≈ 0.32%, i.e. roughly 1 in 315 runs — matching the observed occasional flake.

Fix

Raise the default maxAttempts from 20 to 50, bounding the miss probability at (3/4)^50 ≈ 5.7e-7 (~1 in 1.8M). Each attempt is only a committee query plus an anvil timestamp warp, so the expected attempt count stays ~4 and the extra headroom costs essentially nothing. The raised default also covers this helper's other callers with the same exposure (broadcasted_invalid_block_proposal_slash, broadcasted_invalid_checkpoint_proposal_slash), none of which override maxAttempts.

Relationship to PR #24548

This is the same failure mode fixed by #24548 for the duplicate_attestation flake, but #24548 does not cover this call site: its patch touches yarn-project/end-to-end/src/e2e_p2p/shared.ts, a file that does not exist on merge-train/spartan-v5 (on this branch the helper lives in multi-node/slashing/setup.ts, and there is no e2e_p2p/ directory). #24548's head branch was cut from a next-layout tree while targeting merge-train/spartan-v5, which is why GitHub reports it as dirty with ~4k changed files — it needs a rebase onto the branch it targets, at which point its fix would land in this same file. This PR applies the fix directly to the merge-train/spartan-v5 copy of the helper.

No tracked issue exists for this flake.


Created by claudebox · group: slackbot

…fenses test

advanceToEpochBeforeProposer checked 20 epochs for the target proposer. With
a 2-slot epoch and warmupSlots=1 each attempt inspects a single slot, and
with a 4-member committee the target is that slot's proposer with
probability 1/4 (proposer index is keccak(epoch, slot, seed) mod committee
size, independent per attempt). The miss probability over 20 attempts is
(3/4)^20 ~= 0.32%, which showed up as a real CI flake. 50 attempts bound it
at ~6e-7; each attempt is only a committee query plus an anvil warp.
@AztecBot AztecBot added ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR. labels Jul 6, 2026
@AztecBot

AztecBot commented Jul 6, 2026

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/09c2c9cfd6f765ba�09c2c9cfd6f765ba8;;�):  yarn-project/end-to-end/scripts/run_test.sh simple src/multi-node/block-production/multi_validator_node.parallel.test.ts "should attest ONLY with the correct validator keys" (58s) (code: 0) group:e2e-p2p-epoch-flakes

@spalladino spalladino marked this pull request as ready for review July 6, 2026 21:04
@spalladino spalladino enabled auto-merge (squash) July 6, 2026 21:05
@spalladino spalladino merged commit 20a97b6 into merge-train/spartan-v5 Jul 6, 2026
64 of 68 checks passed
@spalladino spalladino deleted the cb/fix-flake-equivocation-offenses-proposer branch July 6, 2026 21:05
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. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure 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