Skip to content

Commit

Permalink
Use u16 for txCount and u32 for message_receipt_count (#578)
Browse files Browse the repository at this point in the history
The `TxPointer.txIndex` is `u16`, so `txCount` can't be more than `u16`.

<img width="444" alt="image"
src="https://github.com/FuelLabs/fuel-specs/assets/18346821/abfaedd5-f475-4b64-a43e-d3c4e886b53a">

The maximum number of receipts is limited to `255` per transaction.
Allowing only `u16` transactions per block means we can have a maximum
of `255 * u16::MAX` that is less than `u32`.

### Before requesting review
- [x] I have reviewed the code myself

### After merging, notify other teams

- [x] [Bridge]
  • Loading branch information
xgreenx authored Apr 29, 2024
1 parent b7c1a7e commit 9788fff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/protocol/block-header.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ The application header is a network-agnostic block header. Different [networks](
| `da_height` | `uint64` | Height of the data availability layer up to which (inclusive) input messages are processed. |
| `consensusParametersVersion` | `uint32` | The version of the consensus parameters used to execute this block. |
| `stateTransitionBytecodeVersion` | `uint32` | The version of the state transition bytecode used to execute this block. |
| `txCount` | `uint64` | Number of [transaction](../tx-format/transaction.md)s in this block. |
| `message_receipt_count` | `uint64` | Number of [output message](../abi/receipts.md#messageout-receipt)s in this block. |
| `txCount` | `uint16` | Number of [transaction](../tx-format/transaction.md)s in this block. |
| `message_receipt_count` | `uint32` | Number of [output message](../abi/receipts.md#messageout-receipt)s in this block. |
| `txRoot` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of [transaction](../tx-format/transaction.md)s in this block. |
| `message_outbox_root` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of [output message](../abi/receipts.md#messageout-receipt)s [`messageId`](../identifiers/utxo-id.md#message-id) in this block. |
| `event_inbox_root` | `byte[32]` | [Merkle root](./cryptographic-primitives.md#binary-merkle-tree) of all [events](./relayer.md) imported from L1 in this block. The order of the events added to the Merkle tree is the L1 block order, and the index of each event within each block |

0 comments on commit 9788fff

Please sign in to comment.