Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.49.0 #723

Merged
merged 1 commit into from
Apr 15, 2024
Merged

Release v0.49.0 #723

merged 1 commit into from
Apr 15, 2024

Conversation

xgreenx
Copy link
Collaborator

@xgreenx xgreenx commented Apr 15, 2024

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 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 Upgradable Wasm bytecode 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 the TxParameters 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 the fuel_tx::test_helpers module.
    • Added a new rule for Create transaction: all inputs should use base asset otherwise it returns TransactionInputContainsNonBaseAssetId error.
    • Renamed some errors because now they are used for several transactions(Upgrade uses some errors from Create and some from Script transactions):
      • TransactionScriptOutputContractCreated -> TransactionOutputContainsContractCreated.
      • TransactionCreateOutputContract -> TransactionOutputContainsContract.
      • TransactionCreateOutputVariable -> TransactionOutputContainsVariable.
      • TransactionCreateOutputChangeNotBaseAsset -> TransactionChangeChangeUsesNotBaseAsset.
      • TransactionCreateInputContract -> TransactionInputContainsContract.
      • TransactionCreateMessageData -> TransactionInputContainsMessageData.
    • 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.

What's Changed

Full Changelog: v0.48.0...v0.49.0

@xgreenx xgreenx requested a review from a team April 15, 2024 15:13
@xgreenx xgreenx self-assigned this Apr 15, 2024
@xgreenx xgreenx enabled auto-merge April 15, 2024 15:17
@xgreenx xgreenx added this pull request to the merge queue Apr 15, 2024
Merged via the queue into master with commit 795d2ee Apr 15, 2024
38 checks passed
@xgreenx xgreenx deleted the release/v0.49.0 branch April 15, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants