Commit 48be067
authored
fix(spartan-bench): tolerate older node images in SlasherConfig schema (#23351)
## Summary
Fixes `block_capacity.test.ts` (nightly spartan bench) failing against a
stale nightly Aztec image.
The nightly-spartan-bench workflow checks out test code from
`merge-train/spartan` but runs against the prebuilt nightly Aztec docker
image, which is built from `next`. `merge-train/spartan` introduced two
new required fields on `SlasherConfigSchema`:
- `slashDataWithholdingToleranceSlots: z.number()` (PR #23116)
- `slashBroadcastedInvalidCheckpointProposalPenalty: schemas.BigInt`
The nightly image (built from `next`, which does not yet have these PRs)
does not include these fields in its config response. As a result the
very first call in the test — `updateSequencersConfig(config, {
minTxsPerBlock: 0 })` → `client.getConfig()` — fails Zod validation,
every subbench dies on `accountAddresses[0] === undefined` in
`beforeAll`, and `block_capacity.test.ts` reports 8/8 failures (see
<http://ci.aztec-labs.com/2679b1738ea39752>).
## Fix
Make the two new fields tolerate undefined in the response schema by
giving them sensible defaults (`3` and `0n`, matching
`spartan/environments/network-defaults.yml` and the slasher defaults).
The TypeScript `SlasherConfig` interface stays strict (output type is
unchanged); only the parse side becomes forgiving, matching the pattern
used by the other recently-added schema fields in `configs.ts`,
`p2p.ts`, and `validator.ts`.
`partial()` (used by `setConfig`) wraps each field with `.optional()` on
the outside, which bypasses `.default()` — so partial updates that omit
these fields will continue to omit them server-side rather than
accidentally clobbering existing values to the defaults.
## Test plan
- nightly-spartan-bench → block-capacity-benchmark passes against the
stale-image scenario
- existing `aztec-node-admin.test.ts` getConfig test continues to pass
(fields are present in the mock)
---
*Created by
[claudebox](https://claudebox.work/v2/sessions/5cbfb8fe5a58619c) ·
group: `slackbot`*1 parent 553a8e0 commit 48be067
1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
45 | 47 | | |
46 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
0 commit comments