From 75022cb34e010e111b1fbd91f3044ed2b76fda77 Mon Sep 17 00:00:00 2001 From: Green Baneling Date: Sat, 5 Aug 2023 19:00:10 +0200 Subject: [PATCH] Duplicate changes from 0.35.3 release (#543) * Actualization of the gas prices for the `fuel-core 0.20` release * ./Make the `fuel-tx` WASM compatible with `serde` feature enabled (#542) * Bump version to `0.35.3` * Fixed artifacts of rebasing * Fix CHANGELOG.md --- .github/workflows/ci.yml | 4 ++ CHANGELOG.md | 5 ++ Cargo.toml | 16 ++--- ci_checks.sh | 4 ++ fuel-asm/src/encoding_tests.rs | 2 +- fuel-crypto/src/ed25519.rs | 4 +- fuel-tx/src/builder.rs | 10 ++-- fuel-tx/src/receipt/receipt_repr.rs | 7 +-- fuel-tx/src/transaction.rs | 18 +++--- .../transaction/consensus_parameters/gas.rs | 30 ++++++++-- fuel-tx/src/transaction/types.rs | 15 ++--- fuel-tx/src/transaction/types/create.rs | 58 ++++++++++++------- fuel-tx/src/transaction/types/input.rs | 7 ++- fuel-tx/src/transaction/types/input/coin.rs | 13 +++-- .../src/transaction/types/input/contract.rs | 11 ++-- .../src/transaction/types/input/message.rs | 6 +- fuel-tx/src/transaction/types/mint.rs | 10 ++-- fuel-tx/src/transaction/types/output.rs | 14 +++-- fuel-tx/src/transaction/types/script.rs | 12 ++-- fuel-tx/src/transaction/types/utxo_id.rs | 6 +- fuel-tx/src/transaction/types/witness.rs | 25 ++++---- fuel-tx/src/transaction/validity.rs | 8 ++- fuel-tx/src/tx_pointer.rs | 8 ++- fuel-vm/src/arith.rs | 6 +- fuel-vm/src/constraints/reg_key.rs | 8 ++- fuel-vm/src/interpreter/internal.rs | 4 +- 26 files changed, 194 insertions(+), 117 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1caacbb28b..2c94a40686 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,6 +62,10 @@ jobs: args: --target thumbv6m-none-eabi -p fuel-asm -p fuel-storage -p fuel-merkle --no-default-features - command: check args: --target wasm32-unknown-unknown -p fuel-crypto --no-default-features + - command: check + args: --target wasm32-unknown-unknown -p fuel-tx --features serde --no-default-features + - command: check + args: --target wasm32-unknown-unknown -p fuel-types --features serde --no-default-features - command: rustc args: --target wasm32-unknown-unknown -p fuel-types --features typescript --crate-type=cdylib - command: rustc diff --git a/CHANGELOG.md b/CHANGELOG.md index 75fd18323d..ee0e3115a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - [#527](https://github.com/FuelLabs/fuel-vm/pull/527): The balances are empty during predicate estimation/verification. +## [Version 0.35.3] + +### Changed + +- [#542](https://github.com/FuelLabs/fuel-vm/pull/542/): Make the `fuel-tx` WASM compatible with `serde` feature enabled. ## [Version 0.35.2] diff --git a/Cargo.toml b/Cargo.toml index 10cb3480b4..c9f514607e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,15 +18,15 @@ edition = "2021" homepage = "https://fuel.network/" license = "BUSL-1.1" repository = "https://github.com/FuelLabs/fuel-vm" -version = "0.35.2" +version = "0.35.3" [workspace.dependencies] -fuel-asm = { version = "0.35.2", path = "fuel-asm", default-features = false } -fuel-crypto = { version = "0.35.2", path = "fuel-crypto", default-features = false } -fuel-merkle = { version = "0.35.2", path = "fuel-merkle", default-features = false } -fuel-storage = { version = "0.35.2", path = "fuel-storage", default-features = false } -fuel-tx = { version = "0.35.2", path = "fuel-tx", default-features = false } -fuel-types = { version = "0.35.2", path = "fuel-types", default-features = false } -fuel-vm = { version = "0.35.2", path = "fuel-vm", default-features = false } +fuel-asm = { version = "0.35.3", path = "fuel-asm", default-features = false } +fuel-crypto = { version = "0.35.3", path = "fuel-crypto", default-features = false } +fuel-merkle = { version = "0.35.3", path = "fuel-merkle", default-features = false } +fuel-storage = { version = "0.35.3", path = "fuel-storage", default-features = false } +fuel-tx = { version = "0.35.3", path = "fuel-tx", default-features = false } +fuel-types = { version = "0.35.3", path = "fuel-types", default-features = false } +fuel-vm = { version = "0.35.3", path = "fuel-vm", default-features = false } bincode = { version = "1.3", default-features = false } criterion = "0.5.0" diff --git a/ci_checks.sh b/ci_checks.sh index de34f06f81..f6017982bc 100755 --- a/ci_checks.sh +++ b/ci_checks.sh @@ -24,6 +24,10 @@ cargo check --all-targets --no-default-features && cargo check --all-targets --all-features && cargo check --target thumbv6m-none-eabi -p fuel-asm -p fuel-storage -p fuel-merkle --no-default-features && cargo check --target wasm32-unknown-unknown -p fuel-crypto --no-default-features && +cargo check --target wasm32-unknown-unknown -p fuel-types --features serde --no-default-features && +cargo check --target wasm32-unknown-unknown -p fuel-tx --features serde --no-default-features && +cargo rustc --target wasm32-unknown-unknown -p fuel-types --features typescript --crate-type=cdylib && +cargo rustc --target wasm32-unknown-unknown -p fuel-asm --features typescript --crate-type=cdylib && cargo make check && cargo test --all-targets --all-features && cargo test --all-targets --no-default-features && diff --git a/fuel-asm/src/encoding_tests.rs b/fuel-asm/src/encoding_tests.rs index 6b990a2f7a..af6c11c0a0 100644 --- a/fuel-asm/src/encoding_tests.rs +++ b/fuel-asm/src/encoding_tests.rs @@ -16,7 +16,7 @@ fn opcode() { for opcode_int in 0..64 { let Ok(op) = Opcode::try_from(opcode_int) else { - continue; + continue }; instructions.push(op.test_construct(r, r, r, r, imm12)); diff --git a/fuel-crypto/src/ed25519.rs b/fuel-crypto/src/ed25519.rs index 9b1b5f3bca..82197ac9e8 100644 --- a/fuel-crypto/src/ed25519.rs +++ b/fuel-crypto/src/ed25519.rs @@ -18,11 +18,11 @@ pub fn verify( message: &Message, ) -> Result<(), Error> { let Ok(signature) = Signature::from_bytes(&**signature) else { - return Err(Error::InvalidSignature); + return Err(Error::InvalidSignature) }; let Ok(pub_key) = ed25519_dalek::PublicKey::from_bytes(&**pub_key) else { - return Err(Error::InvalidPublicKey); + return Err(Error::InvalidPublicKey) }; if pub_key.verify_strict(&**message, &signature).is_ok() { diff --git a/fuel-tx/src/builder.rs b/fuel-tx/src/builder.rs index 086e962dee..0495381a69 100644 --- a/fuel-tx/src/builder.rs +++ b/fuel-tx/src/builder.rs @@ -40,8 +40,10 @@ use fuel_types::{ Word, }; -use alloc::vec::Vec; -use std::collections::HashMap; +use alloc::{ + collections::BTreeMap, + vec::Vec, +}; pub trait BuildableAloc where @@ -126,7 +128,7 @@ pub struct TransactionBuilder { // We take the key by reference so this lib won't have the responsibility to properly // zeroize the keys // Maps signing keys -> witness indexes - sign_keys: HashMap, + sign_keys: BTreeMap, } impl TransactionBuilder