Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/lit-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runs:
- name: Clone LiT repository
uses: actions/checkout@v4
with:
repository: lightninglabs/lightning-terminal
repository: ${{ env.LITD_ITEST_REPOSITORY || 'lightninglabs/lightning-terminal' }}
ref: ${{ env.LITD_ITEST_BRANCH }}
path: lightning-terminal

Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ env:
# If you change this value, please change it in the following files as well:
# /Dockerfile
GO_VERSION: 1.27.3
LITD_ITEST_BRANCH: master
# Test the coordinated migration until lightning-terminal#1438 lands.
LITD_ITEST_REPOSITORY: hieblmi/lightning-terminal
LITD_ITEST_BRANCH: 020303943686284e08669995b02eda03841b06d2

jobs:
########################
Expand Down
20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,6 @@ GOBUILD := CGO_ENABLED=0 GO111MODULE=on go build -v
GOINSTALL := CGO_ENABLED=0 GO111MODULE=on go install -v
GOMOD := GO111MODULE=on go mod

# GitLab-backed module sources can reject CI runner traffic. Seed GitLab and
# modernc.org modules through the public Go proxy before the direct check.
MOD_CHECK_FILES := go.mod go.sum swapserverrpc/go.mod swapserverrpc/go.sum \
looprpc/go.mod looprpc/go.sum tools/go.mod tools/go.sum
MOD_CHECK_PREFETCH := $(shell awk '($$1 ~ /^(gitlab\.com\/|modernc\.org\/)/) { \
version=$$2; sub("/go.mod$$", "", version); \
if (version ~ /^v/) print $$1 "@" version; \
}' $(MOD_CHECK_FILES) | sort -u)

COMMIT := $(shell git describe --abbrev=40 --dirty --tags)
COMMIT_HASH := $(shell git rev-parse HEAD)
DIRTY := $(shell git diff-index --quiet HEAD -- || echo dirty)
Expand Down Expand Up @@ -165,13 +156,10 @@ mod-tidy:

mod-check:
@$(call print, "Checking modules.")
ifneq ($(MOD_CHECK_PREFETCH),)
@GOPROXY=https://proxy.golang.org $(GOMOD) download $(MOD_CHECK_PREFETCH)
endif
GOPROXY=direct $(GOMOD) tidy
cd swapserverrpc/ && GOPROXY=direct $(GOMOD) tidy
cd looprpc/ && GOPROXY=direct $(GOMOD) tidy
cd tools/ && GOPROXY=direct $(GOMOD) tidy
$(GOMOD) tidy
cd swapserverrpc/ && $(GOMOD) tidy
cd looprpc/ && $(GOMOD) tidy
cd tools/ && $(GOMOD) tidy
if test -n "$$(git status --porcelain)"; then echo "Running go mod tidy changes go.mod/go.sum"; git status; git diff; exit 1; fi

commitmsg-lint:
Expand Down
2 changes: 1 addition & 1 deletion assets/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"sync"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/taproot-assets/rfqmath"
"github.com/lightninglabs/taproot-assets/taprpc"
"github.com/lightninglabs/taproot-assets/taprpc/priceoraclerpc"
Expand Down
2 changes: 1 addition & 1 deletion assets/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/taproot-assets/taprpc/rfqrpc"
"github.com/lightninglabs/taproot-assets/taprpc/universerpc"
"github.com/lightningnetwork/lnd/lnwire"
Expand Down
13 changes: 7 additions & 6 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"sync/atomic"
"time"

