cmd/loop: skip expiring deposits in static loop-in --all#1186
Open
GustavoStingelin wants to merge 2 commits into
Open
cmd/loop: skip expiring deposits in static loop-in --all#1186GustavoStingelin wants to merge 2 commits into
GustavoStingelin wants to merge 2 commits into
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
GustavoStingelin
force-pushed
the
feat/omit-expiring-deposits-all
branch
from
July 24, 2026 17:16
51e6379 to
d7c016f
Compare
starius
reviewed
Jul 24, 2026
starius
left a comment
Collaborator
There was a problem hiding this comment.
Doing this in CLI is not ideal. This does not cover LiT and other direct gRPC callers.
I think this should be implemented on the loopd side, and we should remove the --min_expiry_blocks option. The minimum is derived from the swap parameters rather than being a user preference:
minimum runway = quote.CltvDelta + DepositHtlcDelta
Keeping DepositHtlcDelta = 50 as a client-side constant in staticaddr/loopin is fine.
The ideal flow would be:
- The CLI passes the
allselection intent to loopd instead of listing deposits, calculating expiry eligibility, and expanding--allinto explicit outpoints itself. - loopd refreshes the deposits and obtains a quote. The quote must expose the CLTV delta that will actually be used for a static Loop-in. Currently, the static-deposit quote path drops
quote.CltvDelta, andGetLoopInQuotedoes not populateInQuoteResponse.CltvDelta; those should be fixed. - loopd computes each deposit's absolute expiry using its confirmation height and CSV delay, then compares its remaining runway with
quote.CltvDelta + 50. Unconfirmed deposits should be evaluated using the same next-block-confirmation assumption as the server. - For an
allselection, loopd omits deposits that do not satisfy the requirement and returns the selected and skipped deposits so the CLI can report them. For explicitly supplied outpoints which are too old, loopd should return an error rather than silently changing the user's selection. - Because removing deposits changes both the amount and the per-input fee, loopd recomputes the amount and obtains a final quote for the filtered deposit count.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
loop static in --all now skips confirmed deposits too close to their CSV expiry, so it won't quote swaps that could fail to complete in time.