Skip to content

Restore Pending HTLC Retries#14

Merged
amackillop merged 2 commits intolsp-0.7.0from
austin_restore-prending-htlc-retries
Mar 20, 2026
Merged

Restore Pending HTLC Retries#14
amackillop merged 2 commits intolsp-0.7.0from
austin_restore-prending-htlc-retries

Conversation

@amackillop
Copy link
Copy Markdown

@amackillop amackillop commented Mar 20, 2026

Accidentally lost these commits. Re-applying

Calls the new LSPS4 process_pending_htlcs() method on the
existing 5-second HTLC expiry timer. This retries forwarding
HTLCs that were deferred at peer_connected time because the
channel was not yet usable (channel_reestablish still in
progress).
Both process_pending_htlcs and handle_expired_htlcs shared a single
5-second sleep, coupling two concerns with very different latency
requirements. Expiry checks are distributed-clock housekeeping where
seconds don't matter. Pending HTLC retries gate payment completion
for serverless SDK clients that reconnect briefly (~20s) during
webhook-driven flows — every extra second of retry latency is a
second the payer is staring at a spinner.

Splitting them into independent select! arms requires switching
from sleep to tokio::time::interval. With sleep, the losing arm
in a select! is cancelled and recreated each iteration — the 1s
pending-HTLC sleep would fire every loop, resetting the 5s expiry
sleep before it ever completes, starving handle_expired_htlcs
entirely. interval maintains its deadline across select! iterations
so both timers tick independently. MissedTickBehavior::Skip avoids
burst catch-up if a handler blocks longer than its interval.
@amackillop amackillop changed the title Restore Pending HTLC Restore Pending HTLC Retries Mar 20, 2026
@amackillop amackillop merged commit 1421000 into lsp-0.7.0 Mar 20, 2026
6 of 34 checks passed
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.

2 participants