Commit 5627161
authored
fix(e2e): resolve flaky checkpoint TypeError in multi_validator_node test (#24543)
## Flake
`multi-node/block-production/multi_validator_node.parallel.test.ts`,
case "should build blocks & attest with multiple validator keys", failed
on [#24537](#24537)
(unrelated PR) with:
```
TypeError: Cannot read properties of undefined (reading 'checkpoint')
at checkpoint (multi-node/block-production/multi_validator_node.parallel.test.ts:92:73)
```
CI log: http://ci.aztec-labs.com/0f321ffb9fa923af
## Root cause
`deployContractAndGetAttestedCheckpoint` reads the published checkpoint
from the archiver immediately after the deploy tx receipt turns mined:
```ts
const [publishedCheckpoint] = await dataStore.getCheckpoints({ from: blockData!.checkpointNumber, limit: 1 });
const payload = ConsensusPayload.fromCheckpoint(publishedCheckpoint.checkpoint, ...); // undefined here
```
The receipt turns mined as soon as the block is built locally, but the
archiver only stores the *published* checkpoint (with its attestations,
which come from the L1 `propose` calldata) once its L1 sync downloads
that tx. In the window between the two, `getCheckpoints` returns `[]`
and `publishedCheckpoint` is `undefined`.
The CI log shows the race directly: the test node published checkpoint 1
to L1 at `15:17:57.694` (`sequencer:publisher ... Published checkpoint 1
at slot 14`), and its archiver logged `Downloaded checkpoint 1` at
`15:17:57.795` — by which point the test had already failed and teardown
was running.
This is a test-side race, not a production bug: the archiver API is
behaving as documented for a not-yet-synced checkpoint.
## Fix
Poll for the checkpoint with `retryUntil` instead of reading it once,
mirroring the existing pattern in
`single-node/cross-chain/cross_chain_messaging_test.ts`
(`advanceToEpochProven`), which wraps the same lookup in
`retryUntil(..., 'archiver indexes checkpoint N', 120, 0.5)`.
Note: the `next`-line variant of this test
(`e2e_multi_validator/e2e_multi_validator_node.test.ts`) has the same
unguarded lookup in two places and could flake the same way; that file
is on a different base branch, so it is not touched here.
Based on `merge-train/spartan-v5` because the flaking file only exists
on the v5 line (it was consolidated into `multi-node/` there), and the
failing run was on a PR targeting that branch.
---
*Created by
[claudebox](https://claudebox.work/v2/sessions/0959caa9f03f59fa) ·
group: `slackbot`*1 parent 20a97b6 commit 5627161
1 file changed
Lines changed: 9 additions & 1 deletion
File tree
- yarn-project/end-to-end/src/multi-node/block-production
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
84 | 85 | | |
85 | 86 | | |
86 | 87 | | |
87 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
88 | 96 | | |
89 | 97 | | |
90 | 98 | | |
| |||
0 commit comments