btcaddr "github.com/btcsuite/btcd/address/v2"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/btcec/v2/schnorr"
"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/btcsuite/btcd/chainhash/v2"
"github.com/lightninglabs/aperture/l402"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop/assets"
Expand Down Expand Up @@ -714,7 +715,7 @@ func (s *Client) getLoopOutSweepFee(ctx context.Context, confTarget int32) (
// type is chosen because it adds the most weight of all output types
// and we want the quote to return a worst case value.
wsh := [32]byte{}
p2wshAddress, err := btcutil.NewAddressWitnessScriptHash(
p2wshAddress, err := btcaddr.NewAddressWitnessScriptHash(
wsh[:], s.lndServices.ChainParams,
)
if err != nil {
Expand Down Expand Up @@ -916,7 +917,7 @@ func (s *Client) estimateFee(ctx context.Context, amt btcutil.Amount,
confTarget int32) (btcutil.Amount, error) {

var (
address btcutil.Address
address btcaddr.Address
err error
)
// Generate a dummy address for fee estimation.
Expand All @@ -927,11 +928,11 @@ func (s *Client) estimateFee(ctx context.Context, amt btcutil.Amount,
)

if scriptVersion != swap.HtlcV3 {
address, err = btcutil.NewAddressWitnessScriptHash(
address, err = btcaddr.NewAddressWitnessScriptHash(
witnessProg[:], s.lndServices.ChainParams,
)
} else {
address, err = btcutil.NewAddressTaproot(
address, err = btcaddr.NewAddressTaproot(
witnessProg[:], s.lndServices.ChainParams,
)
}
Expand Down
9 changes: 5 additions & 4 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"errors"
"testing"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
btcaddr "github.com/btcsuite/btcd/address/v2"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/btcsuite/btcd/chaincfg/v2"
"github.com/btcsuite/btcd/chainhash/v2"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
Expand All @@ -23,7 +24,7 @@ import (
)

var (
testAddr, _ = btcutil.NewAddressScriptHash(
testAddr, _ = btcaddr.NewAddressScriptHash(
[]byte{123}, &chaincfg.TestNet3Params,
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/feecap.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"math/big"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/loop/looprpc"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/feecap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"math"
"testing"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/loop/looprpc"
"github.com/stretchr/testify/require"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/loopout.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/loop"
"github.com/lightninglabs/loop/labels"
"github.com/lightninglabs/loop/loopdb"
Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"syscall"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop"
"github.com/lightninglabs/loop/loopd"
Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/quote.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"os"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/loop"
"github.com/lightninglabs/loop/looprpc"
"github.com/lightninglabs/taproot-assets/rfqmath"
Expand Down
6 changes: 3 additions & 3 deletions cmd/loop/staticaddr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"strings"
"testing"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/btcsuite/btcd/chainhash/v2"
"github.com/btcsuite/btcd/wire/v2"
"github.com/lightninglabs/loop/looprpc"
"github.com/lightninglabs/loop/staticaddr/deposit"
"github.com/lightninglabs/loop/staticaddr/loopin"
Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/sweephtlc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"encoding/hex"
"fmt"

"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcd/wire/v2"
"github.com/lightninglabs/loop/looprpc"
"github.com/urfave/cli/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/loop/terms.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"fmt"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/loop/looprpc"
"github.com/urfave/cli/v3"
)
Expand Down
2 changes: 1 addition & 1 deletion cost_migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/v2"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
Expand Down
2 changes: 1 addition & 1 deletion cost_migration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"testing"
"time"

"github.com/btcsuite/btcd/btcutil"
"github.com/btcsuite/btcd/btcutil/v2"
"github.com/lightninglabs/lndclient"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/test"
Expand Down
15 changes: 15 additions & 0 deletions docs/release-notes/release-notes-next.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,28 @@

#### Breaking Changes

* Loop now uses the btcd v2 modules. Projects compiling against Loop's
exported Go APIs must migrate address, transaction, and related types to the
corresponding btcd v2 packages.
The lnd snapshot retains the v0.21.4 forwarding-response recovery fixes.
[PR #1199](https://github.com/lightninglabs/loop/pull/1199)

#### Bug Fixes

* The `postgres.maxconnections` option now limits the number of open
connections to the Postgres server. It was ignored before, so concurrent
requests could open more connections than the server accepts. If the option
isn't set, loopd now opens at most 25 connections.

* Setting a P2PKH or P2SH address or a raw public key as the autoloop
destination no longer crashes loopd. The address is now decoded for the
active network, and a raw public key is rejected.

* Autoloop, Instant Out, static address withdrawals and manual HTLC sweeps now
reject destination addresses of another network, as Loop Out already did. If
the saved autoloop destination belongs to another network, loopd removes it
at startup, and autoloop pays to wallet addresses.

#### Maintenance

#### Contributors (Alphabetical Order)
Loading
Loading