Skip to content

feat: improve oracle name prefixes#21101

Merged
nventuro merged 2 commits intomerge-train/fairiesfrom
nico/f-100-improve-oracle-name-prefixes
Mar 4, 2026
Merged

feat: improve oracle name prefixes#21101
nventuro merged 2 commits intomerge-train/fairiesfrom
nico/f-100-improve-oracle-name-prefixes

Conversation

@nventuro
Copy link
Contributor

@nventuro nventuro commented Mar 4, 2026

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:

  • utilityutl
  • privateprv
  • avmOpcodeavm
  • 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.

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>
Copy link
Contributor

@benesjan benesjan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do all the oracles have the aztec prefix? Is it the expectation that there will be non-aztec oracles?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we fine breaking all the oracles here when @nchamo is trying to keep them backwards compatible in #20957 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@nventuro nventuro merged commit 75ce5f9 into merge-train/fairies Mar 4, 2026
10 checks passed
@nventuro nventuro deleted the nico/f-100-improve-oracle-name-prefixes branch March 4, 2026 18:47
@AztecBot
Copy link
Collaborator

AztecBot commented Mar 4, 2026

❌ Failed to cherry-pick to v4 due to conflicts. Dispatching ClaudeBox to resolve. View backport run.

github-merge-queue bot pushed a commit that referenced this pull request Mar 5, 2026
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
benesjan pushed a commit that referenced this pull request Mar 11, 2026
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>
benesjan added a commit that referenced this pull request Mar 12, 2026
…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>
benesjan pushed a commit that referenced this pull request Mar 12, 2026
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>
benesjan added a commit that referenced this pull request Mar 12, 2026
…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>
ludamad pushed a commit that referenced this pull request Mar 12, 2026
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>
nventuro added a commit that referenced this pull request Mar 13, 2026
## 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants