Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
8a6502c
Started work on the `assemble_tx` endpoint.
xgreenx Feb 26, 2025
a19bcc3
Implemented remaining logic
xgreenx Feb 27, 2025
8a5ff0c
fix: Updated integer types in client
netrome Feb 27, 2025
59bc96a
feat: Support assembleTx in client
netrome Feb 27, 2025
6d87183
fix: Use HexString instead of passing around Vec<u8>
netrome Feb 27, 2025
2a42e40
fix: Integer changes in tests
netrome Feb 27, 2025
1c3561d
fix: Typo
netrome Feb 27, 2025
04660bd
fix: Cleanup
netrome Feb 27, 2025
2da4546
Re-worked some tests to use new assemble tx API. ALong with it fixed …
xgreenx Feb 28, 2025
cdf2970
Merge branch 'refs/heads/master' into feature/assemble-tx
xgreenx Feb 28, 2025
30177d0
Updated CHANGELOG
xgreenx Feb 28, 2025
2bc6258
refactor: Tidy up `FuelCoreClientExt` trait
netrome Feb 28, 2025
7f7df62
refactor: Simplify control flow in assemble_transaction impl
netrome Feb 28, 2025
208f60b
refactor: Reorder trait methods
netrome Feb 28, 2025
7fd6d51
refactor: Tidy up `AssembleTx::new` logic
netrome Feb 28, 2025
0b38697
Remove breaking change from API
xgreenx Feb 28, 2025
f307ba5
Use GraphQL to produce a block, it awaits off-chain database to index…
xgreenx Feb 28, 2025
9eddbf9
feat: Don't use bool for `destroy` option
netrome Mar 3, 2025
a2942f1
fix: Remove unsafe array slicing
netrome Mar 3, 2025
2646e53
feat: Break out big loop to dedicated `populate_missing_contract_inpu…
netrome Mar 3, 2025
3885dee
Removed unnessesary cover tip step
xgreenx Mar 3, 2025
03b281e
We still need to cover fee because fake coin doesn't have any amount …
xgreenx Mar 3, 2025
14ecbce
Added protection over many estimation of predicates
xgreenx Mar 3, 2025
a6963e7
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 3, 2025
25d26d7
Merge branch 'master' into feature/assemble-tx
AurelienFT Mar 4, 2025
71d5b1e
Fix tests compilation
AurelienFT Mar 4, 2025
c8c1e49
Fixed witness index
xgreenx Mar 4, 2025
d118248
Fixed the issues with custom witness limit.
xgreenx Mar 4, 2025
00fda90
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 4, 2025
28a3c10
Include `gas_price` into the response.
xgreenx Mar 4, 2025
eb7aa08
Fixed wrong `used_gas` calculation logic
xgreenx Mar 4, 2025
dfa5e81
Added filling of missing witnesses
xgreenx Mar 5, 2025
78c1e4c
Merge branch 'refs/heads/master' into feature/assemble-tx
xgreenx Mar 6, 2025
af19011
Resolved conflicts
xgreenx Mar 6, 2025
269ab9f
Make CI happy
xgreenx Mar 6, 2025
c2e215a
Make CI happy
xgreenx Mar 6, 2025
c86be0a
Fixed flaky test
xgreenx Mar 6, 2025
c0f51fe
Merge branch 'master' into feature/assemble-tx
netrome Mar 6, 2025
3c29542
Add more tests for the change and variable outputs
xgreenx Mar 6, 2025
dfd59ca
Handle cases with zero gas price and when we don't need base asset to…
xgreenx Mar 7, 2025
7a42126
Make audit happy
xgreenx Mar 7, 2025
a5fed62
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 7, 2025
ca42157
Merge branch 'master' into feature/assemble-tx
rymnc Mar 7, 2025
1760da4
Fixed panic during adding change outputs.
xgreenx Mar 9, 2025
13e0607
Make CI happy
xgreenx Mar 9, 2025
7fc0a0a
Use a new feature from the VM to get all required inputs in one dry run
xgreenx Mar 10, 2025
4ee17c3
Updated changelog.
xgreenx Mar 11, 2025
0eade5b
Mini self review
xgreenx Mar 11, 2025
4ce0dc9
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 11, 2025
9ace50b
Merge branch 'feature/assemble-tx' into feature/assemble-tx-follow-up
xgreenx Mar 11, 2025
876241e
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 11, 2025
dc0e5df
Address comments from the PR
xgreenx Mar 11, 2025
c1ae36e
Use `ok_or_else`
xgreenx Mar 11, 2025
14f842a
Merge branch 'master' into feature/assemble-tx
xgreenx Mar 11, 2025
4f0a02f
Merge branch 'refs/heads/feature/assemble-tx' into feature/assemble-t…
xgreenx Mar 11, 2025
256600d
Merge branch 'refs/heads/master' into feature/assemble-tx-follow-up
xgreenx Mar 11, 2025
83e65ee
Merge branch 'master' into feature/assemble-tx-follow-up
xgreenx Mar 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changes/added/2840.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Added a new CLI arguments:
- `assemble-tx-dry-run-limit` - The max number how many times script can be executed during `assemble_tx` GraphQL request. Default value is `3` times.
- `assemble-tx-estimate-predicates-limit` - The max number how many times predicates can be estimated during `assemble_tx` GraphQL request. Default values is `10` times.
3 changes: 3 additions & 0 deletions .changes/breaking/2840.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CLI argument `vm-backtrace` is deprecated and does nothing. It will be removed in a future version of `fuel-core`.
The `extra_tx_checks` field was renamed into `forbid_fake_coins` that affects JSON based serialization/deserialization.
Renamed `extra_tx_checks_default` field into `forbid_fake_coins_default`.
1 change: 1 addition & 0 deletions .changes/changed/2840.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed `log_backtrace` logic from the executor. It is not needed anymore with the existence of the local debugger for the transactions.
1 change: 1 addition & 0 deletions .changes/fixed/2840.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed `fuel-core-client` receipt deserialization in the case if the `ContractId` is zero.
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions bin/fuel-core/src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ use fuel_core::{
Config,
DbType,
RelayerConsensusConfig,
VMConfig,
},
state::rocks_db::{
ColumnsPolicy,
Expand Down Expand Up @@ -197,6 +196,7 @@ pub struct Command {

/// Enable logging of backtraces from vm errors
#[arg(long = "vm-backtrace", env)]
#[deprecated]
pub vm_backtrace: bool,

/// Enable full utxo stateful validation
Expand Down Expand Up @@ -307,6 +307,7 @@ pub struct Command {

impl Command {
pub async fn get_config(self) -> anyhow::Result<Config> {
#[allow(deprecated)]
let Command {
service_name: name,
max_database_cache_size,
Expand All @@ -319,7 +320,7 @@ impl Command {
db_prune,
snapshot,
continue_on_error,
vm_backtrace,
vm_backtrace: _,
debug,
historical_execution,
utxo_validation,
Expand Down Expand Up @@ -628,6 +629,9 @@ impl Command {
max_concurrent_queries: graphql.graphql_max_concurrent_queries,
request_body_bytes_limit: graphql.graphql_request_body_bytes_limit,
api_request_timeout: graphql.api_request_timeout.into(),
assemble_tx_dry_run_limit: graphql.assemble_tx_dry_run_limit,
assemble_tx_estimate_predicates_limit: graphql
.assemble_tx_estimate_predicates_limit,
query_log_threshold_time: graphql.query_log_threshold_time.into(),
costs: Costs {
balance_query: graphql.costs.balance_query,
Expand Down Expand Up @@ -671,9 +675,6 @@ impl Command {
executor_number_of_cores,
block_production: trigger,
predefined_blocks_path,
vm: VMConfig {
backtrace: vm_backtrace,
},
txpool: TxPoolConfig {
max_txs_chain_count: tx_max_chain_count,
max_txs_ttl: tx_pool_ttl,
Expand Down
14 changes: 14 additions & 0 deletions bin/fuel-core/src/cli/run/graphql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ pub struct GraphQLArgs {
#[clap(long = "api-request-timeout", default_value = "30s", env)]
pub api_request_timeout: humantime::Duration,

/// The max number how many times script can be executed
/// during `assemble_tx` GraphQL request.
#[clap(long = "assemble-tx-dry-run-limit", default_value = "3", env)]
pub assemble_tx_dry_run_limit: usize,

/// The max number how many times predicate can be estimated
/// during `assemble_tx` GraphQL request.
#[clap(
long = "assemble-tx-estimate-predicates-limit",
default_value = "10",
env
)]
pub assemble_tx_estimate_predicates_limit: usize,

/// Maximum allowed block lag for GraphQL fuel block height requests.
/// The client waits for the node to catch up if it's behind by no more blocks than
/// this tolerance.
Expand Down
49 changes: 38 additions & 11 deletions crates/client/src/client/schema/tx/transparent_receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,14 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
fn try_from(schema: Receipt) -> Result<Self, Self::Error> {
Ok(match schema.receipt_type {
ReceiptType::Call => fuel_tx::Receipt::Call {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
to: schema
.to
.ok_or_else(|| MissingField("to".to_string()))?
.into(),
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
amount: schema
.amount
.ok_or_else(|| MissingField("amount".to_string()))?
Expand Down Expand Up @@ -107,7 +110,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::Return => fuel_tx::Receipt::Return {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
val: schema
.val
.ok_or_else(|| MissingField("val".to_string()))?
Expand All @@ -122,7 +128,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::ReturnData => fuel_tx::Receipt::ReturnData {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
ptr: schema
.ptr
.ok_or_else(|| MissingField("ptr".to_string()))?
Expand Down Expand Up @@ -151,7 +160,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::Panic => fuel_tx::Receipt::Panic {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
reason: schema
.reason
.ok_or_else(|| MissingField("reason".to_string()))?
Expand All @@ -167,7 +179,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
contract_id: schema.contract_id.map(Into::into),
},
ReceiptType::Revert => fuel_tx::Receipt::Revert {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
ra: schema
.ra
.ok_or_else(|| MissingField("ra".to_string()))?
Expand All @@ -182,7 +197,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::Log => fuel_tx::Receipt::Log {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
ra: schema
.ra
.ok_or_else(|| MissingField("ra".to_string()))?
Expand All @@ -209,7 +227,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::LogData => fuel_tx::Receipt::LogData {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
ra: schema
.ra
.ok_or_else(|| MissingField("ra".to_string()))?
Expand Down Expand Up @@ -246,7 +267,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::Transfer => fuel_tx::Receipt::Transfer {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
to: schema
.to
.ok_or_else(|| MissingField("to".to_string()))?
Expand All @@ -269,7 +293,10 @@ impl TryFrom<Receipt> for fuel_tx::Receipt {
.into(),
},
ReceiptType::TransferOut => fuel_tx::Receipt::TransferOut {
id: schema.id.map(|id| id.into()).unwrap_or_default(),
id: schema
.id
.map(Into::into)
.unwrap_or(fuel_tx::ContractId::zeroed()),
to: schema
.to_address
.ok_or_else(|| MissingField("to_address".to_string()))?
Expand Down
45 changes: 20 additions & 25 deletions crates/fuel-core/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,8 @@ mod tests {
/// The executor already has these parameters, and this field allows us
/// to override the existing value.
pub consensus_parameters: ConsensusParameters,
/// Print execution backtraces if transaction execution reverts.
pub backtrace: bool,
/// Default mode for utxo_validation
pub utxo_validation_default: bool,
/// Default mode for `forbid_fake_coins` in the executor.
pub forbid_fake_coins_default: bool,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -216,8 +214,7 @@ mod tests {
config: Config,
) -> Executor<Database, DisabledRelayer> {
let executor_config = fuel_core_upgradable_executor::config::Config {
backtrace: config.backtrace,
utxo_validation_default: config.utxo_validation_default,
forbid_fake_coins_default: config.forbid_fake_coins_default,
native_executor_version: None,
allow_historical_execution: true,
};
Expand Down Expand Up @@ -825,7 +822,7 @@ mod tests {
let mut validator = create_executor(
Default::default(),
Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
},
);
Expand Down Expand Up @@ -1158,7 +1155,7 @@ mod tests {

// setup executors with utxo-validation enabled
let config = Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
};
let producer = create_executor(Database::default(), config.clone());
Expand Down Expand Up @@ -1286,7 +1283,7 @@ mod tests {
let mut executor = create_executor(
Database::default(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -1354,7 +1351,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -1423,7 +1420,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -1472,7 +1469,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -1667,7 +1664,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
},
);
Expand Down Expand Up @@ -1722,7 +1719,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
},
);
Expand Down Expand Up @@ -1824,7 +1821,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
},
);
Expand Down Expand Up @@ -1930,9 +1927,8 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
consensus_parameters: consensus_parameters.clone(),
..Default::default()
},
);

Expand Down Expand Up @@ -2091,7 +2087,7 @@ mod tests {
let mut executor = create_executor(
db.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -2380,7 +2376,7 @@ mod tests {
create_executor(
database,
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
)
Expand Down Expand Up @@ -2807,7 +2803,7 @@ mod tests {
let mut executor = create_executor(
database.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand Down Expand Up @@ -2871,7 +2867,7 @@ mod tests {
let mut executor = create_executor(
database.clone(),
Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
..Default::default()
},
);
Expand All @@ -2893,9 +2889,8 @@ mod tests {

let consensus_parameters = ConsensusParameters::default();
let config = Config {
utxo_validation_default: true,
forbid_fake_coins_default: true,
consensus_parameters: consensus_parameters.clone(),
..Default::default()
};

let mut tx = TransactionBuilder::script(
Expand Down Expand Up @@ -3088,7 +3083,7 @@ mod tests {
.finalize();

let config = Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
};
let (sender, mut receiver) = tokio::sync::mpsc::channel(2);
Expand Down Expand Up @@ -3152,7 +3147,7 @@ mod tests {
.finalize();

let config = Config {
utxo_validation_default: false,
forbid_fake_coins_default: false,
..Default::default()
};
let (sender, mut receiver) = tokio::sync::mpsc::channel(2);
Expand Down
Loading
Loading