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.
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
Small Offers Fixes #2881
Small Offers Fixes #2881
Changes from all commits
98340dc
b290336
29984a7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Perhaps this just needs more clarification in the commit message, but why isn't this required in the
OffersMessageHandler
implementation? I might just not have a full grasp of the issue.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.
Hmm, I think we're okay. There's two cases where we care about the persistence-guard - (a) when we changed the
ChannelManager
and we need to write a fresh copy to disk, (b) when we have a new message that we need to send a peer, but only if its not a response (in which case the socket handler will prod thePeerManager
for us).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.
Somewhat related: I was chatting with @tnull about adding an
InvoiceSent
event to help with LDK Node managing inbound payments. We create the invoice in theOffersMessageHandler
implementation, but we don't send it until it goes through theOnionMessenger
. By the time thePeerManager
sends it, the invoice is no longer accessible as it's inside theOnionMessage
. Wondering what the best strategy would be for generating such an event?ChannelManager
before it is actually sent (thus needing persistence here)OnionMessenger
, which we avoided forConnectionNeeded
(but event not persisted then)PeerManager
by pairing theOnionMessage
with the (cloned)Bolt12Invoice
payload (same, not persisted)Seems like the options aren't that great. Any other alternatives?
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.
I think probably this? We can wake without persistence now, which IIRC will also see events.
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.
Might be a bit better to put this after all the potential error paths/right before we push into
self.pending_offers_messages
, but that's a very minor optimization.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.
Yea, not sure it matters much and it reads simpler here, less chance we add something and forget to move the persistence lock.