Skip to content

walletrpc: test configurable lease capability failure - #2

Closed
bhandras wants to merge 6 commits into
codex/reorg-aware-output-lock-20260825from
codex/reorg-followups-20260827
Closed

walletrpc: test configurable lease capability failure#2
bhandras wants to merge 6 commits into
codex/reorg-aware-output-lock-20260825from
codex/reorg-followups-20260827

Conversation

@bhandras

Copy link
Copy Markdown
Owner

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_confs but the configured wallet backend implements only
legacy time-based leases. These tests prove that failure happens before any
legacy lease side effect.

Coverage

  • FundPsbt input locking rejects the unsupported option.
  • Direct WalletKit.LeaseOutput rejects the unsupported option.
  • Neither path calls the legacy LeaseOutput method.

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=1
  • go vet -tags=walletrpc ./lnrpc/walletrpc
  • commit-message lint
  • signed-commit verification

Commit

  • 7653dc06b walletrpc: Test configurable lease capability failure

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
bhandras force-pushed the codex/reorg-aware-output-lock-20260825 branch from 34267bd to 09fa9b6 Compare August 27, 2026 12:19
@bhandras

Copy link
Copy Markdown
Owner Author

Folded into lightningnetwork#11125 after review. The parent now contains both fail-closed capability tests and the repaired LockID commit placement.

@bhandras bhandras closed this Aug 27, 2026
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.

1 participant