Skip to content

Conversation

@fjl
Copy link
Contributor

@fjl fjl commented Oct 14, 2025

This fixes a regression introduced in #32518. In that PR, we removed the slowdown logic that would throttle lookups when the table runs empty. Said logic was originally added in #20389.

Usually it's fine, but there exist pathological cases, such as hive tests, where the node can only discover one other node, so it can only ever query that node and won't get any results. In cases like these, we need to throttle the creation of lookups to avoid crazy CPU usage.

@fjl fjl requested a review from zsfelfoldi as a code owner October 14, 2025 17:28
@fjl fjl force-pushed the p2p-discover-refresh-debounce branch from c6aa3fb to 3868d86 Compare October 14, 2025 17:28

now := time.Now()
diff := now.Sub(it.lastLookup)
it.lastLookup = now
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just nitpicking, but something like the following would be more precise:
defer func() { it.lastLookup = time.Now() }()

Anyway, the current one works as well for the scope here.

@fjl fjl merged commit 7c107c2 into ethereum:master Oct 15, 2025
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants