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:
Aaro Altonen
2023-04-07 11:20:17 +03:00
committed by GitHub
parent 23de70a536
commit e77099c1a6
6 changed files with 81 additions and 33 deletions
@@ -141,6 +141,13 @@ pub struct NetworkParams {
verbatim_doc_comment
)]
pub sync: SyncMode,
/// Maximum number of blocks per request.
///
/// Try reducing this number from the default value if you have a slow network connection
/// and observe block requests timing out.
#[arg(long, value_name = "COUNT", default_value_t = 64)]
pub max_blocks_per_request: u32,
}
impl NetworkParams {
@@ -230,6 +237,7 @@ impl NetworkParams {
allow_private_ip,
},
max_parallel_downloads: self.max_parallel_downloads,
max_blocks_per_request: self.max_blocks_per_request,
enable_dht_random_walk: !self.reserved_only,
allow_non_globals_in_dht,
kademlia_disjoint_query_paths: self.kademlia_disjoint_query_paths,