Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/paritytech/polkadot-sdk i…
Browse files Browse the repository at this point in the history
…nto HEAD
  • Loading branch information
command-bot committed Oct 6, 2024
2 parents 746dd48 + ec73ea9 commit eaaa9ce
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 3 deletions.
4 changes: 3 additions & 1 deletion cumulus/parachains/chain-specs/people-polkadot.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"/dns/polkadot-people-connect-0.polkadot.io/tcp/30334/p2p/12D3KooWP7BoJ7nAF9QnsreN8Eft1yHNUhvhxFiQyKFEUePi9mu3",
"/dns/polkadot-people-connect-1.polkadot.io/tcp/30334/p2p/12D3KooWSSfWY3fTGJvGkuNUNBSNVCdLLNJnwkZSNQt7GCRYXu4o",
"/dns/polkadot-people-connect-0.polkadot.io/tcp/443/wss/p2p/12D3KooWP7BoJ7nAF9QnsreN8Eft1yHNUhvhxFiQyKFEUePi9mu3",
"/dns/polkadot-people-connect-1.polkadot.io/tcp/443/wss/p2p/12D3KooWSSfWY3fTGJvGkuNUNBSNVCdLLNJnwkZSNQt7GCRYXu4o"
"/dns/polkadot-people-connect-1.polkadot.io/tcp/443/wss/p2p/12D3KooWSSfWY3fTGJvGkuNUNBSNVCdLLNJnwkZSNQt7GCRYXu4o",
"/dns/people-polkadot-boot-ng.dwellir.com/tcp/443/wss/p2p/12D3KooWKMYu1L28TkDf1ooMW8D8PHcztLnjV3bausH9eiVTRUYN",
"/dns/people-polkadot-boot-ng.dwellir.com/tcp/30346/p2p/12D3KooWKMYu1L28TkDf1ooMW8D8PHcztLnjV3bausH9eiVTRUYN"
],
"telemetryEndpoints": null,
"protocolId": null,
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/dispute-coordinator/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2797,7 +2797,7 @@ fn participation_with_onchain_disabling_confirmed() {
})
.await;

handle_disabled_validators_queries(&mut virtual_overseer, vec![]).await;
handle_disabled_validators_queries(&mut virtual_overseer, vec![disabled_index]).await;
handle_approval_vote_request(&mut virtual_overseer, &candidate_hash, HashMap::new())
.await;
assert_eq!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport));
Expand Down
11 changes: 11 additions & 0 deletions prdoc/pr_5859.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
title: Add number of live peers available for requests

doc:
- audience: [Node Operator, Node Dev]
description: |
This PR adds a new metric for the number of live peers available for beefy requests.
The metric is exposed under the name `substrate_beefy_on_demand_live_peers`.

crates:
- name: sc-consensus-beefy
bump: minor
3 changes: 3 additions & 0 deletions prdoc/pr_5901.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
crates:
- name: polkadot-node-core-dispute-coordinator
bump: none
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::{
request_response::{Error, JustificationRequest, BEEFY_SYNC_LOG_TARGET},
},
justification::{decode_and_verify_finality_proof, BeefyVersionedFinalityProof},
metric_inc,
metric_inc, metric_set,
metrics::{register_metrics, OnDemandOutgoingRequestsMetrics},
KnownPeers,
};
Expand Down Expand Up @@ -242,6 +242,8 @@ impl<B: Block, AuthorityId: AuthorityIdBound> OnDemandJustificationsEngine<B, Au
// meaning we're done with current state. Move the engine to `State::Idle`.
self.state = State::Idle;

metric_set!(self.metrics, beefy_on_demand_live_peers, self.live_peers.lock().len() as u64);

let block = req_info.block;
match self.process_response(&peer, &req_info, resp) {
Err(err) => {
Expand Down
9 changes: 9 additions & 0 deletions substrate/client/consensus/beefy/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ pub struct OnDemandOutgoingRequestsMetrics {
pub beefy_on_demand_justification_invalid_proof: Counter<U64>,
/// Number of on-demand justification good proof
pub beefy_on_demand_justification_good_proof: Counter<U64>,
/// Number of live beefy peers available for requests.
pub beefy_on_demand_live_peers: Gauge<U64>,
}

impl PrometheusRegister for OnDemandOutgoingRequestsMetrics {
Expand Down Expand Up @@ -277,6 +279,13 @@ impl PrometheusRegister for OnDemandOutgoingRequestsMetrics {
)?,
registry,
)?,
beefy_on_demand_live_peers: register(
Gauge::new(
"substrate_beefy_on_demand_live_peers",
"Number of live beefy peers available for requests.",
)?,
registry,
)?,
})
}
}
Expand Down

0 comments on commit eaaa9ce

Please sign in to comment.