feat: improve oracle name prefixes#21101
Conversation
Add `aztec` namespace prefix and shorten scope prefixes for oracle names: - `utility` → `aztec_utl_` - `private` → `aztec_prv_` - `avmOpcode` → `aztec_avm_` - `txe` → `aztec_txe_` Strip prefixes from TS handler interfaces and implementations, keeping them only at the ACIR boundary (Oracle class and RPCTranslator). Bump ORACLE_VERSION to 13. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| match function { | ||
| "avmOpcodeCall" => handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::CALL), | ||
| "avmOpcodeStaticCall" => { | ||
| "aztec_avm_call" => handle_external_call(avm_instrs, destinations, inputs, AvmOpcode::CALL), |
There was a problem hiding this comment.
Why do all the oracles have the aztec prefix? Is it the expectation that there will be non-aztec oracles?
There was a problem hiding this comment.
See noir-lang/noir#10105. We want for nargo to be able to detect that a user is calling aztec oracles with no resolver, and to tell them to go read the docs. E.g. some other protocol mayan might use Noir and have similar oracle names.
Our oracles would always have the aztec prefix probably.
| /// called | ||
| /// and if the oracle version is incompatible an error is thrown. | ||
| pub global ORACLE_VERSION: Field = 12; | ||
| pub global ORACLE_VERSION: Field = 13; |
There was a problem hiding this comment.
I think what chamo was trying to do in that PR was to have the capacity for aztecnr to change the event/note length without breaking the oracle interface, i.e. make the oracle future-proof.
|
❌ Failed to cherry-pick to |
BEGIN_COMMIT_OVERRIDE chore: remove prefund env var in non local networks (#21095) feat: aztec new supporting multiple contract crates (#21007) feat!: Expose offchain effects when simulating/sending txs (#20563) chore: exclude auto-generated dirs from VS Code search (#20881) feat: improve oracle name prefixes (#21101) fix(pxe): correct contract class log DA gas metering from +2 to +1 (#21102) chore: remove stale aes comments (#21133) chore: add warning on invalid recipients (#21134) feat: mask ciphertext fields with Poseidon2-derived values (#21009) END_COMMIT_OVERRIDE
This adds the `aztec` namespace prefix to all oracles. We need this for noir-lang/noir#10105, so that we can get proper error messages on `nargo` that link to aztec docs. It also shortens the current prefixes: - `utility` → `utl` - `private` → `prv` - `avmOpcode` → `avm` - `txe` unchanged The prefixes only exist as the actual oracle name in the nr <> ts communication layer, they are not present in the nr code nor ts code. I actually removed the current prefixes from oracle handler fn (e.g. `utilityGetBlockNumber` becomes `getBlockNumber`) to reduce verbosity and repetitiveness, given that those functions already exist in interfaces that scope the oracles that correspond to that execution mode. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…tracts Expands the legacy oracle aliases from 5 to 30 entries covering all oracles used by all pinned protocol contracts (not just ContractInstanceRegistry, ContractClassRegistry, and FeeJuice). This is needed for the v4-next backport of oracle prefix renames (#21101) and oracle restructuring (#21209). Includes adapter functions for #21209 signature changes where privateNotifyEnqueuedPublicFunctionCall and privateNotifySetPublicTeardownFunctionCall (4 params) are mapped to aztec_prv_validatePublicCalldata (1 param). Also replaces isActualProtocolContract (which only checked 3 contracts) with isProtocolContract (which checks all protocol contracts) for the oracle version check skip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This adds the `aztec` namespace prefix to all oracles. We need this for noir-lang/noir#10105, so that we can get proper error messages on `nargo` that link to aztec docs. It also shortens the current prefixes: - `utility` → `utl` - `private` → `prv` - `avmOpcode` → `avm` - `txe` unchanged The prefixes only exist as the actual oracle name in the nr <> ts communication layer, they are not present in the nr code nor ts code. I actually removed the current prefixes from oracle handler fn (e.g. `utilityGetBlockNumber` becomes `getBlockNumber`) to reduce verbosity and repetitiveness, given that those functions already exist in interfaces that scope the oracles that correspond to that execution mode. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
…tracts Expands the legacy oracle aliases from 5 to 30 entries covering all oracles used by all pinned protocol contracts (not just ContractInstanceRegistry, ContractClassRegistry, and FeeJuice). This is needed for the v4-next backport of oracle prefix renames (#21101) and oracle restructuring (#21209). Includes adapter functions for #21209 signature changes where privateNotifyEnqueuedPublicFunctionCall and privateNotifySetPublicTeardownFunctionCall (4 params) are mapped to aztec_prv_validatePublicCalldata (1 param). Also replaces isActualProtocolContract (which only checked 3 contracts) with isProtocolContract (which checks all protocol contracts) for the oracle version check skip. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This adds the `aztec` namespace prefix to all oracles. We need this for noir-lang/noir#10105, so that we can get proper error messages on `nargo` that link to aztec docs. It also shortens the current prefixes: - `utility` → `utl` - `private` → `prv` - `avmOpcode` → `avm` - `txe` unchanged The prefixes only exist as the actual oracle name in the nr <> ts communication layer, they are not present in the nr code nor ts code. I actually removed the current prefixes from oracle handler fn (e.g. `utilityGetBlockNumber` becomes `getBlockNumber`) to reduce verbosity and repetitiveness, given that those functions already exist in interfaces that scope the oracles that correspond to that execution mode. --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
## Summary - Backports 5 PRs from `merge-train/fairies` related to oracle changes: - #21101 - feat: improve oracle name prefixes - #21349 - fix: skip oracle version check for pinned protocol contracts - #21244 - refactor: deduplicate MembershipWitness struct - #21176 - feat(pxe)!: pass BoundedVec sizes as oracle params - #21209 - refactor!: cleaning up public call and tx phase related oracles ## Test plan - CI passes on backport branch 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Nicolás Venturo <nicolas.venturo@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Nicolas Chamo <nicolas@chamo.com.ar> Co-authored-by: benesjan <benesjan@users.noreply.github.com>
This adds the
aztecnamespace prefix to all oracles. We need this for noir-lang/noir#10105, so that we can get proper error messages onnargothat link to aztec docs.It also shortens the current prefixes:
utility→utlprivate→prvavmOpcode→avmtxeunchangedThe prefixes only exist as the actual oracle name in the nr <> ts communication layer, they are not present in the nr code nor ts code. I actually removed the current prefixes from oracle handler fn (e.g.
utilityGetBlockNumberbecomesgetBlockNumber) to reduce verbosity and repetitiveness, given that those functions already exist in interfaces that scope the oracles that correspond to that execution mode.