Database Schema Overview

All persistent data is stored across multiple RocksDB databases:

  • block_replay_wal
  • preimages
  • repository
  • state
  • tree
  • proofs (JSON files, not RocksDB)

1. block_replay_wal

Write-ahead log containing recent (non-compacted) block data.

ColumnKeyValue
block_output_hashblock numberBlock output hash
contextblock numberBinary-encoded BlockContext (BlockMetadataFromOracle)
last_processed_l1_tx_idblock numberID (u64) of the last processed L1 tx in the block
txsblock numberVector of EIP-2718 encoded transactions
node_versionblock numberNode version that produced the block
latest‘latest_block’Latest block number

2. preimages

ColumnKeyValue
meta‘block’Latest block ID
storagehashPreimage for the hash

3. repository

Canonical blocks and transactions.

ColumnKeyValue
initiator_and_nonce_to_hashaddress (20 bytes) + nonce (u64)Transaction hash
tx_metatransaction hashBinary TxMeta (hash, number, gas used, etc.)
block_datablock hashAlloy-serialized block
tx_receipttransaction hashBinary EIP-2718 receipt
meta‘block_number’Latest block number
txtransaction hashEIP-2718 encoded bytes
block_number_to_hashblock numberBlock hash

4. state

Data compacted from the write-ahead log.

ColumnKeyValue
meta‘base_block’Base block number for this state snapshot
storagekeyValue (compacted storage)

5. tree

Merkle-like structure.

ColumnKeyValue
defaultcomposite (version + nibble + index)Serialized Leaf or Internal node
key_indiceshashKey index

Note: The ‘default’ column also stores a serialized Manifest at key ‘0’.


6. proofs

Stored as JSON files in a separate directory: ../shared/fri_batch_envelopes