Commit 3ba6dbe
authored
test(e2e): fix race in broadcasted_invalid_block_proposal_slash under pipelining (#23302)
## 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=11 parent 7551378 commit 3ba6dbe
1 file changed
Lines changed: 54 additions & 39 deletions
Lines changed: 54 additions & 39 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
16 | | - | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
117 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| 125 | + | |
121 | 126 | | |
122 | 127 | | |
123 | 128 | | |
| |||
134 | 139 | | |
135 | 140 | | |
136 | 141 | | |
137 | | - | |
| 142 | + | |
138 | 143 | | |
139 | | - | |
| 144 | + | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
| |||
149 | 154 | | |
150 | 155 | | |
151 | 156 | | |
152 | | - | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
156 | 161 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
186 | 171 | | |
187 | | - | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
| |||
193 | 195 | | |
194 | 196 | | |
195 | 197 | | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
200 | 215 | | |
201 | 216 | | |
202 | 217 | | |
| |||
0 commit comments