Skip to main content

L2 Output RPC method

The Rollup node has its own RPC method, optimism_outputAtBlock which returns a 32 byte hash corresponding to the L2 output root.

Structures

These define the types used by rollup node API methods. The types defined here are extended from the engine API specs.

BlockID

  • hash: DATA, 32 Bytes
  • number: QUANTITY, 64 Bits

L1BlockRef

  • hash: DATA, 32 Bytes
  • number: QUANTITY, 64 Bits
  • parentHash: DATA, 32 Bytes
  • timestamp: QUANTITY, 64 Bits

L2BlockRef

  • hash: DATA, 32 Bytes
  • number: QUANTITY, 64 Bits
  • parentHash: DATA, 32 Bytes
  • timestamp: QUANTITY, 64 Bits
  • l1origin: BlockID
  • sequenceNumber: QUANTITY, 64 Bits - distance to first block of epoch

SyncStatus

Represents a snapshot of the rollup driver.

Output Method API

The input and return types here are as defined by the engine API specs.

optimism_outputAtBlock

Returns an output root and associated metadata for a given L2 block. Parameters
NameTypeDescription
blockNumberQUANTITY, 64 bitsL2 integer block number
Returns
NameTypeDescription
versionDATA, 32 BytesOutput root version number, beginning with 0
outputRootDATA, 32 BytesThe output root
blockRefObjectInstance of L2BlockRef
withdrawalStorageRootDATA, 32 BytesStorage root of the L2ToL1MessagePasser contract
stateRootDATA, 32 BytesThe state root
syncStatusObjectInstance of SyncStatus