Skip to content

Commit 3930014

Browse files
author
MarcoFalke
committed
Merge #18864: Add v0.16.3 backwards compatibility test, bump v0.19.0.1 to v0.19.1
d135c29 [ci] make list of previous releases to download a setting (Sjors Provoost) 9c246b8 [test] backwards compatibility: bump v0.19.0.1 to v0.19.1 (Sjors Provoost) 89a28e0 [test] add v0.16.3 backwards compatibility test (Sjors Provoost) Pull request description: Thanks to #18774's `adjust_bitcoin_conf_for_pre_17` we can now test backwards compatibility for v0.16.3, both for sync and loading a recent wallet. This PR bumps v0.19.0.1 to v0.19.1. I also made the version list consistent for the `contrib/devtools/previous_release.sh` instruction, between both tests. ACKs for top commit: MarcoFalke: ACK d135c29 Tree-SHA512: 5ff137a7a934237fa220f1c2807ce9abeeb75929266558bf3e4045bec7dfcd0a8747fa74d700065c568330b18badf58c60c308eb13d1eed444d4bbfe6decc48b
2 parents f547532 + d135c29 commit 3930014

File tree

4 files changed

+43
-15
lines changed

4 files changed

+43
-15
lines changed

ci/test/00_setup_env_native_qt5.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export RUN_UNIT_TESTS_SEQUENTIAL="true"
1414
export RUN_UNIT_TESTS="false"
1515
export GOAL="install"
1616
export TEST_PREVIOUS_RELEASES=true
17+
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.1 v0.18.1 v0.19.1"
1718
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-glibc-back-compat --enable-reduce-exports --enable-c++17 --enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\""

ci/test/05_before_script.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ if [ -z "$NO_DEPENDS" ]; then
3535
fi
3636
DOCKER_EXEC $SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS
3737
fi
38-
if [ "$TEST_PREVIOUS_RELEASES" = "true" ]; then
38+
if [ -n "$PREVIOUS_RELEASES_TO_DOWNLOAD" ]; then
3939
BEGIN_FOLD previous-versions
40-
DOCKER_EXEC contrib/devtools/previous_release.sh -b -t "$PREVIOUS_RELEASES_DIR" v0.15.2 v0.16.3 v0.17.1 v0.18.1 v0.19.0.1
40+
DOCKER_EXEC contrib/devtools/previous_release.sh -b -t "$PREVIOUS_RELEASES_DIR" "${PREVIOUS_RELEASES_TO_DOWNLOAD}"
4141
END_FOLD
4242
fi

test/functional/feature_backwards_compatibility.py

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
77
Test various backwards compatibility scenarios. Download the previous node binaries:
88
9-
contrib/devtools/previous_release.sh -b v0.19.0.1 v0.18.1 v0.17.1
9+
contrib/devtools/previous_release.sh -b v0.19.1 v0.18.1 v0.17.1 v0.16.3 v0.15.2
10+
11+
v0.15.2 is not required by this test, but it is used in wallet_upgradewallet.py.
12+
Due to a hardfork in regtest, it can't be used to sync nodes.
13+
1014
1115
Due to RPC changes introduced in various versions the below tests
1216
won't work for older versions without some patches or workarounds.
@@ -22,6 +26,7 @@
2226
from test_framework.descriptors import descsum_create
2327

