Commit 086a669
committed
Batch same-channel MPP claims into a single commitment update
When multiple parts of an MPP payment arrive on the same channel, claim
them via the holding cell so they are released as one combined
ChannelMonitorUpdate (every PaymentPreimage step plus a single
commitment_signed) instead of one round-trip per part.
claim_payment_internal now forces the holding-cell path whenever there
is more than one source, records each touched channel, and flushes them
after queueing. The single-source case keeps the existing inline fast
path.
FundedChannel::get_update_fulfill_htlc gains a force_holding_cell flag
that suppresses the per-claim ChannelMonitorUpdate so the flush can
emit one combined update. When the holding cell cannot be freed
immediately (awaiting RAA, monitor update in progress, disconnected,
quiescent, ...), build_preimage_only_monitor_update writes a one-step
preimage update so the preimage stays durable across restarts; the
commitment_signed follows when the holding cell is naturally flushed.
Update test_single_channel_multiple_mpp, test_simple_mpp, and
auto_retry_partial_failure to reflect the new single-round-trip
behavior, and drop the threaded reproducer that targeted the old
per-claim path.1 parent 783c280 commit 086a669
4 files changed
Lines changed: 634 additions & 297 deletions
0 commit comments