Honest Block Proposer

This document describes the tasks of an honest block proposer to assemble a new block. Performing these actions is not enforced by the consensus rules, so long as a valid block is produced.

Constructing a Block

Before arranging available data into shares, the block proposer must select which transactions to include and determine the size of the original data square.

There are two restrictions on the original data's square size:

  1. It must be at most AVAILABLE_DATA_ORIGINAL_SQUARE_MAX.
  2. It must be a power of 2.

With these restrictions in mind, the block proposer performs the following actions:

  1. Initialize a square builder with the maximum effective square size (the lesser of the GovMaxSquareSize governance parameter and the AVAILABLE_DATA_ORIGINAL_SQUARE_MAX upper bound).
  2. Separate the available transactions from the mempool into normal transactions and blob transactions. Filter out any transactions that exceed the maximum transaction size.
  3. Iterate through normal transactions and attempt to add each one to the square:
    1. If adding the transaction would cause the total share count to exceed the maximum square capacity, skip it.
    2. Validate the transaction (e.g. signature verification, fee checks). If validation fails, revert the addition and skip it.
  4. Iterate through blob transactions and attempt to add each one to the square:
    1. If adding the blob transaction (including its blobs and padding required by share commitment rules) would cause the total share count to exceed the maximum square capacity, skip it.
    2. Validate the transaction. If validation fails, revert the addition and skip it.
  5. Compute the smallest square size that is a power of 2 that can fit all the accepted transactions and blobs (including any padding between blobs).
  6. Sort blobs by namespace (preserving the mempool-provided order of blobs within the same namespace, which is based on sender-aggregated priority).
  7. Write out the final square: normal transaction shares, then pay-for-blob transaction shares, then reserved padding, then blob shares (with inter-blob padding as needed), then tail padding.