Skip to content

Commit 6cddcf2

Browse files
committed
multi: update LND and friends
This commit updates: - LND - pool - loop - taproot-assets - faraday - lighting-node-connect - aperture - lndclient - btclog We start using the new btclog v2 library and the associated breaking changes in the lnd/build package. With this commit, we deprecate the `--remote.lit-maxlogfiles` and `--remote.lit-maxlogfilesize` options and introduce new logging options under the `--remote.lit-logging` namespace. Finally, the LND update introduced a new `MaxBlocksMinedPerTest` variable in the `lntest` package that we now need to override in order for our itests to pass.
1 parent 1bf419e commit 6cddcf2

File tree

24 files changed

+269
-239
lines changed

24 files changed

+269
-239
lines changed

accounts/context.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import (
44
"context"
55
"fmt"
66

7-
"github.com/btcsuite/btclog"
8-
"github.com/lightningnetwork/lnd/build"
7+
"github.com/btcsuite/btclog/v2"
98
)
109

1110
// ContextKey is the type that we use to identify account specific values in the
@@ -95,5 +94,5 @@ func requestScopedValuesFromCtx(ctx context.Context) (btclog.Logger,
9594

9695
prefix := fmt.Sprintf("[account: %s, request: %d]", acc.ID, reqID)
9796

98-
return build.NewPrefixLog(prefix, log), acc, reqID, nil
97+
return log.WithPrefix(prefix), acc, reqID, nil
9998
}

accounts/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package accounts
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

autopilotserver/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package autopilotserver
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

autopilotserver/mock/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package mock
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

config.go

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ const (
5454

5555
defaultConfigFilename = "lit.conf"
5656

57-
defaultLogLevel = "info"
58-
defaultMaxLogFiles = 3
59-
defaultMaxLogFileSize = 10
57+
defaultLogLevel = "info"
6058

6159
defaultLetsEncryptSubDir = "letsencrypt"
6260
defaultLetsEncryptListen = ":80"
@@ -285,15 +283,17 @@ func (c *Config) lndConnectParams() (string, lndclient.Network, string,
285283

286284
// defaultConfig returns a configuration struct with all default values set.
287285
func defaultConfig() *Config {
286+
defaultLogCfg := build.DefaultLogConfig()
288287
return &Config{
289288
HTTPSListen: defaultHTTPSListen,
290289
TLSCertPath: DefaultTLSCertPath,
291290
TLSKeyPath: defaultTLSKeyPath,
292291
Remote: &subservers.RemoteConfig{
292+
LitLogConfig: defaultLogCfg,
293293
LitDebugLevel: defaultLogLevel,
294294
LitLogDir: defaultLogDir,
295-
LitMaxLogFiles: defaultMaxLogFiles,
296-
LitMaxLogFileSize: defaultMaxLogFileSize,
295+
LitMaxLogFiles: defaultLogCfg.File.MaxLogFiles,
296+
LitMaxLogFileSize: defaultLogCfg.File.MaxLogFileSize,
297297
Lnd: &subservers.RemoteDaemonConfig{
298298
RPCServer: defaultRemoteLndRpcServer,
299299
MacaroonPath: DefaultRemoteLndMacaroonPath,
@@ -376,11 +376,21 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
376376
os.Exit(0)
377377
}
378378

379+
// The logging config we use to initialise the sub-logger manager below
380+
// depends on whether we're running in remote mode or not.
381+
logCfg := preCfg.Lnd.LogConfig
382+
if preCfg.LndMode == ModeRemote {
383+
logCfg = preCfg.Remote.LitLogConfig
384+
}
385+
379386
// Before we validate the config, we first hook up our own loggers.
380387
// This must be done before the config is validated if LND is running
381388
// in integrated mode so that the log levels for various non-LND related
382389
// subsystems can be set via the `lnd.debuglevel` flag.
383-
SetupLoggers(preCfg.Lnd.LogWriter, interceptor)
390+
preCfg.Lnd.SubLogMgr = build.NewSubLoggerManager(
391+
build.NewDefaultLogHandlers(logCfg, preCfg.Lnd.LogRotator)...,
392+
)
393+
SetupLoggers(preCfg.Lnd.SubLogMgr, interceptor)
384394

385395
// Load the main configuration file and parse any command line options.
386396
// This function will also set up logging properly.
@@ -413,7 +423,7 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
413423
debuglevel += fmt.Sprintf(",%s=off", GrpcLogSubsystem)
414424
}
415425

416-
err = build.ParseAndSetDebugLevels(debuglevel, cfg.Lnd.LogWriter)
426+
err = build.ParseAndSetDebugLevels(debuglevel, cfg.Lnd.SubLogMgr)
417427
if err != nil {
418428
return nil, err
419429
}
@@ -753,16 +763,34 @@ func validateRemoteModeConfig(cfg *Config) error {
753763

754764
r.LitLogDir = lncfg.CleanAndExpandPath(r.LitLogDir)
755765

766+
// Initialize the log manager with the actual logging configuration. We
767+
// need to support the deprecated max log files and max log file size
768+
// options for now.
769+
if r.LitMaxLogFiles != build.DefaultMaxLogFiles {
770+
log.Warnf("Config option 'remote.lit-maxlogfiles' is " +
771+
"deprecated, please use " +
772+
"'remote.lit-logging.file.max-files' instead")
773+
774+
r.LitLogConfig.File.MaxLogFiles = r.LitMaxLogFiles
775+
}
776+
if r.LitMaxLogFileSize != build.DefaultMaxLogFileSize {
777+
log.Warnf("Config option 'remote.lit-maxlogfilesize' is " +
778+
"deprecated, please use " +
779+
"'remote.lit-logging.file.max-file-size' instead")
780+
781+
r.LitLogConfig.File.MaxLogFileSize = r.LitMaxLogFileSize
782+
}
783+
756784
// In remote mode, we don't call lnd's ValidateConfig that sets up a
757785
// logging backend for us. We need to manually create and start one. The
758786
// root logger should've already been created as part of the default
759787
// config though.
760-
if cfg.Lnd.LogWriter == nil {
761-
cfg.Lnd.LogWriter = build.NewRotatingLogWriter()
788+
if cfg.Lnd.LogRotator == nil {
789+
cfg.Lnd.LogRotator = build.NewRotatingLogWriter()
762790
}
763-
err := cfg.Lnd.LogWriter.InitLogRotator(
791+
err := cfg.Lnd.LogRotator.InitLogRotator(
792+
cfg.Remote.LitLogConfig.File,
764793
filepath.Join(r.LitLogDir, cfg.Network, defaultLogFilename),
765-
r.LitMaxLogFileSize, r.LitMaxLogFiles,
766794
)
767795
if err != nil {
768796
return fmt.Errorf("log rotation setup failed: %v", err.Error())

db/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package db
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

db/migrations.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"net/http"
1010
"strings"
1111

12-
"github.com/btcsuite/btclog"
12+
"github.com/btcsuite/btclog/v2"
1313
"github.com/golang-migrate/migrate/v4"
1414
"github.com/golang-migrate/migrate/v4/database"
1515
"github.com/golang-migrate/migrate/v4/source/httpfs"

firewall/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package firewall
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

firewalldb/log.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package firewalldb
22

33
import (
4-
"github.com/btcsuite/btclog"
4+
"github.com/btcsuite/btclog/v2"
55
"github.com/lightningnetwork/lnd/build"
66
)
77

go.mod

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/lightninglabs/lightning-terminal
22

33
require (
4-
github.com/btcsuite/btcd v0.24.3-0.20240921052913-67b8efd3ba53
4+
github.com/btcsuite/btcd v0.24.3-0.20241210095828-e646d437e95b
55
github.com/btcsuite/btcd/btcec/v2 v2.3.4
66
github.com/btcsuite/btcd/btcutil v1.1.5
77
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0
8-
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c
8+
github.com/btcsuite/btclog/v2 v2.0.1-0.20250110154127-3ae4bf1cb318
99
github.com/btcsuite/btcwallet/walletdb v1.4.4
1010
github.com/davecgh/go-spew v1.1.1
1111
github.com/go-errors/errors v1.0.1
@@ -16,41 +16,42 @@ require (
1616
github.com/jackc/pgerrcode v0.0.0-20240316143900-6e2875d9b438
1717
github.com/jessevdk/go-flags v1.4.0
1818
github.com/lib/pq v1.10.9
19-
github.com/lightninglabs/faraday v0.2.14-alpha
19+
github.com/lightninglabs/faraday v0.2.14-alpha.0.20250305102803-f668619b351e
2020
github.com/lightninglabs/faraday/frdrpc v1.0.0
21-
github.com/lightninglabs/lightning-node-connect v0.3.2-alpha.0.20240822142323-ee4e7ff52f83
21+
github.com/lightninglabs/lightning-node-connect v0.3.3-alpha.0.20250306111457-cad4234830cc
2222
github.com/lightninglabs/lightning-terminal/autopilotserverrpc v0.0.2
2323
github.com/lightninglabs/lightning-terminal/litrpc v1.0.1
24-
github.com/lightninglabs/lndclient v0.18.4-9
25-
github.com/lightninglabs/loop v0.29.0-beta
26-
github.com/lightninglabs/loop/looprpc v1.0.3
27-
github.com/lightninglabs/loop/swapserverrpc v1.0.12
28-
github.com/lightninglabs/pool v0.6.5-beta.0.20241015105339-044cb451b5df
29-
github.com/lightninglabs/pool/auctioneerrpc v1.1.2
30-
github.com/lightninglabs/pool/poolrpc v1.0.0
31-
github.com/lightninglabs/taproot-assets v0.5.1
32-
github.com/lightningnetwork/lnd v0.18.5-beta
24+
github.com/lightninglabs/lndclient v0.19.0-2
25+
github.com/lightninglabs/loop v0.29.0-beta.rc2.0.20250306160707-1091a628755c
26+
github.com/lightninglabs/loop/looprpc v1.0.4-0.20250306160707-1091a628755c
27+
github.com/lightninglabs/loop/swapserverrpc v1.0.13-0.20250306160707-1091a628755c
28+
github.com/lightninglabs/pool v0.6.5-beta.0.20250305125211-4e860ec4e77f
29+
github.com/lightninglabs/pool/auctioneerrpc v1.1.3-0.20250305125211-4e860ec4e77f
30+
github.com/lightninglabs/pool/poolrpc v1.0.1-0.20250305125211-4e860ec4e77f
31+
github.com/lightninglabs/taproot-assets v0.5.2-0.20250313171535-331ac78538a3
32+
github.com/lightningnetwork/lnd v0.18.0-beta.rc4.0.20250310214651-97bba5752089
3333
github.com/lightningnetwork/lnd/cert v1.2.2
3434
github.com/lightningnetwork/lnd/clock v1.1.1
3535
github.com/lightningnetwork/lnd/fn v1.2.3
36-
github.com/lightningnetwork/lnd/kvdb v1.4.10
37-
github.com/lightningnetwork/lnd/tlv v1.2.6
38-
github.com/lightningnetwork/lnd/tor v1.1.2
36+
github.com/lightningnetwork/lnd/fn/v2 v2.0.8
37+
github.com/lightningnetwork/lnd/kvdb v1.4.12
38+
github.com/lightningnetwork/lnd/tlv v1.3.0
39+
github.com/lightningnetwork/lnd/tor v1.1.5
3940
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f
4041
github.com/mwitkow/grpc-proxy v0.0.0-20230212185441-f345521cb9c9
4142
github.com/ory/dockertest/v3 v3.10.0
4243
github.com/stretchr/testify v1.9.0
43-
github.com/urfave/cli v1.22.9
44+
github.com/urfave/cli v1.22.14
4445
go.etcd.io/bbolt v1.3.11
45-
golang.org/x/crypto v0.31.0
46+
golang.org/x/crypto v0.35.0
4647
golang.org/x/exp v0.0.0-20240325151524-a685a6edb6d8
47-
golang.org/x/net v0.33.0
48-
golang.org/x/sync v0.10.0
48+
golang.org/x/net v0.36.0
49+
golang.org/x/sync v0.11.0
4950
google.golang.org/grpc v1.65.0
5051
google.golang.org/protobuf v1.34.2
5152
gopkg.in/macaroon-bakery.v2 v2.1.0
5253
gopkg.in/macaroon.v2 v2.1.0
53-
modernc.org/sqlite v1.30.0
54+
modernc.org/sqlite v1.34.5
5455
)
5556

5657
require (
@@ -66,6 +67,7 @@ require (
6667
github.com/andybalholm/brotli v1.0.4 // indirect
6768
github.com/beorn7/perks v1.0.1 // indirect
6869
github.com/btcsuite/btcd/btcutil/psbt v1.1.10 // indirect
70+
github.com/btcsuite/btclog v0.0.0-20241003133417-09c4e92e319c // indirect
6971
github.com/btcsuite/btcwallet v0.16.10-0.20241127094224-93c858b2ad63 // indirect
7072
github.com/btcsuite/btcwallet/wallet/txauthor v1.3.5 // indirect
7173
github.com/btcsuite/btcwallet/wallet/txrules v1.2.2 // indirect
@@ -81,8 +83,8 @@ require (
8183
github.com/coreos/bbolt v1.3.3 // indirect
8284
github.com/coreos/go-semver v0.3.0 // indirect
8385
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf // indirect
84-
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
85-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
86+
github.com/coreos/go-systemd/v22 v22.5.0 // indirect
87+
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
8688
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
8789
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect
8890
github.com/decred/dcrd/lru v1.1.2 // indirect
@@ -92,12 +94,12 @@ require (
9294
github.com/docker/go-connections v0.4.0 // indirect
9395
github.com/docker/go-units v0.5.0 // indirect
9496
github.com/dustin/go-humanize v1.0.1 // indirect
95-
github.com/felixge/httpsnoop v1.0.4 // indirect
9697
github.com/fergusstrange/embedded-postgres v1.25.0 // indirect
9798
github.com/fortytw2/leaktest v1.3.0 // indirect
9899
github.com/go-logr/logr v1.4.2 // indirect
99100
github.com/go-logr/stdr v1.2.2 // indirect
100101
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
102+
github.com/goccy/go-yaml v1.15.23 // indirect
101103
github.com/gogo/protobuf v1.3.2 // indirect
102104
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
103105
github.com/golang/protobuf v1.5.4 // indirect
@@ -113,7 +115,6 @@ require (
113115
github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect
114116
github.com/hashicorp/errwrap v1.1.0 // indirect
115117
github.com/hashicorp/go-multierror v1.1.1 // indirect
116-
github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect
117118
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
118119
github.com/jackc/pgio v1.0.0 // indirect
119120
github.com/jackc/pgpassfile v1.0.0 // indirect
@@ -135,15 +136,15 @@ require (
135136
github.com/klauspost/compress v1.17.9 // indirect
136137
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
137138
github.com/libdns/libdns v0.2.1 // indirect
138-
github.com/lightninglabs/aperture v0.3.4-beta // indirect
139+
github.com/lightninglabs/aperture v0.3.8-beta.0.20250305101039-2eead0180691 // indirect
139140
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf // indirect
140141
github.com/lightninglabs/lightning-node-connect/hashmailrpc v1.0.2 // indirect
141142
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd // indirect
142143
github.com/lightninglabs/neutrino/cache v1.1.2 // indirect
143144
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240712235311-98bd56499dfb // indirect
144-
github.com/lightningnetwork/lnd/healthcheck v1.2.5 // indirect
145+
github.com/lightningnetwork/lnd/healthcheck v1.2.6 // indirect
145146
github.com/lightningnetwork/lnd/queue v1.1.1 // indirect
146-
github.com/lightningnetwork/lnd/sqldb v1.0.4 // indirect
147+
github.com/lightningnetwork/lnd/sqldb v1.0.7 // indirect
147148
github.com/lightningnetwork/lnd/ticker v1.1.1 // indirect
148149
github.com/ltcsuite/ltcd v0.0.0-20190101042124-f37f8bf35796 // indirect
149150
github.com/mattn/go-isatty v0.0.20 // indirect
@@ -152,13 +153,14 @@ require (
152153
github.com/mholt/acmez v1.0.4 // indirect
153154
github.com/miekg/dns v1.1.50 // indirect
154155
github.com/moby/docker-image-spec v1.3.1 // indirect
156+
github.com/moby/sys/user v0.3.0 // indirect
155157
github.com/moby/term v0.5.0 // indirect
156158
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
157159
github.com/modern-go/reflect2 v1.0.2 // indirect
158160
github.com/ncruces/go-strftime v0.1.9 // indirect
159161
github.com/opencontainers/go-digest v1.0.0 // indirect
160162
github.com/opencontainers/image-spec v1.0.2 // indirect
161-
github.com/opencontainers/runc v1.1.14 // indirect
163+
github.com/opencontainers/runc v1.2.0 // indirect
162164
github.com/pkg/errors v0.9.1 // indirect
163165
github.com/pmezard/go-difflib v1.0.0 // indirect
164166
github.com/prometheus/client_golang v1.14.0 // indirect
@@ -169,10 +171,9 @@ require (
169171
github.com/rivo/uniseg v0.2.0 // indirect
170172
github.com/rogpeppe/fastuuid v1.2.0 // indirect
171173
github.com/rs/cors v1.7.0 // indirect
172-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
174+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
173175
github.com/shopspring/decimal v1.3.1 // indirect
174-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
175-
github.com/sirupsen/logrus v1.9.2 // indirect
176+
github.com/sirupsen/logrus v1.9.3 // indirect
176177
github.com/soheilhy/cmux v0.1.5 // indirect
177178
github.com/spf13/pflag v1.0.5 // indirect
178179
github.com/stretchr/objx v0.5.2 // indirect
@@ -205,9 +206,9 @@ require (
205206
go.uber.org/multierr v1.6.0 // indirect
206207
go.uber.org/zap v1.23.0 // indirect
207208
golang.org/x/mod v0.17.0 // indirect
208-
golang.org/x/sys v0.28.0 // indirect
209-
golang.org/x/term v0.27.0 // indirect
210-
golang.org/x/text v0.21.0 // indirect
209+
golang.org/x/sys v0.30.0 // indirect
210+
golang.org/x/term v0.29.0 // indirect
211+
golang.org/x/text v0.22.0 // indirect
211212
golang.org/x/time v0.3.0 // indirect
212213
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
213214
google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b // indirect
@@ -217,12 +218,9 @@ require (
217218
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
218219
gopkg.in/yaml.v2 v2.4.0 // indirect
219220
gopkg.in/yaml.v3 v3.0.1 // indirect
220-
modernc.org/gc/v3 v3.0.0-20240107210532-573471604cb6 // indirect
221-
modernc.org/libc v1.50.9 // indirect
221+
modernc.org/libc v1.55.3 // indirect
222222
modernc.org/mathutil v1.6.0 // indirect
223223
modernc.org/memory v1.8.0 // indirect
224-
modernc.org/strutil v1.2.0 // indirect
225-
modernc.org/token v1.1.0 // indirect
226224
nhooyr.io/websocket v1.8.7 // indirect
227225
pgregory.net/rapid v1.1.0 // indirect
228226
sigs.k8s.io/yaml v1.2.0 // indirect

0 commit comments

Comments
 (0)