Skip to content

itest: run lnd backend in remote-signing mode#1694

Open
guggero wants to merge 5 commits into
mainfrom
itest-remote-signer
Open

itest: run lnd backend in remote-signing mode#1694
guggero wants to merge 5 commits into
mainfrom
itest-remote-signer

Conversation

@guggero
Copy link
Copy Markdown
Contributor

@guggero guggero commented Jul 31, 2025

Depends on btcsuite/btcwallet#1022 and then lightningnetwork/lnd#10119 which will hopefully make it into lnd v0.19.3-beta.

Created this itest to reproduce lightninglabs/lightning-terminal#1123.
Further investigation then lead to the creation of this bug report issue: lightningnetwork/lnd#10120

So this test will not succeed until lightningnetwork/lnd#10120 is fixed. But putting up the PR as a draft as we should aim to fix that issue and then have these tests run in the CI by default.

@coveralls
Copy link
Copy Markdown

coveralls commented Jul 31, 2025

Coverage Report for CI Build 26889171221

Coverage decreased (-0.03%) to 34.83%

Details

  • Coverage decreased (-0.03%) from the base build.
  • Patch coverage: 64 uncovered changes across 2 files (0 of 64 lines covered, 0.0%).
  • 37 coverage regressions across 8 files.

Uncovered Changes

File Changed Covered %
itest/test_harness.go 48 0 0.0%
itest/multisig.go 16 0 0.0%

Coverage Regressions

37 previously-covered lines in 8 files lost coverage.

File Lines Losing Coverage Coverage
address/mock.go 14 88.59%
tapdb/multiverse.go 6 54.43%
tapgarden/caretaker.go 6 68.5%
asset/mock.go 3 65.89%
tapgarden/planter.go 3 63.34%
asset/asset.go 2 46.74%
tappsbt/create.go 2 22.71%
commitment/tap.go 1 72.67%

Coverage Stats

Coverage Status
Relevant Lines: 102270
Covered Lines: 35621
Line Coverage: 34.83%
Coverage Strength: 0.37 hits per line

💛 - Coveralls

@levmi levmi moved this from 🆕 New to 👀 In review in Taproot-Assets Project Board Jul 31, 2025
@levmi levmi moved this from 👀 In review to 🏗 In progress in Taproot-Assets Project Board Jul 31, 2025
@guggero guggero force-pushed the itest-remote-signer branch 2 times, most recently from e62df0f to f200946 Compare August 7, 2025 07:26
@guggero guggero marked this pull request as ready for review August 7, 2025 07:30
@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented Aug 7, 2025

With lnd v0.19.3-beta.rc1 out, this is now out of draft.

@guggero guggero requested review from GeorgeTsagk and ffranr August 7, 2025 07:30
@guggero guggero moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Aug 7, 2025
@guggero guggero force-pushed the itest-remote-signer branch 3 times, most recently from f1b456f to 1e4f9ea Compare August 21, 2025 07:25
@guggero guggero requested review from jtobin and removed request for ffranr August 21, 2025 07:25
Copy link
Copy Markdown
Member

@jtobin jtobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 👍

@guggero guggero force-pushed the itest-remote-signer branch from 1e4f9ea to 1e2cb4a Compare August 21, 2025 15:35
@jtobin jtobin force-pushed the itest-remote-signer branch from 1e2cb4a to 1da61fd Compare December 4, 2025 10:31
@jtobin
Copy link
Copy Markdown
Member

jtobin commented Dec 4, 2025

I've rebased this, as it seems easy enough to resurrect and review otherwise. Unsure we actually want to run w/remote signing mode in CI, though.

Comment thread docs/release-notes/release-notes-0.7.0.md Outdated
@jtobin jtobin force-pushed the itest-remote-signer branch 2 times, most recently from e45ed66 to 0fec22a Compare December 4, 2025 13:10
@jtobin
Copy link
Copy Markdown
Member

jtobin commented May 1, 2026

lightninglabs-deploy mute

@lightninglabs-deploy
Copy link
Copy Markdown

@GeorgeTsagk: review reminder
@guggero, remember to re-request review from reviewers when ready

@guggero
Copy link
Copy Markdown
Contributor Author

guggero commented May 22, 2026

!lightninglabs-deploy mute

@GeorgeTsagk GeorgeTsagk self-assigned this May 22, 2026
This commit adds a new flag to the integration test suite that starts
the single lnd node (alice) either in normal or in remote-signing mode.
In remote-signing mode, alice is actually a watch-only node that is
connected to a seconardy signer node over RPC.

