EmbeddedPxe

Struct EmbeddedPxe 

Source
pub struct EmbeddedPxe<N>
where N: AztecNode,
{ /* private fields */ }
Expand description

Embedded PXE that runs private execution logic in-process.

In-process PXE for Aztec v4.x where PXE runs client-side. Talks to the Aztec node via node_* RPC methods and maintains local stores for contracts, keys, addresses, notes, capsules, and events.

Phase 3 additions: anchor block tracking, block reorg handling, private event retrieval, transaction profiling, and persistent storage.

Implementations§

Source§

impl<N> EmbeddedPxe<N>
where N: AztecNode + Clone + 'static,

Source

pub async fn create( node: N, kv: Arc<dyn KvStore>, ) -> Result<EmbeddedPxe<N>, Error>

Create a new EmbeddedPxe backed by the given node client and KV store.

Source

pub async fn create_with_prover_config( node: N, kv: Arc<dyn KvStore>, prover_config: BbProverConfig, ) -> Result<EmbeddedPxe<N>, Error>

Create a new EmbeddedPxe with custom BB prover configuration.

Source

pub async fn create_with_config( node: N, kv: Arc<dyn KvStore>, config: EmbeddedPxeConfig, ) -> Result<EmbeddedPxe<N>, Error>

Create a new EmbeddedPxe with full configuration.

Source

pub async fn create_ephemeral(node: N) -> Result<EmbeddedPxe<N>, Error>

Create a new EmbeddedPxe with an in-memory KV store.

Source

pub fn node(&self) -> &N

Get a reference to the underlying node client.

Source

pub fn contract_store(&self) -> &ContractStore

Get a reference to the contract store.

Source

pub fn key_store(&self) -> &KeyStore

Get a reference to the key store.

Source

pub fn address_store(&self) -> &AddressStore

Get a reference to the address store.

Source

pub fn note_store(&self) -> &NoteStore

Get a reference to the note store.

Source

pub fn anchor_block_store(&self) -> &AnchorBlockStore

Get a reference to the anchor block store.

Source

pub fn private_event_store(&self) -> &PrivateEventStore

Get a reference to the private event store.

Trait Implementations§

Source§

impl<N> Pxe for EmbeddedPxe<N>
where N: AztecNode + Clone + 'static,

Source§

fn get_synced_block_header<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<BlockHeader, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get the synced block header.
Source§

fn get_contract_instance<'life0, 'life1, 'async_trait>( &'life0 self, address: &'life1 AztecAddress, ) -> Pin<Box<dyn Future<Output = Result<Option<ContractInstanceWithAddress>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get a contract instance by its address.
Source§

fn get_contract_artifact<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 Fr, ) -> Pin<Box<dyn Future<Output = Result<Option<ContractArtifact>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get a contract artifact by its class ID.
Source§

fn get_contracts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AztecAddress>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get all registered contract addresses.
Source§

fn register_account<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, secret_key: &'life1 Fr, partial_address: &'life2 Fr, ) -> Pin<Box<dyn Future<Output = Result<CompleteAddress, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Register an account with the PXE.
Source§

fn get_registered_accounts<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<CompleteAddress>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get all registered account addresses.
Source§

fn register_sender<'life0, 'life1, 'async_trait>( &'life0 self, sender: &'life1 AztecAddress, ) -> Pin<Box<dyn Future<Output = Result<AztecAddress, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Register a sender address for private log syncing.
Source§

fn get_senders<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<AztecAddress>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get all registered sender addresses.
Source§

fn remove_sender<'life0, 'life1, 'async_trait>( &'life0 self, sender: &'life1 AztecAddress, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Remove a registered sender.
Source§

fn register_contract_class<'life0, 'life1, 'async_trait>( &'life0 self, artifact: &'life1 ContractArtifact, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Register a contract class with the PXE (artifact only, no instance).
Source§

fn register_contract<'life0, 'async_trait>( &'life0 self, request: RegisterContractRequest, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Register a contract instance (and optionally its artifact).
Source§

fn update_contract<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, address: &'life1 AztecAddress, artifact: &'life2 ContractArtifact, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Update a contract’s artifact.
Source§

fn simulate_tx<'life0, 'life1, 'async_trait>( &'life0 self, tx_request: &'life1 TxExecutionRequest, opts: SimulateTxOpts, ) -> Pin<Box<dyn Future<Output = Result<TxSimulationResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Simulate a transaction without sending it.
Source§

fn prove_tx<'life0, 'life1, 'async_trait>( &'life0 self, tx_request: &'life1 TxExecutionRequest, scopes: Vec<AztecAddress>, ) -> Pin<Box<dyn Future<Output = Result<TxProvingResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Prove a transaction, producing a proven result ready for submission.
Source§

fn profile_tx<'life0, 'life1, 'async_trait>( &'life0 self, tx_request: &'life1 TxExecutionRequest, opts: ProfileTxOpts, ) -> Pin<Box<dyn Future<Output = Result<TxProfileResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Profile a transaction for gas estimation and performance data.
Source§

fn execute_utility<'life0, 'life1, 'async_trait>( &'life0 self, call: &'life1 FunctionCall, opts: ExecuteUtilityOpts, ) -> Pin<Box<dyn Future<Output = Result<UtilityExecutionResult, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Execute a utility (view/unconstrained) function.
Source§

fn get_private_events<'life0, 'life1, 'async_trait>( &'life0 self, event_selector: &'life1 EventSelector, filter: PrivateEventFilter, ) -> Pin<Box<dyn Future<Output = Result<Vec<PackedPrivateEvent>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Get private events matching a selector and filter.
Source§

fn stop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, EmbeddedPxe<N>: 'async_trait,

Stop the PXE instance.

Auto Trait Implementations§

§

impl<N> !Freeze for EmbeddedPxe<N>

§

impl<N> !RefUnwindSafe for EmbeddedPxe<N>

§

impl<N> Send for EmbeddedPxe<N>

§

impl<N> Sync for EmbeddedPxe<N>

§

impl<N> Unpin for EmbeddedPxe<N>
where N: Unpin,

§

impl<N> !UnwindSafe for EmbeddedPxe<N>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more