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

fix compile with new compiler - dead code #4530

Merged
merged 4 commits into from
Dec 15, 2021
Merged
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
11 changes: 11 additions & 0 deletions node/core/dispute-coordinator/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ use polkadot_node_subsystem_util::metrics::{self, prometheus};
#[derive(Clone)]
struct MetricsInner {
/// Number of opened disputes.
#[cfg(feature = "disputes")]
Copy link
Contributor

Choose a reason for hiding this comment

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

More stuff to remove when we get rid of the feature gate :P

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, ...

open: prometheus::Counter<prometheus::U64>,
/// Votes of all disputes.
#[cfg(feature = "disputes")]
votes: prometheus::CounterVec<prometheus::U64>,
/// Conclusion across all disputes.
#[cfg(feature = "disputes")]
concluded: prometheus::CounterVec<prometheus::U64>,
/// Number of participations that have been queued.
#[cfg(feature = "disputes")]
queued_participations: prometheus::CounterVec<prometheus::U64>,
}

Expand Down Expand Up @@ -78,6 +82,13 @@ impl Metrics {
}

impl metrics::Metrics for Metrics {
#[cfg(not(feature = "disputes"))]
fn try_register(_registry: &prometheus::Registry) -> Result<Self, prometheus::PrometheusError> {
let metrics = MetricsInner {};
Ok(Metrics(Some(metrics)))
}

#[cfg(feature = "disputes")]
fn try_register(registry: &prometheus::Registry) -> Result<Self, prometheus::PrometheusError> {
let metrics = MetricsInner {
open: prometheus::register(
Expand Down
3 changes: 1 addition & 2 deletions node/malus/src/variants/suggest_garbage_candidate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ struct ReplacePoVBytes<Sender>
where
Sender: Send,
{
keystore: SyncCryptoStorePtr,
queue: metered::UnboundedMeteredSender<(Sender, Hash, CandidateReceipt)>,
}

Expand Down Expand Up @@ -112,7 +111,7 @@ impl OverseerGen for SuggestGarbageCandidate {
let (sink, source) = metered::unbounded();
let keystore = args.keystore.clone() as SyncCryptoStorePtr;

let filter = ReplacePoVBytes { keystore: keystore.clone(), queue: sink };
let filter = ReplacePoVBytes { queue: sink };

let keystore2 = keystore.clone();
let spawner2 = spawner.clone();
Expand Down
2 changes: 2 additions & 0 deletions utils/staking-miner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,12 @@ struct MonitorConfig {
#[derive(Debug, Clone, StructOpt)]
struct EmergencySolutionConfig {
/// The block hash at which scraping happens. If none is provided, the latest head is used.
#[allow(dead_code)]
#[structopt(long)]
at: Option<Hash>,

/// The solver algorithm to use.
#[allow(dead_code)]
Copy link
Member

Choose a reason for hiding this comment

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

if unused should be removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, but this would change public API, hence we can't remove it like that without risking breakage.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unless there is a decision before CI passes, let's make this a follow-up and avoid any further friction for people getting red CI tests and the goto fix merge master doesn't cut it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

ack, thanks for the ping @ordian.

#[structopt(subcommand)]
solver: Solvers,

Expand Down