Subcomponent: Celestia Reader
The Celestia Reader component fetches blobs containing sequencer block headers and rollup transactions from Celestia via JSON-RPC, validates them, and forwards them as firm blocks to the Executor.
The Celestia Reader's FetchConvertVerifyAndReconstruct
task does the following:
Fetches the block-header blobs and rollup blobs from Celestia, with exponential backoff on retries
Attempts to decode the blobs to their expected types, dropping blobs that fail to decompress or decode
Verifies, while decoding
SubmittedMetadata
, a Merkle proof that the rollup transaction root is included in the blockDiscards headers for blocks that are older than the current firm height
Checks that each block header's chain ID and block hash agree with the sequencer's block for that height (fetched and cached from sequencer) and that the block was signed by a two-thirds majority of the sequencer's validators
Reconstructs blocks from the headers and rollups blobs, dropping rollup blobs that do not have a valid inclusion proof for their associated header, which ensures that all and only the transactions associated with this sequencer block are included in the reconstructed block
Yields the reconstructed blocks to the Celestia Reader's main loop, which inserts them into its block cache
The Celestia Reader's main loop acts as a scheduler:
It schedules
FetchConvertVerifyAndReconstruct
tasks when Celestia's height is ahead of what has been processed and there are not too many reconstruction tasks pending.It handles shutdown requests from elsewhere in the conductor.
It tracks which Celestia height the executor has last accepted.
If it has reconstructed the block for the current firm height, it submits it as a firm block to the executor.
It inserts reconstructed blocks into its block cache.
It polls Celestia for its latest height.