Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 46 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,52 @@ jobs:
format: 'golang'
parallel: true

# Integration tests on Postgres backend.
########################
# run integration tests with lnd remote-signer
########################
integration-test-lnd-remote-signer:
name: run itests with lnd remote-signer
runs-on: ubuntu-latest
steps:
- name: cleanup space
run: rm -rf /opt/hostedtoolcache

- name: git checkout
uses: actions/checkout@v4

- name: Setup go ${{ env.GO_VERSION }}
uses: actions/setup-go@v5
with:
go-version: '${{ env.GO_VERSION }}'

- name: run itest
run: make itest-parallel remote-signing=1

- name: Zip log files on failure
if: ${{ failure() }}
run: 7z a logs-itest-lnd-remotesigner.zip itest/**/*.log

- name: Upload log files on failure
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: logs-itest-lnd-remotesigner
path: logs-itest-lnd-remotesigner.zip
retention-days: 5

- name: Send coverage
uses: coverallsapp/github-action@v2
if: ${{ success() }}
continue-on-error: true
with:
file: itest/coverage.txt
flag-name: 'itest'
format: 'golang'
parallel: true

########################
# run integration tests with Postgres backend
########################
integration-test-postgres:
name: run itests postgres
runs-on: ubuntu-latest
Expand Down
10 changes: 8 additions & 2 deletions docs/release-notes/release-notes-0.8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
- [Garbage collection of orphaned UTXOs](https://github.com/lightninglabs/taproot-assets/pull/1832)
by sweeping tombstones and burn outputs when executing onchain transactions.
Garbage collection will be executed on every burn, transfer or call to
`AnchorVirtualPsbts`. A new configuration is available to control the sweeping
`AnchorVirtualPsbts`. A new configuration is available to control the sweeping
via the flag `wallet.sweep-orphan-utxos`.

## RPC Updates
Expand All @@ -57,7 +57,7 @@
## Config Changes

- [PR#1870](https://github.com/lightninglabs/taproot-assets/pull/1870)
The `proofs-per-universe` configuration option is removed. New option
The `proofs-per-universe` configuration option is removed. New option
`max-proof-cache-size` sets the proof cache limit in bytes and accepts
human-readable values such as `64MB`.

Expand All @@ -66,6 +66,12 @@
- [PR#1897](https://github.com/lightninglabs/taproot-assets/pull/1897)
Fix witness writeback issue when a split commitment is present.

- A [bug in `btcwallet` and `lnd` was fixed that prevented `tapd` from running
properly when connected to an `lnd` node that is running in remote-signing
mode](https://github.com/lightninglabs/taproot-assets/pull/1694). A new
integration test suite now asserts that `tapd` fully supports remote-signing
`lnd` backends.

## Breaking Changes

## Performance Improvements
Expand Down
4 changes: 2 additions & 2 deletions itest/mint_fund_seal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,15 @@ func deriveRandomKey(t *testing.T, ctxt context.Context,
keyRing *lndservices.LndRpcKeyRing) keychain.KeyDescriptor {

var (
randFam = test.RandInt31n(math.MaxInt32)
randFam = test.RandInt31n(math.MaxInt8)
randInd = test.RandInt31n(255)
desc keychain.KeyDescriptor
err error
)

// Ensure that we use a different key family from tapd.
for randFam == asset.TaprootAssetsKeyFamily {
randFam = test.RandInt31n(math.MaxInt32)
randFam = test.RandInt31n(math.MaxInt8)
}

desc, err = keyRing.DeriveNextKey(
Expand Down
9 changes: 9 additions & 0 deletions itest/multisig.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,15 @@ func FinalizePacket(t *testing.T, lnd *rpc.HarnessRPC,
return signedPacket
}

// FinalizeFullySigned is a helper function that finalizes a PSBT packet
// that is already fully signed. It will return the finalized packet.
func FinalizeFullySigned(t *testing.T, pkt *psbt.Packet) *psbt.Packet {
err := psbt.MaybeFinalizeAll(pkt)
require.NoError(t, err)

return pkt
}

// PublishAndLogTransferOption defines a functional option for
// PublishAndLogTransfer.
type PublishAndLogTransferOption func(*publishAndLogTransferOptions)
Expand Down
4 changes: 2 additions & 2 deletions itest/psbt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,7 @@ func testPsbtInteractiveAltLeafAnchoring(t *harnessTest) {
require.NoError(t.t, err)

commitPacket = signPacket(t.t, senderLnd, commitPacket)
commitPacket = FinalizePacket(t.t, senderLnd.RPC, commitPacket)
commitPacket = FinalizeFullySigned(t.t, commitPacket)
publishResp := PublishAndLogTransfer(
t.t, sender, commitPacket, []*tappsbt.VPacket{activePacket},
[]*tappsbt.VPacket{passivePacket}, commitResp,
Expand Down Expand Up @@ -2918,7 +2918,7 @@ func testPsbtExternalCommit(t *harnessTest) {
t.Logf("Committed transaction: %v", toJSON(t.t, commitResp))

btcPacket = signPacket(t.t, aliceLnd, btcPacket)
btcPacket = FinalizePacket(t.t, aliceLnd.RPC, btcPacket)
btcPacket = FinalizeFullySigned(t.t, btcPacket)

transferLabel := "itest-psbt-external-commit"

Expand Down
61 changes: 56 additions & 5 deletions itest/test_harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/lightninglabs/taproot-assets/taprpc"
unirpc "github.com/lightninglabs/taproot-assets/taprpc/universerpc"
"github.com/lightningnetwork/lnd/build"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
"github.com/lightningnetwork/lnd/lntest"
"github.com/lightningnetwork/lnd/lntest/node"
"github.com/lightningnetwork/lnd/lntest/port"
Expand All @@ -40,13 +42,24 @@ var (

// noDelete is a command line flag for disabling deleting the tapd
// data directories.
noDelete = flag.Bool("nodelete", false, "Set to true to keep all "+
"tapd data directories after completing the tests")
noDelete = flag.Bool(
"nodelete", false, "Set to true to keep all tapd data "+
"directories after completing the tests",
)

// logLevel is a command line flag for setting the log level of the
// integration test output.
logLevel = flag.String("loglevel", "info", "Set the log level of the "+
"integration test output")
logLevel = flag.String(
"loglevel", "info", "Set the log level of the integration "+
"test output",
)

// lndRemoteSigner is a command line flag that indicates whether the
// lnd instances should be set up to use a remote signer.
lndRemoteSigner = flag.Bool(
"lndremotesigner", false, "if true, the lnd instances will "+
"be set up to use a remote signer",
)
)

const (
Expand Down Expand Up @@ -303,7 +316,45 @@ func setupHarnesses(t *testing.T, ht *harnessTest,
proofCourier = universeServer
}

alice := lndHarness.NewNodeWithCoins("Alice", nil)
var alice *node.HarnessNode
if *lndRemoteSigner {
signer := lndHarness.NewNode("Signer", nil)

rpcAccts := signer.RPC.ListAccounts(
&walletrpc.ListAccountsRequest{},
)

watchOnlyAccounts, err := walletrpc.AccountsToWatchOnly(
rpcAccts.Accounts,
)
require.NoError(t, err)
alice = lndHarness.NewNodeRemoteSigner(
"WatchOnly", []string{
"--remotesigner.enable",
fmt.Sprintf(
"--remotesigner.rpchost=localhost:%d",
signer.Cfg.RPCPort,
),
fmt.Sprintf(
"--remotesigner.tlscertpath=%s",
signer.Cfg.TLSCertPath,
),
fmt.Sprintf(
"--remotesigner.macaroonpath=%s",
signer.Cfg.AdminMacPath,
),
},
[]byte("itestpassword"), &lnrpc.WatchOnly{
MasterKeyBirthdayTimestamp: 0,
MasterKeyFingerprint: nil,
Accounts: watchOnlyAccounts,
},
)

lndHarness.FundNumCoins(alice, 5)
} else {
alice = lndHarness.NewNodeWithCoins("Alice", nil)
}

// Create a tapd that uses Alice and connect it to the universe server.
tapdHarness := setupTapdHarness(
Expand Down
5 changes: 5 additions & 0 deletions make/testing_flags.mk
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ ifneq ($(nodelete),)
ITEST_FLAGS += -nodelete
endif

# Run the lnd node in remote signing mode.
ifneq ($(remote-signing),)
ITEST_FLAGS += -lndremotesigner
endif

# Run the optional tests.
ifneq ($(optional),)
ITEST_FLAGS += -optional -postgrestimeout=240m
Expand Down
Loading