Repository navigation
Conversation
The JSON lease output used by listleases and the psbt fund commands only carried the expiration, so a lease without a timeout looked like an ordinary timed lease. Report the no_expiry flag returned by the server alongside it.
Allow leasing an output without a timeout. The flag cannot be combined with --expiry, and exactly one of the two must be set. Move the request parsing into its own function so the flag validation can be tested without a running node.
FundPsbt accepts a custom lock ID, a lease duration and the no-expiry option for the inputs it acquires, but neither psbt fund nor psbt fundtemplate exposed them. Add --lockid, --lock_expiry and --no_expiry to both commands and leave validating the combination to the server.
🟡 PR Severity: MEDIUM
🟡 Medium (1 file)
🟢 Low (2 files)
AnalysisThe only non-test, non-doc file touched is To override, add a |
agammann
left a comment
There was a problem hiding this comment.
The new TestParseFundLeaseFlags loop exercises both fund and fundtemplate, including their unchanged default request and explicit lease fields. TestMarshallLocksNoExpiry also checks that JSON carries the NoExpiry bit independently of Expiration, which matters because an indefinite lease may still have an expiration value in the response. The local leaseoutput parser covers both mutually exclusive flag choices.
litbot-9000
left a comment
There was a problem hiding this comment.
/gateway review
Verdict: no issues found — approve-worthy. Posting as COMMENT rather than APPROVE because the requesting party is not this workspace's approval delegate; the outward approval belongs to roasbeef.
Verified (head d55ffd5):
go build ./...,go build -tags="dev walletrpc" ./cmd/commands/,go vet -tags="dev walletrpc" ./cmd/commands/— all clean.- Per-commit build of
cmd/commandsat each of the 4 commits — every commit compiles. - New tests pass, and each named test was confirmed executed in
-voutput:go test -tags="dev walletrpc" ./cmd/commands/ -run 'TestParseLeaseOutputRequest|TestParseFundLeaseFlags|TestMarshallLocksNoExpiry' -v -count=1. - Mutation-tested all four new guards; each neutralization fails the suite as it should:
case noExpiry && expiry != 0→&& false:TestParseLeaseOutputRequest/bothfails.case !noExpiry && expiry == 0→&& false:TestParseLeaseOutputRequest/neitherfails.if ctx.IsSet(fundLockIDFlag.Name)→&& false:TestParseFundLeaseFlags/{fund,fundtemplate}fail (CustomLockId stays nil).NoExpiry: lock.NoExpiry→false:TestMarshallLocksNoExpiryfails.
(Worktree restored clean afterwards.)
- 80-column check on the diff: clean.
- Server side honors the fields as the PR body claims (
FundPsbtinwalletkit_server.go):input_lease_no_expirycombined withlock_expiration_seconds→errLeaseLifetimeConflict; missing/zero/reserved custom lock ID rejected for no-expiry funding. The local--expiry/--no_expiryexclusivity check inleaseoutputcomplements this correctly, and deferring combination validation to the server for the fund commands is consistent with the existing design. - Release note present at
docs/release-notes/unreleased/11550.md.
Not verified: itests and the full CI matrix — the ci-hold label holds all tier jobs by design, so the CI result failure is the hold mechanism working, not a code signal. This pod has no Docker for itests. The author's regtest steps in the PR body cover the end-to-end paths and are consistent with the server-side validation quoted above.
Required changes: none.
— claudell ⚡ (OpenClaw dev agent; approval posts as litbot-9000 and does not count toward branch protection)
|
@MPins, remember to re-request review from reviewers when ready |
Change Description
Follow-up to #11396, which made no-expiry output leases explicit in WalletKit.
lnclihad no way to use them, and its lease output hid the new acknowledgement:lncli wallet leaseoutputgains--no_expiry. Exactly one of--expiryand--no_expirymust be set; combining them is rejected before calling the server.lncli wallet psbt fundandlncli wallet psbt fundtemplategain--lockid,--lock_expiryand--no_expiry, mapping to the existingcustom_lock_id,lock_expiration_secondsandinput_lease_no_expiryrequest fields. None of the three was exposed before, and--no_expiryneeds--lockidbecause the server requires a caller-specific lock ID for that mode. The server keeps validating the combination.lncli wallet listleasesand by both fund commands now includesno_expiry. Previously a no-expiry lease looked like an ordinary timed lease there, with an expiration that is not enforced.lncli wallet leaseoutputalready printed the raw RPC response, so it showedno_expirybefore this change.Steps to Test
I also tested it by hand on a regtest node (btcd + lnd built from this branch without the
devtag), usinglnclidirectly:wallet leaseoutput --no_expiry --expiry 30is rejected locally,--no_expiryreturns"no_expiry": trueand--expiry 300returnsfalse;wallet listleasesshows both leases with the matchingno_expiryvalue.wallet psbt fund --no_expiryfails without--lockid("custom lock ID required"), with--lock_expiry 60("cannot be combined with a duration") and with a non-hex--lockid. With--lockid ... --no_expiry, bothpsbt fundandpsbt fundtemplatereturn locks with the given ID and"no_expiry": true. Without the new flags,psbt fundstill uses lnd's internal lock ID and reports"no_expiry": false.wallet releaseoutput --lockid ...releases a no-expiry lease.--no_expiry, its lease stays while the transaction is in the mempool and disappears once the spend confirms.listunspent.