Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: use bitcoind v26.0 for CI #8273

Merged
merged 13 commits into from
Mar 20, 2024
Merged
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
44 changes: 41 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ defaults:
shell: bash

env:
BITCOIN_VERSION: "23.0"
BITCOIN_VERSION: "26"

# If you change this value, please change it in the following files as well:
# /.travis.yml
Expand Down Expand Up @@ -215,7 +215,7 @@ jobs:
key-prefix: unit-test

- name: install bitcoind
run: ./scripts/install_bitcoind.sh
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION

- name: run ${{ matrix.unit_type }}
run: make log="stdlog debug" ${{ matrix.unit_type }}
Expand Down Expand Up @@ -271,7 +271,7 @@ jobs:
key-prefix: integration-test

- name: install bitcoind
run: ./scripts/install_bitcoind.sh
run: ./scripts/install_bitcoind.sh $BITCOIN_VERSION

- name: run ${{ matrix.name }}
run: make itest-parallel ${{ matrix.args }}
Expand Down Expand Up @@ -328,6 +328,44 @@ jobs:
path: logs-itest-windows.zip
retention-days: 5

########################
# run macOS integration test
guggero marked this conversation as resolved.
Show resolved Hide resolved
########################
macos-integration-test:
name: run macOS itest
runs-on: macos-14
if: '!contains(github.event.pull_request.labels.*.name, ''no-itest'')'
steps:
- name: git checkout
uses: actions/checkout@v3

- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: integration-test

- name: install bitcoind
run: |
wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}.0/bitcoin-${BITCOIN_VERSION}.0-arm64-apple-darwin.tar.gz
tar zxvf bitcoin-${BITCOIN_VERSION}.0-arm64-apple-darwin.tar.gz
mv bitcoin-${BITCOIN_VERSION}.0 /tmp/bitcoin

- name: run itest
run: PATH=$PATH:/tmp/bitcoin/bin make itest-parallel backend=bitcoind

- name: Zip log files on failure
if: ${{ failure() }}
timeout-minutes: 5 # timeout after 5 minute
run: 7z a logs-itest-macos.zip itest/**/*.log

- name: Upload log files on failure
uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: logs-itest-macos
path: logs-itest-macos.zip
retention-days: 5

########################
# check pinned dependencies
Expand Down
46 changes: 0 additions & 46 deletions .travis.yml

This file was deleted.

