> Aztec.nr API reference, v6.0.0 (mainnet and testnet). Index: https://docs.aztec.network/aztec-nr-api/v6.0.0/llms.txt

# Function create_block_end_state_field

Module: `noir_aztec::protocol::blob_data`

```rust
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.
