Skip to content

refactor(node-rpc)!: remove deprecated AztecNode methods and L2BlockSource tip helpers#22934

Merged
PhilWindle merged 1 commit into
merge-train/spartanfrom
spl/remove-deprecated-methods
May 8, 2026
Merged

refactor(node-rpc)!: remove deprecated AztecNode methods and L2BlockSource tip helpers#22934
PhilWindle merged 1 commit into
merge-train/spartanfrom
spl/remove-deprecated-methods

Conversation

@spalladino

Copy link
Copy Markdown
Contributor

Motivation

After three back-to-back unifications of the block/checkpoint APIs (#22781, #22809, plus the two query-object refactors on this stack), four @deprecated AztecNode RPC methods and three redundant L2BlockSource tip-number helpers had outlived their replacements and remained only as stop-gaps. This PR retires them and migrates every caller to the canonical query-object APIs.

Approach

Removed isL1ToL2MessageSynced, getL2Tips, getBlockHeader, getCheckpointedBlocks from AztecNode, and getProvenBlockNumber, getCheckpointedL2BlockNumber, getFinalizedL2BlockNumber from L2BlockSource. Callers now use getL1ToL2MessageCheckpoint, getChainTips, getBlock(...).header, getBlocks(..., { onlyCheckpointed, includeL1PublishInfo, includeAttestations }), and getBlockNumber({ tag }) respectively. BlockIncludeOptions was split into a single-block variant and a BlocksIncludeOptions extension so onlyCheckpointed is rejected at the type level on getBlock. Internal BlockStore primitives are intentionally kept since they remain the underlying implementation.

Changes

  • stdlib (interfaces): dropped four @deprecated AztecNode methods + their zod entries; dropped three tip-number helpers from L2BlockSource and its archiver schema; split BlockIncludeOptions into single- and range-block variants
  • aztec-node: removed deprecated server impls; simplified getBlockNumber(tip) to a single getBlockNumber({ tag: tip }) call; fixed getL1ToL2MessageCheckpoint to handle messageIndex === 0n correctly (previously coerced to undefined via truthy check)
  • archiver: dropped the now-unused tip-number passthroughs in data_source_base and the MockL2BlockSource overrides
  • prover-node, p2p: migrated getProvenBlockNumber callers to getBlockNumber({ tag: 'proven' })
  • pxe: adjusted block_stream_source to wrap getChainTips() into the L2Tips shape required by L2BlockStream
  • txe: added l2TipsProvider getter that adapts getChainTips() for the TXE state machine
  • end-to-end (tests): migrated 15+ test files to the new APIs (getBlocks with onlyCheckpointed/includeTransactions where bodies are read, getChainTips, getBlock(...).header, getL1ToL2MessageCheckpoint(...) !== undefined)
  • aztec-node, stdlib (tests): dropped tests of removed methods; added unit tests covering the messageIndex === 0n edge case
  • docs: updated the node-API generator to drop removed methods, regenerated the operator API reference, and migrated node_getL2Tips curl examples in the operator setup guides to node_getChainTips

@spalladino spalladino added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels May 4, 2026
@spalladino spalladino force-pushed the spl/remove-deprecated-methods branch from 3591449 to c3ee069 Compare May 4, 2026 21:38
@spalladino spalladino force-pushed the spl/checkpoint-api-unify branch from 928510b to 069d262 Compare May 5, 2026 12:04
Base automatically changed from spl/checkpoint-api-unify to merge-train/spartan May 6, 2026 15:12
@spalladino spalladino force-pushed the spl/remove-deprecated-methods branch 2 times, most recently from e595510 to c228c80 Compare May 7, 2026 13:02
@spalladino spalladino marked this pull request as ready for review May 7, 2026 14:09
…ource tip helpers

Removes four @deprecated AztecNode RPC methods (isL1ToL2MessageSynced,
getL2Tips, getBlockHeader, getCheckpointedBlocks) and three redundant
L2BlockSource tip-number helpers (getProvenBlockNumber,
getCheckpointedL2BlockNumber, getFinalizedL2BlockNumber), migrating all
callers to the canonical query-object APIs introduced in prior refactors.
@spalladino spalladino force-pushed the spl/remove-deprecated-methods branch from c228c80 to 590acf4 Compare May 7, 2026 20:06
@spalladino spalladino removed the ci-draft Run CI on draft PRs. label May 7, 2026
@PhilWindle PhilWindle merged commit e0899d6 into merge-train/spartan May 8, 2026
15 checks passed
@PhilWindle PhilWindle deleted the spl/remove-deprecated-methods branch May 8, 2026 08:12
spalladino pushed a commit that referenced this pull request May 8, 2026
…artan (#23083)

## Motivation

The `verifies transactions at 10 TPS` sub-test of
[`yarn-project/end-to-end/src/bench/tx_stats_bench.test.ts`](https://github.com/AztecProtocol/aztec-packages/blob/merge-train/spartan/yarn-project/end-to-end/src/bench/tx_stats_bench.test.ts)
is now reliably flaking on the `bench all` step of
`merge-train/spartan`. It has fired on at least two different
merge-train commits hours apart, with no relation to either commit's
diff:

| Run | Triggering merge-train commit | CI log |
|---|---|---|
|
[25546251580](https://github.com/AztecProtocol/aztec-packages/actions/runs/25546251580)
| #22934 (refactor(node-rpc)! removing deprecated AztecNode methods) |
http://ci.aztec-labs.com/1778227975844707 |
|
[25552992890](https://github.com/AztecProtocol/aztec-packages/actions/runs/25552992890)
| #22405 (feat(p2p): detect and track announce IP changes at runtime) |
http://ci.aztec-labs.com/1778237470322975 |

Both runs hit the same assertion:

```
● transaction benchmarks › verifies transactions at 10 TPS

  expect(received).toBe(expected) // Object.is equality
  Expected: true
  Received: false
    at bench/tx_stats_bench.test.ts:268
```

Sub-test failing log on the latest run:
http://ci.aztec-labs.com/ca459ca73d02002c (`bench all` parent:
http://ci.aztec-labs.com/90616bad7bf7ebaa).

The other three sub-tests in the suite (compression; single private
verify x20 serial; single public verify x20 serial) pass cleanly against
the same proven txs in both runs. The failure is in the stress sub-test
that fires 600 IVC verifications at 10/s with 8 concurrent IVC verifiers
(`BB_NUM_IVC_VERIFIERS=8`, `BB_IVC_CONCURRENCY=1`). At least one
verification returns `valid: false` under load.

## Cause

Neither triggering commit touches the IVC verifier path:
- #22934 is a pure node-rpc surface refactor.
- #22405 is p2p / discv5 ENR plumbing.

The two failures sharing this signature across unrelated diffs is strong
evidence that the flake is independent of the merge-train commit and
stems from the bench infrastructure itself.

The likely culprit is the recent bb-prover migration to the bb.js
`NativeUnixSocket` backend (#21564), which spawns a fresh bb subprocess
per Chonk verification via `withVerifierInstance`. Under 8x parallel
verifications on the CPU-isolated bench host (each verifier requesting
16 threads, 8 × 16 = 128 threads on 56 isolated cores), transient
verifier failures appear. The bench-output log shows continuous `bb.js -
Received signal 15, shutting down gracefully...` traffic during the 10
TPS phase — verifier instances are being torn down rapidly, and at least
one verification slips through with a stale/incomplete response. Because
the serial sub-tests (`numIterations = 20` sequential) pass cleanly in
both runs, this is a stress-only interaction, not a correctness
regression.

## Approach

Add `tx_stats_bench` to `.test_patterns.yml` with an `error_regex`
anchored to the test file's stack-trace line
(`tx_stats_bench.test.ts:<line>:<col>`), and assign `*charlie` as owner
(author of the bb.js migration). With this entry, `ci3/run_test_cmd`
retries the test once on failure and treats a single retry-pass as a
flake instead of a hard fail, unblocking the merge train for unrelated
commits while Charlie investigates the underlying concurrency
interaction with the bb.js backend.

The `error_regex` is intentionally narrow (file + line + column from the
stack trace) so other ways tx_stats_bench could fail (timeout, OOM,
infra) are still surfaced as hard fails.

## Changes

- `.test_patterns.yml`: add a `tx_stats_bench` entry with an error_regex
anchored to the test file's stack-trace line and `*charlie` as owner.

ClaudeBox logs:
- https://claudebox.work/s/6e7853d3a073145f?run=1 (initial diagnosis on
#22934 failure)
- https://claudebox.work/s/c12a360275f05ad3?run=1 (this update on #22405
recurrence)
rangozd pushed a commit to rangozd/aztec-packages that referenced this pull request May 16, 2026
BEGIN_COMMIT_OVERRIDE
fix(test): warp L1 forward when proposer scan hits EpochNotStable
(AztecProtocol#22967)
test(e2e): fail epochs tests on proposer-rollup-check-failed (AztecProtocol#22965)
fix: grafana switch to aztec_status="proposed" (AztecProtocol#22978)
chore: update benchmark scraper (AztecProtocol#22984)
test(e2e): migrate simple epoch tests to pipelining (AztecProtocol#22973)
chore: remove top-level yarn.lock (AztecProtocol#22987)
refactor(archiver)!: unify L2BlockSource checkpoint lookups via query
objects (AztecProtocol#22933)
fix(sequencer): bounded sweep instead of event scan for governance
proposal check (AztecProtocol#22989)
fix(docs): allow webapp-tutorial yarn install to populate empty lockfile
in CI (AztecProtocol#23000)
test(e2e): enable pipelining in l1-reorgs and mbps redistribution tests
(AztecProtocol#23009)
fix(archiver): restore pending block height metric under pipelining
(AztecProtocol#22994)
chore(p2p): remove skipped validation result option (AztecProtocol#23034)
refactor(p2p)!: remove slow tx collection flow (AztecProtocol#22878)
chore(spartan): add next-net-clone environment config (AztecProtocol#22995)
chore(sequencer): add context to proposer-rollup-check-failed logs
(AztecProtocol#23071)
test(e2e): wait for archiver sync before asserting pipelining (AztecProtocol#22997)
refactor(node-rpc)!: remove deprecated AztecNode methods and
L2BlockSource tip helpers (AztecProtocol#22934)
feat(p2p): detect and track announce IP changes at runtime (AztecProtocol#22405)
test: mark tx_stats_bench 10 TPS as flake-retryable on
merge-train/spartan (AztecProtocol#23083)
fix(sequencer): bind vote-only multicalls to target slot under
pipelining (AztecProtocol#23090)
feat(sequencer): build optimistically across pruning epoch boundary
(AztecProtocol#23056)
fix(sequencer): use chainTipsOverride.pending for log context (AztecProtocol#23098)
test(e2e): relax post-boundary slot assertion in
epochs_proof_at_boundary (AztecProtocol#23108)
fix(bb-prover): pool long-lived bb verifier processes instead of
spawning per-call (AztecProtocol#23093)
fix(sequencer): anchor fee asset price modifier to predicted parent
(AztecProtocol#23113)
chore: error log when L1 head timestamp drifts (AztecProtocol#22947)
fix(sequencer): override full parent checkpoint cell in pipelined
simulation (AztecProtocol#23073)
test(e2e): enable pipelining on missed l1 slot test (AztecProtocol#23068)
fix: more robust metrics reporting in IRM monitor (AztecProtocol#23038)
fix: preserve LMDB slashing protection (AztecProtocol#23145)
test(e2e): enable pipelining on p2p tests (AztecProtocol#23070)
fix(archiver): move L2 tips cache refresh out of write transactions
(AztecProtocol#23110)
test(e2e): fix data_withholding_slash flake by freezing L1 across
restart (AztecProtocol#23162)
fix(validator): include proposed checkpoint out-hashes when validating
checkpoint proposals (AztecProtocol#23119)
refactor(config): drop nested config option, flatten l1Contracts
(AztecProtocol#23143)
test(e2e): bump bash TIMEOUT for e2e_p2p/add_rollup to match jest 20m
(AztecProtocol#23177)
fix(p2p): chunk archive of mined txs on block finalization (A-969)
(AztecProtocol#23085)
fix(p2p): stream tx pool hydration to bound startup memory (A-968)
(AztecProtocol#23086)
chore: remove orphan --archiver flag usages from start invocations
(AztecProtocol#23186)
feat(ci): daily merge-train/spartan stale-PR notifier (AztecProtocol#23189)
fix: preserve contract artifact permissions (AztecProtocol#23174)
fix(ci3): accept slashes in /list/&lt;path:key&gt; for merge-train
history (AztecProtocol#23160)
feat(ci): route merge-train/spartan flake notifications to
#team-alpha-ci (AztecProtocol#23219)
fix(cheat-codes): wait for post-warp L2 block in warpL2TimeAtLeastTo
(AztecProtocol#23213)
feat: slash attesters signing over bad checkpoints (AztecProtocol#23180)
refactor(prover-client): split orchestrator into sub-tree + top-tree
pair (AztecProtocol#22996)
fix(srs): retry transient CRS HTTP downloads with exponential backoff
(AztecProtocol#23244)
refactor(p2p): remove old reqresp mode (AztecProtocol#23158)
docs(sequencer-client): rewrite top-level and timing READMEs (AztecProtocol#23149)
fix(aztec-node): include upcoming checkpoint's L1 to L2 messages in
simulatePublicCalls (AztecProtocol#23163)
END_COMMIT_OVERRIDE
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jun 4, 2026
…or (AztecProtocol#23798)

## Motivation

The Node JSON-RPC API reference generator
(`docs/scripts/node_api_reference_generation/generate_node_api_reference.ts`)
does not instantiate Zod at runtime — it string-parses the schema source
(`AztecNodeApiSchema = { ... }`) via the TypeScript compiler API.
`parseZodFunctionExpr` only recognized the **Zod 3** DSL:

```ts
z.function().args(BlockParameterSchema, schemas.Fr).returns(schemas.Fr)
```

After the repo-wide Zod 3 → 4 migration, every schema moved to the Zod 4
form:

```ts
getPublicStorageAt: z.function({
  input: z.tuple([BlockParameterSchema, schemas.AztecAddress, schemas.Fr]),
  output: schemas.Fr,
}),
```

There is no `.args(` / `.returns(` left, so `argsStart`/`returnsStart`
are `-1` and **every** method is emitted with `Parameters: None` and
`Returns: void`. It does not throw — it silently produces a useless
reference. This is the breakage referenced in AztecProtocol#23660 ("the
node-api-reference generator is currently incompatible with the repo's
Zod 4 schemas — a pre-existing issue affecting all methods"); it
predates that PR and stems from the Zod 4 migration (the generator last
regenerated cleanly in AztecProtocol#22934, when schemas were still Zod 3).

## Approach

Rewrote `parseZodFunctionExpr` to read the Zod 4 `z.function({ input:
z.tuple([...]), output: <expr> })` object: it extracts the `input` tuple
elements as the parameter list and the `output` expression as the return
type, reusing the existing `simplifyZodType` mapping. The legacy
`.args().returns()` path is kept as a fallback so older versioned-docs
schemas still regenerate. Added small helpers `findMatchingBracket`,
`findTopLevelColon`, and `parseInputArgs`.

## Verification

The only changed logic is the pure expression parser, so I unit-tested
the actual functions (loaded from this file) against real schema strings
copied verbatim from `aztec-node.ts`, plus a legacy Zod 3 string:

```
PASS  getPublicStorageAt (multi-arg tuple)            -> [BlockHash|number|"latest", AztecAddress, Fr] / Fr
PASS  getWorldStateSyncStatus (empty tuple)           -> [] / WorldStateSyncStatus
PASS  getTxReceipt (class.schema)                     -> [TxHash] / TxReceipt
PASS  getPendingTxs (optionals + array output)        -> [number|undefined, TxHash|undefined] / Tx[]
PASS  getBlockNumber (optional ref + branded return)  -> [ChainTip|undefined] / number
PASS  registerContractFunctionSignatures (nested arr) -> [string[]] / void
PASS  LEGACY Zod 3 .args().returns()                  -> [number, boolean|undefined] / void
7/7 passed
```

Red→green: pre-fix, the same parser returns `{ paramTypes: [],
returnType: "void" }` for every Zod 4 string.

**Not done in this PR (needs the built monorepo):** I did not run the
full generator end-to-end (`yarn generate:node-api-reference` requires
`yarn-project/node_modules`) or commit a regenerated
`node-api-reference.md`. A maintainer/CI should run the generator and
commit the refreshed reference as a follow-up.

## Out of scope (follow-ups)

The generator's static tables have also drifted from the current RPC
surface and will produce misplaced/ungrouped output even after this
parser fix — kept separate to keep this change focused:

- `METHOD_GROUPS` lists removed methods (`getPublicLogs`,
`getContractClassLogs`, `getPublicLogsByTagsFromContract`) and omits
current ones (`getPrivateLogsByTags`, `getPublicLogsByTags`,
`getCheckpointNumber`, `getCheckpointsData`, `getValidatorStats`, …).
- `simplifyZodType` still maps deleted schemas (`LogFilterSchema`,
`GetPublicLogsResponseSchema`, `GetContractClassLogsResponseSchema`) and
lacks `LogResultSchema` / `PrivateLogsQuerySchema` /
`PublicLogsQuerySchema` / `TxReceiptSchema`.

The separate TypeScript API reference generator
(`typescript_api_generation/`) is unrelated to this bug.

---
*Created by
[claudebox](https://claudebox.work/v2/sessions/46be71fd1d38fe81) ·
group: `slackbot`*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants