Skip to content

Commit 402d9a8

Browse files
committed
gomod: bump lnd to version 0.18.0-beta
1 parent 60c149f commit 402d9a8

File tree

10 files changed

+29
-33
lines changed

10 files changed

+29
-33
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ require (
2020
github.com/jessevdk/go-flags v1.4.0
2121
github.com/lib/pq v1.10.9
2222
github.com/lightninglabs/aperture v0.3.2-beta
23-
github.com/lightninglabs/lndclient v0.18.0-0
23+
github.com/lightninglabs/lndclient v0.18.0-1
2424
github.com/lightninglabs/loop/swapserverrpc v1.0.5
25-
github.com/lightningnetwork/lnd v0.18.0-beta.rc3
25+
github.com/lightningnetwork/lnd v0.18.0-beta
2626
github.com/lightningnetwork/lnd/cert v1.2.2
2727
github.com/lightningnetwork/lnd/clock v1.1.1
2828
github.com/lightningnetwork/lnd/queue v1.1.1
@@ -198,4 +198,4 @@ replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-d
198198

199199
replace github.com/lightninglabs/loop/swapserverrpc => ./swapserverrpc
200200

201-
go 1.21.4
201+
go 1.22.3

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,8 +1110,8 @@ github.com/lightninglabs/aperture v0.3.2-beta h1:J2GQwBmSHxpr5VOatXbgrTogF/qN2l6
11101110
github.com/lightninglabs/aperture v0.3.2-beta/go.mod h1:M/5dPzHjHvuYXQuxzicqaGiCclHUvKW6N0ay1t/HGiM=
11111111
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf h1:HZKvJUHlcXI/f/O0Avg7t8sqkPo78HFzjmeYFl6DPnc=
11121112
github.com/lightninglabs/gozmq v0.0.0-20191113021534-d20a764486bf/go.mod h1:vxmQPeIQxPf6Jf9rM8R+B4rKBqLA2AjttNxkFBL2Plk=
1113-
github.com/lightninglabs/lndclient v0.18.0-0 h1:dx7rms+8IZMzN/bcjfvBO8of9JAJzoAsOyw9jeDN43w=
1114-
github.com/lightninglabs/lndclient v0.18.0-0/go.mod h1:XMt97uW9EJ8JqL8Acnh6mDc+1A6/FkIvcA06+M1tUt0=
1113+
github.com/lightninglabs/lndclient v0.18.0-1 h1:b9ur24NTbNRUOfotkhio6SAlkvXADLz9k7QLIlLYpSk=
1114+
github.com/lightninglabs/lndclient v0.18.0-1/go.mod h1:GBIttLpj+W82XrZrFvQ1gpQH074aTcwisP/zvdGbqE4=
11151115
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd h1:D8aRocHpoCv43hL8egXEMYyPmyOiefFHZ66338KQB2s=
11161116
github.com/lightninglabs/neutrino v0.16.1-0.20240425105051-602843d34ffd/go.mod h1:x3OmY2wsA18+Kc3TSV2QpSUewOCiscw2mKpXgZv2kZk=
11171117
github.com/lightninglabs/neutrino/cache v1.1.2 h1:C9DY/DAPaPxbFC+xNNEI/z1SJY9GS3shmlu5hIQ798g=
@@ -1120,8 +1120,8 @@ github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display h1:Y2WiPkBS
11201120
github.com/lightninglabs/protobuf-go-hex-display v1.33.0-hex-display/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
11211121
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f h1:Pua7+5TcFEJXIIZ1I2YAUapmbcttmLj4TTi786bIi3s=
11221122
github.com/lightningnetwork/lightning-onion v1.2.1-0.20230823005744-06182b1d7d2f/go.mod h1:c0kvRShutpj3l6B9WtTsNTBUtjSmjZXbJd9ZBRQOSKI=
1123-
github.com/lightningnetwork/lnd v0.18.0-beta.rc3 h1:tO/yJA9SnrWKK+/m+Vi+A0/i0eUHYXLQu0F/8TGtxww=
1124-
github.com/lightningnetwork/lnd v0.18.0-beta.rc3/go.mod h1:1SA9iv9rZddNAcfP38SN9lNSVT1zf5aqmukLUoomjDU=
1123+
github.com/lightningnetwork/lnd v0.18.0-beta h1:3cH7npkUh156FI5kb6bZbiO+Fl3YD+Bu2UbFKoLZ4lo=
1124+
github.com/lightningnetwork/lnd v0.18.0-beta/go.mod h1:1SA9iv9rZddNAcfP38SN9lNSVT1zf5aqmukLUoomjDU=
11251125
github.com/lightningnetwork/lnd/cert v1.2.2 h1:71YK6hogeJtxSxw2teq3eGeuy4rHGKcFf0d0Uy4qBjI=
11261126
github.com/lightningnetwork/lnd/cert v1.2.2/go.mod h1:jQmFn/Ez4zhDgq2hnYSw8r35bqGVxViXhX6Cd7HXM6U=
11271127
github.com/lightningnetwork/lnd/clock v1.1.1 h1:OfR3/zcJd2RhH0RU+zX/77c0ZiOnIMsDIBjgjWdZgA0=

instantout/instantout.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ func (i *InstantOut) generateHtlcSweepTx(ctx context.Context,
381381
return nil, err
382382
}
383383

384-
fee := feeRate.FeeForWeight(int64(weightEstimator.Weight()))
384+
fee := feeRate.FeeForWeight(weightEstimator.Weight())
385385

386386
htlcOutValue := i.finalizedHtlcTx.TxOut[0].Value
387387
output := &wire.TxOut{
@@ -424,7 +424,7 @@ func (i *InstantOut) generateHtlcSweepTx(ctx context.Context,
424424
}
425425

426426
// htlcWeight returns the weight for the htlc transaction.
427-
func htlcWeight(numInputs int) int64 {
427+
func htlcWeight(numInputs int) lntypes.WeightUnit {
428428
var weightEstimator input.TxWeightEstimator
429429
for i := 0; i < numInputs; i++ {
430430
weightEstimator.AddTaprootKeySpendInput(
@@ -434,11 +434,11 @@ func htlcWeight(numInputs int) int64 {
434434

435435
weightEstimator.AddP2WSHOutput()
436436

437-
return int64(weightEstimator.Weight())
437+
return weightEstimator.Weight()
438438
}
439439

440440
// sweeplessSweepWeight returns the weight for the sweepless sweep transaction.
441-
func sweeplessSweepWeight(numInputs int) int64 {
441+
func sweeplessSweepWeight(numInputs int) lntypes.WeightUnit {
442442
var weightEstimator input.TxWeightEstimator
443443
for i := 0; i < numInputs; i++ {
444444
weightEstimator.AddTaprootKeySpendInput(
@@ -448,7 +448,7 @@ func sweeplessSweepWeight(numInputs int) int64 {
448448

449449
weightEstimator.AddP2TROutput()
450450

451-
return int64(weightEstimator.Weight())
451+
return weightEstimator.Weight()
452452
}
453453

454454
// pubkeyTo33ByteSlice converts a pubkey to a 33 byte slice.

liquidity/loopin.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func loopInSweepFee(fee chainfee.SatPerKWeight) btcutil.Amount {
7777
maxSize := htlc.MaxTimeoutWitnessSize()
7878

7979
estimator.AddWitnessInput(maxSize)
80-
weight := int64(estimator.Weight())
8180

82-
return fee.FeeForWeight(weight)
81+
return fee.FeeForWeight(estimator.Weight())
8382
}

loopin.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -837,7 +837,7 @@ func getTxFee(tx *wire.MsgTx, fee chainfee.SatPerKVByte) btcutil.Amount {
837837
btcTx := btcutil.NewTx(tx)
838838
vsize := mempool.GetTxVirtualSize(btcTx)
839839

840-
return fee.FeeForVSize(vsize)
840+
return fee.FeeForVSize(lntypes.VByte(vsize))
841841
}
842842

843843
// waitForSwapComplete waits until a spending tx of the htlc gets confirmed and

loopout_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"github.com/lightninglabs/loop/sweepbatcher"
1818
"github.com/lightninglabs/loop/test"
1919
"github.com/lightningnetwork/lnd/lnrpc"
20+
"github.com/lightningnetwork/lnd/lntypes"
2021
"github.com/lightningnetwork/lnd/lnwallet/chainfee"
2122
"github.com/lightningnetwork/lnd/zpay32"
2223
"github.com/stretchr/testify/require"
@@ -423,7 +424,7 @@ func testCustomSweepConfTarget(t *testing.T) {
423424
)
424425
require.NoError(t, err, "unable to retrieve fee estimate")
425426

426-
minFee := feeRate.FeeForWeight(weight)
427+
minFee := feeRate.FeeForWeight(lntypes.WeightUnit(weight))
427428
// Just an estimate that works to sanity check fee upper bound.
428429
maxFee := btcutil.Amount(float64(minFee) * 1.5)
429430

swap/htlc.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ type HtlcScript interface {
6363

6464
// MaxSuccessWitnessSize returns the maximum witness size for the
6565
// success case witness.
66-
MaxSuccessWitnessSize() int
66+
MaxSuccessWitnessSize() lntypes.WeightUnit
6767

6868
// MaxTimeoutWitnessSize returns the maximum witness size for the
6969
// timeout case witness.
70-
MaxTimeoutWitnessSize() int
70+
MaxTimeoutWitnessSize() lntypes.WeightUnit
7171

7272
// TimeoutScript returns the redeem script required to unlock the htlc
7373
// after timeout.
@@ -436,7 +436,7 @@ func (h *HtlcScriptV2) SuccessScript() []byte {
436436
}
437437

438438
// MaxSuccessWitnessSize returns maximum success witness size.
439-
func (h *HtlcScriptV2) MaxSuccessWitnessSize() int {
439+
func (h *HtlcScriptV2) MaxSuccessWitnessSize() lntypes.WeightUnit {
440440
// Calculate maximum success witness size
441441
//
442442
// - number_of_witness_elements: 1 byte
@@ -446,11 +446,11 @@ func (h *HtlcScriptV2) MaxSuccessWitnessSize() int {
446446
// - preimage: 32 bytes
447447
// - witness_script_length: 1 byte
448448
// - witness_script: len(script) bytes
449-
return 1 + 1 + 73 + 1 + 32 + 1 + len(h.script)
449+
return lntypes.WeightUnit(1 + 1 + 73 + 1 + 32 + 1 + len(h.script))
450450
}
451451

452452
// MaxTimeoutWitnessSize returns maximum timeout witness size.
453-
func (h *HtlcScriptV2) MaxTimeoutWitnessSize() int {
453+
func (h *HtlcScriptV2) MaxTimeoutWitnessSize() lntypes.WeightUnit {
454454
// Calculate maximum timeout witness size
455455
//
456456
// - number_of_witness_elements: 1 byte
@@ -461,7 +461,7 @@ func (h *HtlcScriptV2) MaxTimeoutWitnessSize() int {
461461
// - zero: 1 byte
462462
// - witness_script_length: 1 byte
463463
// - witness_script: len(script) bytes
464-
return 1 + 1 + 73 + 1 + 33 + 1 + 1 + len(h.script)
464+
return lntypes.WeightUnit(1 + 1 + 73 + 1 + 33 + 1 + 1 + len(h.script))
465465
}
466466

467467
// SuccessSequence returns the sequence to spend this htlc in the success case.
@@ -735,7 +735,7 @@ func (h *HtlcScriptV3) SuccessScript() []byte {
735735

736736
// MaxSuccessWitnessSize returns the maximum witness size for the
737737
// success case witness.
738-
func (h *HtlcScriptV3) MaxSuccessWitnessSize() int {
738+
func (h *HtlcScriptV3) MaxSuccessWitnessSize() lntypes.WeightUnit {
739739
// Calculate maximum success witness size
740740
//
741741
// - number_of_witness_elements: 1 byte
@@ -755,7 +755,7 @@ func (h *HtlcScriptV3) MaxSuccessWitnessSize() int {
755755

756756
// MaxTimeoutWitnessSize returns the maximum witness size for the
757757
// timeout case witness.
758-
func (h *HtlcScriptV3) MaxTimeoutWitnessSize() int {
758+
func (h *HtlcScriptV3) MaxTimeoutWitnessSize() lntypes.WeightUnit {
759759
// Calculate maximum timeout witness size
760760
//
761761
// - number_of_witness_elements: 1 byte
@@ -768,7 +768,7 @@ func (h *HtlcScriptV3) MaxTimeoutWitnessSize() int {
768768
// - leafVersionAndParity: 1
769769
// - internalPubkey: 32
770770
// - proof: 32
771-
return 1 + 1 + 64 + 1 + 36 + 1 + 65
771+
return lntypes.WeightUnit(1 + 1 + 64 + 1 + 36 + 1 + 65)
772772
}
773773

774774
// SuccessSequence returns the sequence to spend this htlc in the

sweep/sweeper.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,5 +217,5 @@ func (s *Sweeper) GetSweepFee(ctx context.Context,
217217

218218
weight := weightEstimate.Weight()
219219

220-
return feeRate.FeeForWeight(int64(weight)), nil
220+
return feeRate.FeeForWeight(weight), nil
221221
}

sweepbatcher/sweep_batch.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -696,9 +696,7 @@ func (b *batch) publishBatch(ctx context.Context) (btcutil.Amount, error) {
696696

697697
weightEstimate.AddP2TROutput()
698698

699-
totalWeight := int64(weightEstimate.Weight())
700-
701-
fee = b.rbfCache.FeeRate.FeeForWeight(totalWeight)
699+
fee = b.rbfCache.FeeRate.FeeForWeight(weightEstimate.Weight())
702700

703701
// Clamp the calculated fee to the max allowed fee amount for the batch.
704702
fee = clampBatchFee(fee, batchAmt)
@@ -828,9 +826,7 @@ func (b *batch) publishBatchCoop(ctx context.Context) (btcutil.Amount,
828826

829827
weightEstimate.AddP2TROutput()
830828

831-
totalWeight := int64(weightEstimate.Weight())
832-
833-
fee = b.rbfCache.FeeRate.FeeForWeight(totalWeight)
829+
fee = b.rbfCache.FeeRate.FeeForWeight(weightEstimate.Weight())
834830

835831
// Clamp the calculated fee to the max allowed fee amount for the batch.
836832
fee = clampBatchFee(fee, batchAmt)

tools/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.21
1+
FROM golang:1.22
22

33
RUN apt-get update && apt-get install -y git
44
ENV GOCACHE=/tmp/build/.cache

0 commit comments

Comments
 (0)