diff --git a/bin/fuel-core/src/cli/run.rs b/bin/fuel-core/src/cli/run.rs index 1a76fb18a68..93964f7c10e 100644 --- a/bin/fuel-core/src/cli/run.rs +++ b/bin/fuel-core/src/cli/run.rs @@ -488,7 +488,7 @@ impl Command { let config = Config { graphql_config: GraphQLConfig { addr, - database_butch_size: graphql.database_butch_size, + database_batch_size: graphql.database_batch_size, max_queries_depth: graphql.graphql_max_depth, max_queries_complexity: graphql.graphql_max_complexity, max_queries_recursive_depth: graphql.graphql_max_recursive_depth, diff --git a/bin/fuel-core/src/cli/run/graphql.rs b/bin/fuel-core/src/cli/run/graphql.rs index 73c682d0643..90a1ad9508c 100644 --- a/bin/fuel-core/src/cli/run/graphql.rs +++ b/bin/fuel-core/src/cli/run/graphql.rs @@ -12,9 +12,9 @@ pub struct GraphQLArgs { #[clap(long = "port", default_value = "4000", env)] pub port: u16, - /// The size of the butch fetched from the database by GraphQL service. - #[clap(long = "graphql-database-butch-size", default_value = "100", env)] - pub database_butch_size: usize, + /// The size of the batch fetched from the database by GraphQL service. + #[clap(long = "graphql-database-batch-size", default_value = "100", env)] + pub database_batch_size: usize, /// The max depth of GraphQL queries. #[clap(long = "graphql-max-depth", default_value = "16", env)] diff --git a/crates/fuel-core/src/graphql_api.rs b/crates/fuel-core/src/graphql_api.rs index 8b8706b75e5..247a79bb59a 100644 --- a/crates/fuel-core/src/graphql_api.rs +++ b/crates/fuel-core/src/graphql_api.rs @@ -20,7 +20,7 @@ pub mod worker_service; #[derive(Clone, Debug)] pub struct ServiceConfig { pub addr: SocketAddr, - pub database_butch_size: usize, + pub database_batch_size: usize, pub max_queries_depth: usize, pub max_queries_complexity: usize, pub max_queries_recursive_depth: usize, diff --git a/crates/fuel-core/src/graphql_api/api_service.rs b/crates/fuel-core/src/graphql_api/api_service.rs index ce0fdbc9f6c..0c185d472a7 100644 --- a/crates/fuel-core/src/graphql_api/api_service.rs +++ b/crates/fuel-core/src/graphql_api/api_service.rs @@ -222,7 +222,7 @@ where { let network_addr = config.config.addr; let combined_read_database = ReadDatabase::new( - config.config.database_butch_size, + config.config.database_batch_size, genesis_block_height, on_database, off_database, diff --git a/crates/fuel-core/src/graphql_api/database.rs b/crates/fuel-core/src/graphql_api/database.rs index bd08761870c..52b1cef5e27 100644 --- a/crates/fuel-core/src/graphql_api/database.rs +++ b/crates/fuel-core/src/graphql_api/database.rs @@ -78,8 +78,8 @@ pub type OffChainView = Arc; /// The container of the on-chain and off-chain database view provides. /// It is used only by `ViewExtension` to create a [`ReadView`]. pub struct ReadDatabase { - /// The size of the butch during fetching from the database. - butch_size: usize, + /// The size of the batch during fetching from the database. + batch_size: usize, /// The height of the genesis block. genesis_height: BlockHeight, /// The on-chain database view provider. @@ -91,7 +91,7 @@ pub struct ReadDatabase { impl ReadDatabase { /// Creates a new [`ReadDatabase`] with the given on-chain and off-chain database view providers. pub fn new( - butch_size: usize, + batch_size: usize, genesis_height: BlockHeight, on_chain: OnChain, off_chain: OffChain, @@ -103,7 +103,7 @@ impl ReadDatabase { OffChain::LatestView: OffChainDatabase, { Self { - butch_size, + batch_size, genesis_height, on_chain: Box::new(ArcWrapper::new(on_chain)), off_chain: Box::new(ArcWrapper::new(off_chain)), @@ -116,7 +116,7 @@ impl ReadDatabase { // It is not possible to implement until `view_at` is implemented for the `AtomicView`. // https://github.com/FuelLabs/fuel-core/issues/1582 Ok(ReadView { - butch_size: self.butch_size, + batch_size: self.batch_size, genesis_height: self.genesis_height, on_chain: self.on_chain.latest_view()?, off_chain: self.off_chain.latest_view()?, @@ -131,7 +131,7 @@ impl ReadDatabase { #[derive(Clone)] pub struct ReadView { - pub(crate) butch_size: usize, + pub(crate) batch_size: usize, pub(crate) genesis_height: BlockHeight, pub(crate) on_chain: OnChainView, pub(crate) off_chain: OffChainView, @@ -273,7 +273,7 @@ impl ReadView { direction: IterDirection, ) -> impl Stream> + '_ { futures::stream::iter(self.on_chain.all_messages(start_message_id, direction)) - .chunks(self.butch_size) + .chunks(self.batch_size) .filter_map(|chunk| async move { // Give a chance to other tasks to run. tokio::task::yield_now().await; @@ -304,7 +304,7 @@ impl ReadView { start_asset, direction, )) - .chunks(self.butch_size) + .chunks(self.batch_size) .filter_map(|chunk| async move { // Give a chance to other tasks to run. tokio::task::yield_now().await; diff --git a/crates/fuel-core/src/query/balance.rs b/crates/fuel-core/src/query/balance.rs index 0638dc768b9..74c0099cf28 100644 --- a/crates/fuel-core/src/query/balance.rs +++ b/crates/fuel-core/src/query/balance.rs @@ -106,7 +106,7 @@ impl ReadView { }) .map_ok(|stream| stream.map(Ok)) .try_flatten() - .chunks(self.butch_size) + .chunks(self.batch_size) .filter_map(|chunk| async move { // Give a chance to other tasks to run. tokio::task::yield_now().await; diff --git a/crates/fuel-core/src/query/balance/asset_query.rs b/crates/fuel-core/src/query/balance/asset_query.rs index 3c9ba49cee6..f404d22ae12 100644 --- a/crates/fuel-core/src/query/balance/asset_query.rs +++ b/crates/fuel-core/src/query/balance/asset_query.rs @@ -106,7 +106,7 @@ impl<'a> AssetsQuery<'a> { }) }); - futures::stream::StreamExt::chunks(stream, database.butch_size) + futures::stream::StreamExt::chunks(stream, database.batch_size) .map(|chunk| { use itertools::Itertools; @@ -159,7 +159,7 @@ impl<'a> AssetsQuery<'a> { }) }); - futures::stream::StreamExt::chunks(stream, database.butch_size) + futures::stream::StreamExt::chunks(stream, database.batch_size) .map(|chunk| { use itertools::Itertools; diff --git a/crates/fuel-core/src/query/block.rs b/crates/fuel-core/src/query/block.rs index 60f98838879..bf5bf91c206 100644 --- a/crates/fuel-core/src/query/block.rs +++ b/crates/fuel-core/src/query/block.rs @@ -27,7 +27,7 @@ impl ReadView { direction: IterDirection, ) -> impl Stream> + '_ { futures::stream::iter(self.blocks(height, direction)) - .chunks(self.butch_size) + .chunks(self.batch_size) .filter_map(|chunk| async move { // Give a chance to other tasks to run. tokio::task::yield_now().await; diff --git a/crates/fuel-core/src/query/coin.rs b/crates/fuel-core/src/query/coin.rs index 7de4a5211d6..641cbf99d3b 100644 --- a/crates/fuel-core/src/query/coin.rs +++ b/crates/fuel-core/src/query/coin.rs @@ -49,7 +49,7 @@ impl ReadView { direction: IterDirection, ) -> impl Stream> + '_ { self.owned_coins_ids(owner, start_coin, direction) - .chunks(self.butch_size) + .chunks(self.batch_size) .map(|chunk| { use itertools::Itertools; diff --git a/crates/fuel-core/src/query/message.rs b/crates/fuel-core/src/query/message.rs index 51550af3555..5d90f559d43 100644 --- a/crates/fuel-core/src/query/message.rs +++ b/crates/fuel-core/src/query/message.rs @@ -98,7 +98,7 @@ impl ReadView { direction: IterDirection, ) -> impl Stream> + 'a { self.owned_message_ids(owner, start_message_id, direction) - .chunks(self.butch_size) + .chunks(self.batch_size) .map(|chunk| { let chunk = chunk.into_iter().try_collect::<_, Vec<_>, _>()?; Ok(chunk) diff --git a/crates/fuel-core/src/query/tx.rs b/crates/fuel-core/src/query/tx.rs index cfeaf00f8d1..0bceeef8809 100644 --- a/crates/fuel-core/src/query/tx.rs +++ b/crates/fuel-core/src/query/tx.rs @@ -41,7 +41,7 @@ impl ReadView { direction: IterDirection, ) -> impl Stream> + '_ { self.owned_transactions_ids(owner, start, direction) - .chunks(self.butch_size) + .chunks(self.batch_size) .map(|chunk| { use itertools::Itertools; diff --git a/crates/fuel-core/src/schema/block.rs b/crates/fuel-core/src/schema/block.rs index 0dd83103545..8bf87a96e5c 100644 --- a/crates/fuel-core/src/schema/block.rs +++ b/crates/fuel-core/src/schema/block.rs @@ -140,7 +140,7 @@ impl Block { let tx_ids = futures::stream::iter(self.0.transactions().iter().copied()); let result = tx_ids - .chunks(query.butch_size) + .chunks(query.batch_size) .filter_map(move |tx_ids: Vec| { let async_query = query.as_ref().clone(); async move { diff --git a/crates/fuel-core/src/schema/tx.rs b/crates/fuel-core/src/schema/tx.rs index e58ef7ea911..c90b25fed89 100644 --- a/crates/fuel-core/src/schema/tx.rs +++ b/crates/fuel-core/src/schema/tx.rs @@ -159,7 +159,7 @@ impl TxQuery { async move { Ok(skip) } }) - .chunks(query_ref.butch_size) + .chunks(query_ref.batch_size) .filter_map(move |chunk: Vec>| { let async_query = query_ref.clone(); async move { diff --git a/crates/fuel-core/src/service/config.rs b/crates/fuel-core/src/service/config.rs index ed75edae477..e990a978949 100644 --- a/crates/fuel-core/src/service/config.rs +++ b/crates/fuel-core/src/service/config.rs @@ -138,7 +138,7 @@ impl Config { std::net::Ipv4Addr::new(127, 0, 0, 1).into(), 0, ), - database_butch_size: 100, + database_batch_size: 100, max_queries_depth: 16, max_queries_complexity: 80000, max_queries_recursive_depth: 16,