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

Commit

Permalink
staking miner: remove needless queue check (#6221)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
niklasad1 authored Nov 8, 2022
1 parent b19973c commit ee1a034
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion utils/staking-miner/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ enum Error<T: EPM::Config> {
AlreadySubmitted,
VersionMismatch,
StrategyNotSatisfied,
QueueFull,
Other(String),
}

Expand Down
5 changes: 2 additions & 3 deletions utils/staking-miner/src/monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ async fn ensure_strategy_met<T: EPM::Config, B: BlockT>(
.map_err::<Error<T>, _>(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::<T>::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.
Expand Down

0 comments on commit ee1a034

Please sign in to comment.