-
Notifications
You must be signed in to change notification settings - Fork 411
ChannelManager
Payment Retries
#1916
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
Merged
valentinewallace
merged 12 commits into
lightningdevkit:main
from
valentinewallace:2022-11-chanman-payment-retries
Jan 26, 2023
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
948ebc6
Copy PaymentAttempts from invoice module to outbound_payment module
valentinewallace cbb75e2
Copy Retry from invoice module to outbound_payment module
valentinewallace ae34533
Parameterize add_new_pending_payment with retry strategy and route pa…
valentinewallace c0a22f7
Store retry data in PendingOutboundPayment::Retryable
valentinewallace 6351a99
Decode onion fail outside of outbound_payments lock
valentinewallace 686ef08
Generate PendingHTLCsForwardable upon retryable payment
valentinewallace 72a7da8
Remove AllPathsFailed outbounds at send_payment_internal callsites in…
valentinewallace d776dee
Retry HTLCs in process_pending_htlc_forwards
valentinewallace acf9292
Support sending payments with a retry strategy in ChannelManager
valentinewallace 2f49c81
Test ChannelManager automatic retries
valentinewallace ad486a4
Payment retries: copy tests from InvoicePayer
valentinewallace 6d81979
Disambiguate send_payment_internal from pay_internal
valentinewallace File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Oops, something went wrong.
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.
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.
Should we have some reasonable default?
Retry::Attempts(0)
would mean no retries. In what situations would we hit this case?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.
We hit this while deserializing
ChannelManager
if a monitor has some htlcs that theChannelManager
forgot about due to being behind the monitor on shutdown, IIRC. Idea is that we never want to retry payments after restart, because the payments are probably stale anywayUh oh!
There was an error while loading. Please reload this page.
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 believe we chose not to retry after restart in
InvoicePayer
because we didn't want to have something else for the user to serialize. But now that the retry logic is inChannelManager
, that rational is no longer applicable. We can still use the no-retry behavior for older serializations, though.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.
Maybe it's a consideration for follow-up, but it does seem like payments would be stale after restart? And even if they weren't, it seems like the sanest default would be to not retry 🤔 I think the invoice payer differed a bit since it has a static retry strategy config, which we don't have here
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.
Restart might just be failing over to a new server, FWIW. Or maybe for mobile switching back and forth between apps?
I think we should at least decided what we'd like to happen to avoid unnecessary churn in the serialization format.
It was mostly because we didn't want to serialize it. If we serialized, the static strategy would have been serialized along with it, I'd imagine.
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.
Discussed offline, not gonna retry on startup due to some race conditions with
abandon_payment
(I'm forgetting the details..)