Commit graph

2359 commits

Author SHA1 Message Date
Boris Nagaev
60d43898f0
Merge pull request #1072 from starius/cli-tests20
cmd/loop: CLI session recording and replay tests
2026-05-20 13:35:37 -05:00
Boris Nagaev
3abede2d8e
cmd/loop: fix openchannel help typo
Correct the duplicated article in the static openchannel
help text so the command summary reads cleanly. Refresh the
recorded help fixtures that surface that summary directly,
including the dedicated openchannel help output and the
parent static command listing.
2026-05-20 03:12:04 -05:00
Boris Nagaev
ca1ce698f0
cmd/loop: bless text-only session updates
Add an env-gated bless mode to recorded-session replay so
CLI-only text changes can refresh fixtures without a live
recording pass. The replay still uses the recorded gRPC
traffic, stdin, and environment, and it only rewrites
stdout, stderr, and run_error after the command preserves
the recorded success or failure shape.

Keep the updater strict by refusing to bless sessions when
replay leaves recorded gRPC events unconsumed, and add
focused tests for the rewrite rules. Document the bless
workflow next to the session fixtures, including the need
for -count=1 so the Go test cache does not skip updates.
2026-05-20 03:12:04 -05:00
Boris Nagaev
e6e3820a76
testdata: add sessions for newly added features 2026-05-20 03:12:04 -05:00
Boris Nagaev
7683da65ff
testdata: add static address and swaps sessions 2026-05-20 03:12:04 -05:00
Boris Nagaev
662f954e0f
testdata: add liquidity sessions 2026-05-20 03:12:03 -05:00
Boris Nagaev
541e0e00fc
testdata: add loop in/out and quote sessions 2026-05-20 03:12:03 -05:00
Boris Nagaev
074257e348
testdata: add instantout and l402 sessions 2026-05-20 03:12:03 -05:00
Boris Nagaev
5157dad741
testdata: add basic swap sessions 2026-05-20 03:12:03 -05:00
Boris Nagaev
9640e3bd4c
cmd/loop: add session recording guide 2026-05-20 03:12:03 -05:00
Boris Nagaev
c3009182b3
cmd/loop: add session replay tests 2026-05-20 03:12:03 -05:00
Boris Nagaev
137097915c
cmd/loop: add session recorder plumbing 2026-05-20 03:12:03 -05:00
Boris Nagaev
c3e102527a
cmd/loop: add session gRPC transport hook 2026-05-20 03:12:03 -05:00
Boris Nagaev
d0591e62b9
cmd/loop: add stdio hooks 2026-05-20 03:12:03 -05:00
Boris Nagaev
cdec0cacef
cmd/loop: add cli clock and hook 2026-05-20 03:12:03 -05:00
Boris Nagaev
3e9a99dd55
cmd/loop: factor newRootCommand 2026-05-20 03:12:03 -05:00
Boris Nagaev
74c7274b03
cmd/loop: add client conn cleanup 2026-05-20 03:12:03 -05:00
Boris Nagaev
3182be8bf1
cmd/loop: remove orphan flag access
abandonSwap used to access flag --id which does not exist.
2026-05-20 03:12:03 -05:00
Boris Nagaev
61945bd9f9
cmd/loop: print homedir in help messages as ~
Make the output homedir-independent to facilitate tests.
2026-05-20 03:12:03 -05:00
Slyghtning
ea03440f29
Merge pull request #1130 from hieblmi/fix-racae
sweepbatcher: harden AddSweep against ctx closure
2026-05-19 07:46:06 +02:00
Boris Nagaev
1b25d8a122
sweepbatcher: assert close-during-add run exit
TestSweepBatcherCloseDuringAdding previously started Batcher.Run in a
detached goroutine and called test assertions from that goroutine. The
test only waited for the add/cancel workers, so a Run-side shutdown
error could be missed or reported unreliably.

Route the Run result through a channel and wait for it in the main test
goroutine. While waiting, keep draining spend registrations so shutdown
cannot deadlock on mock notifier traffic.

This makes the existing shutdown-race test cover both sides of the race:
AddSweep callers may exit with cancellation, and Batcher.Run must also
terminate with an expected shutdown error.
2026-05-18 11:58:54 +02:00
Boris Nagaev
707fef340b
sweepbatcher: mask presign cancellation races
PresignSweepsGroup uses context-sensitive wallet and presigned-helper
calls, but it previously returned their raw wrapped errors even when the
caller context or batcher shutdown state had already become terminal.
That leaves backend/helper errors visible during normal cancellation.

Check for shutdown/cancellation before presigning and after fee lookup
or presigning failures, preferring context.Canceled or
ErrBatcherShuttingDown over lower-level errors.

Log the original presign-path error before returning the shutdown or
cancellation error so normal shutdown remains debuggable without
changing the returned error.

Add a regression test with a presigned helper that cancels the caller
context while returning driver.ErrBadConn from SignTx. The test asserts
PresignSweepsGroup reports context.Canceled and does not wrap the driver
error, and runs against both mock and SQL-backed stores.
2026-05-18 11:58:54 +02:00
Boris Nagaev
8a4e2f1941
sweepbatcher: normalize run-loop shutdown errors
AddSweep now masks cancellation races during its caller-side setup, but
a request can still be accepted by the batcher run loop before the run
context cancellation is selected. If handleSweeps then performs a
context-sensitive store call while shutdown is in progress, a
backend-specific error such as driver.ErrBadConn can still bubble out
through Batcher.Run.

Prefer the run context's terminal error when startup, handleSweeps, or
asynchronous errChan failures happen after the run context has been
canceled. This keeps normal shutdown reporting consistent and avoids
surfacing backend driver errors from the accepted-request and async
error paths.

