-
-
Notifications
You must be signed in to change notification settings - Fork 107
fix: propagate observed joiner address through connect #2090
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@iduartgomez This PR fixes issue #2087 (loopback address problem preventing SuccessfulPut delivery). All CI checks pass including six-peer-regression. Ready for review. Key changes:
This should unblock River - the root cause was nodes advertising 127.0.0.1 to remote peers. [AI-assisted - Claude] |
Agents (especially Codex) often write terse PR descriptions that list changes without explaining why. Added detailed section with: - Bad vs good examples using real PR #2090 as template - Key principles: explain problem, approach, reasoning - Instruction to review and improve descriptions before requesting review 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
6b1d260 to
ff92a60
Compare
|
@claude Please review |
|
Claude finished @sanity's task —— View job PR Review Complete
Review SummaryThis PR effectively solves the NAT/loopback address problem (#2087). The approach is clean and well-reasoned - letting the gateway observe and tag the real socket address from UDP traffic is the right solution. The code quality is good overall with one minor improvement opportunity. Strengths
Issues & SuggestionsCritical: Overwriting observed_addr field on every inbound messageLocation: The current code unconditionally sets if payload.observed_addr.is_none() {
payload.observed_addr = Some(remote_addr);
}Problem: This means any peer that relays a ConnectRequest can overwrite the observed address, not just the first hop (gateway). If a joiner sends through gateway G1, which sets the observed address to Current behavior seems correct for the single-request case, but consider this edge case:
Recommendation: The current code is actually fine for the common case. The check // Gateway tags the observed address on first hop. Subsequent relays
// preserve this value since observed_addr will already be Some(...).
if payload.observed_addr.is_none() {
payload.observed_addr = Some(remote_addr);
}Minor: Removed proactive connect logic without explanationLocation: The PR removes a 30-line block that proactively initiated connections when receiving messages from unconnected peers. This seems unrelated to the observed address fix. Questions:
Recommendation: If this removal is intentional and tested, it's fine. But the PR description doesn't mention this change. Consider adding a note explaining why proactive connects were removed. Code Quality: Field naming inconsistency fixedLocation: Good change: renaming Test Coverage: Good regression testLocation: The new test
This correctly validates the fix. Well done. Minor Suggestions
VerdictApprove with minor suggestion: Add the clarifying comment about gateway-only tagging to make the invariant explicit. The core fix is sound and well-tested. |
|
Merge queue run failed on test_three_node_network_connectivity (timeout); rerunning locally passed. Re-enqueuing. |
Agents (especially Codex) often write terse PR descriptions that list changes without explaining why. Added detailed section with: - Bad vs good examples using real PR #2090 as template - Key principles: explain problem, approach, reasoning - Instruction to review and improve descriptions before requesting review 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Testing