Skip to content
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

introduce support for alternative addresses for peer connections #7422

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

maxrantil
Copy link
Collaborator

@maxrantil maxrantil commented Jun 21, 2024

This PR introduces a new configuration parameter, alt_addr, which allows specifying an alternative address for peer connections.

Key Features

  1. Initial Connection: Upon connecting to a peer, if an alt_addr is specified, this address is communicated to the peer.
  2. Reconnection: During reconnection attempts, the alt_addr is used to establish the connection.
  3. Configuration Parameters: Added alt-addr, alt-bind-addr, and alt-announce-addr for managing alternative addresses.
  4. Database Integration: Added fields to the database to store alternative addresses for peers.
  5. New RPC Command: Implemented command for managing alternative addresses in combination with alt-bind-addr for specific peers.

@maxrantil maxrantil requested a review from cdecker as a code owner June 21, 2024 10:09
@maxrantil maxrantil marked this pull request as draft June 21, 2024 10:11
@cdecker
Copy link
Member

cdecker commented Jun 21, 2024

Thanks @maxrantil for the proposal. I read through the description, and I'm not sure I understand the rationale for this change. Is this intended as a way to say "hey, if we get disconnected, this is how you can reach me again", or is the intention something else?

Just thought I'd ask this before looking at the code itself, wanting to start with the right mental model.

@maxrantil
Copy link
Collaborator Author

maxrantil commented Jun 21, 2024

Hi @cdecker , as you might know, this project is part of Summer of Bitcoin and this is the project description:

The lightning network has regimes of public and private data. Public channels and nodes are announced with gossip, while channel activity is private between peers. A nodes connection address is disseminated with the public node announcement message, which is well suited for two peers initiating a connection for the first time. Peers with an established channel or history, may prefer to connect via an alternate address for privacy, reliability, or latency concerns. This project will add a new message to communicate a private alternative connection address, and then use that address when reconnecting to a peer who has provided it.

I think this answers your question, right?

@cdecker
Copy link
Member

cdecker commented Jun 21, 2024

Oh, cool, yeah I hadn't made the connection right away. Thanks for sharing the description, it's much clearer now ☺️

@rustyrussell rustyrussell added Highlight - Protocol Protocol and spec enhancements / implementation SoB Summer of Bitcoin project labels Jun 23, 2024
@maxrantil maxrantil force-pushed the max/alt-addr branch 4 times, most recently from f6bacf0 to 24018af Compare June 26, 2024 07:25
@maxrantil maxrantil changed the title WIP, add a new message to communicate a private alternative connection address WIP: add a new message to communicate a private alternative connection address Jun 26, 2024
@maxrantil maxrantil force-pushed the max/alt-addr branch 8 times, most recently from d212cd9 to 572a616 Compare June 29, 2024 12:30
@maxrantil maxrantil force-pushed the max/alt-addr branch 5 times, most recently from 821e28d to e461ad2 Compare July 5, 2024 09:14
@maxrantil maxrantil changed the title WIP: add a new message to communicate a private alternative connection address channeld: introduce support for alternative addresses for peer connections Jul 5, 2024
@maxrantil maxrantil force-pushed the max/alt-addr branch 3 times, most recently from aae893b to e6ff7da Compare July 5, 2024 10:02
@maxrantil maxrantil force-pushed the max/alt-addr branch 16 times, most recently from f803825 to b97dfbf Compare August 13, 2024 08:53
- Aswell as parameters alt-bind-addr and alt-announce-addr

Changelog-Added: Introduced the 'alt-addr' config parameter for specifying alternative addresses.

Signed-off-by: Max Rantil <[email protected]>
@maxrantil maxrantil force-pushed the max/alt-addr branch 4 times, most recently from ecc7b94 to 79d6eb8 Compare August 13, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Highlight - Protocol Protocol and spec enhancements / implementation SoB Summer of Bitcoin project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants