feat!: make node.getContract take a reference block - #24205
Closed
nventuro wants to merge 2 commits into
Closed
Conversation
spalladino
requested changes
Jun 19, 2026
| * @param address - Address of the deployed contract. | ||
| */ | ||
| getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>; | ||
| getContract(referenceBlock: BlockParameter, address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>; |
Contributor
There was a problem hiding this comment.
Can you flip the arguments and make referenceBlock optional, so the change is backwards compatible and we don't accidentally break stuff if we can avoid it?
nventuro
added a commit
that referenced
this pull request
Jun 22, 2026
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 `referenceBlock` argument is optional and defaults to `'latest'`, with `address` kept as the first argument, so the change is backwards compatible: existing single-argument `getContract(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 --------- Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com>
Contributor
Author
|
Superceded by #24207. |
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.