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

[feature]: add a default value for timeout_seconds in SendPaymentV2 routerrpc.SendPaymentRequest #9282

Open
ZZiigguurraatt opened this issue Nov 19, 2024 · 5 comments · May be fixed by #9359
Assignees
Labels
enhancement Improvements to existing features / behaviour good first issue Issues suitable for first time contributors to LND payments Related to invoices/payments
Milestone

Comments

@ZZiigguurraatt
Copy link

I propose that in the SendPaymentV2 RPC call's routerrpc.SendPaymentRequest that we change the timeout_seconds to have a default value of 60 seconds. Right now, there is no default, so the RPC call results in an error if that field is not populated. Is there a technical reason that timeout_seconds has no default value?

Also, the API docs say timeout_seconds is

An upper limit on the amount of time we should spend when
attempting to fulfill the payment. This is expressed in seconds.
If we cannot make a successful payment within this time
frame, an error will be returned. This field must be non-zero.

However, is this really an "upper limit" if a node along the route stalls for a while during the last payment attempt? Seems like it is more like the time in which the last HTCL will be initiated?

@ZZiigguurraatt ZZiigguurraatt added the enhancement Improvements to existing features / behaviour label Nov 19, 2024
@ziggie1984 ziggie1984 added payments Related to invoices/payments good first issue Issues suitable for first time contributors to LND labels Nov 19, 2024
@kelvinator07
Copy link

@ZZiigguurraatt @ziggie1984 I'd like to work on this issue.

@NishantBansal2003
Copy link

NishantBansal2003 commented Dec 14, 2024

I am not entirely sure if tests are required for this change since it primarily involves setting a default value for timeout_seconds. However, if you feel that tests are necessary to validate this update, I can research further and write the necessary test cases to ensure the functionality is well-covered.
Please let me know your thoughts or if you have any specific suggestions for tests that would be valuable here.
PR: #9359

@hieblmi
Copy link
Collaborator

hieblmi commented Dec 16, 2024

However, is this really an "upper limit" if a node along the route stalls for a while during the last payment attempt? Seems like it is more like the time in which the last HTCL will be initiated?

Yes, this should be clarified. Something like ...is the time up until new payment attempts are submitted. If the timeout is reached, an ongoing payment attempt with pending htlcs might still be in flight. The SendPaymentV2 call however will return.

I wonder if it should be a recommendation to check the status of the payment for pending htlcs to figure out if there is a dangling payment attempt.

@saubyk
Copy link
Collaborator

saubyk commented Dec 16, 2024

Hi @NishantBansal2003 strictly for future reference...

If the issue is already assigned to another contributor, it's a common courtesy to ask for their permission before submitting a pr or taking over the issue. You can just post a comment on the issue showing your intent to submit a pr.

@NishantBansal2003
Copy link

Hi @NishantBansal2003 strictly for future reference...

If the issue is already assigned to another contributor, it's a common courtesy to ask for their permission before submitting a pr or taking over the issue. You can just post a comment on the issue showing your intent to submit a pr.

Thank you for pointing this out. My apologies for not seeking permission in this case. Since the issue was marked as gfi and had been inactive for over a month, I assumed it was fine to proceed. I’ll be sure to follow this etiquette moving forward. Appreciate your guidance!

@saubyk saubyk added this to the v0.19.0 milestone Dec 19, 2024
@saubyk saubyk added this to lnd v0.19 Dec 19, 2024
@saubyk saubyk moved this to In Progress in lnd v0.19 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements to existing features / behaviour good first issue Issues suitable for first time contributors to LND payments Related to invoices/payments
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

6 participants