pub struct Executor<R>where
R: RelayerPort + Clone,{
pub database: Database,
pub relayer: R,
pub config: Arc<Config>,
/* private fields */
}
Expand description
! The executor is used for block production and validation. Given a block, it will execute all the transactions contained in the block and persist changes to the underlying database as needed. In production mode, block fields like transaction commitments are set based on the executed txs. In validation mode, the processed block commitments are compared with the proposed block.
Fields§
§database: Database
§relayer: R
§config: Arc<Config>
Implementations§
source§impl<R> Executor<R>where
R: RelayerPort + Clone,
impl<R> Executor<R>where R: RelayerPort + Clone,
pub fn new(database: Database, config: Config, relayer: R) -> Self
sourcepub fn execute_and_commit(
&self,
block: ExecutionBlock
) -> ExecutorResult<ExecutionResult>
pub fn execute_and_commit( &self, block: ExecutionBlock ) -> ExecutorResult<ExecutionResult>
Executes the block and commits the result of the execution into the inner Database
.
source§impl<R> Executor<R>where
R: RelayerPort + Clone,
impl<R> Executor<R>where R: RelayerPort + Clone,
pub fn execute_without_commit<TxSource>( &self, block: ExecutionBlockWithSource<TxSource> ) -> ExecutorResult<UncommittedResult<StorageTransaction<Database>>>where TxSource: TransactionsSource,
pub fn dry_run( &self, component: Components<Transaction>, utxo_validation: Option<bool> ) -> ExecutorResult<Vec<Vec<Receipt>>>
source§impl<R> Executor<R>where
R: RelayerPort + Clone,
impl<R> Executor<R>where R: RelayerPort + Clone,
sourcepub fn verify_tx_predicates<Tx>(&self, tx: Checked<Tx>) -> ExecutorResult<()>where
Tx: ExecutableTransaction,
<Tx as IntoChecked>::Metadata: CheckedMetadata,
pub fn verify_tx_predicates<Tx>(&self, tx: Checked<Tx>) -> ExecutorResult<()>where Tx: ExecutableTransaction, <Tx as IntoChecked>::Metadata: CheckedMetadata,
Verify all the predicates of a tx.
Trait Implementations§
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Executor<R>
impl<R> Send for Executor<R>where R: Send,
impl<R> Sync for Executor<R>where R: Sync,
impl<R> Unpin for Executor<R>where R: Unpin,
impl<R> !UnwindSafe for Executor<R>
Blanket Implementations§
§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Returns a reference to the underlying type as
Any
.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
Mutably borrows from an owned value. Read more