17 changes: 9 additions & 8 deletions chainntnfs/bitcoindnotify/bitcoind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/lightningnetwork/lnd/blockcache"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lntest/unittest"
"github.com/lightningnetwork/lnd/lntest/wait"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -61,7 +62,7 @@ func setUpNotifier(t *testing.T, bitcoindConn *chain.BitcoindConn,
t.Helper()

notifier := New(
bitcoindConn, chainntnfs.NetParams, spendHintCache,
bitcoindConn, unittest.NetParams, spendHintCache,
confirmHintCache, blockCache,
)
if err := notifier.Start(); err != nil {
Expand Down Expand Up @@ -119,12 +120,12 @@ func TestHistoricalConfDetailsTxIndex(t *testing.T) {
}

func testHistoricalConfDetailsTxIndex(t *testing.T, rpcPolling bool) {
miner := chainntnfs.NewMiner(
t, []string{"--txindex"}, true, 25,
miner := unittest.NewMiner(
t, unittest.NetParams, []string{"--txindex"}, true, 25,
)

bitcoindConn := chainntnfs.NewBitcoindBackend(
t, miner.P2PAddress(), true, rpcPolling,
bitcoindConn := unittest.NewBitcoindBackend(
t, unittest.NetParams, miner.P2PAddress(), true, rpcPolling,
)

hintCache := initHintCache(t)
Expand Down Expand Up @@ -217,10 +218,10 @@ func TestHistoricalConfDetailsNoTxIndex(t *testing.T) {
}

func testHistoricalConfDetailsNoTxIndex(t *testing.T, rpcpolling bool) {
miner := chainntnfs.NewMiner(t, nil, true, 25)
miner := unittest.NewMiner(t, unittest.NetParams, nil, true, 25)

bitcoindConn := chainntnfs.NewBitcoindBackend(
t, miner.P2PAddress(), false, rpcpolling,
bitcoindConn := unittest.NewBitcoindBackend(
t, unittest.NetParams, miner.P2PAddress(), false, rpcpolling,
)

hintCache := initHintCache(t)
Expand Down
9 changes: 5 additions & 4 deletions chainntnfs/btcdnotify/btcd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/lightningnetwork/lnd/blockcache"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lntest/unittest"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -55,7 +56,7 @@ func setUpNotifier(t *testing.T, h *rpctest.Harness) *BtcdNotifier {

rpcCfg := h.RPCConfig()
notifier, err := New(
&rpcCfg, chainntnfs.NetParams, hintCache, hintCache, blockCache,
&rpcCfg, unittest.NetParams, hintCache, hintCache, blockCache,
)
require.NoError(t, err, "unable to create notifier")
if err := notifier.Start(); err != nil {
Expand All @@ -73,8 +74,8 @@ func setUpNotifier(t *testing.T, h *rpctest.Harness) *BtcdNotifier {
func TestHistoricalConfDetailsTxIndex(t *testing.T) {
t.Parallel()

harness := chainntnfs.NewMiner(
t, []string{"--txindex"}, true, 25,
harness := unittest.NewMiner(
t, unittest.NetParams, []string{"--txindex"}, true, 25,
)

notifier := setUpNotifier(t, harness)
Expand Down Expand Up @@ -145,7 +146,7 @@ func TestHistoricalConfDetailsTxIndex(t *testing.T) {
func TestHistoricalConfDetailsNoTxIndex(t *testing.T) {
t.Parallel()

harness := chainntnfs.NewMiner(t, nil, true, 25)
harness := unittest.NewMiner(t, unittest.NetParams, nil, true, 25)

notifier := setUpNotifier(t, harness)

Expand Down
49 changes: 19 additions & 30 deletions chainntnfs/test/test_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"github.com/lightningnetwork/lnd/chainntnfs/btcdnotify"
"github.com/lightningnetwork/lnd/chainntnfs/neutrinonotify"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lntest/unittest"
"github.com/lightningnetwork/lnd/lnutils"
"github.com/stretchr/testify/require"
)
Expand Down Expand Up @@ -1043,14 +1044,9 @@ func testReorgConf(miner *rpctest.Harness,
notifier chainntnfs.TestChainNotifier, scriptDispatch bool, t *testing.T) {

// Set up a new miner that we can use to cause a reorg.
miner2, err := rpctest.New(
chainntnfs.NetParams, nil, []string{"--txindex"}, "",
miner2 := unittest.NewMiner(
t, unittest.NetParams, []string{"--txindex"}, false, 0,
)
require.NoError(t, err, "unable to create mining node")
if err := miner2.SetUp(false, 0); err != nil {
t.Fatalf("unable to set up mining node: %v", err)
}
defer miner2.TearDown()

// We start by connecting the new miner to our original miner,
// such that it will sync to our original chain.
Expand Down Expand Up @@ -1204,14 +1200,9 @@ func testReorgSpend(miner *rpctest.Harness,
require.NoError(t, err, "unable to register for spend")

// Set up a new miner that we can use to cause a reorg.
miner2, err := rpctest.New(
chainntnfs.NetParams, nil, []string{"--txindex"}, "",
miner2 := unittest.NewMiner(
t, unittest.NetParams, []string{"--txindex"}, false, 0,
)
require.NoError(t, err, "unable to create mining node")
if err := miner2.SetUp(false, 0); err != nil {
t.Fatalf("unable to set up mining node: %v", err)
}
defer miner2.TearDown()

// We start by connecting the new miner to our original miner, in order
// to have a consistent view of the chain from both miners. They should
Expand Down Expand Up @@ -1527,14 +1518,9 @@ func testCatchUpOnMissedBlocksWithReorg(miner1 *rpctest.Harness,
var wg sync.WaitGroup

// Set up a new miner that we can use to cause a reorg.
miner2, err := rpctest.New(
chainntnfs.NetParams, nil, []string{"--txindex"}, "",
miner2 := unittest.NewMiner(
t, unittest.NetParams, []string{"--txindex"}, false, 0,
)
require.NoError(t, err, "unable to create mining node")
if err := miner2.SetUp(false, 0); err != nil {
t.Fatalf("unable to set up mining node: %v", err)
}
defer miner2.TearDown()

// We start by connecting the new miner to our original miner,
// such that it will sync to our original chain.
Expand Down Expand Up @@ -1905,7 +1891,7 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
// dedicated miner to generate blocks, cause re-orgs, etc. We'll set up
// this node with a chain length of 125, so we have plenty of BTC to
// play around with.
miner := chainntnfs.NewMiner(t, nil, true, 25)
miner := unittest.NewMiner(t, unittest.NetParams, nil, true, 25)

rpcConfig := miner.RPCConfig()
p2pAddr := miner.P2PAddress()
Expand Down Expand Up @@ -1944,39 +1930,42 @@ func TestInterfaces(t *testing.T, targetBackEnd string) {
switch notifierType {
case "bitcoind":
var bitcoindConn *chain.BitcoindConn
bitcoindConn = chainntnfs.NewBitcoindBackend(
t, p2pAddr, true, false,
bitcoindConn = unittest.NewBitcoindBackend(
t, unittest.NetParams, p2pAddr, true, false,
)
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return bitcoindnotify.New(
bitcoindConn, chainntnfs.NetParams,
bitcoindConn, unittest.NetParams,
hintCache, hintCache, blockCache,
), nil
}

case "bitcoind-rpc-polling":
var bitcoindConn *chain.BitcoindConn
bitcoindConn = chainntnfs.NewBitcoindBackend(
t, p2pAddr, true, true,
bitcoindConn = unittest.NewBitcoindBackend(
t, unittest.NetParams, p2pAddr, true, true,
)
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return bitcoindnotify.New(
bitcoindConn, chainntnfs.NetParams,
bitcoindConn, unittest.NetParams,
hintCache, hintCache, blockCache,
), nil
}

case "btcd":
configCopy := rpcConfig
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return btcdnotify.New(
&rpcConfig, chainntnfs.NetParams,
&configCopy, unittest.NetParams,
hintCache, hintCache, blockCache,
)
}

case "neutrino":
var spvNode *neutrino.ChainService
spvNode = chainntnfs.NewNeutrinoBackend(t, p2pAddr)
spvNode = unittest.NewNeutrinoBackend(
t, unittest.NetParams, p2pAddr,
)
newNotifier = func() (chainntnfs.TestChainNotifier, error) {
return neutrinonotify.New(
spvNode, hintCache, hintCache,
Expand Down
Loading
Loading