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

[router] Use the invoice value for last-hop hint channel capacity #986

Merged

Conversation

TheBlueMatt
Copy link
Collaborator

If an invoice contains route hints, we should assume the channel
capacity is sufficient to route the invoice's value.

If an invoice contains route hints, we should assume the channel
capacity is sufficient to route the invoice's value.
@TheBlueMatt TheBlueMatt force-pushed the 2021-07-route-lasthop-value branch from f38b12d to 9169dfb Compare July 5, 2021 18:21
@codecov
Copy link

codecov bot commented Jul 5, 2021

Codecov Report

Merging #986 (9169dfb) into main (84967fa) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #986   +/-   ##
=======================================
  Coverage   90.73%   90.73%           
=======================================
  Files          60       60           
  Lines       30650    30650           
=======================================
  Hits        27811    27811           
  Misses       2839     2839           
Impacted Files Coverage Δ
lightning/src/routing/router.rs 96.06% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 84967fa...9169dfb. Read the comment docs.

@naumenkogs
Copy link
Contributor

If an invoice contains route hints, we should assume the channel capacity is sufficient to route the invoice's value.

It seems like this patch changes nothing at all (at least for now)?


We can also add asserts e.g. htlc_maximum_msat >= final_value_msat.

@TheBlueMatt
Copy link
Collaborator Author

It seems like this patch changes nothing at all (at least for now)?

No - if you go to send a payment from an invoice that has route hints on it, we'll currently assume that the last-hop channel can only route 0.0025 BTC, even if we're trying to pay more than that. This causes us to fail to find a route, since we assume that each last-hop channel can only route 0.0025 BTC. Instead, here, we assume that each last-hop can handle the full value of the payment, which is maybe also not true, but better than just entirely failing.

@naumenkogs
Copy link
Contributor

ACK 9169dfb

@ariard
Copy link

ariard commented Jul 25, 2021

ACK 9169dfb

@TheBlueMatt TheBlueMatt merged commit 99ecd02 into lightningdevkit:main Jul 26, 2021
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.

3 participants