lightning
lightning copied to clipboard
introduce support for alternative addresses for peer connections
This PR introduces a new configuration parameter, alt_addr, which allows specifying an alternative address for peer connections.
Key Features
- Initial Connection: Upon connecting to a peer, if an
alt_addris specified, this address is communicated to the peer. - Reconnection: During reconnection attempts, the
alt_addris used to establish the connection. - Configuration Parameters: Added
alt-addr,alt-bind-addr, andalt-announce-addrfor managing alternative addresses. - Database Integration: Added fields to the database to store alternative addresses for peers.
- New RPC Command: Implemented command for managing alternative addresses in combination with
alt-bind-addrfor specific peers.
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.
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?
Oh, cool, yeah I hadn't made the connection right away. Thanks for sharing the description, it's much clearer now ☺️
I apologize that I am only reviewing this now. It needs significant rework to be included, and may not make this release.
I'm aware that this was a Summer of Bitcoin project, so I can make the changes myself.
Thanks for looking into it @rustyrussell , I understand that there now needs to be a lot of fixes to merge it and if it doesn't make it to the release it will hopefully make it to the next one.
I will try to answer all your questions