Submitting a block to Ethereum

Rollup blocks are submitted to the host chain by calling the Zenith submitBlockarrow-up-right function, attaching transaction data in a 4844 blob.

Code Flows

These examples assume one has already chosen a set of transactions and bundles, and gotten a co-signature from the Sequencer API.

circle-info

The builder examplearrow-up-right has a submission process without host fills that can be referenced for blob construction.

For blocks with host fill components, builders should use a multi-call contract to do the following:

  • Call submitBlock as described below

  • Pass each permit2 blob to the Passage contract's fillPermit2 method

Creating the blob transaction

let header = Zenith::BlockHeader {
    hostBlockNumber: resp.req.host_block_number,
    rollupChainId: U256::from(self.config.ru_chain_id),
    gasLimit: resp.req.gas_limit,
    rewardAddress: resp.req.ru_reward_address,
    blockDataHash: in_progress.contents_hash(),
};
  1. Encodearrow-up-right the submitBlockarrow-up-right transaction data from the BlockHeader & the Sequencer's Signature from the SignResponse

circle-info

NOTE: the final unnamed bytes parameter should be an empty bytes string

  1. Encodearrow-up-right the transactions into a 4844 blob sidecar containing the rlp-encoded transactions.

circle-info

Signet blobs use the alloy SimpleCoderarrow-up-right blob encoding scheme. This may change in the future.

  1. Fill in remaining transaction details (including the calldata, which must contain the encoded submitBlockCall above).

circle-info

If using a multi-call contract, the input to the multi-call must send the encoded submitBlockCall to the Zenith contract.

  1. Submit the constructed transaction to Ethereum.

circle-exclamation

Last updated