2428
from test_framework.util import (
29+
adjust_bitcoin_conf_for_pre_17,
2530
assert_equal,
2631
sync_blocks,
2732
sync_mempools,
@@ -31,14 +36,15 @@
3136
class BackwardsCompatibilityTest(BitcoinTestFramework):
3237
def set_test_params(self):
3338
self.setup_clean_chain = True
34-
self.num_nodes = 5
39+
self.num_nodes = 6
3540
# Add new version after each release:
3641
self.extra_args = [
3742
["-addresstype=bech32"], # Pre-release: use to mine blocks
3843
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # Pre-release: use to receive coins, swap wallets, etc
39-
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.19.0.1
44+
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.19.1
4045
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.18.1
41-
["-nowallet", "-walletrbf=1", "-addresstype=bech32"] # v0.17.1
46+
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.17.1
47+
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.16.3
4248
]
4349

4450
def skip_test_if_missing_module(self):
@@ -49,10 +55,13 @@ def setup_nodes(self):
4955
self.add_nodes(self.num_nodes, extra_args=self.extra_args, versions=[
5056
None,
5157
None,
52-
190001,
58+
190100,
5359
180100,
5460
170100,
61+
160300,
5562
])
63+
# adapt bitcoin.conf, because older bitcoind's don't recognize config sections
64+
adjust_bitcoin_conf_for_pre_17(self.nodes[5].bitcoinconf)
5665

5766
self.start_nodes()
5867

@@ -65,10 +74,11 @@ def run_test(self):
6574
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
6675
assert_equal(res['blocks'], 101)
6776

68-
node_master = self.nodes[self.num_nodes - 4]
69-
node_v19 = self.nodes[self.num_nodes - 3]
70-
node_v18 = self.nodes[self.num_nodes - 2]
71-
node_v17 = self.nodes[self.num_nodes - 1]
77+
node_master = self.nodes[self.num_nodes - 5]
78+
node_v19 = self.nodes[self.num_nodes - 4]
79+
node_v18 = self.nodes[self.num_nodes - 3]
80+
node_v17 = self.nodes[self.num_nodes - 2]
81+
node_v16 = self.nodes[self.num_nodes - 1]
7282

7383
self.log.info("Test wallet backwards compatibility...")
7484
# Create a number of wallets and open them in older versions:
@@ -167,13 +177,21 @@ def run_test(self):
167177
node_v19_wallets_dir = os.path.join(node_v19.datadir, "regtest/wallets")
168178
node_v18_wallets_dir = os.path.join(node_v18.datadir, "regtest/wallets")
169179
node_v17_wallets_dir = os.path.join(node_v17.datadir, "regtest/wallets")
180+
node_v16_wallets_dir = os.path.join(node_v16.datadir, "regtest")
170181
node_master.unloadwallet("w1")
171182
node_master.unloadwallet("w2")
172183
node_v19.unloadwallet("w1_v19")
173184
node_v19.unloadwallet("w2_v19")
174185
node_v18.unloadwallet("w1_v18")
175186
node_v18.unloadwallet("w2_v18")
176187

188+
# Copy wallets to v0.16
189+
for wallet in os.listdir(node_master_wallets_dir):
190+
shutil.copytree(
191+
os.path.join(node_master_wallets_dir, wallet),
192+
os.path.join(node_v16_wallets_dir, wallet)
193+
)
194+
177195
# Copy wallets to v0.17
178196
for wallet in os.listdir(node_master_wallets_dir):
179197
shutil.copytree(
@@ -292,10 +310,17 @@ def run_test(self):
292310
# assert_raises_rpc_error(-4, "Wallet loading failed.", node_v17.loadwallet, 'w3_v18')
293311

294312
# Instead, we stop node and try to launch it with the wallet:
295-
self.stop_node(self.num_nodes - 1)
313+
self.stop_node(4)
296314
node_v17.assert_start_raises_init_error(["-wallet=w3_v18"], "Error: Error loading w3_v18: Wallet requires newer version of Bitcoin Core")
297315
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: Error loading w3: Wallet requires newer version of Bitcoin Core")
298-
self.start_node(self.num_nodes - 1)
316+
self.start_node(4)
317+
318+
# Open most recent wallet in v0.16 (no loadwallet RPC)
319+
self.stop_node(5)
320+
self.start_node(5, extra_args=["-wallet=w2"])
321+
wallet = node_v16.get_wallet_rpc("w2")
322+
info = wallet.getwalletinfo()
323+
assert info['keypoolsize'] == 1
299324

300325
self.log.info("Test wallet upgrade path...")
301326
# u1: regular wallet, created with v0.17

test/functional/wallet_upgradewallet.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55
"""upgradewallet RPC functional test
66
7-
Test upgradewallet RPC. Download v0.15.2 v0.16.3 node binaries:
7+
Test upgradewallet RPC. Download node binaries:
88
9-
contrib/devtools/previous_release.sh -b v0.15.2 v0.16.3
9+
contrib/devtools/previous_release.sh -b v0.19.1 v0.18.1 v0.17.1 v0.16.3 v0.15.2
10+
11+
Only v0.15.2 and v0.16.3 are required by this test. The others are used in feature_backwards_compatibility.py
1012
"""
1113

1214
import os

0 commit comments

Comments
 (0)