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

routing: if MaxShardAmt is set, then use that as a ceiling for our splits, use default of 16 for MaxParts #5017

Merged
merged 5 commits into from Feb 16, 2021

Conversation

Roasbeef
Copy link
Member

@Roasbeef Roasbeef commented Feb 12, 2021

In this commit, we thread through the necessary state to allow users to
set a max shard amount. If this value is set, then this'll effectively
serve as a ceiling for all our split attempts. If we need to split,
we'll first try to use paymentAmt/2, if that's bigger than
`MaxShardAmt, then we'll use the latter instead.

Ideally in the future we have a dynamic way to automatically set both
the MaxShardAmt as well as MaxParts for users. Until then exposing
these two new fields will allow us to experiment with setting them
automatically using the RPC interface, and also give users a bit more
control over how we attempt to route payments, akin to coin control for
on-chain payments.

Fixes #4730

@Roasbeef Roasbeef added enhancement Improvements to existing features / behaviour rpc Related to the RPC interface payments Related to invoices/payments labels Feb 12, 2021
@Roasbeef Roasbeef added this to the 0.13.0 milestone Feb 12, 2021
@Roasbeef Roasbeef added this to In progress in v0.13.0-beta via automation Feb 12, 2021
@Roasbeef Roasbeef added the P1 MUST be fixed or reviewed label Feb 12, 2021
Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

concept ACK

lnrpc/routerrpc/router_backend.go Outdated Show resolved Hide resolved
lnrpc/routerrpc/router_backend.go Outdated Show resolved Hide resolved
routing/payment_session.go Outdated Show resolved Hide resolved
v0.13.0-beta automation moved this from In progress to Review in progress Feb 12, 2021
lnrpc/routerrpc/router_backend.go Outdated Show resolved Hide resolved
routing/router.go Show resolved Hide resolved
routing/payment_session.go Outdated Show resolved Hide resolved
In this commit, we raise the default value for the `MaxParts` field from
1 to 16. This change was motivated by the fact that many users either
forget, or don't even know this field is there in the first place. A
value of 16 was chosen rather arbitraliy (other than power of 2). In
the future, we should tune this value based on the expected number of
payment attempts for a given payment amount.
…lits

In this commit, we thread through the necessary state to allow users to
set a max shard amount. If this value is set, then this'll effectively
serve as a ceiling for all our split attempts. If we need to split,
we'll first try to use `paymentAmt/2`, if that's bigger than
`MaxShardAmt, then we'll use the latter instead.

Ideally in the future we have a dynamic way to automatically set both
the `MaxShardAmt` as well as `MaxParts` for users. Until then exposing
these two new fields will allow us to experiment with setting them
automatically using the RPC interface, and also give users a bit more
control over how we attempt to route payments, akin to coin control for
on-chain payments.

Fixes lightningnetwork#4730
Copy link
Collaborator

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

Copy link
Contributor

@cfromknecht cfromknecht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

Copy link
Contributor

@halseth halseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

v0.13.0-beta automation moved this from Review in progress to Reviewer approved Feb 16, 2021
@cfromknecht cfromknecht merged commit db5af6f into lightningnetwork:master Feb 16, 2021
v0.13.0-beta automation moved this from Reviewer approved to Done Feb 16, 2021
@cfromknecht cfromknecht mentioned this pull request Feb 16, 2021
@MaxHillebrand
Copy link
Contributor

Thanks for building this!

I'm confused why the name is different though. Why not maxPartAmount, I think mixing Shard and Part for essentially the same thing is confusing...

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 P1 MUST be fixed or reviewed payments Related to invoices/payments rpc Related to the RPC interface v0.13
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

routing: expose custom split size over RPC interface, prefer smaller splits on path finding
5 participants