pub struct ArbBlockExecutor<'a, Evm, Spec, R: ReceiptBuilder> {
pub inner: EthBlockExecutor<'a, Evm, Spec, R>,
pub arb_hooks: Option<DefaultArbOsHooks>,
pub arb_ctx: ArbBlockExecutionCtx,
pub block_gas_left: u64,
pub gas_used_for_l1: Vec<u64>,
pub multi_gas_used: Vec<MultiGas>,
/* private fields */
}Expand description
Arbitrum block executor wrapping EthBlockExecutor.
Adds ArbOS-specific pre/post execution logic:
- Loads ArbOS state at block start (version, fee accounts)
- Adjusts gas accounting for L1 poster costs
- Distributes fees to network/infra/poster accounts after each tx
- Tracks block gas consumption for rate limiting
Fields§
§inner: EthBlockExecutor<'a, Evm, Spec, R>Inner Ethereum block executor.
arb_hooks: Option<DefaultArbOsHooks>ArbOS hooks for per-transaction processing.
arb_ctx: ArbBlockExecutionCtxArbitrum-specific block context.
block_gas_left: u64Remaining block gas for rate limiting. Starts at per_block_gas_limit and decreases with each tx’s compute gas.
gas_used_for_l1: Vec<u64>Per-receipt poster gas (L1 gas component), parallel to the receipts vector.
Used to populate gasUsedForL1 in RPC receipt responses.
multi_gas_used: Vec<MultiGas>Per-receipt multi-dimensional gas, parallel to the receipts vector.
Implementations§
Source§impl<'a, Evm, Spec, R: ReceiptBuilder> ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R: ReceiptBuilder> ArbBlockExecutor<'a, Evm, Spec, R>
Sourcepub fn with_hooks(self, hooks: DefaultArbOsHooks) -> Self
pub fn with_hooks(self, hooks: DefaultArbOsHooks) -> Self
Set the ArbOS hooks for this block execution.
Sourcepub fn with_arb_ctx(self, ctx: ArbBlockExecutionCtx) -> Self
pub fn with_arb_ctx(self, ctx: ArbBlockExecutionCtx) -> Self
Set the Arbitrum execution context.
Sourcepub fn zombie_accounts(&self) -> HashSet<Address>
pub fn zombie_accounts(&self) -> HashSet<Address>
Returns the set of zombie account addresses.
Zombie accounts are empty accounts that should be preserved in the state trie (not deleted by EIP-161) because they were re-created by a zero-value transfer on pre-Stylus ArbOS.
Sourcepub fn finalise_deleted(&self) -> &HashSet<Address>
pub fn finalise_deleted(&self) -> &HashSet<Address>
Returns accounts deleted by per-tx Finalise (EIP-161). These may need trie deletion if they existed pre-block.
Sourcepub fn deduct_failed_tx_gas(&mut self, is_user_tx: bool)
pub fn deduct_failed_tx_gas(&mut self, is_user_tx: bool)
Deduct TX_GAS from block gas budget for a failed/invalid transaction. Call this when a user transaction fails execution so the block budget and user-tx counter stay in sync (TX_GAS is charged for invalid txs and userTxsProcessed is incremented).
Sourcepub fn drain_scheduled_txs(&mut self) -> Vec<Vec<u8>>
pub fn drain_scheduled_txs(&mut self) -> Vec<Vec<u8>>
Drain any scheduled transactions (e.g. auto-redeem retry txs) produced by the most recently committed transaction. The caller should decode and re-inject these as new transactions in the same block.
Trait Implementations§
Source§impl<'a, Evm, Spec, R: ReceiptBuilder> ArbScheduledTxDrain for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R: ReceiptBuilder> ArbScheduledTxDrain for ArbBlockExecutor<'a, Evm, Spec, R>
Source§impl<'db, DB, E, Spec, R> BlockExecutor for ArbBlockExecutor<'_, E, Spec, R>where
DB: Database + 'db,
E: Evm<DB = &'db mut State<DB>, Tx: FromRecoveredTx<R::Transaction> + FromTxWithEncoded<R::Transaction> + ArbTransactionEnv>,
Spec: EthExecutorSpec,
R: ReceiptBuilder<Transaction: Transaction + Encodable2718 + ArbTransactionExt, Receipt: TxReceipt<Log = Log> + SetArbReceiptFields>,
R::Transaction: TransactionEnvelope,
impl<'db, DB, E, Spec, R> BlockExecutor for ArbBlockExecutor<'_, E, Spec, R>where
DB: Database + 'db,
E: Evm<DB = &'db mut State<DB>, Tx: FromRecoveredTx<R::Transaction> + FromTxWithEncoded<R::Transaction> + ArbTransactionEnv>,
Spec: EthExecutorSpec,
R: ReceiptBuilder<Transaction: Transaction + Encodable2718 + ArbTransactionExt, Receipt: TxReceipt<Log = Log> + SetArbReceiptFields>,
R::Transaction: TransactionEnvelope,
Source§type Transaction = <R as ReceiptBuilder>::Transaction
type Transaction = <R as ReceiptBuilder>::Transaction
Source§type Result = EthTxResult<<E as Evm>::HaltReason, <<R as ReceiptBuilder>::Transaction as TransactionEnvelope>::TxType>
type Result = EthTxResult<<E as Evm>::HaltReason, <<R as ReceiptBuilder>::Transaction as TransactionEnvelope>::TxType>
Source§fn apply_pre_execution_changes(&mut self) -> Result<(), BlockExecutionError>
fn apply_pre_execution_changes(&mut self) -> Result<(), BlockExecutionError>
Source§fn execute_transaction_without_commit(
&mut self,
tx: impl ExecutableTx<Self>,
) -> Result<Self::Result, BlockExecutionError>
fn execute_transaction_without_commit( &mut self, tx: impl ExecutableTx<Self>, ) -> Result<Self::Result, BlockExecutionError>
Source§fn commit_transaction(
&mut self,
output: Self::Result,
) -> Result<u64, BlockExecutionError>
fn commit_transaction( &mut self, output: Self::Result, ) -> Result<u64, BlockExecutionError>
Source§fn finish(
self,
) -> Result<(Self::Evm, BlockExecutionResult<R::Receipt>), BlockExecutionError>
fn finish( self, ) -> Result<(Self::Evm, BlockExecutionResult<R::Receipt>), BlockExecutionError>
Source§fn set_state_hook(&mut self, hook: Option<Box<dyn OnStateHook>>)
fn set_state_hook(&mut self, hook: Option<Box<dyn OnStateHook>>)
§fn execute_transaction(
&mut self,
tx: impl ExecutableTx<Self>,
) -> Result<u64, BlockExecutionError>
fn execute_transaction( &mut self, tx: impl ExecutableTx<Self>, ) -> Result<u64, BlockExecutionError>
§fn execute_transaction_with_result_closure(
&mut self,
tx: impl ExecutableTx<Self>,
f: impl FnOnce(&ExecutionResult<<Self::Evm as Evm>::HaltReason>),
) -> Result<u64, BlockExecutionError>
fn execute_transaction_with_result_closure( &mut self, tx: impl ExecutableTx<Self>, f: impl FnOnce(&ExecutionResult<<Self::Evm as Evm>::HaltReason>), ) -> Result<u64, BlockExecutionError>
ExecutionResult] produced by the EVM. Read more§fn execute_transaction_with_commit_condition(
&mut self,
tx: impl ExecutableTx<Self>,
f: impl FnOnce(&ExecutionResult<<Self::Evm as Evm>::HaltReason>) -> CommitChanges,
) -> Result<Option<u64>, BlockExecutionError>
fn execute_transaction_with_commit_condition( &mut self, tx: impl ExecutableTx<Self>, f: impl FnOnce(&ExecutionResult<<Self::Evm as Evm>::HaltReason>) -> CommitChanges, ) -> Result<Option<u64>, BlockExecutionError>
ExecutionResult] produced by the EVM, and commits the
transaction to the state on [CommitChanges::Yes]. Read more§fn apply_post_execution_changes(
self,
) -> Result<BlockExecutionResult<Self::Receipt>, BlockExecutionError>where
Self: Sized,
fn apply_post_execution_changes(
self,
) -> Result<BlockExecutionResult<Self::Receipt>, BlockExecutionError>where
Self: Sized,
BlockExecutor::finish] returning only the [BlockExecutionResult].§fn with_state_hook(self, hook: Option<Box<dyn OnStateHook>>) -> Selfwhere
Self: Sized,
fn with_state_hook(self, hook: Option<Box<dyn OnStateHook>>) -> Selfwhere
Self: Sized,
BlockExecutor::set_state_hook].§fn execute_block(
self,
transactions: impl IntoIterator<Item = impl ExecutableTx<Self>>,
) -> Result<BlockExecutionResult<Self::Receipt>, BlockExecutionError>where
Self: Sized,
fn execute_block(
self,
transactions: impl IntoIterator<Item = impl ExecutableTx<Self>>,
) -> Result<BlockExecutionResult<Self::Receipt>, BlockExecutionError>where
Self: Sized,
Auto Trait Implementations§
impl<'a, Evm, Spec, R> !Freeze for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R> !RefUnwindSafe for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R> Send for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R> !Sync for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R> Unpin for ArbBlockExecutor<'a, Evm, Spec, R>
impl<'a, Evm, Spec, R> !UnwindSafe for ArbBlockExecutor<'a, Evm, Spec, R>
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> Conv for T
impl<T> Conv for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
impl<TxEnv, T> FromRecoveredTx<&T> for TxEnvwhere
TxEnv: FromRecoveredTx<T>,
§fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
fn from_recovered_tx(tx: &&T, sender: Address) -> TxEnv
TxEnv] from a transaction and a sender address.§impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
impl<TxEnv, T> FromTxWithEncoded<&T> for TxEnvwhere
TxEnv: FromTxWithEncoded<T>,
§fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
fn from_encoded_tx(tx: &&T, sender: Address, encoded: Bytes) -> TxEnv
TxEnv] from a transaction, its sender, and encoded transaction bytes.§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§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.