Refresh expired mining candidates on request - #2478
Open
a-shannon wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reopens #2443 against
v6.0.7. GitHub closed the original PR automatically when itsv6.0.4base branch was deleted.Problem
Candidate expiry is checked while handling
ChangedMempool, but a mempool change can arrive beforeblockCandidateGenerationIntervalelapses. In that case the reader is updated without regenerating. If the pool then stays unchanged, later non-forced mining requests can keep returning the expired candidate because the cache-hit path does not check its age.This can leave transactions already present in the node's mempool out of successive mining jobs beyond the configured refresh interval.
Fix
Validation
CandidateGeneratorSpec: 20/20 passed.MiningApiRouteSpec: 10/10 passed.ErgoMinerSpec: 5/5 passed.git diff --checkpassed onb8eb8f402.v6.0.7replay found no blocker or duplicate implementation.Scope
This patch does not change mempool ordering or candidate transaction-selection policy. It complements the regeneration work in #1363, #1412, #2164, and #2231 by enforcing candidate lifetime when a later non-forced request reads the cache.