From e1ccb8499dfaa375e34e5531b14adfe52c1bc6a0 Mon Sep 17 00:00:00 2001 From: Niklas Adolfsson Date: Tue, 8 Nov 2022 17:19:48 +0100 Subject: [PATCH] staking miner: remove needless queue check (#6221) * staking miner: remove needless queue check If the queue is full and the "mined solution" is better than solutions in the queue according to the "strategy" then the solution with worse score will be kicked out from the queue. Thus, the check can be removed completly. * fix compile warns --- polkadot/utils/staking-miner/src/main.rs | 1 - polkadot/utils/staking-miner/src/monitor.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/polkadot/utils/staking-miner/src/main.rs b/polkadot/utils/staking-miner/src/main.rs index 6e5b534235..8c134874f2 100644 --- a/polkadot/utils/staking-miner/src/main.rs +++ b/polkadot/utils/staking-miner/src/main.rs @@ -253,7 +253,6 @@ enum Error { AlreadySubmitted, VersionMismatch, StrategyNotSatisfied, - QueueFull, Other(String), } diff --git a/polkadot/utils/staking-miner/src/monitor.rs b/polkadot/utils/staking-miner/src/monitor.rs index 0780ef881f..bfc075668e 100644 --- a/polkadot/utils/staking-miner/src/monitor.rs +++ b/polkadot/utils/staking-miner/src/monitor.rs @@ -120,9 +120,8 @@ async fn ensure_strategy_met( .map_err::, _>(Into::into)? .unwrap_or_default(); - // we check the queue here as well. Could be checked elsewhere. - if indices.len() as u32 >= max_submissions { - return Err(Error::::QueueFull) + if indices.len() >= max_submissions as usize { + log::debug!(target: LOG_TARGET, "The submissions queue is full"); } // default score is all zeros, any score is better than it.