Commit 30640df
authored
test(e2e): fix data_withholding_slash flake by freezing L1 across restart (#23162)
## Motivation
`e2e_p2p_data_withholding_slash` was flaky because L1 raced past the
epoch-8 prune deadline (`aztecProofSubmissionEpochs=0` makes the
deadline ~32s after slot 17) while we stopped, wiped, and recreated the
4 validators (~28s). The recreated archivers detected the prune during
their initial L1 sync and emitted `L2PruneUnproven` for epoch 8 with the
original tx-carrying block, but `EpochPruneWatcher.start()` is only
invoked inside `void archiver.waitForInitialSync().then(...)` in
`aztec-node/server.ts`, so the listener wasn't attached yet and the
event dropped silently. The recreated validators then built an empty
epoch 10 on top of genesis which pruned cleanly later, producing 4
`VALID_EPOCH_PRUNED` offenses instead of the expected 4
`DATA_WITHHOLDING`.
## Approach
Pause anvil block production between `removeInitialNode` and `stopNodes`
so L1 stays inside epoch 8 across the recreate gap. The recreated
archivers then ingest checkpoint 1 cleanly during initial sync (no prune
fires, nothing to miss), `EpochPruneWatcher.start()` attaches its
listener, and we resume L1 with an explicit warp + mine + interval
restart so the deadline crossing is deterministic — the prune now fires
while the watcher is live, producing `DATA_WITHHOLDING` for epoch 8 as
the test expects. A `getCurrentEpoch < 9` assertion right after pausing
fails fast if the timing window ever tightens further.
## Changes
- **end-to-end (tests)**: in `data_withholding_slash.test.ts`, pause L1
mining after `removeInitialNode` and before `stopNodes`; resume after
`waitForP2PMeshConnectivity` by warping to current wall-clock time,
mining one L1 block, and restoring interval mining. Add a fail-fast
assertion that we are still in epoch 8 when we pause.1 parent 4d8791a commit 30640df
1 file changed
Lines changed: 39 additions & 1 deletion
Lines changed: 39 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
| 160 | + | |
| 161 | + | |
160 | 162 | | |
161 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
162 | 190 | | |
163 | 191 | | |
164 | 192 | | |
| |||
186 | 214 | | |
187 | 215 | | |
188 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
189 | 227 | | |
190 | 228 | | |
191 | 229 | | |
| |||
0 commit comments