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 Bytesnumber:QUANTITY, 64 Bits
L1BlockRef
hash:DATA, 32 Bytesnumber:QUANTITY, 64 BitsparentHash:DATA, 32 Bytestimestamp:QUANTITY, 64 Bits
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
Represents a snapshot of the rollup driver.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.
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
| Name | Type | Description |
|---|---|---|
blockNumber | QUANTITY, 64 bits | L2 integer block number |
| 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 |