From 483f22cedca8a552986d4306620b23f406d882dd Mon Sep 17 00:00:00 2001 From: yusong wang Date: Sun, 13 Aug 2023 13:08:54 +0800 Subject: [PATCH 1/3] [rpc] Parallelise estimate_predicates endpoint --- crates/fuel-core/src/schema/tx.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/fuel-core/src/schema/tx.rs b/crates/fuel-core/src/schema/tx.rs index 19cfacf1c8f..8754af77d16 100644 --- a/crates/fuel-core/src/schema/tx.rs +++ b/crates/fuel-core/src/schema/tx.rs @@ -37,7 +37,10 @@ use fuel_core_storage::{ Error as StorageError, Result as StorageResult, }; -use fuel_core_txpool::service::TxStatusMessage; +use fuel_core_txpool::{ + service::TxStatusMessage, + txpool::TokioWithRayon, +}; use fuel_core_types::{ fuel_tx::{ Cacheable, @@ -205,11 +208,13 @@ impl TxQuery { tx: HexString, ) -> async_graphql::Result { let mut tx = FuelTx::from_bytes(&tx.0)?; + let config = ctx.data_unchecked::(); - tx.estimate_predicates(&CheckPredicateParams::from( + tx.estimate_predicates_async::(&CheckPredicateParams::from( &config.consensus_parameters, - ))?; + )) + .await?; Ok(Transaction::from_tx( tx.id(&config.consensus_parameters.chain_id), From 5f76705faeae7f1553ba00427346268b6885fd3a Mon Sep 17 00:00:00 2001 From: yusong wang Date: Sun, 13 Aug 2023 20:07:01 +0800 Subject: [PATCH 2/3] update changelog --- CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c5db62779e..992341e3374 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,8 +15,7 @@ Description of the upcoming release here. ### Changed -- Something changed here 1 -- Something changed here 2 +- [#1291](https://github.com/FuelLabs/fuel-core/issues/1291): Parallelise estimate_predicates endpoint #### Breaking - [#1262](https://github.com/FuelLabs/fuel-core/pull/1262): The `ConsensusParameters` aggregates all configuration data related to the consensus. It contains many fields that are segregated by the usage. The API of some functions was affected to use lesser types instead the whole `ConsensusParameters`. It is a huge breaking change requiring repetitively monotonically updating all places that use the `ConsensusParameters`. But during updating, consider that maybe you can use lesser types. Usage of them may simplify signatures of methods and make them more user-friendly and transparent. From 8c26a676f30634bba7e8d441d5ec0d7a50e3a6b3 Mon Sep 17 00:00:00 2001 From: Green Baneling Date: Mon, 14 Aug 2023 13:30:40 +0100 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 992341e3374..04fdf2b5a88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ Description of the upcoming release here. ### Changed -- [#1291](https://github.com/FuelLabs/fuel-core/issues/1291): Parallelise estimate_predicates endpoint +- [#1293](https://github.com/FuelLabs/fuel-core/issues/1293): Parallelized the `estimate_predicates` endpoint to utilize all available threads. #### Breaking - [#1262](https://github.com/FuelLabs/fuel-core/pull/1262): The `ConsensusParameters` aggregates all configuration data related to the consensus. It contains many fields that are segregated by the usage. The API of some functions was affected to use lesser types instead the whole `ConsensusParameters`. It is a huge breaking change requiring repetitively monotonically updating all places that use the `ConsensusParameters`. But during updating, consider that maybe you can use lesser types. Usage of them may simplify signatures of methods and make them more user-friendly and transparent.