diff --git a/tesseract/substrate/src/lib.rs b/tesseract/substrate/src/lib.rs index 81b6d13cd..b5b7104b6 100644 --- a/tesseract/substrate/src/lib.rs +++ b/tesseract/substrate/src/lib.rs @@ -59,6 +59,8 @@ pub struct SubstrateConfig { pub signer: Option, /// Latest state machine height pub latest_height: Option, + /// Max concurrent rpc requests allowed + pub max_concurent_queries: Option, } /// Core substrate client. @@ -77,6 +79,8 @@ pub struct SubstrateClient { pub address: Vec, /// Latest state machine height. initial_height: u64, + /// Max concurrent rpc requests allowed + max_concurent_queries: Option, } impl SubstrateClient @@ -122,6 +126,7 @@ where signer, address, initial_height: latest_height, + max_concurent_queries: config.max_concurent_queries, }) } @@ -170,6 +175,7 @@ impl Clone for SubstrateClient { signer: self.signer.clone(), address: self.address.clone(), initial_height: self.initial_height, + max_concurent_queries: self.max_concurent_queries, } } } diff --git a/tesseract/substrate/src/provider.rs b/tesseract/substrate/src/provider.rs index e31ecde6a..00718f1da 100644 --- a/tesseract/substrate/src/provider.rs +++ b/tesseract/substrate/src/provider.rs @@ -584,7 +584,7 @@ where } fn max_concurrent_queries(&self) -> usize { - 50 + self.max_concurent_queries.unwrap_or(10) as usize } }