From 4d0a9545e27e71838958cb77022fe44ba7c50ca5 Mon Sep 17 00:00:00 2001 From: hal3e Date: Thu, 10 Apr 2025 13:54:33 +0200 Subject: [PATCH 1/2] chore: bump `fuel-core` to `v0.43.0` --- .github/workflows/ci.yml | 2 +- Cargo.toml | 12 +++---- .../provider/supported_fuel_core_version.rs | 2 +- packages/fuels-accounts/src/schema/schema.sdl | 35 +++++++++++++++---- 4 files changed, 37 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 75e24eeda9..0d5fc85718 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ env: CARGO_TERM_COLOR: always DASEL_VERSION: https://github.com/TomWright/dasel/releases/download/v2.3.6/dasel_linux_amd64 RUSTFLAGS: "-D warnings" - FUEL_CORE_VERSION: 0.42.0 + FUEL_CORE_VERSION: 0.43.0 FUEL_CORE_PATCH_BRANCH: "" FUEL_CORE_PATCH_REVISION: "" RUST_VERSION: 1.85.0 diff --git a/Cargo.toml b/Cargo.toml index 15f0a71d61..c79b7db36b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,14 +95,14 @@ testcontainers = { version = "0.23", default-features = false } k256 = { version = "0.13", default-features = false } # Dependencies from the `fuel-core` repository: -fuel-core = { version = "0.42.0", default-features = false, features = [ +fuel-core = { version = "0.43.0", default-features = false, features = [ "wasm-executor", ] } -fuel-core-chain-config = { version = "0.42.0", default-features = false } -fuel-core-client = { version = "0.42.0", default-features = false } -fuel-core-poa = { version = "0.42.0", default-features = false } -fuel-core-services = { version = "0.42.0", default-features = false } -fuel-core-types = { version = "0.42.0", default-features = false } +fuel-core-chain-config = { version = "0.43.0", default-features = false } +fuel-core-client = { version = "0.43.0", default-features = false } +fuel-core-poa = { version = "0.43.0", default-features = false } +fuel-core-services = { version = "0.43.0", default-features = false } +fuel-core-types = { version = "0.43.0", default-features = false } # Dependencies from the `fuel-vm` repository: fuel-asm = { version = "0.60.0" } diff --git a/packages/fuels-accounts/src/provider/supported_fuel_core_version.rs b/packages/fuels-accounts/src/provider/supported_fuel_core_version.rs index 26bed93f40..448a4b583d 100644 --- a/packages/fuels-accounts/src/provider/supported_fuel_core_version.rs +++ b/packages/fuels-accounts/src/provider/supported_fuel_core_version.rs @@ -1 +1 @@ -pub const SUPPORTED_FUEL_CORE_VERSION: semver::Version = semver::Version::new(0, 42, 0); +pub const SUPPORTED_FUEL_CORE_VERSION: semver::Version = semver::Version::new(0, 43, 0); diff --git a/packages/fuels-accounts/src/schema/schema.sdl b/packages/fuels-accounts/src/schema/schema.sdl index 60d090be7c..089633e347 100644 --- a/packages/fuels-accounts/src/schema/schema.sdl +++ b/packages/fuels-accounts/src/schema/schema.sdl @@ -332,6 +332,11 @@ type DryRunFailureStatus { totalFee: U64! } +type DryRunStorageReads { + txStatuses: [DryRunTransactionExecutionStatus!]! + storageReads: [StorageReadReplayEvent!]! +} + type DryRunSuccessStatus { programState: ProgramState receipts: [Receipt!]! @@ -900,7 +905,7 @@ type PreconfirmationFailureStatus { transactionId: TransactionId! transaction: Transaction receipts: [Receipt!] - resolvedOutputs: [Output!] + resolvedOutputs: [ResolvedOutput!] } type PreconfirmationSuccessStatus { @@ -910,7 +915,7 @@ type PreconfirmationSuccessStatus { transactionId: TransactionId! transaction: Transaction receipts: [Receipt!] - resolvedOutputs: [Output!] + resolvedOutputs: [ResolvedOutput!] } input Predicate { @@ -1055,6 +1060,11 @@ type Query { """ dryRun(txs: [HexString!]!, utxoValidation: Boolean, gasPrice: U64, blockHeight: U32): [DryRunTransactionExecutionStatus!]! """ + Execute a dry-run of multiple transactions using a fork of current state, no changes are committed. + Also records accesses, so the execution can be replicated locally. + """ + dryRunRecordStorageReads(txs: [HexString!]!, utxoValidation: Boolean, gasPrice: U64, blockHeight: U32): DryRunStorageReads! + """ Get execution trace for an already-executed block. """ storageReadReplay(height: U32!): [StorageReadReplayEvent!]! @@ -1226,6 +1236,11 @@ input RequiredBalance { changePolicy: ChangePolicy! } +type ResolvedOutput { + utxoId: UtxoId! + output: Output! +} + enum ReturnType { RETURN RETURN_DATA @@ -1276,6 +1291,10 @@ input SpendQueryElementInput { The maximum number of currencies for selection. """ max: U16 + """ + If true, returns available coins instead of failing when the requested amount is unavailable. + """ + allowPartial: Boolean } type SqueezedOutStatus { @@ -1329,7 +1348,11 @@ type Subscription { """ The ID of the transaction """ - id: TransactionId! + id: TransactionId!, + """ + If true, accept to receive the preconfirmation status + """ + includePreconfirmation: Boolean ): TransactionStatus! """ Submits transaction to the `TxPool` and await either success or failure. @@ -1338,9 +1361,9 @@ type Subscription { """ Submits the transaction to the `TxPool` and returns a stream of events. Compared to the `submitAndAwait`, the stream also contains - `SubmittedStatus` as an intermediate state. + `SubmittedStatus` and potentially preconfirmation as an intermediate state. """ - submitAndAwaitStatus(tx: HexString!, estimatePredicates: Boolean): TransactionStatus! + submitAndAwaitStatus(tx: HexString!, estimatePredicates: Boolean, includePreconfirmation: Boolean): TransactionStatus! contractStorageSlots(contractId: ContractId!): StorageSlot! contractStorageBalances(contractId: ContractId!): ContractBalance! } @@ -1382,7 +1405,7 @@ type Transaction { outputContract: ContractOutput witnesses: [HexString!] receiptsRoot: Bytes32 - status: TransactionStatus + status(includePreconfirmation: Boolean): TransactionStatus script: HexString scriptData: HexString bytecodeWitnessIndex: U16 From 55084c2650b8466732dcdd2d2ef5527b73c13724 Mon Sep 17 00:00:00 2001 From: hal3e Date: Fri, 11 Apr 2025 11:05:33 +0200 Subject: [PATCH 2/2] add fault-proving features --- packages/fuels-accounts/Cargo.toml | 1 + packages/fuels-core/Cargo.toml | 1 + packages/fuels-programs/Cargo.toml | 1 + packages/fuels-test-helpers/Cargo.toml | 1 + packages/fuels/Cargo.toml | 1 + 5 files changed, 5 insertions(+) diff --git a/packages/fuels-accounts/Cargo.toml b/packages/fuels-accounts/Cargo.toml index d06b716b6e..3690ec671c 100644 --- a/packages/fuels-accounts/Cargo.toml +++ b/packages/fuels-accounts/Cargo.toml @@ -51,3 +51,4 @@ test-helpers = [] keystore = ["dep:eth-keystore"] signer-aws-kms = ["dep:aws-sdk-kms", "dep:aws-config"] signer-google-kms = ["dep:google-cloud-kms"] +fault-proving = ["fuel-core-types/fault-proving", "fuel-core-client?/fault-proving", "fuels-core/fault-proving"] diff --git a/packages/fuels-core/Cargo.toml b/packages/fuels-core/Cargo.toml index 11e2b930d7..2669843f75 100644 --- a/packages/fuels-core/Cargo.toml +++ b/packages/fuels-core/Cargo.toml @@ -41,3 +41,4 @@ tokio = { workspace = true, features = ["test-util", "macros"] } [features] default = ["std"] std = ["dep:fuel-core-client", "fuel-core-types/std"] +fault-proving = ["fuel-core-chain-config/fault-proving", "fuel-core-types/fault-proving", "fuel-core-client?/fault-proving"] diff --git a/packages/fuels-programs/Cargo.toml b/packages/fuels-programs/Cargo.toml index 91011dcda8..4e847bc06f 100644 --- a/packages/fuels-programs/Cargo.toml +++ b/packages/fuels-programs/Cargo.toml @@ -29,3 +29,4 @@ test-case = { workspace = true } [features] default = ["std"] std = ["fuels-core/std", "fuels-accounts/std"] +fault-proving = ["fuels-core/fault-proving", "fuels-accounts/fault-proving"] diff --git a/packages/fuels-test-helpers/Cargo.toml b/packages/fuels-test-helpers/Cargo.toml index 5d3db165b4..890518b5bd 100644 --- a/packages/fuels-test-helpers/Cargo.toml +++ b/packages/fuels-test-helpers/Cargo.toml @@ -36,3 +36,4 @@ default = ["fuels-accounts", "std"] std = ["fuels-accounts?/std", "fuels-core/std", "fuel-core-chain-config/std"] fuel-core-lib = ["dep:fuel-core"] rocksdb = ["fuel-core?/rocksdb"] +fault-proving = ["fuel-core?/fault-proving", "fuel-core-chain-config/fault-proving", "fuel-core-client/fault-proving", "fuel-core-poa/fault-proving", "fuels-accounts?/fault-proving", "fuels-core/fault-proving"] diff --git a/packages/fuels/Cargo.toml b/packages/fuels/Cargo.toml index 2686a4b229..ee8fe674fa 100644 --- a/packages/fuels/Cargo.toml +++ b/packages/fuels/Cargo.toml @@ -44,3 +44,4 @@ rocksdb = ["fuels-test-helpers?/rocksdb"] accounts-signer-aws-kms = ["fuels-accounts/signer-aws-kms"] accounts-signer-google-kms = ["fuels-accounts/signer-google-kms"] accounts-keystore = ["fuels-accounts/keystore"] +fault-proving = ["fuel-core-client?/fault-proving", "fuels-test-helpers?/fault-proving", "fuels-accounts/fault-proving", "fuels-core/fault-proving", "fuels-programs/fault-proving"]