Expand description
EIP-2930 access list builder with L2 profitability accounting.
The caller supplies the addresses and storage slots to include; this module decides whether attaching the list is profitable, not which slots are interesting (it carries no protocol-specific slot knowledge). The trade-off is purely economic: pre-declaring an account/slot warms it (cheaper EIP-2929 execution) but costs L1 data to post the list. Slots whose serialized form is mostly zero bytes (e.g. small, low-entropy values) are cheap to post; dense, high-entropy 32-byte keys are expensive on L1 — so the value of a given entry depends on its bytes, which is why the include/exclude decision is left to the caller and the profitability check below.
On L2, automatically disables itself when L1 fees rise high enough that the
L1 data cost exceeds the L2 execution savings. Arbitrum uses ArbGasInfo
pricing with exact EIP-2930 RLP data gas; OP Stack chains use
GasPriceOracle.getL1Fee(bytes) to compare whole transactions with and
without the access list.
On L1 (Ethereum): Access lists always save gas (no L1 data posting overhead),
so use into_access_list_always() to skip the profitability check.
Modules§
- ArbGas
Info - Module containing a contract’s types and functions.
- OpGas
Price Oracle - Module containing a contract’s types and functions.
Structs§
- Smart
Access List - An EIP-2930 access list builder with L2 profitability accounting.
Enums§
- Access
List Pricing - Pricing inputs used when deciding whether to include a simulation access list.
- Chain
Type - Chain fee model used by helpers that only need to identify the chain’s L1 base-fee oracle.
Constants§
- OP_
GAS_ PRICE_ ORACLE - Optimism GasPriceOracle predeploy (Bedrock+).
Functions§
- access_
list_ if_ profitable - Evaluate whether an existing access list is profitable on Arbitrum.
- access_
list_ rlp_ data_ gas - Exact L1 calldata gas for the EIP-2930 RLP encoding of an access list.
- apply_
access_ list - Filter already-warm and excluded addresses from an access list, then apply it to the transaction request.
- compute_
op_ l1_ fee - Compute the OP stack L1 data fee for a given transaction calldata.
- l1_
data_ gas_ for_ bytes - L1 calldata gas for a byte slice: zero bytes = 4 gas, non-zero = 16 gas.
- query_
l1_ base_ fee_ for_ chain - Query the current L1 base fee estimate, dispatching to the correct predeploy
based on chain type. Returns
U256::ZEROfor L1 chains or on failure. - resolve_
access_ list - Select the appropriate access list strategy based on pricing inputs.