mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Make blocks per request configurable (#13824)
* Make blocks per request configurable * Correct type * Update docs * Update client/cli/src/params/network_params.rs
This commit is contained in:
@@ -264,6 +264,14 @@ where
|
||||
SyncOperationMode::Warp => SyncMode::Warp,
|
||||
};
|
||||
let max_parallel_downloads = network_config.max_parallel_downloads;
|
||||
let max_blocks_per_request = if network_config.max_blocks_per_request >
|
||||
crate::MAX_BLOCKS_IN_RESPONSE as u32
|
||||
{
|
||||
log::info!(target: "sync", "clamping maximum blocks per request to {}", crate::MAX_BLOCKS_IN_RESPONSE);
|
||||
crate::MAX_BLOCKS_IN_RESPONSE as u32
|
||||
} else {
|
||||
network_config.max_blocks_per_request
|
||||
};
|
||||
let cache_capacity = NonZeroUsize::new(
|
||||
(network_config.default_peers_set.in_peers as usize +
|
||||
network_config.default_peers_set.out_peers as usize)
|
||||
@@ -318,6 +326,7 @@ where
|
||||
roles,
|
||||
block_announce_validator,
|
||||
max_parallel_downloads,
|
||||
max_blocks_per_request,
|
||||
warp_sync_params,
|
||||
metrics_registry,
|
||||
network_service.clone(),
|
||||
|
||||
Reference in New Issue
Block a user