Skip to content

Conversation

@sanity
Copy link
Collaborator

@sanity sanity commented Dec 2, 2025

Problem

Peers behind NAT don't know their own external address. When they subscribe to contracts or act as seeders, the protocol needs to properly handle this "unknown address" case.

Previous PRs #2174 and #2175 attempted to fix this but had CHANGES_REQUESTED from Nacho. This PR consolidates those changes for fresh review.

This Solution

Builds on PR #2191 (wire protocol cleanup) and adds:

Subscribe operation fixes:

  • Subscribers with PeerAddr::Unknown have their address filled in by the first recipient (gateway)
  • Gateway observes the real UDP source address and updates the subscriber's address

Seeding manager fixes:

  • SeedingManager tracks subscriber addresses properly
  • Handles the case where subscribers initially have unknown addresses
  • Address updates propagate correctly through subscription tree

Test updates:

  • live_tx tests updated for new address model
  • In-memory testing infrastructure updated for PeerAddr

Previous Feedback

Nacho's review on PRs #2174/#2175 requested changes. Key concerns:

  • [Need to review original feedback and address it here]

Testing

  • Pre-commit hooks pass (fmt, clippy)
  • Unit tests updated for new address model

Related

[AI-assisted - Claude]

Consolidates changes from PRs #2172, #2174, and #2175:

This builds on PR #2191 (wire protocol cleanup) and adds:
- Fix seeding/subscribe operations to handle PeerAddr::Unknown for NAT scenarios
- Gateway properly fills in observed addresses from packet source
- Improved subscriber address tracking in seeding manager
- Update live_tx and connection tests for new address model

NOTE: This PR requires review - previous PRs (#2174, #2175) had
CHANGES_REQUESTED from Nacho. Submitting consolidated changes for
fresh review.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@sanity sanity changed the title fix: NAT address handling in subscribe/seeding operations fix: NAT address handling in subscribe and seeding operations Dec 2, 2025
@sanity sanity changed the title fix: NAT address handling in subscribe and seeding operations fix: handle NAT address in subscribe and seeding operations Dec 2, 2025
@sanity
Copy link
Collaborator Author

sanity commented Dec 2, 2025

Closing in favor of new PR with rebased changes

@sanity sanity closed this Dec 2, 2025
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.

2 participants