#721: Added additional logic to the BMT proof verification algorithm to check the length of the provided proof set against the index provided in the proof.
Breaking
#719: Fix overflow in LDC instruction when contract size with padding would overflow.
#715: The Interpreter supports the processing of the Upload transaction. The change affects InterpreterStorage, adding StorageMutate<UploadedBytes> constrain.
#714: The change adds a new Upload transaction that allows uploading huge byte code on chain subsection by subsection. This transaction is chargeable and is twice as expensive as the Create transaction. Anyone can submit this transaction.
#712: The Interpreter supports the processing of the Upgrade transaction. The change affects InterpreterStorage, adding 5 new methods that must be implemented.
#707: The change adds a new Upgrade transaction that allows upgrading either consensus parameters or state transition function used by the network to produce future blocks.
The purpose of the upgrade is defined by the Upgrade Purpose type:
pub enum UpgradePurpose {
/// The upgrade is performed to change the consensus parameters.
ConsensusParameters {
/// The index of the witness in the [`Witnesses`] field that contains
/// the serialized consensus parameters.
witness_index: u16,
/// The hash of the serialized consensus parameters.
/// Since the serialized consensus parameters live inside witnesses(malleable
/// data), any party can override them. The `checksum` is used to verify that the
/// data was not modified.
checksum: Bytes32,
},
/// The upgrade is performed to change the state transition function.
StateTransition {
/// The Merkle root of the new bytecode of the state transition function.
/// The bytecode must be present on the blockchain(should be known by the
/// network) at the moment of inclusion of this transaction.
root: Bytes32,
},
}
The Upgrade transaction is chargeable, and the sender should pay for it. Transaction inputs should contain only base assets.
Only the privileged address can upgrade the network. The privileged address can be either a real account or a predicate.
Since serialized consensus parameters are small(< 2kb), they can be part of the upgrade transaction and live inside of witness data. The bytecode of the blockchain state transition function is huge ~1.6MB(relative to consensus parameters), and it is impossible to fit it into one transaction. So when we perform the upgrade of the state transition function, it should already be available on the blockchain. The transaction to actually upload the bytecode(Upload transaction) will implemented in the https://github.com/FuelLabs/fuel-core/issues/1754.
Changed
#707: Used the same pattern everywhere in the codebase:
The combination of serde and postcard is used to serialize and deserialize ConsensusParameters during the upgrade. This means the protocol and state transition function requires the serde feature by default for ConsensusParameters and fuel-types.
#697: Changed the VM to internally use separate buffers for the stack and the heap to improve startup time. After this change, memory that was never part of the stack or the heap cannot be accessed, even for reading. Also, even if the whole memory is allocated, accesses spanning from the stack to the heap are not allowed. This PR also fixes a bug that required one-byte gap between the stack and the heap. Multiple errors have been changed to be more sensible ones, and sometimes the order of which error is returned has changed. ALOC opcode now zeroes the newly allocated memory.
Version v0.49.0
Added
Breaking
LDC
instruction when contract size with padding would overflow.Interpreter
supports the processing of theUpload
transaction. The change affectsInterpreterStorage
, addingStorageMutate<UploadedBytes>
constrain.Upload
transaction that allows uploading huge byte code on chain subsection by subsection. This transaction is chargeable and is twice as expensive as theCreate
transaction. Anyone can submit this transaction.Interpreter
supports the processing of theUpgrade
transaction. The change affectsInterpreterStorage
, adding 5 new methods that must be implemented.#707: The change adds a new
Upgrade
transaction that allows upgrading either consensus parameters or state transition function used by the network to produce future blocks. The purpose of the upgrade is defined by theUpgrade Purpose
type:The
Upgrade
transaction is chargeable, and the sender should pay for it. Transaction inputs should contain only base assets.Only the privileged address can upgrade the network. The privileged address can be either a real account or a predicate.
Since serialized consensus parameters are small(< 2kb), they can be part of the upgrade transaction and live inside of witness data. The bytecode of the blockchain state transition function is huge ~1.6MB(relative to consensus parameters), and it is impossible to fit it into one transaction. So when we perform the upgrade of the state transition function, it should already be available on the blockchain. The transaction to actually upload the bytecode(
Upload
transaction) will implemented in the https://github.com/FuelLabs/fuel-core/issues/1754.Changed
#707: Used the same pattern everywhere in the codebase:
Instead of:
Breaking
#714: Added
max_bytecode_subsections
field to theTxParameters
to limit the number of subsections that can be uploaded.#707: Side small breaking for tests changes from the
Upgrade
transaction:fuel-tx-test-helpers
logic into thefuel_tx::test_helpers
module.Create
transaction: all inputs should use base asset otherwise it returnsTransactionInputContainsNonBaseAssetId
error.Upgrade
uses some errors fromCreate
and some fromScript
transactions):TransactionScriptOutputContractCreated
->TransactionOutputContainsContractCreated
.TransactionCreateOutputContract
->TransactionOutputContainsContract
.TransactionCreateOutputVariable
->TransactionOutputContainsVariable
.TransactionCreateOutputChangeNotBaseAsset
->TransactionChangeChangeUsesNotBaseAsset
.TransactionCreateInputContract
->TransactionInputContainsContract
.TransactionCreateMessageData
->TransactionInputContainsMessageData
.serde
andpostcard
is used to serialize and deserializeConsensusParameters
during the upgrade. This means the protocol and state transition function requires theserde
feature by default forConsensusParameters
andfuel-types
.#697: Changed the VM to internally use separate buffers for the stack and the heap to improve startup time. After this change, memory that was never part of the stack or the heap cannot be accessed, even for reading. Also, even if the whole memory is allocated, accesses spanning from the stack to the heap are not allowed. This PR also fixes a bug that required one-byte gap between the stack and the heap. Multiple errors have been changed to be more sensible ones, and sometimes the order of which error is returned has changed.
ALOC
opcode now zeroes the newly allocated memory.What's Changed
Upgrade
transaction to perform network upgrades by @xgreenx in https://github.com/FuelLabs/fuel-vm/pull/707Upgrade
transaction inside of theInterpreter
by @xgreenx in https://github.com/FuelLabs/fuel-vm/pull/712Upload
transaction to upload the huge bytecode on the chain by @xgreenx in https://github.com/FuelLabs/fuel-vm/pull/720Upload
transaction inside theInterpreter
by @xgreenx in https://github.com/FuelLabs/fuel-vm/pull/715Full Changelog: https://github.com/FuelLabs/fuel-vm/compare/v0.48.0...v0.49.0