Commit graph

179 commits

Author SHA1 Message Date
cyberguru1
7cde9c50ae
itest: add test for super macaroon auto-bake
Add testSuperMacaroonOnStartup to verify startup baking logic. The test
restarts the node with the auto-baking config flags and asserts the
macaroon is baked with read-only or read-write permissions accordingly.

Also add validation tests verifying that starting with an invalid path
suffix or in stateless-init mode with baking enabled fails as expected.

Verify permission addition/expansion by starting the node with sub-servers
disabled and then restarting with sub-servers re-enabled. Also verify
the none config choice, asserting that no super macaroon file is
baked/created on startup.
2026-07-27 06:08:48 -05:00
cyberguru1
0977e375d6
itest: add integration tests for AccountPayments
Add integration tests inside itest/litd_accounts_test.go to verify
retrieval of account payments against a running LND node, validating
correct responses for ID/label lookup, offsets, pagination limits,
and counting of total payments.
2026-07-22 14:06:43 -05:00
Vandit Singh
73569014f2 accounts: don't mask payment errors when request values are absent 2026-07-19 01:19:35 +05:30
bitromortac
6f8159e003 itest: wait for LiT's own Running status in WaitUntilStarted
HarnessNode.Start calls WaitUntilStarted, then immediately reads
LitMacPath off disk via connectLitRPC to set up hn.litConn. But
WaitUntilStarted only polled subservers.LND's Running status, not LiT's
own - and litd only bakes and writes its default macaroons to disk
during its own startInternalSubServers step, strictly after LND is
marked Running but before LiT itself is. That left a window where the
harness read LitMacPath before litd had written it, failing with
"open .../lit.macaroon: no such file or directory"
(TestLightningTerminal/.../terminal_stateless_init_mode, CI run
29407791912).

