initialize_arbos_state

Function initialize_arbos_state 

Source
pub fn initialize_arbos_state<D: Database>(
    state: &mut State<D>,
    init_msg: &ParsedInitMessage,
    chain_id: u64,
    target_arbos_version: u64,
    chain_owner: Address,
) -> Result<(), String>
Expand description

Initialize ArbOS state in a freshly created database.

This sets up:

  • ArbOS version (set to 1, then upgrade to target version)
  • All precompile accounts with [0xFE] invalid code marker
  • L1 pricing state (initial base fee, batch poster table)
  • L2 pricing state (base fee, gas pool, speed limit)
  • Retryable state, address table, merkle accumulator, blockhashes
  • Chain owner and chain config

The init_msg comes from parsing the L1 Initialize message (Kind=11).