diff --git a/noir-projects/aztec-nr/aztec/src/macros/aztec.nr b/noir-projects/aztec-nr/aztec/src/macros/aztec.nr index bc2500721919..fa3b0c97fd4f 100644 --- a/noir-projects/aztec-nr/aztec/src/macros/aztec.nr +++ b/noir-projects/aztec-nr/aztec/src/macros/aztec.nr @@ -10,7 +10,7 @@ use crate::{ }; /// Marks a contract as an Aztec contract, generating the interfaces for its functions and notes, as well as injecting -/// the `sync_private_state` utility function PXE requires in order to discover notes. +/// the `sync_private_state` utility function. /// Note: This is a module annotation, so the returned quote gets injected inside the module (contract) itself. pub comptime fn aztec(m: Module) -> Quoted { let interface = generate_contract_interface(m); diff --git a/noir-projects/aztec-nr/aztec/src/messages/discovery/pending_tagged_log.nr b/noir-projects/aztec-nr/aztec/src/messages/discovery/pending_tagged_log.nr index cbd676745c47..4913ddc003da 100644 --- a/noir-projects/aztec-nr/aztec/src/messages/discovery/pending_tagged_log.nr +++ b/noir-projects/aztec-nr/aztec/src/messages/discovery/pending_tagged_log.nr @@ -5,12 +5,12 @@ use protocol_types::{ traits::{Deserialize, Serialize}, }; -// Base slot for the pending tagged log array to which the syncPrivateState oracle inserts found private logs. +// Base slot for the pending tagged log array to which the fetchTaggedLogs oracle inserts found private logs. pub(crate) global PENDING_TAGGED_LOG_ARRAY_BASE_SLOT: Field = sha256_to_field( "AZTEC_NR::PENDING_TAGGED_PENDING_TAGGED_LOG_ARRAY_BASE_SLOT".as_bytes(), ); -/// Represents a log as it is stored in the pending tagged log array to which the syncPrivateState oracle inserts found private log. +/// Represents a log as it is stored in the pending tagged log array to which the fetchTaggedLogs oracle inserts found private log. #[derive(Deserialize, Serialize)] pub(crate) struct PendingTaggedLog { pub log: BoundedVec, diff --git a/noir-projects/aztec-nr/aztec/src/messages/discovery/private_logs.nr b/noir-projects/aztec-nr/aztec/src/messages/discovery/private_logs.nr index 614ed21ca268..ddfa6bcfc067 100644 --- a/noir-projects/aztec-nr/aztec/src/messages/discovery/private_logs.nr +++ b/noir-projects/aztec-nr/aztec/src/messages/discovery/private_logs.nr @@ -13,7 +13,7 @@ use crate::{ PARTIAL_NOTE_PRIVATE_MSG_TYPE_ID, PRIVATE_EVENT_MSG_TYPE_ID, PRIVATE_NOTE_MSG_TYPE_ID, }, }, - oracle::{logs::store_private_event_log, message_discovery::sync_private_state}, + oracle::{logs::store_private_event_log, message_discovery::fetch_tagged_logs}, utils::array, }; @@ -31,10 +31,10 @@ pub unconstrained fn fetch_and_process_private_tagged_logs( contract_address: AztecAddress, compute_note_hash_and_nullifier: ComputeNoteHashAndNullifier, ) { - // We will eventually perform log discovery via tagging here, but for now we simply call the `syncPrivateState` oracle. + // We will eventually perform log discovery via tagging here, but for now we simply call the `fetchTaggedLogs` oracle. // This makes PXE synchronize tags, download logs and store the pending tagged logs in capsule array which are then // retrieved and processed here. - sync_private_state(PENDING_TAGGED_LOG_ARRAY_BASE_SLOT); + fetch_tagged_logs(PENDING_TAGGED_LOG_ARRAY_BASE_SLOT); // Get the logs from the capsule array and process them one by one let logs = diff --git a/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr b/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr index 92c41f68afaa..eaa049a915bc 100644 --- a/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr +++ b/noir-projects/aztec-nr/aztec/src/oracle/message_discovery.nr @@ -6,12 +6,12 @@ use dep::protocol_types::{ /// Finds new private logs that may have been sent to all registered accounts in PXE in the current contract and makes /// them available for later processing in Noir by storing them in a capsule array. -pub unconstrained fn sync_private_state(pending_tagged_log_array_base_slot: Field) { - sync_private_state_oracle(pending_tagged_log_array_base_slot); +pub unconstrained fn fetch_tagged_logs(pending_tagged_log_array_base_slot: Field) { + fetch_tagged_logs_oracle(pending_tagged_log_array_base_slot); } -#[oracle(syncPrivateState)] -unconstrained fn sync_private_state_oracle(pending_tagged_log_array_base_slot: Field) {} +#[oracle(fetchTaggedLogs)] +unconstrained fn fetch_tagged_logs_oracle(pending_tagged_log_array_base_slot: Field) {} /// Informs PXE of a note's existence so that it can later be retrieved by the `getNotes` oracle. The note will be /// scoped to `contract_address`, meaning other contracts will not be able to access it unless authorized. diff --git a/yarn-project/simulator/src/private/acvm/oracle/oracle.ts b/yarn-project/simulator/src/private/acvm/oracle/oracle.ts index adc3610bbcc0..0d71f2c7bca8 100644 --- a/yarn-project/simulator/src/private/acvm/oracle/oracle.ts +++ b/yarn-project/simulator/src/private/acvm/oracle/oracle.ts @@ -379,8 +379,8 @@ export class Oracle { return []; } - async syncPrivateState([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise { - await this.typedOracle.syncPrivateState(Fr.fromString(pendingTaggedLogArrayBaseSlot)); + async fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise { + await this.typedOracle.fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot)); return []; } diff --git a/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts b/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts index 13ca5443637f..acc110a02ba5 100644 --- a/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts +++ b/yarn-project/simulator/src/private/acvm/oracle/typed_oracle.ts @@ -214,8 +214,8 @@ export abstract class TypedOracle { return Promise.reject(new OracleMethodNotAvailableError('incrementAppTaggingSecretIndexAsSender')); } - syncPrivateState(_pendingTaggedLogArrayBaseSlot: Fr): Promise { - return Promise.reject(new OracleMethodNotAvailableError('syncPrivateState')); + fetchTaggedLogs(_pendingTaggedLogArrayBaseSlot: Fr): Promise { + return Promise.reject(new OracleMethodNotAvailableError('fetchTaggedLogs')); } deliverNote( diff --git a/yarn-project/simulator/src/private/private_execution_oracle.ts b/yarn-project/simulator/src/private/private_execution_oracle.ts index 82909e4acce5..51c6d7e850e5 100644 --- a/yarn-project/simulator/src/private/private_execution_oracle.ts +++ b/yarn-project/simulator/src/private/private_execution_oracle.ts @@ -500,7 +500,7 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle { await this.executionDataProvider.incrementAppTaggingSecretIndexAsSender(this.contractAddress, sender, recipient); } - public override async syncPrivateState(pendingTaggedLogArrayBaseSlot: Fr) { + public override async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) { await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes); await this.executionDataProvider.removeNullifiedNotes(this.contractAddress); diff --git a/yarn-project/simulator/src/private/providers/circuit_recording/circuit_recorder.ts b/yarn-project/simulator/src/private/providers/circuit_recording/circuit_recorder.ts index 05a2bd386889..9adc155c259c 100644 --- a/yarn-project/simulator/src/private/providers/circuit_recording/circuit_recorder.ts +++ b/yarn-project/simulator/src/private/providers/circuit_recording/circuit_recorder.ts @@ -51,7 +51,7 @@ import { Oracle } from '../../acvm/oracle/oracle.js'; * ] * }, * { - * "name": "syncPrivateState", + * "name": "fetchTaggedLogs", * "inputs": [] * } * ] diff --git a/yarn-project/simulator/src/private/utility_execution_oracle.ts b/yarn-project/simulator/src/private/utility_execution_oracle.ts index b1bed1d3f291..39b9080925d2 100644 --- a/yarn-project/simulator/src/private/utility_execution_oracle.ts +++ b/yarn-project/simulator/src/private/utility_execution_oracle.ts @@ -274,7 +274,7 @@ export class UtilityExecutionOracle extends TypedOracle { return await this.executionDataProvider.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient); } - public override async syncPrivateState(pendingTaggedLogArrayBaseSlot: Fr) { + public override async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) { await this.executionDataProvider.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes); await this.executionDataProvider.removeNullifiedNotes(this.contractAddress); diff --git a/yarn-project/stdlib/src/logs/pending_tagged_log.ts b/yarn-project/stdlib/src/logs/pending_tagged_log.ts index 0caf79f64e5f..6ea03bf011ad 100644 --- a/yarn-project/stdlib/src/logs/pending_tagged_log.ts +++ b/yarn-project/stdlib/src/logs/pending_tagged_log.ts @@ -5,7 +5,7 @@ import type { AztecAddress } from '../aztec-address/index.js'; import type { TxHash } from '../tx/tx_hash.js'; /** - * Represents a pending tagged log as it is stored in the pending tagged log array to which the syncPrivateState oracle + * Represents a pending tagged log as it is stored in the pending tagged log array to which the fetchTaggedLogs oracle * inserts found private logs. A TS version of `pending_tagged_log.nr`. */ export class PendingTaggedLog { diff --git a/yarn-project/txe/src/oracle/txe_oracle.ts b/yarn-project/txe/src/oracle/txe_oracle.ts index c3233836783b..2a7f976dd976 100644 --- a/yarn-project/txe/src/oracle/txe_oracle.ts +++ b/yarn-project/txe/src/oracle/txe_oracle.ts @@ -1161,7 +1161,7 @@ export class TXE implements TypedOracle { return await this.pxeOracleInterface.getIndexedTaggingSecretAsSender(this.contractAddress, sender, recipient); } - async syncPrivateState(pendingTaggedLogArrayBaseSlot: Fr) { + async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr) { await this.pxeOracleInterface.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot); await this.pxeOracleInterface.removeNullifiedNotes(this.contractAddress); diff --git a/yarn-project/txe/src/txe_service/txe_service.ts b/yarn-project/txe/src/txe_service/txe_service.ts index 87960019c846..8026c13beef0 100644 --- a/yarn-project/txe/src/txe_service/txe_service.ts +++ b/yarn-project/txe/src/txe_service/txe_service.ts @@ -689,14 +689,14 @@ export class TXEService { return toForeignCallResult(secret.toFields().map(toSingle)); } - async syncPrivateState(pendingTaggedLogArrayBaseSlot: ForeignCallSingle) { + async fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: ForeignCallSingle) { if (!this.oraclesEnabled) { throw new Error( 'Oracle access from the root of a TXe test are not enabled. Please use env._ to interact with the oracles.', ); } - await this.typedOracle.syncPrivateState(fromSingle(pendingTaggedLogArrayBaseSlot)); + await this.typedOracle.fetchTaggedLogs(fromSingle(pendingTaggedLogArrayBaseSlot)); return toForeignCallResult([]); }