-
Notifications
You must be signed in to change notification settings - Fork 599
fix: complete legacy oracle mappings for all pinned contracts #21404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nventuro
merged 7 commits into
merge-train/fairies
from
be/complete-legacy-oracle-mappings
Mar 12, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
88b0560
fix: complete legacy oracle name mappings for all pinned protocol con…
benesjan 8209ba7
fix: add adapter for legacy validateAndStoreEnqueuedNotesAndEvents pa…
benesjan 3a72716
simplifying return type
benesjan bea97d9
nico feedback commit 1
benesjan 7193e0a
dropping special casing of SponsoredFPC
benesjan 2d6f4ec
relaxing version check
benesjan d174a17
Merge branch 'merge-train/fairies' into be/complete-legacy-oracle-map…
nventuro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
77 changes: 77 additions & 0 deletions
77
yarn-project/pxe/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| import { Fr } from '@aztec/foundation/curves/bn254'; | ||
| import type { ACIRCallback, ACVMField } from '@aztec/simulator/client'; | ||
|
|
||
| import type { Oracle } from './oracle.js'; | ||
|
|
||
| /** | ||
| * Builds legacy oracle name callbacks for pinned protocol contracts whose artifacts are committed and cannot be | ||
| * changed. | ||
| * TODO(F-416): Remove these aliases on v5 when protocol contracts are redeployed. | ||
| */ | ||
| export function buildLegacyOracleCallbacks(oracle: Oracle): ACIRCallback { | ||
| return { | ||
| // Simple prefix renames (privateXxx/utilityXxx → aztec_prv_/aztec_utl_) | ||
| utilityLog: (...args: ACVMField[][]) => oracle.aztec_utl_log(args[0], args[1], args[2], args[3]), | ||
| utilityAssertCompatibleOracleVersion: (...args: ACVMField[][]) => | ||
| oracle.aztec_utl_assertCompatibleOracleVersion(args[0]), | ||
| utilityLoadCapsule: (...args: ACVMField[][]) => oracle.aztec_utl_loadCapsule(args[0], args[1], args[2]), | ||
| privateStoreInExecutionCache: (...args: ACVMField[][]) => oracle.aztec_prv_storeInExecutionCache(args[0], args[1]), | ||
| privateLoadFromExecutionCache: (...args: ACVMField[][]) => oracle.aztec_prv_loadFromExecutionCache(args[0]), | ||
| privateCallPrivateFunction: (...args: ACVMField[][]) => | ||
| oracle.aztec_prv_callPrivateFunction(args[0], args[1], args[2], args[3], args[4]), | ||
| privateIsNullifierPending: (...args: ACVMField[][]) => oracle.aztec_prv_isNullifierPending(args[0], args[1]), | ||
| privateNotifyCreatedNullifier: (...args: ACVMField[][]) => oracle.aztec_prv_notifyCreatedNullifier(args[0]), | ||
| privateNotifyCreatedContractClassLog: (...args: ACVMField[][]) => | ||
| oracle.aztec_prv_notifyCreatedContractClassLog(args[0], args[1], args[2], args[3]), | ||
| privateGetNextAppTagAsSender: (...args: ACVMField[][]) => oracle.aztec_prv_getNextAppTagAsSender(args[0], args[1]), | ||
| privateGetSenderForTags: () => oracle.aztec_prv_getSenderForTags(), | ||
| privateSetSenderForTags: (...args: ACVMField[][]) => oracle.aztec_prv_setSenderForTags(args[0]), | ||
| utilityGetUtilityContext: () => oracle.aztec_utl_getUtilityContext(), | ||
| utilityStorageRead: (...args: ACVMField[][]) => oracle.aztec_utl_storageRead(args[0], args[1], args[2], args[3]), | ||
| utilityStoreCapsule: (...args: ACVMField[][]) => oracle.aztec_utl_storeCapsule(args[0], args[1], args[2]), | ||
| utilityCopyCapsule: (...args: ACVMField[][]) => oracle.aztec_utl_copyCapsule(args[0], args[1], args[2], args[3]), | ||
| utilityDeleteCapsule: (...args: ACVMField[][]) => oracle.aztec_utl_deleteCapsule(args[0], args[1]), | ||
| utilityAes128Decrypt: (...args: ACVMField[][]) => | ||
| oracle.aztec_utl_aes128Decrypt(args[0], args[1], args[2], args[3]), | ||
| utilityGetSharedSecret: (...args: ACVMField[][]) => | ||
| oracle.aztec_utl_getSharedSecret(args[0], args[1], args[2], args[3]), | ||
| utilityFetchTaggedLogs: (...args: ACVMField[][]) => oracle.aztec_utl_fetchTaggedLogs(args[0]), | ||
| utilityBulkRetrieveLogs: (...args: ACVMField[][]) => oracle.aztec_utl_bulkRetrieveLogs(args[0], args[1], args[2]), | ||
| // Adapter: old 3-param signature → new 5-param with injected constants. | ||
| // Values derived from: MAX_MESSAGE_CONTENT_LEN(11) - RESERVED_FIELDS (3 for notes, 1 for events). | ||
| utilityValidateAndStoreEnqueuedNotesAndEvents: ( | ||
| contractAddress: ACVMField[], | ||
| noteValidationRequestsArrayBaseSlot: ACVMField[], | ||
| eventValidationRequestsArrayBaseSlot: ACVMField[], | ||
| ) => | ||
| oracle.aztec_utl_validateAndStoreEnqueuedNotesAndEvents( | ||
| contractAddress, | ||
| noteValidationRequestsArrayBaseSlot, | ||
| eventValidationRequestsArrayBaseSlot, | ||
| [new Fr(8).toString()], | ||
| [new Fr(10).toString()], | ||
| ), | ||
| utilityGetL1ToL2MembershipWitness: (...args: ACVMField[][]) => | ||
| oracle.aztec_utl_getL1ToL2MembershipWitness(args[0], args[1], args[2]), | ||
| utilityCheckNullifierExists: (...args: ACVMField[][]) => oracle.aztec_utl_checkNullifierExists(args[0]), | ||
| utilityGetRandomField: () => oracle.aztec_utl_getRandomField(), | ||
| utilityEmitOffchainEffect: (...args: ACVMField[][]) => oracle.aztec_utl_emitOffchainEffect(args[0]), | ||
| // Renames (same signature, different oracle name) | ||
| privateNotifySetMinRevertibleSideEffectCounter: (...args: ACVMField[][]) => | ||
| oracle.aztec_prv_notifyRevertiblePhaseStart(args[0]), | ||
| privateIsSideEffectCounterRevertible: (...args: ACVMField[][]) => oracle.aztec_prv_inRevertiblePhase(args[0]), | ||
| // Signature changes: old 4-param oracles → new 1-param validatePublicCalldata | ||
| privateNotifyEnqueuedPublicFunctionCall: ( | ||
| [_contractAddress]: ACVMField[], | ||
| [calldataHash]: ACVMField[], | ||
| [_sideEffectCounter]: ACVMField[], | ||
| [_isStaticCall]: ACVMField[], | ||
| ) => oracle.aztec_prv_validatePublicCalldata([calldataHash]), | ||
| privateNotifySetPublicTeardownFunctionCall: ( | ||
| [_contractAddress]: ACVMField[], | ||
| [calldataHash]: ACVMField[], | ||
| [_sideEffectCounter]: ACVMField[], | ||
| [_isStaticCall]: ACVMField[], | ||
| ) => oracle.aztec_prv_validatePublicCalldata([calldataHash]), | ||
| }; | ||
| } |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.