Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion PR for adding max notification sizes #2287

Merged
6 commits merged into from
Jan 19, 2021
Merged

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Jan 18, 2021

paritytech/substrate#7925

Adds an explicit maximum limit to the sizes of notifications that we can receive.

@tomaka tomaka added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes A4-companion A PR that needs a companion PR to merge in parallel for one of its downstream dependencies. C1-low PR touches the given topic and has a low impact on builders. labels Jan 18, 2021
@@ -36,9 +36,15 @@ impl PeerSet {
/// network service.
pub fn get_info(self) -> NonDefaultSetConfig {
let protocol = self.into_protocol_name();
let max_notification_size = match self {
PeerSet::Validation = 1024 * 1024,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went for 1MiB because pragmatically speaking that's the current limit, but it could be lower.

node/network/protocol/src/peer_set.rs Outdated Show resolved Hide resolved
node/network/protocol/src/peer_set.rs Outdated Show resolved Hide resolved
@@ -36,9 +36,17 @@ impl PeerSet {
/// network service.
pub fn get_info(self) -> NonDefaultSetConfig {
let protocol = self.into_protocol_name();
let max_notification_size = match self {
PeerSet::Validation => 1024 * 1024,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PoV are also sent on the ValidationProtocol, so message limits should be the same IMO

Copy link
Member

@eskimor eskimor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from rphmeier's comment, LGTM.

@ghost
Copy link

ghost commented Jan 19, 2021

Waiting for commit status.

@ghost ghost merged commit 036cf5e into master Jan 19, 2021
@ghost ghost deleted the tka-companion-notif-sizes branch January 19, 2021 11:27
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. A4-companion A PR that needs a companion PR to merge in parallel for one of its downstream dependencies. B0-silent Changes should not be mentioned in any release notes C1-low PR touches the given topic and has a low impact on builders.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants