ArbOsHooks

Trait ArbOsHooks 

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

Source

fn start_tx(&mut self, ctx: &StartTxContext) -> Result<(), Self::Error>

Called before each transaction. Sets up gas accounting, processes deposits, and initializes retryable state.

Source

fn gas_charging( &mut self, ctx: &GasChargingContext, ) -> Result<GasChargingResult, Self::Error>

Called after intrinsic gas calculation. Charges poster costs and manages L1 pricing.

Source

fn end_tx(&mut self, ctx: &EndTxContext) -> Result<(), Self::Error>

Called after transaction execution. Handles gas refunds, poster fee distribution, and state cleanup.

Source

fn nonrefundable_gas(&self) -> u64

Returns the amount of gas that cannot be refunded.

Source

fn held_gas(&self) -> u64

Returns the amount of gas held for compute.

Source

fn scheduled_txs(&mut self) -> Vec<Vec<u8>>

Returns scheduled internal transactions generated during execution.

Source

fn drop_tip(&self) -> bool

Whether the priority fee tip should be dropped (not sent to coinbase).

Source

fn gas_price_op(&self, gas_price: U256, base_fee: U256) -> U256

The effective gas price for the GASPRICE opcode.

Source

fn msg_is_non_mutating(&self) -> bool

Whether the message is non-mutating (eth_call).

Source

fn is_calldata_pricing_increase_enabled(&self) -> bool

Whether EIP-7623 calldata pricing increase is enabled.

Implementors§