Wait for subservers.LIT's Running status alongside the existing
per-subserver checks so callers can't observe LiT as "started" before
it has finished baking its macaroons.
2026-07-16 09:53:44 +00:00
bitromortac
9bfcdbe9ae
Merge pull request #1333 from Cyberguru1/fix-itest-process-leak
Some checks failed
CI / frontend tests on macOS-latest (push) Has been cancelled
CI / frontend tests on ubuntu-latest (push) Has been cancelled
CI / frontend tests on windows-latest (push) Has been cancelled
CI / backend build on macOS-latest (push) Has been cancelled
CI / backend build on ubuntu-latest (push) Has been cancelled
CI / backend build on windows-latest (push) Has been cancelled
CI / cross compilation (push) Has been cancelled
CI / cross compilation-1 (push) Has been cancelled
CI / cross compilation-2 (push) Has been cancelled
CI / RPC proto compilation check (push) Has been cancelled
CI / check commits (push) Has been cancelled
CI / Sqlc check (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / run unit tests (push) Has been cancelled
CI / run unit tests-1 (push) Has been cancelled
CI / run unit tests-2 (push) Has been cancelled
CI / run unit tests-3 (push) Has been cancelled
CI / build itest binaries (push) Has been cancelled
CI / check release notes updated (push) Has been cancelled
CI / integration test (push) Has been cancelled
CI / integration test-1 (push) Has been cancelled
CI / integration test-2 (push) Has been cancelled
itest: fix flaky testRequestLoggerDisable node cleanup
2026-07-10 08:33:52 +02:00
cyberguru1
02a1b31303
itest: fix testRequestLoggerDisable node cleanup
The test node variable was reassigned in a later step. This broke the
deferred cleanup closure and leaked the reqlog-on node process.

The leaked process caused random cleanup timeouts under heavy test load.
Fixed by copying the node to a local variable before the defer.
2026-06-22 03:27:39 -05:00
cyberguru1
484d5d789e itest: add custom permissions integration tests
Add a new sub-test case to verify that custom `entity:action`
permissions are correctly handled and enforced for LNC custom
sessions. The test uses the `info:read` permission to
assert that the connection can only query LND's GetInfo endpoint
and is blocked on other endpoints. Tests are added for both
integrated mode and remote mode suites.
2026-06-22 01:50:56 -05:00
Viktor Torstensson
9016bbb3d2
multi: confirm kvdb migration at startup
Prompt before automatically migrating legacy kvdb state to SQL when
litd starts with a SQL backend and active bbolt data is still present.

Detect prior migrations by checking for the SQL tombstone marker so
already-migrated stores can start without prompting. Add unit coverage
for the prompt flow and wire stdin through the itest harness so the
migration restart path can acknowledge the prompt automatically.
2026-06-08 21:11:51 +02:00
Calvin Zachman
862c1dba9d
multi: bump lnd, lndclient, and taproot-assets dependencies
Bumps lnd to v0.21.0-beta, lndclient to v0.21.0-1, and
taproot-assets to v0.8.0 across the root, litrpc, and perms
modules. taprpc uses the proper v1.1.0 tag.

lnd removed the deprecated SendPaymentSync, SendToRouteSync,
SendPayment (streaming), and SendToRoute (streaming) RPCs. The
account interceptor checkers and their tests for these RPCs are
removed since no client can call them anymore. The V2 checkers
already handle account tracking for payments.

The itest harness is updated for lnd v0.21's miner API changes
(SendOutputs -> SendOutput, Miner.Client.Generate -> GenerateBlocks,
waitForNTxsInMempool replaced by Miner.AssertNumTxsInMempool) and
TimeLockDelta bumped from 20 to 40 since lnd v0.21 raised
MinCLTVDelta from 18 to 24.
2026-06-08 13:18:37 -04:00
Viktor Torstensson
003041271a
itest: add deprecated bbolt db coverage
Expand the kvdb -> SQL migration itest to cover the full post-migration
startup behavior, not just the initial data copy and SQL assertions.

Verify that bbolt startup is blocked once kvdb files are deprecated,
that deleting the SQL database reruns the migration successfully, and
that older litd binaries still fail to start against deprecated kvdb
files.

Also add ordered blocker checks for the deprecated kvdb files so the
test shows startup fails first on accounts.db, then session.db, and
finally rules.db as earlier files are removed.
2026-05-14 11:39:19 +02:00
Viktor Torstensson
d43d4446b8
itest: avoid blocking on failed litd exits
Close the process exit signal before forwarding litd startup errors from
the wait goroutine. This lets the harness observe that the process has
already exited even when no receiver is currently ready on the error
channel.

Use a non-blocking send for the captured process error so failed startup
paths do not hang the goroutine while holding back log finalization or
process exit handling.

This will be needed for the upcoming commit which adds itest coverage
of deprecated kvdb databases.
2026-05-14 11:39:17 +02:00
Viktor Torstensson
067eeafd7e
itest: add kvdb -> SQL migration test
This commit implements an itest kvdb -> SQL migration itest. The
intention of the itest is to verify that the kvdb -> SQL migration flow
works for a litd node which has data inserted to the bbolt database.
To verify that, the minimum amount of data required to trigger the full
migration flow is inserted into the bbolt database, which is one object
to each database file. Those objects are:
* One account - accounts.DB file
* One session - session.db file
* One action - rules.db file

As the respective unit tests for each migration extensively tests that
data of all forms for each database file can successfully be migrated,
the itest only focuses on testing that the full migration flow works,
and leaves the responsibility of data variation coverage to the
respective unit test.

The test is executed in different steps, and uses RPCs to seed and
validate migration fixtures:
1. Start a node with a bbolt backend.
2. Insert one account, one session and one action via RPC.
3. Snapshot the inserted objects via RPC.
4. Restart with the configured SQL backend to trigger migration.
5. Query objects again via RPC.
6. Compare the new objects to the pre-migration snapshot.
7. Assert the migrated objects in SQL via direct queries, to verify that
it's actually the SQL database that contains the migrated objects.
2026-05-14 11:38:45 +02:00
Boris Nagaev
1629e3106a
session: fix mailbox TLS ALPN regression
Starting in grpc-go v1.67.0, clients and servers reject TLS handshakes when
ALPN is not negotiated. This changed the default value of
GRPC_ENFORCE_ALPN_ENABLED from false to true.

The default flip is in https://github.com/grpc/grpc-go/pull/7535

Our mailbox transport handshake can reach endpoints that currently do not
negotiate ALPN, so LNC session setup started failing and the lnc_auth flow
timed out, with malformed header/content-type errors showing up later on the
stream path.

This adds mailbox-specific TLS transport credentials that allow a missing
negotiated ALPN value for mailbox links. The mailbox server path and the
integration-test mailbox clients now use these credentials, so session
establishment works again.
2026-04-05 17:21:21 -05:00
Dario Anongba Varela
5960b65cfa
itest: remove custom channels tests and backward compat infrastructure
Custom channels integration tests have been fully migrated to the
taproot-assets repository where they run natively via the tapd-integrated
binary without any lightning-terminal dependency. This removes the
duplicate test suite and all supporting infrastructure from LiT.

The LiT-specific itests are unaffected.
2026-03-16 15:37:49 +01:00
Jared Tobin
8d601c6e45
Merge pull request #1198 from jtobin/capacity-check
itest: add channel capacity assertions
2026-02-16 13:51:38 +04:00
Jared Tobin
a5c54f98c5
itest: add passive assets test
Adds a 'custom channels passive assets' icase asserting that passive
assets aren't included amongst the funding proofs sent to a responder.
2026-02-13 17:30:14 +04:00
Viktor Torstensson
fa23141fd4
multi: bump taproot-assets taprpc & migrate
Bump `taproot-assets` to `v0.7.1` & `taprpc` to `v1.0.12`. This tapd
uses a new migrate dependency version, and therefore that is also bumped
in `litd`.

As the `tapd` `/universerpc.Universe/Info` call now requires a macaroon,
we need to add the `taproot-assets.allow-public-uni-proof-courier` to
the node config in order to whitelist the call.
2026-02-12 19:18:09 +01:00
Viktor Torstensson
51f33086be
firewall: add request logger disable flag
This introduces a new firewall.request-logger.disable config option to
completely disable request logging. When disabled, the request logger
interceptor is not instantiated, avoiding all logging overhead including
database writes and request processing.

This is implemented as a separate disable flag rather than adding a new
log level because the goal is to bypass the logging system entirely for
performance reasons, not just filter events. A log level would still
process and filter each request through the interceptor.

The change also adds validation to ensure autopilot remains enabled only
when request logging is active, since autopilot relies on action logs
for rule enforcement and auditing.
2026-02-12 17:14:01 +01:00
Jared Tobin
058394278e
Merge pull request #1190 from jtobin/itest-tapd-no-cert-verification
itest: have tapd skip cert verification
2026-02-09 20:38:48 +04:00
Elle Mouton
3852d3169e
itest: fix nil error deref
Here we fix a nil pointer panic that is caused by an 'err' var being
deferenced before first checking that it is not nil. This was caused by
an oversite in a refactor commit that was attempting to improve line
length.
2026-01-14 09:31:22 +02:00
Jared Tobin
c03a1e4bba
itest: have tapd skip cert verification
The mock oracle uses a self-signed certificate for TLS, but we're not
concerned with having tapd verify it in the itest environment. This
commit adds the 'experimental.rfq.priceoracletlsinsecure' flag added in
lightninglabs/taproot-assets#1775 to the litd args list, instructing
tapd not to verify certificates.
2025-12-10 12:10:15 +04:00
ffranr
a0e63124c0
multi: reformat long lines for readability
- Replace occurrences of `// nolint:lll` with `// nolint:ll` across
  files for consistency.
- Reformat multiline strings, comments, and function parameters to
  improve clarity and adhere to style guidelines.
- Add `// nolint:ll` comments where necessary to prevent linter
  warnings.
2025-12-09 16:12:03 +00:00
ffranr
128e0b6df6
itest: add tranche-based parallel runner and clearer logs
- add tranche splitting/shuffling flags to the itest harness
- add itest-parallel target and scripts to run tranches concurrently
- write per-tranche logs under .logs/trancheN and tail failures for
  clarity
2025-12-09 12:47:05 +00:00
Viktor Torstensson
4a9ac9ed3c
multi: remove legacy // +build tag Lines
With a upgrade to a never version of newer golang.org/x/tools/govet,
a lint check to check for legacy buildtag lines starting with
`// +build` has been added, as they're no longer needed.

In order for the `make lint` check to pass with the newer version, we
remove such buildtag lines.
2025-11-25 01:38:22 +01:00
George Tsagkarelis
d9b6f4c0a2
itest: add v1 upgrade path breach test 2025-10-15 13:43:24 +02:00
George Tsagkarelis
e4bbe5260d
itest: add option for node upgrade/downgrade when suspending 2025-10-15 13:43:24 +02:00
George Tsagkarelis
69c7b20258
itest: fix custom channel itests for noop htlcs
Since we're now always using no-op HTLCs over all taproot assets
channels that support it, that means that certain liquidity related
assumptions do not hold anymore. In some test cases where we assume that
a satoshi balance was eventually accumulated we instead manually slosh
that balance as sats don't really shift in the channel balance over the
long term.
2025-10-15 13:43:24 +02:00
George Tsagkarelis
b008a3fe1d
itest: all non-backward-compat nodes use noop flag 2025-10-15 13:43:23 +02:00
George Tsagkarelis
d2ff63cc81
itest: scope down asset in decode-payreq itest
Changes the itest asset used in the decode payreq itest to instead be a
new variable declared within the scope of the itest. This prevents
mutating the global asset that is re-used by other test cases and would
lead to failures otherwise.

Thanks @jtobin for spotting.

Co-authored-by: Jared Tobin <jared@jtobin.io>
2025-10-15 13:43:23 +02:00
George Tsagkarelis
5406373adf
itest: fix typo in coop closer helper comment 2025-10-15 13:40:53 +02:00
George Tsagkarelis
65fb67a2a1
itest: add invoice with existing route hints edge case 2025-10-15 11:07:21 +02:00
George Tsagkarelis
b0cbb4324b
itest: formatting enhancements for tap payments
This commit mainly changes the returned type of the payment result for
asset payments. We create a struct TapPaymentResult which contains all
the related information for the outcome of an asset payment.
2025-10-15 11:07:21 +02:00
George Tsagkarelis
9a861e6023
itest: add George node to multi-rfq topology 2025-10-14 11:38:41 +02:00
George Tsagkarelis
d96c552bbc
make+itest: pin multi-rfq Yara node to v0.15.0-alpha 2025-10-14 11:38:40 +02:00
George Tsagkarelis
d2f3f58bc9
itest: enhance multi-rfq itest with sending 2025-10-14 11:38:40 +02:00
George Tsagkarelis
2151a10943
itest: allow setting empty peer pubkey on tapd SendPayment 2025-10-14 11:38:40 +02:00
Oliver Gugger
8a4625acdb
mod+itest: update to latest tapd 2025-10-14 11:38:37 +02:00
George Tsagkarelis
3ccfc5231b
multi: prepare for new non-constant string rule
In preparation for the next commit which bumps golang to a newer
version, we want to make some code changes that would otherwise render
some log-related calls problematic. With go1.24 a new govet rule was
added that disallows non-constant strings (i.e including a tag like
"%s") in calls to printf. See more in the related issue
https://github.com/golang/go/issues/60529.
2025-09-18 12:05:28 +02:00
Bob Smith
2685477b45
config: add testnet4 network option 2025-07-30 13:08:06 -04:00
Oliver Gugger
b0e1d552d1
itest: add test case for policy in route hint
This commit tests that the routing policy of the correct peer (the
policy pointing toward the recipient of an invoice) is included in an
asset invoice.
2025-06-17 19:30:41 +02:00
Oliver Gugger
fe9a36ceee
itest: test single sat keysend payment with no asset balance
Tests an edge case that previously lead to a force close due to the
following error:
unable to sort commitment transaction: output and allocation size mismatch with error

Having a below-dust satoshi balance is only allowed when there is no
asset balance. But since such a dust output isn't materialized on-chain,
tapd needs to filter it out correctly and not create an allocation.
2025-06-17 19:30:41 +02:00
Oliver Gugger
b4e16b1283
itest: parse old channel format, more compat tests 2025-06-05 16:34:45 +02:00
Oliver Gugger
b9f847c693
itest: add test case for RFQ quote compat fix
Adds a test case to validate the fix in
lightninglabs/taproot-assets#1583, by adding a test that:
 - Creates two asset channels between Alice and Bob
 - Creates a BTC channel between Bob and Charlie
 - The two asset channels each have a different asset in them
 - The balance of the pences channel is decreased (lower bandwidth)
 - An RFQ payment is attempted, with pences as the payment asset
2025-06-05 16:34:45 +02:00
Oliver Gugger
33f4ef3872
itest: add assets to btc self-payment test case 2025-06-05 16:34:44 +02:00
George Tsagkarelis
105a13138b
itest: fix liquidity edgecases AddInvoice expected error 2025-05-20 13:13:12 +02:00
George Tsagkarelis
34e9e955a5
itest: add custom channels multi rfq receive itest 2025-05-20 13:13:12 +02:00
George Tsagkarelis
3d9834d792
itest: allow nil rfq peer pubkey on asset invoice helpers 2025-05-20 13:13:12 +02:00
George Tsagkarelis
3e26bd261d
itest: utilize more options when paying with satoshi 2025-05-20 13:13:11 +02:00
George Tsagkarelis
16b5b84fd5
itest: add multi-rfq asset network creator 2025-05-20 13:13:11 +02:00
Oliver Gugger
03c80cfeab
multi: add backward compatibility test 2025-05-16 18:52:03 +02:00