fix(p2p/discover): return nil when v4 resolve cannot refresh node#2428
fix(p2p/discover): return nil when v4 resolve cannot refresh node#2428gzliudan wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR restores expected endpoint-resolution semantics in Discovery v4 by making UDPv4.Resolve return nil when a node cannot be resolved, allowing the dial scheduler’s backoff logic to correctly treat unresolved nodes as failures.
Changes:
- Change
UDPv4.Resolveto returnnil(instead of returning the input node) when resolution fails, including the “no secp256k1 key” case. - Update the
Resolvedoc comment to match the new behavior. - Add a regression test asserting
Resolvereturnsnilfor an unresolved node.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| p2p/discover/v4_udp.go | Restores Resolve failure semantics to return nil so dial backoff can detect unresolved nodes. |
| p2p/discover/v4_udp_test.go | Adds a regression test for Resolve returning nil on an unresolved node path. |
e82a54c to
b516558
Compare
Restore Resolve failure semantics to return nil so dial backoff can detect unresolved nodes correctly.\n\nAdd a regression test covering unresolved ENR refresh paths.
b516558 to
8a56826
Compare
Proposed changes
Restore Resolve failure semantics to return nil so dial backoff can detect unresolved nodes correctly.
Add a regression test covering unresolved ENR refresh paths.
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that