p2p/enode: use per-source timeout in FairMix.Next#18046
Merged
anacrolix merged 2 commits intoDec 3, 2025
Merged
Conversation
Contributor
|
@Fibonacci747 any reason you didn't take teh whole diff from upstream? |
Contributor
Author
Now took whole diff |
Contributor
|
@Fibonacci747 what about the comments 😓 |
anacrolix
requested changes
Dec 2, 2025
Contributor
anacrolix
left a comment
There was a problem hiding this comment.
Fine to merge this when the comments are included
Contributor
Author
But comments are uncluded? you mean comments on line 222-223, 231-233? ethereum/go-ethereum@c0135a8 |
anacrolix
approved these changes
Dec 3, 2025
Contributor
|
I might have missed them in the follow up review, GitHub likes to jump the gun and show diffs of what changed rather than the full PR. Thanks for the contribution |
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.
This change fixes an issue where mixSource.timeout was initialized and mutated but never actually used to drive the timer in FairMix.Next. Previously the timer was based on the global m.timeout, so the per-source exponential backoff logic had no effect and the timeout field was effectively dead code. The fix moves timer creation after picking the source and bases it on source.timeout, resetting it to m.timeout on successful reads and halving it on timeouts. This matches the upstream intent (see go-ethereum PR #25962 ethereum/go-ethereum#25962 ) and restores per-source backoff, improving responsiveness when individual sources stall, while preserving the negative-timeout “completely fair” behavior.