Skip to content

Commit d7cd8f1

Browse files
committed
go: replace lightning-onion with fork
Use fork github.com/gijswijs/lightning-onion at commit fac332540872 to include onion-messaging support before the upstream PR is merged. This temporary replace in go.mod ensures compatibility with the current module path while allowing local development and CI to build with the new functionality.
1 parent 0b14d46 commit d7cd8f1

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ linters:
160160
- github.com/gogo/protobuf
161161
- google.golang.org/protobuf
162162
- github.com/lightningnetwork/lnd/sqldb
163+
- github.com/lightningnetwork/lightning-onion
163164
replace-local: true
164165

165166
gosec:

go.mod

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ require (
8282
github.com/containerd/continuity v0.3.0 // indirect
8383
github.com/coreos/go-semver v0.3.0 // indirect
8484
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
85-
github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect
85+
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
8686
github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect
8787
github.com/decred/dcrd/lru v1.1.2 // indirect
8888
github.com/docker/cli v28.1.1+incompatible // indirect
@@ -148,8 +148,7 @@ require (
148148
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
149149
github.com/rivo/uniseg v0.2.0 // indirect
150150
github.com/rogpeppe/fastuuid v1.2.0 // indirect
151-
github.com/russross/blackfriday/v2 v2.0.1 // indirect
152-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
151+
github.com/russross/blackfriday/v2 v2.1.0 // indirect
153152
github.com/sirupsen/logrus v1.9.2 // indirect
154153
github.com/soheilhy/cmux v0.1.5 // indirect
155154
github.com/spf13/pflag v1.0.6 // indirect
@@ -213,6 +212,12 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
213212
// allows us to specify that as an option.
214213
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display
215214

215+
// This replace is for https://github.com/lightningnetwork/lnd/pull/10089 If
216+
// github.com/lightningnetwork/lightning-onion/pull/68 is merged we need to bump
217+
// the version of the dependency and remove this replace and also remove the
218+
// correspondong entry in replace-allow-list in .golangci.yml.
219+
replace github.com/lightningnetwork/lightning-onion => github.com/gijswijs/lightning-onion v0.0.0-20250915140630-fac332540872
220+
216221
// If you change this please also update docs/INSTALL.md and GO_VERSION in
217222
// Makefile (then run `make lint` to see where else it needs to be updated as
218223
// well).

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f/go.mod h1:F5haX7
111111
github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI=
112112
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
113113
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
114-
github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
115-
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
114+
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
115+
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
116116
github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
117117
github.com/creack/pty v1.1.18 h1:n56/Zwd5o6whRC5PMGretI4IdRLlmBXYNjScPaBgsbY=
118118
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
@@ -160,6 +160,8 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4
160160
github.com/fsnotify/fsnotify v1.5.4 h1:jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
161161
github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
162162
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
163+
github.com/gijswijs/lightning-onion v0.0.0-20250915140630-fac332540872 h1:hVmecsLGFuzN+4+nRMzKPs71r32zdCU33It6h/4TaGQ=
164+
github.com/gijswijs/lightning-onion v0.0.0-20250915140630-fac332540872/go.mod h1:RyABSGwaY11fBV9iwO95PFOne2XcFHeev+VrPqGsA6Y=
163165
github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
164166
github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
165167
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
@@ -368,8 +370,6 @@ github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3
368370
github.com/lightninglabs/neutrino/cache v1.1.2/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo=
369371
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS/00EiEg0qp0FhehxnQfk3vv8U6Xt3nN+rTY=
370372
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
371-
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9 h1:6D3LrdagJweLLdFm1JNodZsBk6iU4TTsBBFLQ4yiXfI=
372-
github.com/lightningnetwork/lightning-onion v1.2.1-0.20240815225420-8b40adf04ab9/go.mod h1:EDqJ3MuZIbMq0QI1czTIKDJ/GS8S14RXPwapHw8cw6w=
373373
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
374374
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
375375
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=
@@ -487,13 +487,13 @@ github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWN
487487
github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ=
488488
github.com/rs/zerolog v1.13.0/go.mod h1:YbFCdg8HfsridGWAh22vktObvhZbQsZXe4/zB0OKkWU=
489489
github.com/rs/zerolog v1.15.0/go.mod h1:xYTKnLHcpfU2225ny5qZjxnj9NvkumZYjJHlAThCjNc=
490-
github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q=
491490
github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
491+
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
492+
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
492493
github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0=
493494
github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
494495
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
495496
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
496-
github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo=
497497
github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
498498
github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
499499
github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q=

htlcswitch/hop/fuzz_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func FuzzHopData(f *testing.F) {
3939

4040
func FuzzHopPayload(f *testing.F) {
4141
f.Fuzz(func(t *testing.T, data []byte) {
42-
if len(data) > sphinx.MaxPayloadSize {
42+
if len(data) > sphinx.MaxRoutingPayloadSize {
4343
return
4444
}
4545

@@ -129,7 +129,7 @@ func FuzzPayloadIntermediateNoBlinding(f *testing.F) {
129129

130130
func fuzzPayload(f *testing.F, finalPayload, updateAddBlinded bool) {
131131
f.Fuzz(func(t *testing.T, data []byte) {
132-
if len(data) > sphinx.MaxPayloadSize {
132+
if len(data) > sphinx.MaxRoutingPayloadSize {
133133
return
134134
}
135135

routing/pathfind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ func findPath(g *graphParams, r *RestrictParams, cfg *PathFindingConfig,
975975

976976
routingInfoSize := toNodeDist.routingInfoSize + payloadSize
977977
// Skip paths that would exceed the maximum routing info size.
978-
if routingInfoSize > sphinx.MaxPayloadSize {
978+
if routingInfoSize > sphinx.MaxRoutingPayloadSize {
979979
return
980980
}
981981

0 commit comments

Comments
 (0)