mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-07 23:38:00 +00:00
Fixed block response limit check (#9692)
* Fixed block response limit check * Fixed start block detection and added a test * Missing test
This commit is contained in:
@@ -62,7 +62,7 @@ pub fn generate_protocol_config(protocol_id: &ProtocolId) -> ProtocolConfig {
|
||||
name: generate_protocol_name(protocol_id).into(),
|
||||
max_request_size: 1024 * 1024,
|
||||
max_response_size: 16 * 1024 * 1024,
|
||||
request_timeout: Duration::from_secs(40),
|
||||
request_timeout: Duration::from_secs(20),
|
||||
inbound_queue: None,
|
||||
}
|
||||
}
|
||||
@@ -355,7 +355,8 @@ impl<B: BlockT> BlockRequestHandler<B> {
|
||||
indexed_body,
|
||||
};
|
||||
|
||||
total_size += block_data.body.len();
|
||||
total_size += block_data.body.iter().map(|ex| ex.len()).sum::<usize>();
|
||||
total_size += block_data.indexed_body.iter().map(|ex| ex.len()).sum::<usize>();
|
||||
blocks.push(block_data);
|
||||
|
||||
if blocks.len() >= max_blocks as usize || total_size > MAX_BODY_BYTES {
|
||||
|
||||
Reference in New Issue
Block a user