You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Such submissions are failing because the miner checks the queue once (which is empty), and then computes a solution for 20 seconds, and then submits it, assuming that the queue is still empty. It should check one last time, after the mining is finish, if the anything exists in the queue or not.
The root cause of this is that the current code requires a full ext to check the queue:
And the ext that we are accessing is simply outdated, because it was fetched some 20 seconds ago.
The way to solve this is to:
rewrite ensure_no_previous_solution such that it directly query the chain state, not requiring an ext, so that we can be sure that no other solution from us lives in the queue.
add ensure_no_better_solution that works in the same manner, but checks that no better solution exists in the queue.
add a configuration enum to configure what we should do about the second check if it does NOT pass, because we might still want to be greedy and submit anyways, even though a better solution is queued. The most simple reason for this could be because we believe the the claimed better solution is fake.
enumSubmissionStrategy{/// Only submit if at the time, we are the best.OnlySubmitIfLeading,// Always submit. AlwaysSubmit,/// Submit if we are leading, or if the solution that's leading is more that the given `Perbill`/// better than us. This helps detect obviously fake solutions and still combat them.SubmitIfClaimBetterThan(Perbill)}
Such submissions are failing because the miner checks the queue once (which is empty), and then computes a solution for 20 seconds, and then submits it, assuming that the queue is still empty. It should check one last time, after the mining is finish, if the anything exists in the queue or not.
The root cause of this is that the current code requires a full
extto check the queue:polkadot/utils/staking-miner/src/monitor.rs
Line 49 in 0a86997
And the
extthat we are accessing is simply outdated, because it was fetched some 20 seconds ago.The way to solve this is to:
ensure_no_previous_solutionsuch that it directly query the chain state, not requiring an ext, so that we can be sure that no other solution from us lives in the queue.ensure_no_better_solutionthat works in the same manner, but checks that no better solution exists in the queue.