v0.49.0
Version v0.49.0
Added
- #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 theUpload
transaction. The change affectsInterpreterStorage
, addingStorageMutate<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 theCreate
transaction. Anyone can submit this transaction. -
#712: The
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: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 FuelLabs/fuel-core#1754.
Changed
-
#707: Used the same pattern everywhere in the codebase:
Self::Script(tx) => tx.encode_static(buffer), Self::Create(tx) => tx.encode_static(buffer), Self::Mint(tx) => tx.encode_static(buffer), Self::Upgrade(tx) => tx.encode_static(buffer),
Instead of:
Transaction::Script(script) => script.encode_static(buffer), Transaction::Create(create) => create.encode_static(buffer), Transaction::Mint(mint) => mint.encode_static(buffer), Transaction::Upgrade(upgrade) => upgrade.encode_static(buffer),
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:- Moved
fuel-tx-test-helpers
logic into thefuel_tx::test_helpers
module. - Added a new rule for
Create
transaction: all inputs should use base asset otherwise it returnsTransactionInputContainsNonBaseAssetId
error. - Renamed some errors because now they are used for several transactions(
Upgrade
uses some errors fromCreate
and some fromScript
transactions):TransactionScriptOutputContractCreated
->TransactionOutputContainsContractCreated
.TransactionCreateOutputContract
->TransactionOutputContainsContract
.TransactionCreateOutputVariable
->TransactionOutputContainsVariable
.TransactionCreateOutputChangeNotBaseAsset
->TransactionChangeChangeUsesNotBaseAsset
.TransactionCreateInputContract
->TransactionInputContainsContract
.TransactionCreateMessageData
->TransactionInputContainsMessageData
.
- The combination of
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
.
- Moved
-
#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
- Store stack and heap separately by @Dentosal @xgreenx in #697
- Add PR template by @Dentosal in #713
- A new
Upgrade
transaction to perform network upgrades by @xgreenx in #707 - Process
Upgrade
transaction inside of theInterpreter
by @xgreenx in #712 - A new
Upload
transaction to upload the huge bytecode on the chain by @xgreenx in #720 - Process
Upload
transaction inside theInterpreter
by @xgreenx in #715 - test: BMT proof verify tests and additional verify logic by @bvrooman in #721
- Handle padded_len_* overflows gracefully by @Dentosal in #719
- Release v0.49.0 by @xgreenx in #723
Full Changelog: v0.48.0...v0.49.0