-
Notifications
You must be signed in to change notification settings - Fork 269
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2092ead
to
0c9b78c
Compare
eclair-core/src/main/scala/fr/acinq/eclair/db/pg/PgPeersDb.scala
Outdated
Show resolved
Hide resolved
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
ad482dc
to
aacfecc
Compare
pm47
reviewed
Feb 12, 2025
There was a problem hiding this 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
eclair-core/src/main/scala/fr/acinq/eclair/db/pg/PgPeersDb.scala
Outdated
Show resolved
Hide resolved
pm47
reviewed
Feb 12, 2025
pm47
approved these changes
Feb 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.