Skip to content

client: get client IP from daemon in disconnect command#3341

Draft
snormore wants to merge 1 commit intomainfrom
snor/disconnect-client-ip-from-daemon
Draft

client: get client IP from daemon in disconnect command#3341
snormore wants to merge 1 commit intomainfrom
snor/disconnect-client-ip-from-daemon

Conversation

@snormore
Copy link
Contributor

@snormore snormore commented Mar 22, 2026

Summary

  • Get client IP from the daemon's /v2/status endpoint in the disconnect command, matching connect's behavior
  • Extract resolve_client_ip() into a testable method with unit tests covering valid IP, empty IP, invalid IP, and daemon-unreachable cases
  • Remove deprecated --client-ip flag from doublezero connect/disconnect invocations in e2e tests
  • Move now-unused look_for_ip helpers behind #[cfg(test)] to fix clippy dead-code warnings
  • Follow-up to client: add onchain reconciler to daemon #3034 which moved connect to get the client IP from the daemon but didn't include the same change for disconnect

Testing Verification

  • resolve_client_ip unit tests cover all error branches (empty, invalid, unreachable) and the happy path
  • All 82 existing doublezero crate tests pass
  • E2e tests compile cleanly with --client-ip removed from connect/disconnect invocations

@snormore snormore force-pushed the snor/disconnect-client-ip-from-daemon branch 2 times, most recently from e27107f to f735034 Compare March 22, 2026 22:19
Match the connect command's behavior by getting the client IP from the
daemon instead of discovering it locally. This avoids mismatches when
the daemon has a different view of the public IP (e.g. behind NAT).

Extract resolve_client_ip() into a testable method and add unit tests
for valid IP, empty IP, invalid IP, and daemon-unreachable cases. Move
now-unused look_for_ip helpers behind #[cfg(test)]. Remove deprecated
--client-ip from connect/disconnect invocations in e2e tests.
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.

1 participant