Co-authored-by: George Tsagkarelis <george.tsagkarelis@gmail.com>
@GeorgeTsagk GeorgeTsagk force-pushed the itest-remote-signer branch from 0fec22a to 28b5766 Compare June 2, 2026 20:18
@GeorgeTsagk GeorgeTsagk requested review from darioAnongba and removed request for GeorgeTsagk June 3, 2026 08:21
@jtobin jtobin self-requested a review June 3, 2026 13:20
guggero and others added 4 commits June 3, 2026 13:49
To make sure `tapd` works when the connected `lnd` node is running in
remote-signing mode, we add a new CI target that runs all integration
tests in that mode.

Co-authored-by: George Tsagkarelis <george.tsagkarelis@gmail.com>
Co-authored-by: George Tsagkarelis <george.tsagkarelis@gmail.com>
Co-authored-by: George Tsagkarelis <george.tsagkarelis@gmail.com>
The first iteration of this PR converted two FinalizePacket call sites
to a new FinalizeFullySigned helper to work around the fact that lnd's
FinalizePsbt RPC fails on p2tr inputs in watch-only mode ("is not a
p2wkh or np2wkh address"). Six more call sites following the same
signPacket -> FinalizePacket pattern have been added to main since
then and were broken under -lndremotesigner; convert them as well.

Two remaining FinalizePacket call sites (in MultiSigTest and in the
mint+fund+seal test) cannot use FinalizeFullySigned because they need
lnd to sign the BTC fee/change inputs that CommitVirtualPsbts added.
For those, FinalizePacket itself is rewritten to do SignPsbt + a local
MaybeFinalizeAll instead of calling FinalizePsbt RPC. SignPsbt handles
p2tr inputs correctly in both regular and watch-only modes, and the
local finalize sidesteps the FinalizePsbt bug entirely.
@GeorgeTsagk GeorgeTsagk force-pushed the itest-remote-signer branch from 28b5766 to 5823c4c Compare June 3, 2026 13:49
@GeorgeTsagk
Copy link
Copy Markdown
Member

Kept mint_assets and basic_send_unidirectional in the coverage: those give us the biggest coverage with the smallest set of test cases (anchor sign / ImportTapscript / script key spend / groupkey sign)

Copy link
Copy Markdown
Member

@jtobin jtobin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, with only one substantial note: the CI workflow still uses the older style that we've since optimized. A few tweaks worth making:

diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml
index 05bc726c..5cd5e16e 100644
--- a/.github/workflows/main.yaml
+++ b/.github/workflows/main.yaml
@@ -467,20 +467,30 @@ jobs:
   integration-test-lnd-remote-signer:
     name: run itests with lnd remote-signer
     runs-on: ubuntu-latest
+    needs: build-itest
     steps:
-      - name: cleanup space
-        run: rm -rf /opt/hostedtoolcache
-
       - name: git checkout
         uses: actions/checkout@v5
 
-      - name: Setup go ${{ env.GO_VERSION }}
-        uses: actions/setup-go@v5
+      - name: Download itest binaries
+        uses: actions/download-artifact@v8
         with:
-          go-version: '${{ env.GO_VERSION }}'
+          name: itest-binaries
+          path: itest
+
+      - name: Initialize environment
+        run: |
+          chmod +x itest/itest.test itest/btcd-itest itest/lnd-itest itest/tapd-itest itest/chantools/chantools
+          mkdir -p ~/.aperture
+
+      - name: CPU info
+        run: |
+          echo "nproc (available to process): $(nproc)"
+          echo "nproc --all (online): $(nproc --all)"
+          lscpu || true
 
       - name: run itest
-        run: make itest icase='(mint_assets|basic_send_unidirectional)' remotesigning=1
+        run: scripts/itest_part.sh 0 1 0 --verbose -lndremotesigner -test.run='TestTaprootAssetsDaemon/tranche.*/.*-of-.*/^(mint_assets|basic_send_unidirectional)$'
 
       - name: Zip log files on failure
         if: ${{ failure() }}
@@ -499,7 +509,7 @@ jobs:
         if: ${{ success() }}
         continue-on-error: true
         with:
-          file: itest/coverage.txt
+          files: itest/regtest/cover/coverage-tranche0.txt
           flag-name: 'itest-remotesigner'
           format: 'golang'
           parallel: true

This mostly just copies the stuff the other itests do, i.e.:

  • ditches the old cleanup space step (no longer needed)
  • removes the setup-go step (ditto)
  • uses the itest binaries from the previous build job
  • invokes scripts/itest_part.sh directly ('make itest' rebuilds the binaries, apparently)
  • writes the coverage stuff to tranche0, which is apparently the right location

(One nit, too: the release note commit can probably be dropped.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

6 participants