Skip to content

Commit

Permalink
Change vec lengths to uint64 to match vm behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Dentosal committed Mar 6, 2024
1 parent 2742f30 commit 7c6c9bb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/fuel-vm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/fuel-vm/instruction-set.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/tx-format/consensus_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
10 changes: 5 additions & 5 deletions src/tx-format/input.md
Original file line number Diff line number Diff line change
Expand Up @@ -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). |

Expand Down Expand Up @@ -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). |
Expand Down
8 changes: 4 additions & 4 deletions src/tx-format/transaction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down Expand Up @@ -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. |
Expand Down
2 changes: 1 addition & 1 deletion src/tx-format/witness.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |

0 comments on commit 7c6c9bb

Please sign in to comment.