Skip to content

Commit ab331d5

Browse files
paritytech-release-backport-bot[bot]AndreiEresgui1117acatangiuEgorPopelyaev
authored
[stable2506] Backport #9912 (#10042)
Backport #9912 into `stable2506` from AndreiEres. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: Andrei Eres <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]> Co-authored-by: gui1117 <[email protected]> Co-authored-by: Adrian Catangiu <[email protected]> Co-authored-by: Egor_P <[email protected]>
1 parent 3c88ea3 commit ab331d5

File tree

7 files changed

+774
-48
lines changed

7 files changed

+774
-48
lines changed

Cargo.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

prdoc/pr_9912.prdoc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
title: '[WIP] Fix statement-store gossiping'
2+
doc:
3+
- audience: Node Dev
4+
description: |-
5+
Fixes gossiping and scalability issues in the statement-store networking:
6+
reduces traffic by propagating only recent statements, skips duplicate processing,
7+
and splits large batches to stay under MAX_STATEMENT_NOTIFICATION_SIZE.
8+
crates:
9+
- name: sc-network-statement
10+
bump: minor
11+
- name: sc-statement-store
12+
bump: minor
13+
- name: sp-statement-store
14+
bump: minor
15+
validate: false

substrate/client/network/statement/Cargo.toml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,15 @@ async-channel = { workspace = true }
2121
codec = { features = ["derive"], workspace = true, default-features = true }
2222
futures = { workspace = true }
2323
log = { workspace = true, default-features = true }
24-
prometheus-endpoint.default-features = true
25-
prometheus-endpoint.workspace = true
26-
sc-network-common.default-features = true
27-
sc-network-common.workspace = true
28-
sc-network-sync.default-features = true
29-
sc-network-sync.workspace = true
30-
sc-network-types.default-features = true
31-
sc-network-types.workspace = true
32-
sc-network.default-features = true
33-
sc-network.workspace = true
34-
sp-consensus.default-features = true
35-
sp-consensus.workspace = true
36-
sp-runtime.default-features = true
37-
sp-runtime.workspace = true
38-
sp-statement-store.default-features = true
39-
sp-statement-store.workspace = true
24+
prometheus-endpoint = { workspace = true, default-features = true }
25+
sc-network = { workspace = true, default-features = true }
26+
sc-network-common = { workspace = true, default-features = true }
27+
sc-network-sync = { workspace = true, default-features = true }
28+
sc-network-types = { workspace = true, default-features = true }
29+
sp-consensus = { workspace = true, default-features = true }
30+
sp-runtime = { workspace = true, default-features = true }
31+
sp-statement-store = { workspace = true, default-features = true }
32+
tokio = { workspace = true }
33+
34+
[dev-dependencies]
35+
async-trait = { workspace = true }

substrate/client/network/statement/src/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ use std::time;
2424
pub(crate) const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(1000);
2525

2626
/// Maximum number of known statement hashes to keep for a peer.
27-
pub(crate) const MAX_KNOWN_STATEMENTS: usize = 4 * 1024 * 1024;
27+
pub(crate) const MAX_KNOWN_STATEMENTS: usize = 4 * 1024 * 1024; // * 32 bytes for hash = 128 MB per peer
2828

2929
/// Maximum allowed size for a statement notification.
30-
pub(crate) const MAX_STATEMENT_SIZE: u64 = 256 * 1024;
30+
pub(crate) const MAX_STATEMENT_NOTIFICATION_SIZE: u64 = 1024 * 1024;
3131

3232
/// Maximum number of statement validation request we keep at any moment.
3333
pub(crate) const MAX_PENDING_STATEMENTS: usize = 2 * 1024 * 1024;

0 commit comments

Comments
 (0)