feat(pxe): implement minor/major oracle version tracking#22254
Merged
benesjan merged 18 commits intoApr 9, 2026
Merged
Conversation
Splits the oracle version from a single integer (22) into major.minor (22.0). Major version mismatches fail immediately (breaking changes). Minor version is stored and used to provide enhanced error messages when an oracle is not found - indicating the contract likely needs a newer PXE version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
benesjan
commented
Apr 2, 2026
- Rename aztec_utl_assertCompatibleOracleVersion to aztec_utl_assertCompatibleOracleVersionV2 (2-arg: major, minor) - Add legacy mapping for old 1-arg oracle name - Improve "oracle not found" errors: suggest PXE upgrade when contract minor > PXE minor, suggest contract bug when PXE should support it - Add warning log when contract version is unexpectedly not set - Created F-546 to rename back on v5 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
benesjan
commented
Apr 2, 2026
benesjan
commented
Apr 2, 2026
benesjan
commented
Apr 2, 2026
benesjan
commented
Apr 2, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
mverzilli
reviewed
Apr 8, 2026
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
mverzilli
reviewed
Apr 9, 2026
mverzilli
reviewed
Apr 9, 2026
Comment on lines
+90
to
+108
| ## Oracle versioning | ||
|
|
||
| The set of oracles that the PXE exposes to private and utility functions is versioned, so that contracts can declare which oracles they expect to be available. Every contract compiled with `Aztec.nr` records the oracle version it was built against, and the PXE checks this version before executing any oracle call. | ||
|
|
||
| The version uses two components, `major.minor`, with the following compatibility rules: | ||
|
|
||
| - **`major`** must match exactly. A major bump is a breaking change — oracles were removed or their signatures changed — and a PXE on a different major cannot safely run the contract. | ||
| - **`minor`** indicates additive changes (new oracles). The PXE uses a best-effort approach here: a contract compiled against a higher `minor` than the PXE supports is still allowed to run, and an error is only thrown if the contract actually invokes an oracle the PXE does not know about. In practice, a contract built with a newer Aztec.nr may not use any of the newly added oracles at all, in which case it runs fine on an older PXE. | ||
|
|
||
| The canonical version constants live in the PXE (`ORACLE_VERSION_MAJOR` / `ORACLE_VERSION_MINOR` in `yarn-project/pxe/src/oracle_version.ts`) and in Aztec.nr (`noir-projects/aztec-nr/aztec/src/oracle/version.nr`). The two are kept in lockstep as part of each release. | ||
|
|
||
| ### Resolving a version mismatch | ||
|
|
||
| If you see an error like _"Oracle '…' not found. … The contract was compiled with Aztec.nr oracle version X.Y, but this private execution environment only supports up to A.B"_, the contract uses oracle from a newer Aztec.nr than your PXE supports. | ||
|
|
||
| To fix it, upgrade the software that ships the PXE (sandbox, wallet, or whatever embeds `@aztec/pxe`) to a release whose Aztec.nr version is at least as new as the one the contract was compiled with. | ||
|
|
||
| If the PXE reports a version that _should_ include every oracle the contract needs but an oracle is still missing, that is a contract bug rather than a version problem and you should likely report it to the app developer. | ||
|
|
Contributor
There was a problem hiding this comment.
Not sure this fits in a foundational topics doc. However we do need something to point at and we need to merge this soon so maybe we could track to move this somewhere else in a Linear issue?
mverzilli
approved these changes
Apr 9, 2026
Co-authored-by: Martin Verzilli <martin@aztec-labs.com>
…r-oracle-version-tracking
Collaborator
|
❌ Failed to cherry-pick to |
benesjan
added a commit
that referenced
this pull request
Apr 9, 2026
Contributor
Author
|
Backport fixed in #22432 |
critesjosh
pushed a commit
that referenced
this pull request
Apr 14, 2026
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.

AI Summary
Implements F-507: minor/major oracle version tracking.
ORACLE_VERSION(22) intoORACLE_VERSION_MAJOR(22) andORACLE_VERSION_MINOR(0) on both Noir and TypeScript sides