Skip to content

Retry payment for local failures #4161

Open

Description

@joostjager

When implementing a payment benchmark in ldk-node #664
, I noticed that it is surprisingly difficult to fully saturate a node with payments. One reason is that payments fail immediately if the local channel cannot handle them at that moment, for example when all HTLC slots are filled. The caller, in this case the benchmark code, must then retry. This requires some form of polling, which can create lock contention and slow down the node. To avoid this, the caller has to ensure that not too many payments are initiated simultaneously, which adds complexity.

This made me wonder why LDK does not use the payment timeout window to wait for the local channel to become available again. Especially when the local failure is temporary, such as hitting the maximum HTLC limit, it seems more reasonable to wait rather than forcing the user to poll aggressively.

Activity

  1. TheBlueMatt commented on Feb 9, 2026

    @TheBlueMatt
    Collaborator

    IMO we shouldn't - HTLC slots being full is pretty rare, the more common case for this is "there is no balance remaining", which I think obviously we should fail early to give the user indication that we've failed. If HTLC slots are full, its probably because we have some stuck HTLCs, and in that case IMO similar logic applies - sitting around for 2-5 seconds twiddling our thumbs is less useful than failing early to tell the user their payment isn't gonna work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions