Expand description
Storage-backed types for ArbOS state.
Provides typed wrappers over raw storage slots — integers, addresses,
byte arrays, queues, and vectors that persist in the state trie — and
re-exports the StorageError surface from arb_storage_errors.
All read and write paths propagate database failures as typed
StorageError::Database so callers can distinguish a genuine
storage-level fault from a logical condition such as “slot is zero”.
Re-exports§
pub use queue::Queue;pub use queue::initialize_queue;pub use queue::open_queue;pub use vector::SubStorageVector;pub use vector::open_sub_storage_vector;
Modules§
Structs§
- AnyError
- Cloneable wrapper around any
Errortype. - Database
Error Info - Implementation-agnostic information about a database failure.
- Storage
- Hierarchical storage abstraction over EVM account state.
- Storage
Backed Address - Storage-backed Ethereum address (20 bytes, right-aligned in 32-byte slot).
- Storage
Backed Address OrNil - Storage-backed optional address, using
1 << 255to representNone. - Storage
Backed BigInt - Storage-backed signed 256-bit integer using two’s complement.
- Storage
Backed BigUint - Storage-backed 256-bit unsigned integer.
- Storage
Backed Bips - Basis points stored as signed
i64. 10000 bips = 100%. - Storage
Backed Bytes - Variable-length byte storage.
- Storage
Backed Int64 - Storage-backed signed 64-bit integer, bit-reinterpreting
i64asu64. - Storage
BackedU Bips - Unsigned basis points stored as
u64. 10000 ubips = 100%. - Storage
Backed Uint16 - Storage-backed 16-bit unsigned integer.
- Storage
Backed Uint24 - Storage-backed 24-bit unsigned integer.
- Storage
Backed Uint32 - Storage-backed 32-bit unsigned integer.
- Storage
Backed Uint64 - Storage-backed 64-bit unsigned integer.
Enums§
- Database
Error - Errors surfaced by the underlying state database when arb-storage reads or writes a slot.
- Detached
- Phantom backend used by read paths that drive ArbOS accessors through a
[
StorageBackend] (such as the precompile handlers reading viaEvmInternals). Direct state-pointer I/O on aStorage<Detached>is unreachable by construction — the type does not implement [Database]. - Storage
Error - Errors raised by the arb-storage layer.
Constants§
- ARBOS_
STATE_ ADDRESS - ArbOS state address — the fictional account that stores all ArbOS state.
- FILTERED_
TX_ STATE_ ADDRESS - Filtered transactions state address — a separate account for tracking filtered tx hashes.
- STORAGE_
READ_ GAS - Gas for reading one storage slot.
- STORAGE_
WRITE_ GAS - Gas for writing a non-zero value to one storage slot.
- STORAGE_
WRITE_ ZERO_ GAS - Gas for clearing one storage slot to zero.
Traits§
- Storage
Backend - Abstraction over the two backing stores
arb-storageaccessor types are driven from: the block executor’s&mut State<D>and the precompile handler’s&mut EvmInternals<'_>. - System
State Backend - Non-journaled read access to system state.
Functions§
- get_
account_ balance - Reads the balance of an account from the state.
- read_
storage_ at - Reads a storage slot from an arbitrary account, checking cache -> bundle -> database.
- set_
account_ code - Sets the code of an account, loading it into cache if needed.
- set_
account_ nonce - Sets the nonce of an account, loading it into cache if needed.
- storage_
key_ map - Computes a storage slot using the keccak256-based mapAddress algorithm.
- write_
arbos_ storage - Writes a storage slot to the ArbOS account using the transition mechanism.
- write_
cost - Gas for one storage write, priced lower when the slot is cleared to zero.
- write_
storage_ at - Writes a storage slot to an arbitrary account using the transition mechanism.