Rollup node RPC
Beyond the execution-layer JSON-RPC namespaces, the Base rollup node exposes its own RPC surface. The method documented here, optimism_outputAtBlock, is the one most integrators reach for: it hands back the 32-byte L2 output root for a chosen block, which is the value bridges and proof systems anchor against.
optimism_outputAtBlock
Section titled “optimism_outputAtBlock”Given an L2 block number, this method returns that block’s output root together with the metadata needed to reason about it.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
blockNumber | QUANTITY, 64 bits | L2 integer block number |
Returns
Section titled “Returns”| Name | Type | Description |
|---|---|---|
version | DATA, 32 Bytes | Output root version number, beginning with 0 |
outputRoot | DATA, 32 Bytes | The output root |
blockRef | Object | Instance of L2BlockRef |
withdrawalStorageRoot | DATA, 32 Bytes | Storage root of the L2ToL1MessagePasser contract |
stateRoot | DATA, 32 Bytes | The state root |
syncStatus | Object | Instance of SyncStatus |
The input and output types follow the engine API specification.
Structures
Section titled “Structures”The object types referenced by the rollup node API are listed below. They extend the structures defined in the engine API specs.
BlockID
Section titled “BlockID”hash:DATA, 32 Bytesnumber:QUANTITY, 64 Bits
L1BlockRef
Section titled “L1BlockRef”hash:DATA, 32 Bytesnumber:QUANTITY, 64 BitsparentHash:DATA, 32 Bytestimestamp:QUANTITY, 64 Bits
L2BlockRef
Section titled “L2BlockRef”hash:DATA, 32 Bytesnumber:QUANTITY, 64 BitsparentHash:DATA, 32 Bytestimestamp:QUANTITY, 64 Bitsl1origin:BlockIDsequenceNumber:QUANTITY, 64 Bits - distance to first block of epoch
SyncStatus
Section titled “SyncStatus”A point-in-time snapshot of the rollup driver’s view of both chains.
current_l1:Object- instance ofL1BlockRef.current_l1_finalized:Object- instance ofL1BlockRef.head_l1:Object- instance ofL1BlockRef.safe_l1:Object- instance ofL1BlockRef.finalized_l1:Object- instance ofL1BlockRef.unsafe_l2:Object- instance ofL2BlockRef.safe_l2:Object- instance ofL2BlockRef.finalized_l2:Object- instance ofL2BlockRef.pending_safe_l2:Object- instance ofL2BlockRef.queued_unsafe_l2:Object- instance ofL2BlockRef.