Skip to content

feat: merge-train/spartan - #24834

Merged
AztecBot merged 10 commits into
nextfrom
merge-train/spartan
Jul 21, 2026
Merged

feat: merge-train/spartan#24834
AztecBot merged 10 commits into
nextfrom
merge-train/spartan

Conversation

@AztecBot

@AztecBot AztecBot commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

BEGIN_COMMIT_OVERRIDE
chore(spartan): lower mainnet inactivity slash target to 70% (#24827)
chore: add rate-limited testnet rpc client (#24836)
fix(ci): move nightly bench inclusion sweep to 06:00 UTC (#24830)
fix(bench): handle void worker-wallet returns in inclusion sweep (#24843)
END_COMMIT_OVERRIDE

aminsammara and others added 3 commits July 21, 2026 09:44
Reduce the mainnet SLASH_INACTIVITY_TARGET_PERCENTAGE default from 0.8
(80%) to 0.7 (70%) in spartan/environments/network-defaults.yml. Only
the networks.mainnet preset is changed; devnet/testnet and the top-level
slasher anchor (all 0.9) are untouched.
The sweep resolves the nightly git tag + docker image for the current
day and verifies the tag exists. It was scheduled at 03:30 UTC, before
the Nightly Release Tag workflow (04:00 UTC) creates that tag, so
"Verify source git ref" failed with "couldn't find remote ref". Align
it with the other nightly consumers (spartan-bench, deploy-next-net) at
06:00 UTC.
Lowers the mainnet `SLASH_INACTIVITY_TARGET_PERCENTAGE` default from
`0.8` (80%) to `0.7` (70%) in
`spartan/environments/network-defaults.yml`. This is the per-epoch
attestation miss ratio at which a validator is counted inactive.

Only the `networks.mainnet` preset changes; devnet/testnet and the
top-level slasher anchor (all `0.9`) are untouched. Changes a baked-in
default for future builds — does not retroactively affect the running
network.
spalladino and others added 6 commits July 21, 2026 09:27
WorkerWallet.call unconditionally JSON.parse'd the transport response, but
void-returning methods (registerContract, registerContractClass) come back as
`undefined` from the worker. JSON.parse(undefined) throws
`SyntaxError: "undefined" is not valid JSON`, which crashed registerSponsoredFPC
during n_tps.test.ts setup and failed every nightly bench inclusion-sweep point
(1/5/10 TPS) deterministically.

Pass an undefined response straight to the method's schema, whose z.void() output
accepts it, and widen callRaw's return type to string | undefined to match.
## Problem

The **Nightly Bench Inclusion Sweep** ([failing
run](https://github.com/AztecProtocol/aztec-packages/actions/runs/29801774127))
resolves the nightly git tag + docker image for the current day and
verifies the tag exists:

```
git fetch --depth 1 origin refs/tags/v6.0.0-nightly.20260721:...
fatal: couldn't find remote ref refs/tags/v6.0.0-nightly.20260721
```

That tag is created by the separate **Nightly Release Tag** workflow at
`0 4 * * *` (04:00 UTC), but the sweep was scheduled at `30 3 * * *`
(03:30 UTC) — 30 min *before* the tag exists. GitHub's scheduled-run
jitter preserves the gap (today the sweep ran at 04:38 UTC, the tag was
created at 05:04 UTC), so `Verify source git ref` fails and the
downstream `cleanup`/`notify-failure` jobs cascade.

## Fix

Move the sweep to `0 6 * * *` (06:00 UTC), aligning it with the other
nightly *consumers* (`nightly-spartan-bench`, `deploy-next-net`) which
already run at 06:00 — a 2h margin over the 04:00 tag job.
@PhilWindle
PhilWindle requested a review from charlielye as a code owner July 21, 2026 14:30
)

## Problem

Every point of the [Nightly Bench Inclusion
Sweep](https://github.com/AztecProtocol/aztec-packages/actions/runs/29801774127)
(1/5/10 TPS) failed identically, ~5ms into the `n_tps.test.ts` body,
during `registerSponsoredFPC` setup:

```
SyntaxError: "undefined" is not valid JSON
    at JSON.parse (<anonymous>)
    at WorkerWallet.call (test-wallet/worker_wallet.ts:127)
    at registerSponsoredFPC (fixtures/setup.ts:821)
```

`WorkerWallet.call` unconditionally `JSON.parse`d the worker's transport
response. But void-returning methods — `registerContract`,
`registerContractClass` (both `output: z.void()` in `WalletSchema`) —
return nothing, and `jsonStringify(undefined)` yields `undefined`, which
arrives at the client as the JS value `undefined` over the
structured-clone transport. `JSON.parse(undefined)` coerces to
`JSON.parse("undefined")` and throws.

The crash is in test setup, before any transactions are sent, so it is
deterministic and independent of TPS — hence all three points failed the
same way. The deployed network and the `6.0.0-nightly.20260721` image
are not implicated.

## Fix

Pass an `undefined` response straight to the method's schema (its
`z.void()` output accepts `undefined`) instead of `JSON.parse`-ing it,
and widen `callRaw`'s return type to `string | undefined`.

## Test

Adds `worker_wallet.test.ts`, which builds a `WorkerWallet` over a stub
transport that returns `undefined` and asserts `registerContract` /
`registerContractClass` resolve. Verified red/green: against the old
code it fails with the exact CI error (`"undefined" is not valid JSON`);
with the fix it passes.

@ludamad ludamad left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🤖 Auto-approved

@AztecBot
AztecBot added this pull request to the merge queue Jul 21, 2026
@AztecBot

Copy link
Copy Markdown
Collaborator Author

🤖 Auto-merge enabled after 4 hours of inactivity. This PR will be merged automatically once all checks pass.

Merged via the queue into next with commit dd11747 Jul 21, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants