Commit graph

2345 commits

Author SHA1 Message Date
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
Boris Nagaev
bfbc180e4b
test: add route hint assertion helper 2026-04-17 21:38:36 -05:00
Boris Nagaev
118c73a0bd
go.mod: pin fixed lndclient addinvoice hints
Include https://github.com/lightninglabs/lndclient/pull/268
Preserve AddInvoiceData fields across invoice wrappers
2026-04-17 21:37:47 -05:00
dependabot[bot]
e8bae4380c
build: bump github.com/jackc/pgx/v5 from 5.7.4 to 5.9.0 in /looprpc
Bumps [github.com/jackc/pgx/v5](https://github.com/jackc/pgx) from 5.7.4 to 5.9.0.
- [Changelog](https://github.com/jackc/pgx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgx/compare/v5.7.4...v5.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-16 23:06:13 +00:00
Boris Nagaev
2f5e821049
Merge pull request #1111 from starius/fix-deposit-test
staticaddr: deflake deposit manager test
2026-04-14 10:06:52 -05:00
Boris Nagaev
aa699b16e6
staticaddr: deflake deposit manager test
The sqlite and postgres race jobs were both hanging in
deposit.TestManager. The test was observing the manager through
implementation details that were not safe to share with the manager
itself:

- it replaced the manager's internal finalizedDepositChan and then
  waited on the same channel the manager consumes
- it reused package-level block and confirmation channels across runs
- it treated confirmationHeight+expiry as the last pre-expiry block
  even though the production IsExpired check uses >=
- it relied on scheduler timing when asserting that no sign request
  had happened yet

Make the test assert on stable effects instead of internal channel
ownership:

- create per-test notifier channels in the test context
- run the manager from a cancellable t.Context-derived context and
  assert clean shutdown
- send the actual last pre-expiry height, then the expiry height
- wait for the expiry sign and publish steps with bounded timeouts
- verify finalization by waiting for the manager to remove the
  deposit from activeDeposits instead of racing its private
  finalization channel

This keeps the test aligned with the production expiry semantics
and removes the race that only showed up reliably under -race.
2026-04-14 04:10:33 -05:00
Boris Nagaev
bf47c92477
Merge pull request #1112 from starius/security-md
add SECURITY policy file
2026-04-14 04:05:46 -05:00
Slyghtning
d95da382d9
Merge pull request #1118 from lightninglabs/dependabot/go_modules/looprpc/go.opentelemetry.io/otel/sdk-1.43.0
build: bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.43.0 in /looprpc
2026-04-13 07:41:12 +02:00
dependabot[bot]
f128203ef3
build: bump go.opentelemetry.io/otel/sdk in /looprpc
Bumps [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) from 1.40.0 to 1.43.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.40.0...v1.43.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-version: 1.43.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-11 05:31:54 +00:00
Slyghtning
b5eeeecd6a
Merge pull request #1117 from lightninglabs/dependabot/go_modules/go.opentelemetry.io/otel/sdk-1.43.0
build: bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.43.0
2026-04-11 07:30:35 +02:00
dependabot[bot]
af79d5480c
build: bump go.opentelemetry.io/otel/sdk from 1.40.0 to 1.43.0
Bumps [go.opentelemetry.io/otel/sdk](https://github.com/open-telemetry/opentelemetry-go) from 1.40.0 to 1.43.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-go/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/open-telemetry/opentelemetry-go/compare/v1.40.0...v1.43.0)

---
updated-dependencies:
- dependency-name: go.opentelemetry.io/otel/sdk
  dependency-version: 1.43.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-08 21:53:40 +00:00
Alex Bosworth
21acb23486
Merge pull request #1116 from lightninglabs/alexbosworth-patch-14
version: bump version to v0.33.0-beta
2026-04-08 08:26:18 -07:00
Alex Bosworth
7943875d3f
version: bump version to v0.33.0-beta
bump version to v0.33.0-beta
2026-04-07 09:58:12 -07:00
Boris Nagaev
0aab352991
Merge pull request #1114 from starius/max-fee-rate
cmd/loop: add max swap fee flags for static in
2026-04-07 10:57:42 -05:00
Boris Nagaev
ad7b92e839
docs: regenerate loop CLI reference 2026-04-06 23:06:55 -05:00