Skip to content

Drop rate-limited static invoice requests - #1101

Open
tnull wants to merge 1 commit into
lightningdevkit:mainfrom
tnull:2026-09-fix-static-invoice-rate-limits
Open

tnull wants to merge 1 commit into
lightningdevkit:mainfrom
tnull:2026-09-fix-static-invoice-rate-limits

Conversation

@tnull

@tnull tnull commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Drop static invoice requests when the rate limit is reached instead of retrying them and delaying later events. Keep retrying storage errors and only acknowledge invoices after saving them.

Fixes an issue reported by @ajaysehwal.

@tnull
tnull requested a review from joostjager September 16, 2026 10:33
@ldk-reviews-bot

ldk-reviews-bot commented Sep 16, 2026

Copy link
Copy Markdown

👋 Thanks for assigning @joostjager as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@tnull
tnull force-pushed the 2026-09-fix-static-invoice-rate-limits branch from d393f3e to ce0d9cf Compare September 16, 2026 10:50

@ajaysehwal ajaysehwal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@tnull , one gap in thorough test suite: there’s no test covering a sender that gets rate-limited once and then successfully retries after the bucket refills.

Not required for correctness — the existing tests already show that the rate-limited request is dropped cleanly without affecting other requests. But a small test using a short refill interval or deterministic bucket advancement would make the intended contract explicit: the request is dropped, and the sender is free to retry later rather than being blocked permanently.

Purely a documentation-via-test nice-to-have.

Comment thread src/payment/asynchronous/static_invoice_store.rs
Drop static invoice requests when the rate limit is reached instead
of retrying them and delaying later events. Keep retrying storage
errors and only acknowledge invoices after saving them.

Fixes an issue reported by Ajay Sehwal.

Co-Authored-By: HAL 9000
@tnull
tnull force-pushed the 2026-09-fix-static-invoice-rate-limits branch from ce0d9cf to 264852e Compare September 16, 2026 12:01

@ajaysehwal ajaysehwal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants