feat(txe): add oracle versioning for test environment#23285
Merged
Conversation
…/f-648-add-txe-version-oracle # Conflicts: # docs/netlify.toml
nchamo
commented
May 14, 2026
|
|
||
| :::warning | ||
| Always use `aztec test` instead of `nargo test`. The `TestEnvironment` requires the TXE (Test eXecution Environment) oracle resolver. | ||
| Always use `aztec test` instead of `nargo test`. The `TestEnvironment` requires the test environment oracle resolver provided by the `aztec` CLI. |
Contributor
Author
There was a problem hiding this comment.
I'm trying to remove the term "TXE" from all user facing docs/errors
nventuro
reviewed
May 14, 2026
|
|
||
| :::warning | ||
| Always use `aztec test` instead of `nargo test`. The `TestEnvironment` requires the TXE (Test eXecution Environment) oracle resolver. | ||
| Always use `aztec test` instead of `nargo test`. The `TestEnvironment` requires the test environment oracle resolver provided by the `aztec` CLI. |
| ` The test was compiled with Aztec.nr test oracle version` + | ||
| ` ${this.txeOracleVersion.major}.${this.txeOracleVersion.minor}, but this test environment` + | ||
| ` only supports up to ${TXE_ORACLE_VERSION_MAJOR}.${TXE_ORACLE_VERSION_MINOR}.` + | ||
| ` Upgrade your test environment to a compatible version.` + |
Contributor
There was a problem hiding this comment.
upgrade the aztec cli, not 'the test env'
| ' See https://docs.aztec.network/errors/12'; | ||
| } else if (this.txeOracleVersion.minor > TXE_ORACLE_VERSION_MINOR) { | ||
| versionHint = | ||
| ` The test was compiled with Aztec.nr test oracle version` + |
Contributor
There was a problem hiding this comment.
Tests are not compiled, rather 'the test uses aztecnr vx.y' etc
| let versionHint: string; | ||
| if (!this.txeOracleVersion) { | ||
| versionHint = | ||
| ' The test appears to have been compiled with an older version of Aztec.nr that does not' + |
Contributor
There was a problem hiding this comment.
same comment re. test compilation. may make people think they need to recompile contracts, which they dont
Comment on lines
+329
to
+333
| ` The test's oracle version (${this.txeOracleVersion.major}.${this.txeOracleVersion.minor})` + | ||
| ` is compatible with this test environment` + | ||
| ` (${TXE_ORACLE_VERSION_MAJOR}.${TXE_ORACLE_VERSION_MINOR}), so all standard oracles should` + | ||
| ` be available. This could mean the test was compiled against a modified version of Aztec.nr,` + | ||
| ` or that it references an oracle that does not exist.`; |
Contributor
There was a problem hiding this comment.
i don't think this message clearly conveys that we don't know wtf is wrong
nventuro
approved these changes
May 14, 2026
AztecBot
pushed a commit
that referenced
this pull request
May 14, 2026
Collaborator
|
✅ Successfully backported to backport-to-v4-next-staging #23291. |
This was referenced May 14, 2026
nchamo
added a commit
that referenced
this pull request
May 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.
Why we are doing this
PXE already has oracle versioning: every contract function begins with an
assertCompatibleOracleVersioncall, and PXE stores the contract'smajor.minorso that unknown-oracle errors include an actionable hint. The TXE test environment had nothing equivalent — an unknown oracle just gave an opaque dispatch error with no version context.Our fix
Mirrors the PXE pattern for TXE, with a separate version namespace (
TXE_ORACLE_VERSION_MAJOR/MINOR) to track the TXE-specific oracle interface independently.At startup (
TestEnvironment::new()), a newaztec_txe_assertCompatibleOracleVersionoracle call enforces a strict major-version check. On mismatch:Incompatible private environment version: The contract was compiled with a newer/older version of Aztec.nr than your private environment supports. [...] See /errors/8 (expected oracle major version X, got Y)Incompatible test environment version: The test was compiled with a newer/older version of Aztec.nr than your test environment supports. [...] See /errors/12 (expected test oracle major version X, got Y)When an unknown oracle is called, TXE uses the stored minor version for three-way diagnostics (same logic as PXE's Proxy-based handler):
Case 1 — no version stored (version check was never called):
Oracle 'X' not found and the contract's oracle version is unknown (the version check oracle was not called before 'X'). This usually means the contract was not compiled with the #[aztec] macro, which injects the version check as the first oracle call in every private/utility external function. If you're using a custom entry point, ensure assert_compatible_oracle_version() is called before any other oracle calls. See /errors/8Unknown oracle 'X'. The test appears to have been compiled with an older version of Aztec.nr that does not support test environment oracle versioning. Recompile the test with a compatible version of Aztec.nr. See /errors/12Case 2 — minor version too high (test needs oracles this env doesn't have):
Oracle 'X' not found. This usually means the contract requires a newer private execution environment than you have. Upgrade your private execution environment to a compatible version. The contract was compiled with Aztec.nr oracle version A.B, but this private execution environment only supports up to C.D. See /errors/8Unknown oracle 'X'. The test was compiled with Aztec.nr test oracle version A.B, but this test environment only supports up to C.D. Upgrade your test environment to a compatible version. See /errors/12Case 3 — versions compatible (likely a bug):
Oracle 'X' not found. The contract's oracle version (A.B) is compatible with this private execution environment (C.D), so all standard oracles should be available. This could mean the contract was compiled against a modified version of Aztec.nr, or that it references an oracle that does not exist. See /errors/8Unknown oracle 'X'. The test's oracle version (A.B) is compatible with this test environment (C.D), so all standard oracles should be available. This could mean the test was compiled against a modified version of Aztec.nr, or that it references an oracle that does not exist.Not yet implemented: automatically detecting changes to the TXE oracle interface (the CI hash check that PXE has in
check_oracle_version.ts). TXE oracles are spread acrossrpc_translator.tsand session handlers rather than a singleOracleclass, making it harder to extract a clean interface to hash. Tracked in F-667.Fixes F-648