Log the original run-loop error before returning the context error so
normal shutdown remains debuggable without changing the returned error.

Add regression tests for both covered run-loop races. One lets AddSweep
successfully hand a sweep request to Run, then cancels the run context
from the second GetSweepStatus call while returning driver.ErrBadConn.
The other queues an errChan error from the event loop while canceling
the run context. Both tests assert that Run returns context.Canceled and
does not wrap the driver error.
2026-05-18 11:58:54 +02:00
Slyghtning
b542b50f7f
sweepbatcher: harden AddSweep against ctx closure 2026-05-18 11:58:53 +02:00
Boris Nagaev
010212044a
Merge pull request #1140 from starius/fix-go-mod-check
go.mod: fix gonum replaces (fix CI)
2026-05-11 12:37:38 -05:00
Slyghtning
de279bca67
Merge pull request #1137 from hieblmi/param-validation
staticaddr: validate server address parameters
2026-05-11 09:52:42 +02:00
Slyghtning
6aa6979e77
staticaddr: validate server address parameters 2026-05-11 08:59:03 +02:00
Boris Nagaev
38481fe4a9
go.mod: fix gonum replaces
Remove gonum/plot replace in looprpc - not needed.

Add gonum replace to swapserverrpc. It was missing and caused recent CI errors.
2026-05-10 22:03:36 -05:00
Boris Nagaev
7c3eb29665
Merge pull request #1138 from starius/fix-perms
looprpc: fix build and permissions of two RPCs
2026-05-08 22:17:32 -05:00
Boris Nagaev
02dc98232c
looprpc: fix build
It depends on our protobuf-go fork. It failed with compilation errors when
building the module itself.
2026-05-07 02:37:00 -05:00
Boris Nagaev
e340797225
looprpc: fix permissions of two RPCs
Both SweepHtlc and StaticAddressLoopIn are active, so the "swap" entity
must have action=execute, not read.
2026-05-07 02:24:17 -05:00
Slyghtning
6ea1c79834
Merge pull request #1135 from hieblmi/risk-notif
swapserverrpc: risk acceptance/rejection notifications
2026-05-05 13:18:59 +02:00
Slyghtning
38654b91af
swapserverrpc: risk rejection notification 2026-05-05 11:37:06 +02:00
Slyghtning
1ec0f77a24
swapserverrpc: risk acceptance notification 2026-05-05 11:37:02 +02:00
Boris Nagaev
62177f9d62
Merge pull request #1122 from starius/addinvoice-coverage
loop-ins: fix route hints passing, add test coverage
2026-05-01 00:17:01 -05:00
Slyghtning
807aa61ae6
Merge pull request #1090 from Olexandr88/master
fix: guard against short reservation id when printing shortid
2026-04-29 16:33:28 +02:00
Olexandr88
6fd752f7e7
cmd/loop: fix panic on zero index in instantout reservation selection 2026-04-29 16:18:36 +02:00
Olexandr88
7b1c60dba2
fix: guard against short reservation id when printing shortid 2026-04-29 16:18:36 +02:00
Slyghtning
5b68d40920 Revert "Merge pull request #1095 from hieblmi/claude-review-approve"
This reverts commit 864029135a, reversing
changes made to ff800df41d.
2026-04-29 12:16:04 +02:00
Slyghtning
787519ea7c
Merge pull request #1125 from hieblmi/correct-static-text
cmd/loop: drop misleading static loop-in fee warning
2026-04-23 19:46:12 +02:00
Slyghtning
b5d26775a5
cmd/loop: drop misleading static loop-in fee warning 2026-04-23 19:21:49 +02:00
Slyghtning
c8ccc1eba9
Merge pull request #1127 from lightninglabs/dependabot/go_modules/looprpc/github.com/jackc/pgx/v5-5.9.2
build: bump github.com/jackc/pgx/v5 from 5.9.0 to 5.9.2 in /looprpc
2026-04-23 18:37:38 +02:00
Slyghtning
93669c2b84
build: sync root pgx dependency for looprpc bump 2026-04-23 08:07:45 +02:00
Slyghtning
d295fbc459
Merge pull request #1126 from lightninglabs/dependabot/go_modules/github.com/jackc/pgx/v5-5.9.2
build: bump github.com/jackc/pgx/v5 from 5.9.0 to 5.9.2
2026-04-23 07:59:14 +02:00
dependabot[bot]
fc47f8ee3a
build: bump github.com/jackc/pgx/v5 from 5.9.0 to 5.9.2 in /looprpc
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.9.0 to 5.9.2.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.9.0...v5.9.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-version: 5.9.2
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 00:34:27 +00:00
dependabot[bot]
0031ed5eba
build: bump github.com/jackc/pgx/v5 from 5.9.0 to 5.9.2
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.9.0 to 5.9.2.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.9.0...v5.9.2)

---
updated-dependencies:
- dependency-name: github.com/jackc/pgx/v5
  dependency-version: 5.9.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-23 00:32:10 +00:00
Slyghtning
13ded17d9e
Merge pull request #1123 from lightninglabs/dependabot/go_modules/looprpc/github.com/jackc/pgx/v5-5.9.0
build: bump github.com/jackc/pgx/v5 from 5.7.4 to 5.9.0 in /looprpc
2026-04-21 09:40:03 +02:00
Slyghtning
7396653e55
build: update root pgx/v5 to 5.9.0 2026-04-21 09:22:56 +02:00
Boris Nagaev
51bb2b6ac5
staticaddr/loopin: add route hint regression test 2026-04-17 21:38:36 -05:00
Boris Nagaev
e1f1077f44
loop+test: add loop-in route hint regression 2026-04-17 21:38:36 -05:00