pub trait ArbOsHooks {
type Error: Debug;
// Required methods
fn start_tx(&mut self, ctx: &StartTxContext) -> Result<(), Self::Error>;
fn gas_charging(
&mut self,
ctx: &GasChargingContext,
) -> Result<GasChargingResult, Self::Error>;
fn end_tx(&mut self, ctx: &EndTxContext) -> Result<(), Self::Error>;
fn nonrefundable_gas(&self) -> u64;
fn held_gas(&self) -> u64;
fn scheduled_txs(&mut self) -> Vec<Vec<u8>>;
fn drop_tip(&self) -> bool;
fn gas_price_op(&self, gas_price: U256, base_fee: U256) -> U256;
fn msg_is_non_mutating(&self) -> bool;
fn is_calldata_pricing_increase_enabled(&self) -> bool;
}Expand description
Hooks for ArbOS-specific transaction processing.
These hooks integrate ArbOS state management into reth’s block execution.
These correspond to the canonical TxProcessor’s StartTxHook,
GasChargingHook, and EndTxHook.
Required Associated Types§
Required Methods§
Sourcefn start_tx(&mut self, ctx: &StartTxContext) -> Result<(), Self::Error>
fn start_tx(&mut self, ctx: &StartTxContext) -> Result<(), Self::Error>
Called before each transaction. Sets up gas accounting, processes deposits, and initializes retryable state.
Sourcefn gas_charging(
&mut self,
ctx: &GasChargingContext,
) -> Result<GasChargingResult, Self::Error>
fn gas_charging( &mut self, ctx: &GasChargingContext, ) -> Result<GasChargingResult, Self::Error>
Called after intrinsic gas calculation. Charges poster costs and manages L1 pricing.
Sourcefn end_tx(&mut self, ctx: &EndTxContext) -> Result<(), Self::Error>
fn end_tx(&mut self, ctx: &EndTxContext) -> Result<(), Self::Error>
Called after transaction execution. Handles gas refunds, poster fee distribution, and state cleanup.
Sourcefn nonrefundable_gas(&self) -> u64
fn nonrefundable_gas(&self) -> u64
Returns the amount of gas that cannot be refunded.
Sourcefn scheduled_txs(&mut self) -> Vec<Vec<u8>>
fn scheduled_txs(&mut self) -> Vec<Vec<u8>>
Returns scheduled internal transactions generated during execution.
Sourcefn drop_tip(&self) -> bool
fn drop_tip(&self) -> bool
Whether the priority fee tip should be dropped (not sent to coinbase).
Sourcefn gas_price_op(&self, gas_price: U256, base_fee: U256) -> U256
fn gas_price_op(&self, gas_price: U256, base_fee: U256) -> U256
The effective gas price for the GASPRICE opcode.
Sourcefn msg_is_non_mutating(&self) -> bool
fn msg_is_non_mutating(&self) -> bool
Whether the message is non-mutating (eth_call).
Sourcefn is_calldata_pricing_increase_enabled(&self) -> bool
fn is_calldata_pricing_increase_enabled(&self) -> bool
Whether EIP-7623 calldata pricing increase is enabled.