From b13a9206cd6db434bbcff5499ccc0dfe23b377a6 Mon Sep 17 00:00:00 2001 From: Hannes Karppila Date: Wed, 6 Mar 2024 17:36:02 +0100 Subject: [PATCH] Change vec lengths to uint64 to match vm behavior (#555) Closes #552 Hopefully I caught everything. --- src/fuel-vm/index.md | 2 +- src/fuel-vm/instruction-set.md | 2 +- src/tx-format/consensus_parameters.md | 4 ++-- src/tx-format/input.md | 10 +++++----- src/tx-format/transaction.md | 8 ++++---- src/tx-format/witness.md | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fuel-vm/index.md b/src/fuel-vm/index.md index 29151e4a..85dd70c2 100644 --- a/src/fuel-vm/index.md +++ b/src/fuel-vm/index.md @@ -24,7 +24,7 @@ This document provides the specification for the Fuel Virtual Machine (FuelVM). | `CONTRACT_MAX_SIZE` | `uint64` | | Maximum contract size, in bytes. | | `MEM_MAX_ACCESS_SIZE` | `uint64` | | Maximum memory access size, in bytes. | | `VM_MAX_RAM` | `uint64` | `2**26` | 64 MiB. | -| `MESSAGE_MAX_DATA_SIZE` | `uint16` | | Maximum size of message data, in bytes. | +| `MESSAGE_MAX_DATA_SIZE` | `uint64` | | Maximum size of message data, in bytes. | ## Semantics diff --git a/src/fuel-vm/instruction-set.md b/src/fuel-vm/instruction-set.md index f7c1fbdd..c584d99e 100644 --- a/src/fuel-vm/instruction-set.md +++ b/src/fuel-vm/instruction-set.md @@ -2041,7 +2041,7 @@ Append a receipt to the list of receipts: | `recipient` | `byte[32]` | The address of the message recipient: `MEM[$rA, 32]`. | | `amount` | `uint64` | Amount of base asset coins sent with message: `$rD`. | | `nonce` | `byte[32]` | The message nonce as described [here](../identifiers/utxo-id.md#message-nonce). | -| `len` | `uint16` | Length of message data, in bytes: `$rC`. | +| `len` | `uint64` | Length of message data, in bytes: `$rC`. | | `digest` | `byte[32]` | [Hash](#s256-sha-2-256) of `MEM[$rB, $rC]`. | In an external context, decrease `MEM[balanceOfStart(0), 8]` by `$rD`. In an internal context, decrease asset ID 0 balance of output with contract ID `MEM[$fp, 32]` by `$rD`. This modifies the `balanceRoot` field of the appropriate contract that had its' funds deducted. diff --git a/src/tx-format/consensus_parameters.md b/src/tx-format/consensus_parameters.md index 362d692e..eeced31f 100644 --- a/src/tx-format/consensus_parameters.md +++ b/src/tx-format/consensus_parameters.md @@ -12,8 +12,8 @@ | `MAX_PREDICATE_DATA_LENGTH` | `uint64` | Maximum length of predicate data, in bytes. | | `MAX_SCRIPT_LENGTH` | `uint64` | Maximum length of script, in instructions. | | `MAX_SCRIPT_DATA_LENGTH` | `uint64` | Maximum length of script data, in bytes. | -| `MAX_MESSAGE_DATA_LENGTH` | `uint16` | Maximum length of message data, in bytes. | -| `MAX_STORAGE_SLOTS` | `uint16` | Maximum number of initial storage slots. | +| `MAX_MESSAGE_DATA_LENGTH` | `uint64` | Maximum length of message data, in bytes. | +| `MAX_STORAGE_SLOTS` | `uint64` | Maximum number of initial storage slots. | | `MAX_TRANSACTION_SIZE` | `uint64` | Maximum size of a transaction, in bytes. | | `MAX_WITNESSES` | `uint64` | Maximum number of witnesses. | | `CHAIN_ID` | `uint64` | A unique per-chain identifier. | diff --git a/src/tx-format/input.md b/src/tx-format/input.md index 0fd8d9c6..fbd34ff0 100644 --- a/src/tx-format/input.md +++ b/src/tx-format/input.md @@ -29,8 +29,8 @@ Transaction is invalid if: | `txPointer` | [`TXPointer`](./tx-pointer.md) | Points to the TX whose output is being spent. | | `witnessIndex` | `uint8` | Index of witness that authorizes spending the coin. | | `predicateGasUsed` | `uint64` | Gas used by predicate. | -| `predicateLength` | `uint16` | Length of predicate, in instructions. | -| `predicateDataLength` | `uint16` | Length of predicate input data, in bytes. | +| `predicateLength` | `uint64` | Length of predicate, in instructions. | +| `predicateDataLength` | `uint64` | Length of predicate input data, in bytes. | | `predicate` | `byte[]` | Predicate bytecode. | | `predicateData` | `byte[]` | Predicate input data (parameters). | @@ -81,9 +81,9 @@ Transaction is invalid if: | `nonce` | `byte[32]` | The message nonce. | | `witnessIndex` | `uint8` | Index of witness that authorizes spending the coin. | | `predicateGasUsed` | `uint64` | Gas used by predicate execution. | -| `dataLength` | `uint16` | Length of message data, in bytes. | -| `predicateLength` | `uint16` | Length of predicate, in instructions. | -| `predicateDataLength` | `uint16` | Length of predicate input data, in bytes. | +| `dataLength` | `uint64` | Length of message data, in bytes. | +| `predicateLength` | `uint64` | Length of predicate, in instructions. | +| `predicateDataLength` | `uint64` | Length of predicate input data, in bytes. | | `data` | `byte[]` | The message data. | | `predicate` | `byte[]` | Predicate bytecode. | | `predicateData` | `byte[]` | Predicate input data (parameters). | diff --git a/src/tx-format/transaction.md b/src/tx-format/transaction.md index 0110dbce..30c54c67 100644 --- a/src/tx-format/transaction.md +++ b/src/tx-format/transaction.md @@ -58,8 +58,8 @@ enum ReceiptType : uint8 { | name | type | description | |--------------------|-----------------------------|-----------------------------------------| | `scriptGasLimit` | `uint64` | Gas limits the script execution. | -| `scriptLength` | `uint16` | Script length, in instructions. | -| `scriptDataLength` | `uint16` | Length of script input data, in bytes. | +| `scriptLength` | `uint64` | Script length, in instructions. | +| `scriptDataLength` | `uint64` | Length of script input data, in bytes. | | `policyTypes` | `uint32` | Bitfield of used policy types. | | `inputsCount` | `uint8` | Number of inputs. | | `outputsCount` | `uint8` | Number of outputs. | @@ -102,10 +102,10 @@ The receipts root `receiptsRoot` is the root of the [binary Merkle tree](../prot | name | type | description | |------------------------|-----------------------------|---------------------------------------------------| -| `bytecodeLength` | `uint16` | Contract bytecode length, in instructions. | +| `bytecodeLength` | `uint64` | Contract bytecode length, in instructions. | | `bytecodeWitnessIndex` | `uint8` | Witness index of contract bytecode to create. | | `policyTypes` | `uint32` | Bitfield of used policy types. | -| `storageSlotsCount` | `uint16` | Number of storage slots to initialize. | +| `storageSlotsCount` | `uint64` | Number of storage slots to initialize. | | `inputsCount` | `uint8` | Number of inputs. | | `outputsCount` | `uint8` | Number of outputs. | | `witnessesCount` | `uint8` | Number of witnesses. | diff --git a/src/tx-format/witness.md b/src/tx-format/witness.md index c37b5d3c..81606a1e 100644 --- a/src/tx-format/witness.md +++ b/src/tx-format/witness.md @@ -2,5 +2,5 @@ | name | type | description | |--------------|----------|-----------------------------------| -| `dataLength` | `uint16` | Length of witness data, in bytes. | +| `dataLength` | `uint64` | Length of witness data, in bytes. | | `data` | `byte[]` | Witness data. |