Skip to content

Store remote features in PeersDb#2978

Merged
t-bast merged 4 commits intomasterfrom
store-remote-peer-features
Feb 12, 2025
Merged

Store remote features in PeersDb#2978
t-bast merged 4 commits intomasterfrom
store-remote-peer-features

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Jan 10, 2025

We only store information about our peers when we succeed in making an outgoing connection to them. The only information we stored was the address that we used when connecting. We now also store the features supported by our peer when we last connected to them.

It's important to note that this means that we previously didn't store peers that always connect to us (e.g. mobile wallet users that never have a stable address): we now store their features in our DB once we have a channel with them. For private peers that always connect to us, we will never store an address: it's their responsibility to connect back to us on disconnection.

@t-bast t-bast force-pushed the store-remote-peer-features branch from 2092ead to 0c9b78c Compare January 10, 2025 11:41
@t-bast t-bast marked this pull request as ready for review January 10, 2025 14:58
@t-bast t-bast requested review from pm47 and thomash-acinq January 10, 2025 15:00
@t-bast t-bast requested a review from thomash-acinq January 13, 2025 09:44
thomash-acinq
thomash-acinq previously approved these changes Jan 13, 2025
We only store information about our peers when we succeed in making an
outgoing connection to them. The only informaiton we stored was the
address that we used when connecting. We now also store the features
supported by our peer when we last connected to them.

It's important to note that this means that we currently don't store
peers that always connect to us (e.g. mobile wallet users that never
have a stable address): we will address that in the next commit.
Once we have a channel with a peer that connected to us, we store their
details in our DB. We don't store the address they're connecting from,
because we don't know if we will be able to connect to them using this
address, but we store their features.
- Use separate function when updating features only
- Remove DB write before channel ready for incoming connection
@t-bast t-bast force-pushed the store-remote-peer-features branch from ad482dc to aacfecc Compare January 30, 2025 15:23
Copy link
Member

@pm47 pm47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we insert/update:

  • the nodeAddress at each reconnection for outgoing peers
  • the initFeatures once when at the first channel creation, and then at each reconnection for peers with channels

@t-bast t-bast merged commit fb58d8c into master Feb 12, 2025
1 check passed
@t-bast t-bast deleted the store-remote-peer-features branch February 12, 2025 13:43
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.

3 participants