Add explicit limits to notifications sizes and adjust yamux buffer size (#7925)

* Add explicit limits to notifications sizes and adjust yamux buffer size

* Docfix

* Tests

* Document these 10 bytes
This commit is contained in:
Pierre Krieger
2021-01-19 12:00:37 +01:00
committed by GitHub
parent bb46f8ac30
commit 8e04515912
12 changed files with 125 additions and 51 deletions
+8 -5
View File
@@ -475,16 +475,19 @@ impl<B: BlockT, H: ExHashT> Protocol<B, H> {
best_hash,
genesis_hash,
).encode();
GenericProto::new(
protocol_id.clone(),
versions,
build_status_message::<B>(&config, best_number, best_hash, genesis_hash),
peerset,
iter::once((block_announces_protocol, block_announces_handshake))
.chain(iter::once((transactions_protocol, vec![])))
.chain(network_config.extra_sets.iter()
.map(|s| (s.notifications_protocol.clone(), handshake_message.clone()))
),
iter::once((block_announces_protocol, block_announces_handshake, 1024 * 1024))
.chain(iter::once((transactions_protocol, vec![], 1024 * 1024)))
.chain(network_config.extra_sets.iter().map(|s| (
s.notifications_protocol.clone(),
handshake_message.clone(),
s.max_notification_size
))),
)
};