aztec-nr - noir_aztec::protocol::blob_data

Function create_block_end_state_field

pub fn create_block_end_state_field(
    state: StateReference,
    total_mana_used: Field,
) -> Field

Create the field that contains information about the end state of a block. It's a concatenation of: l1_to_l2_message_next_available_leaf_index | note_hash_next_available_leaf_index | nullifier_next_available_leaf_index | public_data_next_available_leaf_index | total_mana_used

total_mana_used occupies 48 bits: l2_gas of tx is of type u32, and there can be up to 2^16 txs per block. Each _next_available_leaf_index occupies the number of bits required to represent the tree height.