Skip to content

refactor: remove aztec dependency from aztec_sublib#22033

Merged
benesjan merged 1 commit intonextfrom
jan/extract-version-oracle-for-sublib
Mar 27, 2026
Merged

refactor: remove aztec dependency from aztec_sublib#22033
benesjan merged 1 commit intonextfrom
jan/extract-version-oracle-for-sublib

Conversation

@benesjan
Copy link
Copy Markdown
Contributor

@benesjan benesjan commented Mar 26, 2026

Reverting bad decision of mine from a while ago.

Summary

  • Copies the version oracle into aztec_sublib so it no longer depends on the aztec (aztecnr) crate
  • Removes the aztec dependency from aztec_sublib/Nargo.toml
  • Makes aztec_sublib fully independent, allowing it to be audited and versioned separately from aztecnr

Resolves https://linear.app/aztec-labs/issue/F-466/extract-oracles-mod-specifically-for-aztec-sublib

Test plan

  • nargo check --package fee_juice_contract compiles successfully
  • No remaining aztec:: imports in aztec_sublib

🤖 Generated with Claude Code

@benesjan benesjan requested a review from mverzilli March 26, 2026 03:05
Base automatically changed from merge-train/fairies to next March 26, 2026 04:08
///
/// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` oracle is
/// called and if the oracle version is incompatible an error is thrown.
pub global ORACLE_VERSION: Field = 21;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how does this ORACLE_VERSION relate to the one in aztec.nr? are they supposed to be in sync so the same PXE picks both up indistinctly?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's to be discussed but currently the version 21 is here because the code of the protocol contract was "following" the changes in the real Aztec.nr. So figuring the versioning out is for another PR.

But this is indeed very problematic because the contracts are to go for an audit at which point we will not want to modify this.

The only feasible approach is to stick to backwards compatibility from now on and modify the pxe oracle check to check that AZTEC_NR_ORACLE_VERSION > 21 && AZTEC_NR_ORACLE_VERSION <= PXE_ORACLE_VERSION.

WDYT?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't understand the issue here - sublib is on version 21 no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, the question is what to do with this with future changes in the real Aztec.nr

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤔

I think I've been thinking of this with the wrong perspective. My concern was that with aztecsublib and aztecnr now properly parting ways, we would end up with two different sets of oracles so we would need two different versions and PXE would need to be aware of that.

But that was the wrong frame: the oracle version is determined by PXE's interface, and the different nr libs just need to declare which one they were built for. Then it's up to PXE to detect compatibility or lack there of.

When Aztec.nr gets future changes leveraging newer oracle versions, it will just state its target version and aztecsublib will stay at 21. Then it's our job to make sure we don't ship PXE's where both libs are properly supported.

So this is not different from the more general issue of oracle semver we've been discussing.

type = "lib"

[dependencies]
aztec = { path = "../../../../aztec-nr/aztec" }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it's so nice to see this line go 😍

@benesjan benesjan requested a review from mverzilli March 27, 2026 01:33
Copy link
Copy Markdown
Contributor

@mverzilli mverzilli left a comment

Choose a reason for hiding this comment

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

🚀

@benesjan benesjan added this pull request to the merge queue Mar 27, 2026
@benesjan benesjan removed this pull request from the merge queue due to a manual request Mar 27, 2026
@benesjan
Copy link
Copy Markdown
Contributor Author

/claudebox point this pr at merge-train/fairies and rebase the branch on it

@AztecBot
Copy link
Copy Markdown
Collaborator

ClaudeBox: point this pr at merge-train/fairies and rebase the branch on it ... workflow run

Copy the version oracle into aztec_sublib directly so it no longer depends on
the aztec (aztecnr) crate. This makes aztec_sublib fully independent, allowing
it to be audited and versioned on its own timeline.

Resolves F-466

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@benesjan benesjan changed the base branch from next to graphite-base/22033 March 27, 2026 13:42
@benesjan benesjan force-pushed the jan/extract-version-oracle-for-sublib branch from f5bc24b to 0b15229 Compare March 27, 2026 13:42
@benesjan benesjan changed the base branch from graphite-base/22033 to merge-train/fairies March 27, 2026 13:42
@benesjan benesjan enabled auto-merge March 27, 2026 13:43
Base automatically changed from merge-train/fairies to next March 27, 2026 15:50
@benesjan benesjan added this pull request to the merge queue Mar 27, 2026
Merged via the queue into next with commit 38440aa Mar 27, 2026
36 of 44 checks passed
@benesjan benesjan deleted the jan/extract-version-oracle-for-sublib branch March 27, 2026 16:23
AztecBot pushed a commit that referenced this pull request Mar 27, 2026
Reverting [bad decision of
mine](#21533 (comment))
from a while ago.

## Summary
- Copies the version oracle into `aztec_sublib` so it no longer depends
on the `aztec` (aztecnr) crate
- Removes the `aztec` dependency from `aztec_sublib/Nargo.toml`
- Makes `aztec_sublib` fully independent, allowing it to be audited and
versioned separately from aztecnr

Resolves
https://linear.app/aztec-labs/issue/F-466/extract-oracles-mod-specifically-for-aztec-sublib

## Test plan
- [x] `nargo check --package fee_juice_contract` compiles successfully
- [x] No remaining `aztec::` imports in aztec_sublib

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@AztecBot
Copy link
Copy Markdown
Collaborator

✅ Successfully backported to backport-to-v4-next-staging #22091.

AztecBot added a commit that referenced this pull request Mar 28, 2026
BEGIN_COMMIT_OVERRIDE
fix(stdlib): correct NoteDao size (#22068)
fix: reject log retrieval requests for not-in-context contracts (#22047)
refactor: remove aztec dependency from aztec_sublib (#22033)
END_COMMIT_OVERRIDE
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.

4 participants