Skip to content

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

@Roasbeef

Description

@Roasbeef

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:

  • max_parts
  • max_shard_size_msat

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:

  • max_parts = 2
  • max_shard_size_msat = 10_000
  • amt_msat = 100_000

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.

Metadata

Metadata

Labels

beginnerIssues suitable for new developersenhancementImprovements to existing features / behaviourrpcRelated to the RPC interfacevalidation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions