bch(M5): drop evicted-then-arrived block from the download queue - #204
Merged
Conversation
expire() requeues a timed-out in-flight block to the FRONT of the pending queue and records it in m_evicted. If the (merely slow) peer then delivers that block, on_block_received bumped false_evict_count but left the hash in the queue -- so the next next_requests() drain re-getdata'd a block already in hand. Remove the hash from the queue on the false-evict path (linear scan; eviction is rare, healthy sync keeps false_evict at 0). A hash already re-issued sits in m_in_flight, not the queue, so the scan is a no-op there. Adds an evicted-then-arrived test pinning both legs: false_evict_count flags the premature eviction (distinct from a clean arrival) AND queued()==0 / a following drain is empty -- no re-download. Refreshes the stale header note that still claimed eviction was deferred (it is implemented and NodeP2P-driven). PURE block-download window plumbing; p2pool-merged-v36 surface NONE; per-coin isolation src/impl/bch/ only; header + test build-inert (bch skip-green).
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.
bch(M5): drop evicted-then-arrived block from the download queue
expire() requeues a timed-out in-flight block to the FRONT of the pending
queue and records it in m_evicted. If the (merely slow) peer then delivers
that block, on_block_received bumped false_evict_count but left the hash in
the queue -- so the next next_requests() drain re-getdata'd a block already
in hand. Remove the hash from the queue on the false-evict path (linear scan;
eviction is rare, healthy sync keeps false_evict at 0). A hash already
re-issued sits in m_in_flight, not the queue, so the scan is a no-op there.
Adds an evicted-then-arrived test pinning both legs: false_evict_count flags
the premature eviction (distinct from a clean arrival) AND queued()==0 / a
following drain is empty -- no re-download. Refreshes the stale header note
that still claimed eviction was deferred (it is implemented and NodeP2P-driven).
PURE block-download window plumbing; p2pool-merged-v36 surface NONE; per-coin
isolation src/impl/bch/ only; header + test build-inert (bch skip-green).