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.
Before arranging available data into shares, the size of the original data's square must be determined.
There are two restrictions on the original data's square size:
- It must be at most
AVAILABLE_DATA_ORIGINAL_SQUARE_MAX
. - It must be a power of 2.
With these restrictions in mind, the block proposer performs the following actions:
- Collect as many transactions and messages from the mempool as possible, such that the total number of shares is at most
AVAILABLE_DATA_ORIGINAL_SQUARE_MAX
. - Compute the smallest square size that is a power of 2 that can fit the number of shares.
- Attempt to lay out the collected transactions and messages in the current square.
- If the square is too small to fit all transactions and messages (which may happen due to needing to insert padding between messages) and the square size is smaller than
AVAILABLE_DATA_ORIGINAL_SQUARE_MAX
, double the size of the square and repeat the above step.
- If the square is too small to fit all transactions and messages (which may happen due to needing to insert padding between messages) and the square size is smaller than
Note: the maximum padding shares between messages should be at most twice the number of message shares. Doubling the square size (i.e. quadrupling the number of shares in the square) should thus only have to happen at most once.