feat: make node.getContract take an optional reference block - #24207
Merged
nventuro merged 4 commits intoJun 22, 2026
Conversation
Flip the getContract arguments so address comes first and referenceBlock is an optional trailing parameter defaulting to 'latest'. This keeps the change backwards compatible: existing single-argument callers keep working, and only the PXE class-id resolution passes an explicit anchor block.
Resolves the TODO(#15170) in the ContractDataSource interface: the timestamp parameter is now required rather than optional, and the archiver implementations no longer silently fall back to the latest proposed block when it is omitted. Callers that want the latest state now resolve and pass the timestamp explicitly.
nventuro
approved these changes
Jun 22, 2026
This was referenced Jun 22, 2026
AztecBot
added a commit
that referenced
this pull request
Jun 26, 2026
merge-train/spartan-v5 has landed in v5-next and auto-pulled into this train. Its server.ts refactor (#24283) rewrote the imports and dropped inspectBlockParameter, but this train's getContract change (#24207) still calls it in the reference-block-not-found error, so the merged server.ts references an unimported symbol and the yarn-project build fails. Re-add inspectBlockParameter to the existing @aztec/stdlib/block import.
mverzilli
added a commit
that referenced
this pull request
Jun 26, 2026
## Why `merge-train/spartan-v5` ([#24272](#24272)) has landed in `v5-next` and been auto-pulled into this train (merge commit `34209c32`), so the cross-train build break is now live on the `merge-train/fairies-v5` tip itself — `yarn-project` no longer compiles (`make: *** [Makefile:359: yarn-project] Error 1`, in `compile_all`). ## Root cause In `aztec-node/src/aztec-node/server.ts`: - spartan-v5's [#24283](#24283) (`split server.ts into factory + focused modules`) rewrote the imports and dropped `inspectBlockParameter` — its own uses moved into `modules/node_world_state_queries.ts`, which imports it correctly. - This train's [#24207](#24207) (`make node.getContract take an optional reference block`) still calls `inspectBlockParameter(referenceBlock)` in `getContract`'s reference-block-not-found error. The auto-merge took spartan-v5's import block, leaving `getContract` referencing an unimported symbol → `Cannot find name 'inspectBlockParameter'`. ## Fix Re-add `inspectBlockParameter` to the existing `@aztec/stdlib/block` import in `server.ts` (it is the only remaining consumer there, and the symbol is still exported from that module). One-line change; the error message is unchanged. Since the train tip already contains spartan-v5's refactor, this PR's own CI now builds the actual merged tree, so it verifies the fix directly. Refs [#24223](#24223), [#24207](#24207), [#24283](#24283).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PXE needs the class id at the anchor block, but the node only exposed the latest one. This forced PXE to reimplement the class id detection by raw reads of the trees combined with delayed public mutable interpretation of said data, which unnecessarily coupled PXE and the registry contracts. With this PR we simply query the data from the node, which will always be available if there's an upgrade, making the original class a safe fallback.
The new
referenceBlockargument is optional and defaults to'latest', withaddresskept as the first argument, so the change is backwards compatible: existing single-argumentgetContract(address)callers keep working unchanged, and only PXE's class-id resolution passes an explicit anchor block.Supersedes #24205, addressing the review feedback to make the new argument optional.
Fixes #15170