pub struct PrivateExecutionOracle<'a, N>where
N: AztecNode,{ /* private fields */ }Expand description
Oracle for private function execution.
Handles foreign-call callbacks from the ACVM during private function execution, routing them to the appropriate local store or node RPC.
Implementations§
Source§impl<'a, N> PrivateExecutionOracle<'a, N>where
N: AztecNode + 'static,
impl<'a, N> PrivateExecutionOracle<'a, N>where
N: AztecNode + 'static,
pub fn new( node: &'a N, contract_store: &'a ContractStore, key_store: &'a KeyStore, note_store: &'a NoteStore, capsule_store: &'a CapsuleStore, address_store: &'a AddressStore, sender_tagging_store: &'a SenderTaggingStore, block_header: Value, contract_address: AztecAddress, protocol_nullifier: Fr, sender_for_tags: Option<AztecAddress>, scopes: Vec<AztecAddress>, call_is_static: bool, ) -> PrivateExecutionOracle<'a, N>
Sourcepub fn set_auth_witnesses(&mut self, witnesses: Vec<(Fr, Vec<Fr>)>)
pub fn set_auth_witnesses(&mut self, witnesses: Vec<(Fr, Vec<Fr>)>)
Set auth witnesses for this execution context.
Sourcepub fn set_capsules(&mut self, capsules: Vec<Capsule>)
pub fn set_capsules(&mut self, capsules: Vec<Capsule>)
Set capsules from the tx request so protocol contract handlers can access auxiliary data (e.g., packed bytecode for class registration).
Sourcepub fn seed_execution_cache(&mut self, hashed_values: &[HashedValues])
pub fn seed_execution_cache(&mut self, hashed_values: &[HashedValues])
Pre-populate the execution cache with hashed values from the tx request.
Mirrors the TS SDK’s HashedValuesCache.create(request.argsOfCalls).
The Noir entrypoint calls loadFromExecutionCache(hash) to retrieve
the args for each nested call; without pre-seeding the cache these
lookups would fail.
Sourcepub fn take_public_call_requests(&mut self) -> Vec<PublicCallRequestData>
pub fn take_public_call_requests(&mut self) -> Vec<PublicCallRequestData>
Return the public call requests accumulated during this execution.
Sourcepub fn take_public_function_calldata(&mut self) -> Vec<HashedValues>
pub fn take_public_function_calldata(&mut self) -> Vec<HashedValues>
Return the public function calldata accumulated during this execution.
Sourcepub fn take_teardown_call_request(&mut self) -> Option<PublicCallRequestData>
pub fn take_teardown_call_request(&mut self) -> Option<PublicCallRequestData>
Return the teardown call request if one was enqueued.
Sourcepub async fn handle_foreign_call(
&mut self,
name: &str,
args: Vec<Vec<Fr>>,
) -> Result<Vec<Vec<Fr>>, Error>
pub async fn handle_foreign_call( &mut self, name: &str, args: Vec<Vec<Fr>>, ) -> Result<Vec<Vec<Fr>>, Error>
Handle an ACVM foreign call by name and arguments.
Supports both prefixed names (from compiled Noir bytecode) and legacy unprefixed names.
Sourcepub fn get_execution_cache_entry(&self, hash: &Fr) -> Option<Vec<Fr>>
pub fn get_execution_cache_entry(&self, hash: &Fr) -> Option<Vec<Fr>>
Look up a value in the execution cache by its hash.
Sourcepub fn block_header(&self) -> &Value
pub fn block_header(&self) -> &Value
Get the block header.
Sourcepub fn build_execution_result(
&self,
acvm_output: AcvmExecutionOutput,
contract_address: AztecAddress,
expiration_timestamp: u64,
) -> PrivateExecutionResult
pub fn build_execution_result( &self, acvm_output: AcvmExecutionOutput, contract_address: AztecAddress, expiration_timestamp: u64, ) -> PrivateExecutionResult
Build a PrivateExecutionResult from the ACVM output and oracle-collected
side effects. This is the bridge between raw ACVM execution and the typed
kernel input structures.
Trait Implementations§
Source§impl<'a, N> OracleCallback for PrivateExecutionOracle<'a, N>
impl<'a, N> OracleCallback for PrivateExecutionOracle<'a, N>
fn handle_foreign_call<'life0, 'life1, 'async_trait>(
&'life0 mut self,
function: &'life1 str,
inputs: Vec<Vec<Fr>>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<Fr>>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
PrivateExecutionOracle<'a, N>: 'async_trait,
Auto Trait Implementations§
impl<'a, N> Freeze for PrivateExecutionOracle<'a, N>
impl<'a, N> !RefUnwindSafe for PrivateExecutionOracle<'a, N>
impl<'a, N> Send for PrivateExecutionOracle<'a, N>
impl<'a, N> Sync for PrivateExecutionOracle<'a, N>
impl<'a, N> Unpin for PrivateExecutionOracle<'a, N>
impl<'a, N> !UnwindSafe for PrivateExecutionOracle<'a, N>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more