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

Store remote features in PeersDb #2978

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

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 thomash-acinq and pm47 January 10, 2025 15:00
@t-bast t-bast requested a review from thomash-acinq January 13, 2025 09:44
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
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