lightningnetwork / lnd

Lightning Network Daemon ⚡️
MIT License
7.7k stars 2.09k forks source link

[feature] - routing: add additional validation to MPP related send payment params #8916

Open Roasbeef opened 3 months ago

Roasbeef commented 3 months ago

Is your feature request related to a problem? Please describe.

Today, for the SendPaymentV2 call we have a series of mpp parameters users can define:

If users aren't careful, then it's possible that the combination of: max parts, max shard size, and the payment amount are incompatible.

Here's an example of incompatible params:

In this case, we can't satisfy the payment as with only two max parts, we can only send 20_000 msat.

Describe the solution you'd like

Add validation, reject if params don't allow the full value to be sent.

Describe alternatives you've considered Silently modify the params to make them compatible. Additional context

Right now incorrect values just result in a path finding loop that'll go until the timeout, as the payment flow can't actually be satisfied.

anibilthare commented 2 months ago

Picking this up

Abdulkbk commented 2 weeks ago

Picking this up

Are you still on it?

anibilthare commented 1 week ago

Thanks for the reminder @Abdulkbk .