Skip to content

Commit

Permalink
Merge branch 'lnd/v0.18.3-beta'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.circleci/config.yml
#	Makefile
#	README.md
#	build/version.go
#	go.mod
#	go.sum
#	linuxamd64.Dockerfile
#	linuxarm32v7.Dockerfile
#	linuxarm64v8.Dockerfile
  • Loading branch information
rockstardev committed Oct 15, 2024
2 parents 8742a9a + ae4bb33 commit 4812090
Show file tree
Hide file tree
Showing 397 changed files with 30,561 additions and 14,781 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
multiarch:
machine:
enabled: true
image: ubuntu-2204:2022.04.1
image: default
steps:
- run:
command: |
Expand Down
15 changes: 15 additions & 0 deletions .github/actions/rebase/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: "Rebase on to the PR target base branch"
description: "A reusable workflow that's used to rebase the PR code on to the target base branch."

runs:
using: "composite"

steps:
- name: fetch and rebase on ${{ github.base_ref }}
shell: bash
run: |
git remote add upstream https://github.com/${{ github.repository }}
git fetch upstream ${{ github.base_ref }}:refs/remotes/upstream/${{ github.base_ref }}
export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="LND CI"
git rebase upstream/${{ github.base_ref }}
4 changes: 2 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Steps for reviewers to follow to test the change.
- [ ] Commits follow the [Ideal Git Commit Structure](https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md#IdealGitCommitStructure).
- [ ] Any new logging statements use an appropriate subsystem and logging level.
- [ ] Any new lncli commands have appropriate tags in the comments for the rpc in the proto file.
- [ ] [There is a change description in the release notes](https://github.com/lightningnetwork/lnd/tree/master/docs/release-notes), or `[skip ci]` in the commit message for small changes.
- [ ] [There is a change description in the release notes](https://github.com/lightningnetwork/lnd/tree/master/docs/release-notes), or `[skip ci]` in the commit message for small changes.

📝 Please see our [Contribution Guidelines](https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md) for further guidance.
📝 Please see our [Contribution Guidelines](https://github.com/lightningnetwork/lnd/blob/master/docs/code_contribution_guidelines.md) for further guidance.
41 changes: 31 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ defaults:

env:
BITCOIN_VERSION: "27"

TRANCHES: 8

# If you change this value, please change it in the following files as well:
# /.travis.yml
# /Dockerfile
# /dev.Dockerfile
# /make/builder.Dockerfile
# /.github/workflows/release.yml
GO_VERSION: 1.22.3
GO_VERSION: 1.22.5

jobs:
########################
Expand Down Expand Up @@ -101,12 +103,7 @@ jobs:
go-version: '${{ env.GO_VERSION }}'

- name: fetch and rebase on ${{ github.base_ref }}
run: |
git remote add upstream https://github.com/${{ github.repository }}
git fetch upstream
export GIT_COMMITTER_EMAIL="[email protected]"
export GIT_COMMITTER_NAME="LND CI"
git rebase upstream/${{ github.base_ref }}
uses: ./.github/actions/rebase

- name: check commits
run: scripts/check-each-commit.sh upstream/${{ github.base_ref }}
Expand Down Expand Up @@ -198,6 +195,12 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase

- name: git checkout fuzzing seeds
uses: actions/checkout@v3
Expand Down Expand Up @@ -264,6 +267,12 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase

- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
Expand All @@ -275,7 +284,7 @@ jobs:
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION

- name: run ${{ matrix.name }}
run: make itest-parallel ${{ matrix.args }}
run: make itest-parallel tranches=${{ env.TRANCHES }} ${{ matrix.args }}

- name: Send coverage
if: ${{ contains(matrix.args, 'cover=1') }}
Expand Down Expand Up @@ -309,6 +318,12 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase

- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
Expand All @@ -317,7 +332,7 @@ jobs:
key-prefix: integration-test

- name: run itest
run: make itest-parallel windows=1
run: make itest-parallel tranches=${{ env.TRANCHES }} windows=1

- name: kill any remaining lnd processes
if: ${{ failure() }}
Expand Down Expand Up @@ -347,6 +362,12 @@ jobs:
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase

- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
Expand All @@ -361,7 +382,7 @@ jobs:
mv bitcoin-${BITCOIN_VERSION}.0 /tmp/bitcoin
- name: run itest
run: PATH=$PATH:/tmp/bitcoin/bin make itest-parallel backend=bitcoind
run: PATH=$PATH:/tmp/bitcoin/bin make itest-parallel tranches=${{ env.TRANCHES }} backend=bitcoind

- name: Zip log files on failure
if: ${{ failure() }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
# /dev.Dockerfile
# /make/builder.Dockerfile
# /.github/workflows/main.yml
GO_VERSION: 1.22.3
GO_VERSION: 1.22.5

jobs:
main:
Expand All @@ -40,11 +40,10 @@ jobs:
run: SKIP_VERSION_CHECK=1 make release tag=${{ env.RELEASE_VERSION }}

- name: Create Release
uses: lightninglabs/gh-actions/action-gh-release@2021.01.25.00
uses: lightninglabs/gh-actions/action-gh-release@c7149b6a7818d1c39b36b69e727569897b6f2c5a
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.RELEASE_VERSION }}
name: lnd ${{ env.RELEASE_VERSION }}
draft: true
prerelease: false
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ linters-settings:
- G306 # Poor file permissions used when writing to a new file.

staticcheck:
go: "1.21"
go: "1.22.5"
checks: ["-SA1019"]

lll:
Expand Down Expand Up @@ -104,11 +104,13 @@ linters-settings:
- 'errors.Wrap'

gomoddirectives:
replace-local: true
replace-allow-list:
# See go.mod for the explanation why these are needed.
- github.com/ulikunitz/xz
- github.com/gogo/protobuf
- google.golang.org/protobuf
- github.com/lightningnetwork/lnd/sqldb


linters:
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# If you change this value, please change it in the following files as well:
# /.travis.yml
# /dev.Dockerfile
# /make/builder.Dockerfile
# /.github/workflows/main.yml
# /.github/workflows/release.yml
FROM golang:1.22.3-alpine as builder
FROM golang:1.22.5-alpine as builder

# Force Go to use the cgo based DNS resolver. This is required to ensure DNS
# queries required to connect to linked containers succeed.
Expand Down
35 changes: 31 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,25 @@ COMMIT := $(shell git describe --tags --dirty)
COMMIT := $(subst -dirty,-fresh-btcpay,$(COMMIT))
LDFLAGS := -ldflags "-X $(PKG)/build.Commit=$(COMMIT)"

GO_VERSION := $(shell go version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
GO_VERSION_MINOR := $(shell echo $(GO_VERSION) | cut -d. -f2)
# Determine the minor version of the active Go installation.
ACTIVE_GO_VERSION := $(shell go version | sed -nre 's/^[^0-9]*(([0-9]+\.)*[0-9]+).*/\1/p')
ACTIVE_GO_VERSION_MINOR := $(shell echo $(ACTIVE_GO_VERSION) | cut -d. -f2)

LOOPVARFIX :=
ifeq ($(shell expr $(ACTIVE_GO_VERSION_MINOR) \>= 21), 1)
LOOPVARFIX := GOEXPERIMENT=loopvar
endif

LOOPVARFIX :=
ifeq ($(shell expr $(GO_VERSION_MINOR) \>= 21), 1)
LOOPVARFIX := GOEXPERIMENT=loopvar
endif

# GO_VERSION is the Go version used for the release build, docker files, and
# GitHub Actions. This is the reference version for the project. All other Go
# versions are checked against this version.
GO_VERSION = 1.22.5

GOBUILD := $(LOOPVARFIX) go build -v
GOINSTALL := $(LOOPVARFIX) go install -v
GOTEST := $(LOOPVARFIX) go test
Expand Down Expand Up @@ -300,11 +311,27 @@ fmt-check: fmt
@$(call print, "Checking fmt results.")
if test -n "$$(git status --porcelain)"; then echo "code not formatted correctly, please run `make fmt` again!"; git status; git diff; exit 1; fi

#? lint: Run static code analysis
lint: docker-tools
#? check-go-version-yaml: Verify that the Go version is correct in all YAML files
check-go-version-yaml:
@$(call print, "Checking for target Go version (v$(GO_VERSION)) in YAML files (*.yaml, *.yml)")
./scripts/check-go-version-yaml.sh $(GO_VERSION)

#? check-go-version-dockerfile: Verify that the Go version is correct in all Dockerfile files
check-go-version-dockerfile:
@$(call print, "Checking for target Go version (v$(GO_VERSION)) in Dockerfile files (*Dockerfile)")
./scripts/check-go-version-dockerfile.sh $(GO_VERSION)

#? check-go-version: Verify that the Go version is correct in all project files
check-go-version: check-go-version-dockerfile check-go-version-yaml

#? lint-source: Run static code analysis
lint-source: docker-tools
@$(call print, "Linting source.")
$(DOCKER_TOOLS) golangci-lint run -v $(LINT_WORKERS)

#? lint: Run static code analysis
lint: check-go-version lint-source

#? protolint: Lint proto files using protolint
protolint:
@$(call print, "Linting proto files.")
Expand Down
6 changes: 3 additions & 3 deletions aezeed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process. A lack of a birthday means that wallets don’t know how far
back to look in the chain to ensure that they derive all the proper
user addresses. Additionally, BIP39 use a very weak [KDF](https://en.wikipedia.org/wiki/Key_derivation_function). We use
scrypt with modern parameters (n=32768, r=8, p=1). A set of benchmarks has
been added, on my laptop I get about 100ms per attempt):
been added, on my laptop I get about 100ms per attempt:

```shell
$ go test -run=XXX -bench=.
Expand Down Expand Up @@ -48,13 +48,13 @@ the keys of the wallet.

The 2 byte timestamp is expressed in Bitcoin Days Genesis, meaning that
the number of days since the timestamp in Bitcoin’s genesis block. This
allow us to save space, and also avoid using a wasteful level of
allows us to save space, and also avoid using a wasteful level of
granularity. This can currently express time up until 2188.

Finally, the entropy is raw entropy that should be used to derive the
wallet’s HD root.

## aezeed enciphering/deciperhing
## aezeed enciphering/deciphering

Next, we’ll take the plaintext seed described above and encipher it to
procure a final cipher text. We’ll then take this cipher text (the
Expand Down
8 changes: 5 additions & 3 deletions autopilot/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (d *dbNode) Addrs() []net.Addr {
//
// NOTE: Part of the autopilot.Node interface.
func (d *dbNode) ForEachChannel(cb func(ChannelEdge) error) error {
return d.db.ForEachNodeChannel(d.tx, d.node.PubKeyBytes,
return d.db.ForEachNodeChannelTx(d.tx, d.node.PubKeyBytes,
func(tx kvdb.RTx, ei *models.ChannelEdgeInfo, ep,
_ *models.ChannelEdgePolicy) error {

Expand All @@ -105,7 +105,9 @@ func (d *dbNode) ForEachChannel(cb func(ChannelEdge) error) error {
return nil
}

node, err := d.db.FetchLightningNode(tx, ep.ToNode)
node, err := d.db.FetchLightningNodeTx(
tx, ep.ToNode,
)
if err != nil {
return err
}
Expand Down Expand Up @@ -164,7 +166,7 @@ func (d *databaseChannelGraph) addRandChannel(node1, node2 *btcec.PublicKey,
return nil, err
}

dbNode, err := d.db.FetchLightningNode(nil, vertex)
dbNode, err := d.db.FetchLightningNode(vertex)
switch {
case err == channeldb.ErrGraphNodeNotFound:
fallthrough
Expand Down
4 changes: 2 additions & 2 deletions autopilot/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import (

"github.com/btcsuite/btcd/btcec/v2"
"github.com/btcsuite/btcd/wire"
"github.com/lightningnetwork/lnd/graph"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/routing"
)

// ManagerCfg houses a set of values and methods that is passed to the Manager
Expand Down Expand Up @@ -36,7 +36,7 @@ type ManagerCfg struct {

// SubscribeTopology is used to get a subscription for topology changes
// on the network.
SubscribeTopology func() (*routing.TopologyClient, error)
SubscribeTopology func() (*graph.TopologyClient, error)
}

// Manager is struct that manages an autopilot agent, making it possible to
Expand Down
2 changes: 1 addition & 1 deletion brontide/noise.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ type Machine struct {
// errors that cause partial writes.
nextHeaderSend []byte

// nextHeaderBody holds a reference to the remaining body bytes to write
// nextBodySend holds a reference to the remaining body bytes to write
// out for a pending message. This allows us to tolerate timeout errors
// that cause partial writes.
nextBodySend []byte
Expand Down
2 changes: 1 addition & 1 deletion brontide/noise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ func TestConnectionCorrectness(t *testing.T) {
}
}

// TestConecurrentHandshakes verifies the listener's ability to not be blocked
// TestConcurrentHandshakes verifies the listener's ability to not be blocked
// by other pending handshakes. This is tested by opening multiple tcp
// connections with the listener, without completing any of the brontide acts.
// The test passes if real brontide dialer connects while the others are
Expand Down
2 changes: 1 addition & 1 deletion build/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const (
AppMinor uint = 18

// AppPatch defines the application patch for this binary.
AppPatch uint = 1
AppPatch uint = 3

// AppPreRelease MUST only contain characters from semanticAlphabet per
// the semantic versioning spec.
Expand Down
7 changes: 6 additions & 1 deletion chainntnfs/bitcoindnotify/bitcoind.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ func (b *BitcoindNotifier) Stop() error {

close(epochClient.epochChan)
}
b.txNotifier.TearDown()

// The txNotifier is only initialized in the start method therefore we
// need to make sure we don't access a nil pointer here.
if b.txNotifier != nil {
b.txNotifier.TearDown()
}

// Stop the mempool notifier.
b.memNotifier.TearDown()
Expand Down
7 changes: 6 additions & 1 deletion chainntnfs/bitcoindnotify/bitcoind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,19 @@ func syncNotifierWithMiner(t *testing.T, notifier *BitcoindNotifier,
"height: %v", err)
}

t.Logf("miner height=%v, bitcoind height=%v", minerHeight,
bitcoindHeight)

if bitcoindHeight == minerHeight {
return uint32(bitcoindHeight)
}

select {
case <-time.After(100 * time.Millisecond):
case <-timeout:
t.Fatalf("timed out waiting to sync notifier")
t.Fatalf("timed out in syncNotifierWithMiner, got "+
"err=%v, minerHeight=%v, bitcoindHeight=%v",
err, minerHeight, bitcoindHeight)
}
}
}
Expand Down
Loading

0 comments on commit 4812090

Please sign in to comment.