walletrpc: test configurable lease capability failure - #2
Closed
bhandras wants to merge 6 commits into
Closed
Conversation
Temporarily point btcwallet and wtxmgr at the draft commits that add persisted release-after-spend lease behavior. The replaces can be removed after upstream versions containing those changes are published.
Define an optional output-leaser interface for persisted lease behavior beyond the existing WalletController contract. Forward it through LightningWallet and translate release-after-spend confirmation depth into btcwallet's lock option. Callers that use the existing LeaseOutput method keep the current behavior.
Add optional confirmation-depth fields to LeaseOutput and FundPsbt. Forward the request to wallets that implement the configurable lease capability and echo the accepted depth in lease responses. Zero keeps the existing wall-clock behavior. A non-zero request fails closed when the configured wallet cannot provide the requested lease semantics.
When locking several inputs fails partway through, release each earlier lease with the ID that acquired it. The previous rollback always used LND's internal ID, which cannot release leases acquired with a caller-provided custom ID.
Document the new LeaseOutput and FundPsbt confirmation-depth option in the 0.22.0 release notes.
Exercise both FundPsbt input locking and the direct LeaseOutput RPC with a wallet that only supports legacy time-based leases. Assert option-bearing requests fail before calling the legacy lease method, so a backend mismatch cannot silently shorten the requested protection.
bhandras
force-pushed
the
codex/reorg-aware-output-lock-20260825
branch
from
August 27, 2026 12:19
34267bd to
09fa9b6
Compare
Owner
Author
|
Folded into lightningnetwork#11125 after review. The parent now contains both fail-closed capability tests and the repaired LockID commit placement. |
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.
Summary
This test-only draft stacks on the branch behind
lightningnetwork#11125. It contains one cherry-pickable commit and no
production-code change.
The base PR intentionally fails closed when a caller requests
release_after_spend_confsbut the configured wallet backend implements onlylegacy time-based leases. These tests prove that failure happens before any
legacy lease side effect.
Coverage
FundPsbtinput locking rejects the unsupported option.WalletKit.LeaseOutputrejects the unsupported option.LeaseOutputmethod.This guards against the unsafe compatibility failure: silently accepting the
request while creating a shorter wall-clock lease.
Validation
go test -tags=walletrpc ./lnrpc/walletrpc -count=1go vet -tags=walletrpc ./lnrpc/walletrpcCommit
7653dc06bwalletrpc: Test configurable lease capability failure