Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
3d1c62e
chore: initial statistics subsystem
EclesioMeloJunior Sep 8, 2025
c70e648
Merge branch 'master' into statistics-collector
EclesioMeloJunior Sep 9, 2025
4e8f90a
chore: account votes that approved candidate
EclesioMeloJunior Sep 9, 2025
0bc38d0
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Sep 9, 2025
a6feab9
chore: remove unneeded file
EclesioMeloJunior Sep 11, 2025
788bf44
Merge branch 'master' into statistics-collector
EclesioMeloJunior Sep 15, 2025
9f9d2f4
chore: add docs, get useful votes, change subsystem name
EclesioMeloJunior Sep 15, 2025
f4d1365
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Sep 15, 2025
8637ad7
chore: start getting chunks downloads metrics
EclesioMeloJunior Sep 17, 2025
0ee9a03
Merge branch 'master' into statistics-collector
EclesioMeloJunior Sep 17, 2025
8bae0a8
chore: include `handle_chunks_downloaded` per session and candidate
EclesioMeloJunior Sep 17, 2025
b7c47ac
address comments
EclesioMeloJunior Sep 18, 2025
d83075a
chore: revert changes in chunks.rs
EclesioMeloJunior Sep 19, 2025
2084903
Merge branch 'master' into statistics-collector
EclesioMeloJunior Sep 19, 2025
fac0526
Merge branch 'master' of github.com:paritytech/polkadot-sdk into stat…
EclesioMeloJunior Sep 19, 2025
803ae6d
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Sep 19, 2025
e4e00dc
chore: fix approval voting tests
EclesioMeloJunior Sep 24, 2025
a5dbccf
fix approval voting tests
EclesioMeloJunior Sep 25, 2025
4f77b87
chore: fixing approval tests
EclesioMeloJunior Sep 25, 2025
f9f4d71
chore: include tests for collectorstats subsytem
EclesioMeloJunior Sep 29, 2025
6282094
chore: include no-shows tests
EclesioMeloJunior Sep 30, 2025
c0f969d
include tests for chunks downloaded
EclesioMeloJunior Sep 30, 2025
b846ced
chore: wip using auth discovery to get peer authority id
EclesioMeloJunior Oct 2, 2025
92119bf
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 3, 2025
0b186a1
deprecate macro was failing to build in recent rust versions
EclesioMeloJunior Oct 3, 2025
2b2c4fa
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 3, 2025
7dfe19d
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 6, 2025
caea9a8
feat: collect upload metrics
EclesioMeloJunior Oct 6, 2025
e6dcf11
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 6, 2025
6b7504c
chore: finish handle_chunk_upload
EclesioMeloJunior Oct 7, 2025
ea150e1
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 8, 2025
796f044
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 8, 2025
9ae0211
chore: including prunning based on block finalisation
EclesioMeloJunior Oct 15, 2025
63e379d
chore: include tests for uploaded chunk
EclesioMeloJunior Oct 15, 2025
848ba5a
chore: remove unnecessary mapping
EclesioMeloJunior Oct 15, 2025
23c0512
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 16, 2025
00c661f
chore: prune when session is finalized
EclesioMeloJunior Oct 16, 2025
e25e99a
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 16, 2025
564e0e5
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 17, 2025
bbab27b
chore: fix tests
EclesioMeloJunior Oct 17, 2025
2dae7cb
chore: improve metrics collection
EclesioMeloJunior Oct 20, 2025
554cd6e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 20, 2025
aa00e1b
chore: testing pruning capabilities
EclesioMeloJunior Oct 20, 2025
3d3686e
chore: assert collected stats for pruned are discarded
EclesioMeloJunior Oct 20, 2025
3ebd9c6
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 21, 2025
27d8061
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 21, 2025
ec2d55d
chore: include zombienet happy-path test
EclesioMeloJunior Oct 22, 2025
91230d2
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 22, 2025
f3bc3d9
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 24, 2025
0994734
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 27, 2025
e90fb75
addressing comments
EclesioMeloJunior Oct 28, 2025
5e33f9a
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 28, 2025
7671486
chore: implemented new pruning based on finalized blocks
EclesioMeloJunior Oct 28, 2025
e2e7b80
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 28, 2025
e986951
chore: aggregate on tallies
EclesioMeloJunior Oct 29, 2025
0a82d3f
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 29, 2025
4dc3efb
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 29, 2025
2016c0c
chore: including on bench + debug logs for session collected stats
EclesioMeloJunior Oct 30, 2025
569176b
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Oct 30, 2025
2161ced
make per validator prometheus metrics optional
EclesioMeloJunior Oct 30, 2025
496c7ed
Merge branch 'master' into statistics-collector
EclesioMeloJunior Oct 30, 2025
ebc2f2e
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 1, 2025
5d6a592
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 3, 2025
880feab
chore: make publish_per_validator_approval_metrics a cli flag
EclesioMeloJunior Nov 3, 2025
5d59954
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 4, 2025
5c166d3
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 5, 2025
67a9cb3
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 6, 2025
87b3ccc
chore: renaming subsystem
EclesioMeloJunior Nov 10, 2025
55da39e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Nov 10, 2025
8aecc01
chore: including approval stats submission
EclesioMeloJunior Nov 11, 2025
e3f757f
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 12, 2025
299d442
chore: starting onchain impl
EclesioMeloJunior Nov 17, 2025
e27fc23
chore: remove onchain impl
EclesioMeloJunior Nov 17, 2025
49f783e
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Nov 17, 2025
f5352e2
chore: addressing comments
EclesioMeloJunior Nov 19, 2025
28ce1ef
chore: addressing comments
EclesioMeloJunior Nov 19, 2025
cbdc2bc
chore: removing unused imports
EclesioMeloJunior Nov 19, 2025
88596c2
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 19, 2025
9ffa52c
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 19, 2025
91305d9
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 24, 2025
f339452
chore: fix `pre_covers_dont_stall_approval` test
EclesioMeloJunior Nov 24, 2025
96494b5
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Nov 24, 2025
9a37b2a
chore: solved zombienet tests
EclesioMeloJunior Nov 25, 2025
34e74fc
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 25, 2025
ea5eeae
chore: include rewards-statistics-collector on benchmark
EclesioMeloJunior Nov 25, 2025
7b83139
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 25, 2025
d26b8d5
Merge branch 'statistics-collector' of github.com:ChainSafe/polkadot-…
EclesioMeloJunior Nov 25, 2025
963ecb5
Merge branch 'master' into statistics-collector
EclesioMeloJunior Nov 26, 2025
200e615
Merge branch 'master' into statistics-collector
EclesioMeloJunior Dec 1, 2025
196ccf7
Merge branch 'statistics-collector' into stats-collector-on-chain
EclesioMeloJunior Dec 1, 2025
66f7d4d
chore: remove charts
EclesioMeloJunior Dec 1, 2025
c545ef4
chore: working on approvals rewards parachain host pallet
EclesioMeloJunior Dec 5, 2025
bf6dd3b
chore small changes
EclesioMeloJunior Dec 8, 2025
32681d1
chore: include benchmarks
EclesioMeloJunior Dec 10, 2025
c526ef1
Merge branch 'master' into stats-collector-on-chain
EclesioMeloJunior Dec 10, 2025
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
78 changes: 68 additions & 10 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ members = [
"polkadot/node/core/dispute-coordinator",
"polkadot/node/core/parachains-inherent",
"polkadot/node/core/prospective-parachains",
"polkadot/node/core/rewards-statistics-collector",
"polkadot/node/core/provisioner",
"polkadot/node/core/pvf",
"polkadot/node/core/pvf-checker",
Expand Down Expand Up @@ -1139,6 +1140,7 @@ polkadot-node-core-chain-selection = { path = "polkadot/node/core/chain-selectio
polkadot-node-core-dispute-coordinator = { path = "polkadot/node/core/dispute-coordinator", default-features = false }
polkadot-node-core-parachains-inherent = { path = "polkadot/node/core/parachains-inherent", default-features = false }
polkadot-node-core-prospective-parachains = { path = "polkadot/node/core/prospective-parachains", default-features = false }
polkadot-node-core-rewards-statistics-collector = { path = "polkadot/node/core/rewards-statistics-collector", default-features = false }
polkadot-node-core-provisioner = { path = "polkadot/node/core/provisioner", default-features = false }
polkadot-node-core-pvf = { path = "polkadot/node/core/pvf", default-features = false }
polkadot-node-core-pvf-checker = { path = "polkadot/node/core/pvf-checker", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions cumulus/client/relay-chain-inprocess-interface/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,7 @@ fn build_polkadot_full_node(
keep_finalized_for: None,
invulnerable_ah_collators: HashSet::new(),
collator_protocol_hold_off: None,
verbose_approval_metrics: false,
};

let (relay_chain_full_node, paranode_req_receiver) = match config.network.network_backend {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,18 @@ impl RuntimeApiSubsystemClient for BlockChainRpcClient {
.await?)
}

async fn submit_approval_statistics(
&self,
at: Hash,
payload: polkadot_primitives::vstaging::ApprovalStatistics,
signature: polkadot_primitives::ValidatorSignature,
) -> Result<(), sp_api::ApiError> {
Ok(self
.rpc_client
.parachain_host_submit_approval_statistics(at, payload, signature)
.await?)
}

async fn pvfs_require_precheck(
&self,
at: Hash,
Expand Down
16 changes: 16 additions & 0 deletions cumulus/client/relay-chain-rpc-interface/src/rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ use sp_version::RuntimeVersion;

use crate::{metrics::RelaychainRpcMetrics, reconnecting_ws_client::ReconnectingWebsocketWorker};
pub use url::Url;
use cumulus_primitives_core::relay_chain::vstaging::ApprovalStatistics;

const LOG_TARGET: &str = "relay-chain-rpc-client";
const NOTIFICATION_CHANNEL_SIZE_LIMIT: usize = 20;
Expand Down Expand Up @@ -261,6 +262,21 @@ impl RelayChainRpcClient {
.await
}

/// Submits approval voting rewards statistics into the transaction pool.
pub async fn parachain_host_submit_approval_statistics(
&self,
at: RelayHash,
payload: ApprovalStatistics,
signature: ValidatorSignature,
) -> Result<(), RelayChainError> {
self.call_remote_runtime_function(
"ParachainHost_submit_approval_statistics",
at,
Some((payload, signature)),
)
.await
}

/// Get system health information
pub async fn system_health(&self) -> Result<Health, RelayChainError> {
self.request("system_health", rpc_params![]).await
Expand Down
9 changes: 9 additions & 0 deletions cumulus/zombienet/zombienet-sdk-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,3 +552,12 @@ pub async fn wait_for_runtime_upgrade(

Err(anyhow!("Did not find a runtime upgrade"))
}

pub fn report_label_with_attributes(label: &str, attributes: Vec<(&str, &str)>) -> String {
let mut attrs: Vec<String> = vec![];
for (k, v) in attributes {
attrs.push(format!("{}=\"{}\"", k, v));
}
let final_attrs = attrs.join(",");
format!("{label}{{{final_attrs}}}")
}
5 changes: 5 additions & 0 deletions polkadot/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ pub struct RunCmd {
/// **Dangerous!** Do not touch unless explicitly advised to.
#[arg(long, hide = true)]
pub collator_protocol_hold_off: Option<u64>,

/// Enable or disable per validator collected approvals metrics
/// to be published to prometheus. If not specified, set to false.
#[arg(long)]
pub verbose_approval_metrics: Option<bool>,
}

#[allow(missing_docs)]
Expand Down
4 changes: 4 additions & 0 deletions polkadot/cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ where
telemetry_worker_handle: None,
node_version,
secure_validator_mode,
verbose_approval_metrics: cli
.run
.verbose_approval_metrics
.unwrap_or(false),
workers_path: cli.run.workers_path,
workers_names: None,
overseer_gen,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ fn main() -> Result<(), String> {
("Sent to peers", 63995.2200, 0.01),
]));
messages.extend(average_usage.check_cpu_usage(&[("approval-voting-parallel", 12.3817, 0.1)]));
messages.extend(average_usage.check_cpu_usage(&[("rewards-statistics-collector", 12.3817, 0.1)]));


if messages.is_empty() {
Ok(())
Expand Down
5 changes: 3 additions & 2 deletions polkadot/node/core/approval-voting/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ use crate::{
};

use polkadot_node_primitives::approval::time::{slot_number_to_tick, Tick};

use polkadot_node_subsystem::messages::RewardsStatisticsCollectorMessage;
use super::{State, LOG_TARGET};

#[derive(Debug)]
Expand Down Expand Up @@ -337,7 +337,8 @@ pub struct BlockImportedCandidates {
pub(crate) async fn handle_new_head<
Sender: SubsystemSender<ChainApiMessage>
+ SubsystemSender<RuntimeApiMessage>
+ SubsystemSender<ChainSelectionMessage>,
+ SubsystemSender<ChainSelectionMessage>
+ SubsystemSender<RewardsStatisticsCollectorMessage>,
AVSender: SubsystemSender<ApprovalDistributionMessage>,
B: Backend,
>(
Expand Down
Loading