Skip to content

chore: deflake epoch invalidate block test#21001

Merged
spalladino merged 1 commit intomerge-train/spartanfrom
mr/deflake-epoch-invalidate-block
Mar 2, 2026
Merged

chore: deflake epoch invalidate block test#21001
spalladino merged 1 commit intomerge-train/spartanfrom
mr/deflake-epoch-invalidate-block

Conversation

@mrzeszutko
Copy link
Contributor

@mrzeszutko mrzeszutko commented Mar 2, 2026

Summary

  • Fix flaky "proposer invalidates previous block with shuffled attestations" e2e test that fails with ValidatorSelection__InvalidCommitteeCommitment
  • Only swap two signed attestation positions in manipulateAttestations, preserving the bitmap so MaliciousCommitteeAttestationsAndSigners signers stay aligned with L1's reconstructCommitteeFromSigners

Root cause

trimAttestations reduces signed attestations to the minimum required (4 of 5), leaving one position with only an address (no signature). The old swap formula (proposerIndex+1)%N, (proposerIndex+2)%N could swap a signed position with an unsigned one, changing the bitmap pattern. MaliciousCommitteeAttestationsAndSigners provides the _signers array in the original bitmap order, but L1's reconstructCommitteeFromSigners maps signers to the new bitmap positions, producing a mismatched committee commitment hash. Whether the swap crosses a signed/unsigned boundary depends on the proposer index and which attestation was trimmed, explaining the flakiness.

Test plan

  • Confirmed the bug reproduces deterministically by forcing a signed/unsigned swap (test times out with 15 InvalidCommitteeCommitment reverts)
  • After fix, test passes cleanly with zero committee commitment errors

Fixes A-590

Copy link
Contributor

@spalladino spalladino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@spalladino spalladino merged commit c272555 into merge-train/spartan Mar 2, 2026
12 checks passed
@spalladino spalladino deleted the mr/deflake-epoch-invalidate-block branch March 2, 2026 14:18
github-merge-queue bot pushed a commit that referenced this pull request Mar 3, 2026
BEGIN_COMMIT_OVERRIDE
fix: track last seen nonce in case of stale fallback L1 RPC node
(#20855)
feat: Validate num txs in block proposals (#20850)
fix(archiver): enforce checkpoint boundary on rollbackTo (#20908)
fix: tps zero metrics (#20656)
fix: handle scientific notation in bigintConfigHelper (#20929)
feat(aztec): node enters standby mode on genesis root mismatch (#20938)
fix: logging of class instances (#20807)
feat(slasher): make slash grace period relative to rollup upgrade time
(#20942)
chore: add script to find PRs to backport (#20956)
chore: remove unused prover-node dep (#20955)
fix: increase minFeePadding in e2e_bot bridge resume tests and harden
GasFees.mul() (#20962)
feat(sequencer): (A-526) rotate publishers when send fails (#20888)
chore: (A-554) bump reth version 1.6.0 -> 1.11.1 for eth devnet (#20889)
chore: metric on how many epochs validator has been on committee
(#20967)
fix: set wallet minFeePadding in BotFactory constructor (#20992)
chore: deflake epoch invalidate block test (#21001)
chore(sequencer): e2e tests for invalid signature recovery in checkpoint
attestations (#20971)
chore: deflake duplicate proposals and attestations (#20990)
chore: deflake epochs mbps test (#21003)
feat: reenable function selectors in txPublicSetupAllowList (#20909)
fix: limit offenses when voting in tally slashing mode by
slashMaxPayloadSize (#20683)
fix(spartan): wire SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT env var
(#21017)
END_COMMIT_OVERRIDE
johnathan79717 pushed a commit that referenced this pull request Mar 4, 2026
## Summary

- Fix flaky "proposer invalidates previous block with shuffled
attestations" e2e test that fails with
`ValidatorSelection__InvalidCommitteeCommitment`
- Only swap two signed attestation positions in
`manipulateAttestations`, preserving the bitmap so
`MaliciousCommitteeAttestationsAndSigners` signers stay aligned with
L1's `reconstructCommitteeFromSigners`

## Root cause

`trimAttestations` reduces signed attestations to the minimum required
(4 of 5), leaving one position with only an address (no signature). The
old swap formula `(proposerIndex+1)%N, (proposerIndex+2)%N` could swap a
signed position with an unsigned one, changing the bitmap pattern.
`MaliciousCommitteeAttestationsAndSigners` provides the `_signers` array
in the original bitmap order, but L1's `reconstructCommitteeFromSigners`
maps signers to the new bitmap positions, producing a mismatched
committee commitment hash. Whether the swap crosses a signed/unsigned
boundary depends on the proposer index and which attestation was
trimmed, explaining the flakiness.

## Test plan

- Confirmed the bug reproduces deterministically by forcing a
signed/unsigned swap (test times out with 15
`InvalidCommitteeCommitment` reverts)
- After fix, test passes cleanly with zero committee commitment errors

Fixes A-590
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