Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions prdoc/pr_9912.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
title: '[WIP] Fix statement-store gossiping'
doc:
- audience: Node Dev
description: |-
Fixes gossiping and scalability issues in the statement-store networking:
reduces traffic by propagating only recent statements, skips duplicate processing,
and splits large batches to stay under MAX_STATEMENT_NOTIFICATION_SIZE.
crates:
- name: sc-network-statement
bump: minor
- name: sc-statement-store
bump: minor
- name: sp-statement-store
bump: minor
15 changes: 15 additions & 0 deletions substrate/client/network/statement/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ async-channel = { workspace = true }
codec = { features = ["derive"], workspace = true, default-features = true }
futures = { workspace = true }
log = { workspace = true, default-features = true }
<<<<<<< HEAD
prometheus-endpoint.default-features = true
prometheus-endpoint.workspace = true
sc-network.default-features = true
Expand All @@ -37,3 +38,17 @@ sp-runtime.default-features = true
sp-runtime.workspace = true
sp-statement-store.default-features = true
sp-statement-store.workspace = true
=======
prometheus-endpoint = { workspace = true, default-features = true }
sc-network = { workspace = true, default-features = true }
sc-network-common = { workspace = true, default-features = true }
sc-network-sync = { workspace = true, default-features = true }
sc-network-types = { workspace = true, default-features = true }
sp-consensus = { workspace = true, default-features = true }
sp-runtime = { workspace = true, default-features = true }
sp-statement-store = { workspace = true, default-features = true }
tokio = { workspace = true }

[dev-dependencies]
async-trait = { workspace = true }
>>>>>>> b21cbb58 (Improve statement-store gossiping performance (#9912))
6 changes: 5 additions & 1 deletion substrate/client/network/statement/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,14 @@ use std::time;
pub(crate) const PROPAGATE_TIMEOUT: time::Duration = time::Duration::from_millis(1000);

/// Maximum number of known statement hashes to keep for a peer.
<<<<<<< HEAD
pub(crate) const MAX_KNOWN_STATEMENTS: usize = 10240;
=======
pub(crate) const MAX_KNOWN_STATEMENTS: usize = 4 * 1024 * 1024; // * 32 bytes for hash = 128 MB per peer
>>>>>>> b21cbb58 (Improve statement-store gossiping performance (#9912))

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

/// Maximum number of statement validation request we keep at any moment.
pub(crate) const MAX_PENDING_STATEMENTS: usize = 8192;
Loading
Loading