mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-19 09:53:47 +01:00
Merge bitcoin/bitcoin#19013: test: add v0.20.1, v0.21.0 and v22.0 to backwards compatibility test
24cec4b5c0
test: Fix intermittent test failure in feature_backwards_compatibility (MarcoFalke)d8b705f1ca
test: previous releases: add v22.0 (Sjors Provoost)40849eebd9
test: bump sandbox argument minimum version (Sjors Provoost)8a57a06a50
test: previous releases: add v0.21.0 (Sjors Provoost)8cba75f5fd
test: v0.20.1 backwards compatibility (Sjors Provoost)0e4b695b6a
test: backwards compatibility: misc fixes (Sjors Provoost)76557cbe4c
test: Remove i686 from test/get_previous_releases.py (MarcoFalke) Pull request description: This also simplifies the tests a bit. ACKs for top commit: ryanofsky: Code review ACK24cec4b5c0
. Only change since last review is rebasing and adding comment and whitelist args. Tree-SHA512: 85a603ddd70fd8f0180d00fb84eb2ad2f92d6199b7d3f7c1abd660bfba53f869faf40f1a4183a8ce15dbd496ee3132d879c1258651c9d443ece69e5fe328bd26
This commit is contained in:
commit
f1ce67f09f
@ -14,6 +14,6 @@ export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude fe
|
|||||||
export RUN_UNIT_TESTS_SEQUENTIAL="true"
|
export RUN_UNIT_TESTS_SEQUENTIAL="true"
|
||||||
export RUN_UNIT_TESTS="false"
|
export RUN_UNIT_TESTS="false"
|
||||||
export GOAL="install"
|
export GOAL="install"
|
||||||
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1 v0.20.1"
|
export PREVIOUS_RELEASES_TO_DOWNLOAD="v0.15.2 v0.16.3 v0.17.2 v0.18.1 v0.19.1 v0.20.1 v0.21.0 v22.0"
|
||||||
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
|
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
|
||||||
--enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8"
|
--enable-debug --disable-fuzz-binary CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8"
|
||||||
|
@ -98,7 +98,7 @@ test/functional/test_runner.py --extended
|
|||||||
In order to run backwards compatibility tests, download the previous node binaries:
|
In order to run backwards compatibility tests, download the previous node binaries:
|
||||||
|
|
||||||
```
|
```
|
||||||
test/get_previous_releases.py -b v0.20.1 v0.19.1 v0.18.1 v0.17.2 v0.16.3 v0.15.2
|
test/get_previous_releases.py -b v22.0 v0.21.0 v0.20.1 v0.19.1 v0.18.1 v0.17.2 v0.16.3 v0.15.2
|
||||||
```
|
```
|
||||||
|
|
||||||
By default, up to 4 tests will be run in parallel by test_runner. To specify
|
By default, up to 4 tests will be run in parallel by test_runner. To specify
|
||||||
|
@ -34,15 +34,18 @@ from test_framework.util import (
|
|||||||
class BackwardsCompatibilityTest(BitcoinTestFramework):
|
class BackwardsCompatibilityTest(BitcoinTestFramework):
|
||||||
def set_test_params(self):
|
def set_test_params(self):
|
||||||
self.setup_clean_chain = True
|
self.setup_clean_chain = True
|
||||||
self.num_nodes = 6
|
self.num_nodes = 9
|
||||||
# Add new version after each release:
|
# Add new version after each release:
|
||||||
self.extra_args = [
|
self.extra_args = [
|
||||||
["-addresstype=bech32"], # Pre-release: use to mine blocks
|
["-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # Pre-release: use to mine blocks. noban for immediate tx relay
|
||||||
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # Pre-release: use to receive coins, swap wallets, etc
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # Pre-release: use to receive coins, swap wallets, etc
|
||||||
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.19.1
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # v22.0
|
||||||
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.18.1
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # v0.21.0
|
||||||
["-nowallet", "-walletrbf=1", "-addresstype=bech32"], # v0.17.2
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # v0.20.1
|
||||||
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-wallet=wallet.dat"], # v0.16.3
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=noban@127.0.0.1"], # v0.19.1
|
||||||
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1"], # v0.18.1
|
||||||
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1"], # v0.17.2
|
||||||
|
["-nowallet", "-walletrbf=1", "-addresstype=bech32", "-whitelist=127.0.0.1", "-wallet=wallet.dat"], # v0.16.3
|
||||||
]
|
]
|
||||||
self.wallet_names = [self.default_wallet_name]
|
self.wallet_names = [self.default_wallet_name]
|
||||||
|
|
||||||
@ -54,6 +57,9 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
self.add_nodes(self.num_nodes, extra_args=self.extra_args, versions=[
|
self.add_nodes(self.num_nodes, extra_args=self.extra_args, versions=[
|
||||||
None,
|
None,
|
||||||
None,
|
None,
|
||||||
|
220000,
|
||||||
|
210000,
|
||||||
|
200100,
|
||||||
190100,
|
190100,
|
||||||
180100,
|
180100,
|
||||||
170200,
|
170200,
|
||||||
@ -63,19 +69,27 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
self.start_nodes()
|
self.start_nodes()
|
||||||
self.import_deterministic_coinbase_privkeys()
|
self.import_deterministic_coinbase_privkeys()
|
||||||
|
|
||||||
|
def nodes_wallet_dir(self, node):
|
||||||
|
if node.version < 170000:
|
||||||
|
return os.path.join(node.datadir, "regtest")
|
||||||
|
return os.path.join(node.datadir, "regtest/wallets")
|
||||||
|
|
||||||
def run_test(self):
|
def run_test(self):
|
||||||
self.generatetoaddress(self.nodes[0], COINBASE_MATURITY + 1, self.nodes[0].getnewaddress())
|
node_miner = self.nodes[0]
|
||||||
|
node_master = self.nodes[1]
|
||||||
# Sanity check the test framework:
|
|
||||||
res = self.nodes[self.num_nodes - 1].getblockchaininfo()
|
|
||||||
assert_equal(res['blocks'], COINBASE_MATURITY + 1)
|
|
||||||
|
|
||||||
node_master = self.nodes[self.num_nodes - 5]
|
|
||||||
node_v19 = self.nodes[self.num_nodes - 4]
|
node_v19 = self.nodes[self.num_nodes - 4]
|
||||||
node_v18 = self.nodes[self.num_nodes - 3]
|
node_v18 = self.nodes[self.num_nodes - 3]
|
||||||
node_v17 = self.nodes[self.num_nodes - 2]
|
node_v17 = self.nodes[self.num_nodes - 2]
|
||||||
node_v16 = self.nodes[self.num_nodes - 1]
|
node_v16 = self.nodes[self.num_nodes - 1]
|
||||||
|
|
||||||
|
legacy_nodes = self.nodes[2:]
|
||||||
|
|
||||||
|
self.generatetoaddress(node_miner, COINBASE_MATURITY + 1, node_miner.getnewaddress())
|
||||||
|
|
||||||
|
# Sanity check the test framework:
|
||||||
|
res = node_v16.getblockchaininfo()
|
||||||
|
assert_equal(res['blocks'], COINBASE_MATURITY + 1)
|
||||||
|
|
||||||
self.log.info("Test wallet backwards compatibility...")
|
self.log.info("Test wallet backwards compatibility...")
|
||||||
# Create a number of wallets and open them in older versions:
|
# Create a number of wallets and open them in older versions:
|
||||||
|
|
||||||
@ -88,21 +102,21 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
assert info['keypoolsize'] > 0
|
assert info['keypoolsize'] > 0
|
||||||
# Create a confirmed transaction, receiving coins
|
# Create a confirmed transaction, receiving coins
|
||||||
address = wallet.getnewaddress()
|
address = wallet.getnewaddress()
|
||||||
self.nodes[0].sendtoaddress(address, 10)
|
node_miner.sendtoaddress(address, 10)
|
||||||
self.sync_mempools()
|
self.sync_mempools()
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(node_miner, 1)
|
||||||
# Create a conflicting transaction using RBF
|
# Create a conflicting transaction using RBF
|
||||||
return_address = self.nodes[0].getnewaddress()
|
return_address = node_miner.getnewaddress()
|
||||||
tx1_id = self.nodes[1].sendtoaddress(return_address, 1)
|
tx1_id = node_master.sendtoaddress(return_address, 1)
|
||||||
tx2_id = self.nodes[1].bumpfee(tx1_id)["txid"]
|
tx2_id = node_master.bumpfee(tx1_id)["txid"]
|
||||||
# Confirm the transaction
|
# Confirm the transaction
|
||||||
self.sync_mempools()
|
self.sync_mempools()
|
||||||
self.generate(self.nodes[0], 1)
|
self.generate(node_miner, 1)
|
||||||
# Create another conflicting transaction using RBF
|
# Create another conflicting transaction using RBF
|
||||||
tx3_id = self.nodes[1].sendtoaddress(return_address, 1)
|
tx3_id = node_master.sendtoaddress(return_address, 1)
|
||||||
tx4_id = self.nodes[1].bumpfee(tx3_id)["txid"]
|
tx4_id = node_master.bumpfee(tx3_id)["txid"]
|
||||||
# Abandon transaction, but don't confirm
|
# Abandon transaction, but don't confirm
|
||||||
self.nodes[1].abandontransaction(tx3_id)
|
node_master.abandontransaction(tx3_id)
|
||||||
|
|
||||||
# w1_v19: regular wallet, created with v0.19
|
# w1_v19: regular wallet, created with v0.19
|
||||||
node_v19.rpc.createwallet(wallet_name="w1_v19")
|
node_v19.rpc.createwallet(wallet_name="w1_v19")
|
||||||
@ -113,6 +127,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
# Use addmultisigaddress (see #18075)
|
# Use addmultisigaddress (see #18075)
|
||||||
address_18075 = wallet.rpc.addmultisigaddress(1, ["0296b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52", "037211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073"], "", "legacy")["address"]
|
address_18075 = wallet.rpc.addmultisigaddress(1, ["0296b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52", "037211a824f55b505228e4c3d5194c1fcfaa15a456abdf37f9b9d97a4040afc073"], "", "legacy")["address"]
|
||||||
assert wallet.getaddressinfo(address_18075)["solvable"]
|
assert wallet.getaddressinfo(address_18075)["solvable"]
|
||||||
|
node_v19.unloadwallet("w1_v19")
|
||||||
|
|
||||||
# w1_v18: regular wallet, created with v0.18
|
# w1_v18: regular wallet, created with v0.18
|
||||||
node_v18.rpc.createwallet(wallet_name="w1_v18")
|
node_v18.rpc.createwallet(wallet_name="w1_v18")
|
||||||
@ -130,20 +145,6 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
assert info['private_keys_enabled'] == False
|
assert info['private_keys_enabled'] == False
|
||||||
assert info['keypoolsize'] == 0
|
assert info['keypoolsize'] == 0
|
||||||
|
|
||||||
# w2_v19: wallet with private keys disabled, created with v0.19
|
|
||||||
node_v19.rpc.createwallet(wallet_name="w2_v19", disable_private_keys=True)
|
|
||||||
wallet = node_v19.get_wallet_rpc("w2_v19")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled'] == False
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
# w2_v18: wallet with private keys disabled, created with v0.18
|
|
||||||
node_v18.rpc.createwallet(wallet_name="w2_v18", disable_private_keys=True)
|
|
||||||
wallet = node_v18.get_wallet_rpc("w2_v18")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled'] == False
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
# w3: blank wallet, created on master: update this
|
# w3: blank wallet, created on master: update this
|
||||||
# test when default blank wallets can no longer be opened by older versions.
|
# test when default blank wallets can no longer be opened by older versions.
|
||||||
node_master.createwallet(wallet_name="w3", blank=True)
|
node_master.createwallet(wallet_name="w3", blank=True)
|
||||||
@ -152,170 +153,72 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
assert info['private_keys_enabled']
|
assert info['private_keys_enabled']
|
||||||
assert info['keypoolsize'] == 0
|
assert info['keypoolsize'] == 0
|
||||||
|
|
||||||
# w3_v19: blank wallet, created with v0.19
|
# Unload wallets and copy to older nodes:
|
||||||
node_v19.rpc.createwallet(wallet_name="w3_v19", blank=True)
|
|
||||||
wallet = node_v19.get_wallet_rpc("w3_v19")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
# w3_v18: blank wallet, created with v0.18
|
|
||||||
node_v18.rpc.createwallet(wallet_name="w3_v18", blank=True)
|
|
||||||
wallet = node_v18.get_wallet_rpc("w3_v18")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
# Copy the wallets to older nodes:
|
|
||||||
node_master_wallets_dir = os.path.join(node_master.datadir, "regtest/wallets")
|
node_master_wallets_dir = os.path.join(node_master.datadir, "regtest/wallets")
|
||||||
node_v19_wallets_dir = os.path.join(node_v19.datadir, "regtest/wallets")
|
node_v19_wallets_dir = os.path.join(node_v19.datadir, "regtest/wallets")
|
||||||
node_v18_wallets_dir = os.path.join(node_v18.datadir, "regtest/wallets")
|
|
||||||
node_v17_wallets_dir = os.path.join(node_v17.datadir, "regtest/wallets")
|
node_v17_wallets_dir = os.path.join(node_v17.datadir, "regtest/wallets")
|
||||||
node_v16_wallets_dir = os.path.join(node_v16.datadir, "regtest")
|
node_v16_wallets_dir = os.path.join(node_v16.datadir, "regtest")
|
||||||
node_master.unloadwallet("w1")
|
node_master.unloadwallet("w1")
|
||||||
node_master.unloadwallet("w2")
|
node_master.unloadwallet("w2")
|
||||||
node_v19.unloadwallet("w1_v19")
|
node_master.unloadwallet("w3")
|
||||||
node_v19.unloadwallet("w2_v19")
|
|
||||||
node_v18.unloadwallet("w1_v18")
|
|
||||||
node_v18.unloadwallet("w2_v18")
|
|
||||||
|
|
||||||
# Copy wallets to v0.16
|
for node in legacy_nodes:
|
||||||
for wallet in os.listdir(node_master_wallets_dir):
|
# Copy wallets to previous version
|
||||||
shutil.copytree(
|
for wallet in os.listdir(node_master_wallets_dir):
|
||||||
os.path.join(node_master_wallets_dir, wallet),
|
shutil.copytree(
|
||||||
os.path.join(node_v16_wallets_dir, wallet)
|
os.path.join(node_master_wallets_dir, wallet),
|
||||||
)
|
os.path.join(self.nodes_wallet_dir(node), wallet)
|
||||||
|
)
|
||||||
# Copy wallets to v0.17
|
|
||||||
for wallet in os.listdir(node_master_wallets_dir):
|
|
||||||
shutil.copytree(
|
|
||||||
os.path.join(node_master_wallets_dir, wallet),
|
|
||||||
os.path.join(node_v17_wallets_dir, wallet)
|
|
||||||
)
|
|
||||||
for wallet in os.listdir(node_v18_wallets_dir):
|
|
||||||
shutil.copytree(
|
|
||||||
os.path.join(node_v18_wallets_dir, wallet),
|
|
||||||
os.path.join(node_v17_wallets_dir, wallet)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy wallets to v0.18
|
|
||||||
for wallet in os.listdir(node_master_wallets_dir):
|
|
||||||
shutil.copytree(
|
|
||||||
os.path.join(node_master_wallets_dir, wallet),
|
|
||||||
os.path.join(node_v18_wallets_dir, wallet)
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy wallets to v0.19
|
|
||||||
for wallet in os.listdir(node_master_wallets_dir):
|
|
||||||
shutil.copytree(
|
|
||||||
os.path.join(node_master_wallets_dir, wallet),
|
|
||||||
os.path.join(node_v19_wallets_dir, wallet)
|
|
||||||
)
|
|
||||||
|
|
||||||
if not self.options.descriptors:
|
if not self.options.descriptors:
|
||||||
# Descriptor wallets break compatibility, only run this test for legacy wallet
|
# Descriptor wallets break compatibility, only run this test for legacy wallet
|
||||||
# Open the wallets in v0.19
|
# Load modern wallet with older nodes
|
||||||
node_v19.loadwallet("w1")
|
for node in legacy_nodes:
|
||||||
wallet = node_v19.get_wallet_rpc("w1")
|
for wallet_name in ["w1", "w2", "w3"]:
|
||||||
info = wallet.getwalletinfo()
|
if node.version < 170000:
|
||||||
assert info['private_keys_enabled']
|
# loadwallet was introduced in v0.17.0
|
||||||
assert info['keypoolsize'] > 0
|
continue
|
||||||
txs = wallet.listtransactions()
|
if node.version < 180000 and wallet_name == "w3":
|
||||||
assert_equal(len(txs), 5)
|
# Blank wallets were introduced in v0.18.0. We test the loading error below.
|
||||||
assert_equal(txs[1]["txid"], tx1_id)
|
continue
|
||||||
assert_equal(txs[2]["walletconflicts"], [tx1_id])
|
node.loadwallet(wallet_name)
|
||||||
assert_equal(txs[1]["replaced_by_txid"], tx2_id)
|
wallet = node.get_wallet_rpc(wallet_name)
|
||||||
assert not(txs[1]["abandoned"])
|
info = wallet.getwalletinfo()
|
||||||
assert_equal(txs[1]["confirmations"], -1)
|
if wallet_name == "w1":
|
||||||
assert_equal(txs[2]["blockindex"], 1)
|
assert info['private_keys_enabled'] == True
|
||||||
assert txs[3]["abandoned"]
|
assert info['keypoolsize'] > 0
|
||||||
assert_equal(txs[4]["walletconflicts"], [tx3_id])
|
txs = wallet.listtransactions()
|
||||||
assert_equal(txs[3]["replaced_by_txid"], tx4_id)
|
assert_equal(len(txs), 5)
|
||||||
assert not(hasattr(txs[3], "blockindex"))
|
assert_equal(txs[1]["txid"], tx1_id)
|
||||||
|
assert_equal(txs[2]["walletconflicts"], [tx1_id])
|
||||||
node_v19.loadwallet("w2")
|
assert_equal(txs[1]["replaced_by_txid"], tx2_id)
|
||||||
wallet = node_v19.get_wallet_rpc("w2")
|
assert not(txs[1]["abandoned"])
|
||||||
info = wallet.getwalletinfo()
|
assert_equal(txs[1]["confirmations"], -1)
|
||||||
assert info['private_keys_enabled'] == False
|
assert_equal(txs[2]["blockindex"], 1)
|
||||||
assert info['keypoolsize'] == 0
|
assert txs[3]["abandoned"]
|
||||||
|
assert_equal(txs[4]["walletconflicts"], [tx3_id])
|
||||||
node_v19.loadwallet("w3")
|
assert_equal(txs[3]["replaced_by_txid"], tx4_id)
|
||||||
wallet = node_v19.get_wallet_rpc("w3")
|
assert not(hasattr(txs[3], "blockindex"))
|
||||||
info = wallet.getwalletinfo()
|
elif wallet_name == "w2":
|
||||||
assert info['private_keys_enabled']
|
assert(info['private_keys_enabled'] == False)
|
||||||
assert info['keypoolsize'] == 0
|
assert info['keypoolsize'] == 0
|
||||||
|
else:
|
||||||
# Open the wallets in v0.18
|
assert(info['private_keys_enabled'] == True)
|
||||||
node_v18.loadwallet("w1")
|
assert info['keypoolsize'] == 0
|
||||||
wallet = node_v18.get_wallet_rpc("w1")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] > 0
|
|
||||||
txs = wallet.listtransactions()
|
|
||||||
assert_equal(len(txs), 5)
|
|
||||||
assert_equal(txs[1]["txid"], tx1_id)
|
|
||||||
assert_equal(txs[2]["walletconflicts"], [tx1_id])
|
|
||||||
assert_equal(txs[1]["replaced_by_txid"], tx2_id)
|
|
||||||
assert not(txs[1]["abandoned"])
|
|
||||||
assert_equal(txs[1]["confirmations"], -1)
|
|
||||||
assert_equal(txs[2]["blockindex"], 1)
|
|
||||||
assert txs[3]["abandoned"]
|
|
||||||
assert_equal(txs[4]["walletconflicts"], [tx3_id])
|
|
||||||
assert_equal(txs[3]["replaced_by_txid"], tx4_id)
|
|
||||||
assert not(hasattr(txs[3], "blockindex"))
|
|
||||||
|
|
||||||
node_v18.loadwallet("w2")
|
|
||||||
wallet = node_v18.get_wallet_rpc("w2")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled'] == False
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
node_v18.loadwallet("w3")
|
|
||||||
wallet = node_v18.get_wallet_rpc("w3")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
node_v17.loadwallet("w1")
|
|
||||||
wallet = node_v17.get_wallet_rpc("w1")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] > 0
|
|
||||||
|
|
||||||
node_v17.loadwallet("w2")
|
|
||||||
wallet = node_v17.get_wallet_rpc("w2")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled'] == False
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
else:
|
else:
|
||||||
# Descriptor wallets appear to be corrupted wallets to old software
|
for node in legacy_nodes:
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v19.loadwallet, "w1")
|
# Descriptor wallets appear to be corrupted wallets to old software
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v19.loadwallet, "w2")
|
# and loadwallet is introduced in v0.17.0
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v19.loadwallet, "w3")
|
if node.version >= 170000 and node.version < 210000:
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v18.loadwallet, "w1")
|
for wallet_name in ["w1", "w2", "w3"]:
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v18.loadwallet, "w2")
|
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node.loadwallet, wallet_name)
|
||||||
assert_raises_rpc_error(-4, "Wallet file verification failed: wallet.dat corrupt, salvage failed", node_v18.loadwallet, "w3")
|
|
||||||
|
|
||||||
# Open the wallets in v0.17
|
|
||||||
node_v17.loadwallet("w1_v18")
|
|
||||||
wallet = node_v17.get_wallet_rpc("w1_v18")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled']
|
|
||||||
assert info['keypoolsize'] > 0
|
|
||||||
|
|
||||||
node_v17.loadwallet("w2_v18")
|
|
||||||
wallet = node_v17.get_wallet_rpc("w2_v18")
|
|
||||||
info = wallet.getwalletinfo()
|
|
||||||
assert info['private_keys_enabled'] == False
|
|
||||||
assert info['keypoolsize'] == 0
|
|
||||||
|
|
||||||
# RPC loadwallet failure causes bitcoind to exit, in addition to the RPC
|
# RPC loadwallet failure causes bitcoind to exit, in addition to the RPC
|
||||||
# call failure, so the following test won't work:
|
# call failure, so the following test won't work:
|
||||||
# assert_raises_rpc_error(-4, "Wallet loading failed.", node_v17.loadwallet, 'w3_v18')
|
# assert_raises_rpc_error(-4, "Wallet loading failed.", node_v17.loadwallet, 'w3')
|
||||||
|
|
||||||
# Instead, we stop node and try to launch it with the wallet:
|
# Instead, we stop node and try to launch it with the wallet:
|
||||||
self.stop_node(4)
|
self.stop_node(node_v17.index)
|
||||||
node_v17.assert_start_raises_init_error(["-wallet=w3_v18"], "Error: Error loading w3_v18: Wallet requires newer version of Bitcoin Core")
|
|
||||||
if self.options.descriptors:
|
if self.options.descriptors:
|
||||||
# Descriptor wallets appear to be corrupted wallets to old software
|
# Descriptor wallets appear to be corrupted wallets to old software
|
||||||
node_v17.assert_start_raises_init_error(["-wallet=w1"], "Error: wallet.dat corrupt, salvage failed")
|
node_v17.assert_start_raises_init_error(["-wallet=w1"], "Error: wallet.dat corrupt, salvage failed")
|
||||||
@ -323,23 +226,23 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: wallet.dat corrupt, salvage failed")
|
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: wallet.dat corrupt, salvage failed")
|
||||||
else:
|
else:
|
||||||
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: Error loading w3: Wallet requires newer version of Bitcoin Core")
|
node_v17.assert_start_raises_init_error(["-wallet=w3"], "Error: Error loading w3: Wallet requires newer version of Bitcoin Core")
|
||||||
self.start_node(4)
|
self.start_node(node_v17.index)
|
||||||
|
|
||||||
if not self.options.descriptors:
|
if not self.options.descriptors:
|
||||||
# Descriptor wallets break compatibility, only run this test for legacy wallets
|
# Descriptor wallets break compatibility, only run this test for legacy wallets
|
||||||
# Open most recent wallet in v0.16 (no loadwallet RPC)
|
# Open most recent wallet in v0.16 (no loadwallet RPC)
|
||||||
self.restart_node(5, extra_args=["-wallet=w2"])
|
self.restart_node(node_v16.index, extra_args=["-wallet=w2"])
|
||||||
wallet = node_v16.get_wallet_rpc("w2")
|
wallet = node_v16.get_wallet_rpc("w2")
|
||||||
info = wallet.getwalletinfo()
|
info = wallet.getwalletinfo()
|
||||||
assert info['keypoolsize'] == 1
|
assert info['keypoolsize'] == 1
|
||||||
|
|
||||||
# Create upgrade wallet in v0.16
|
# Create upgrade wallet in v0.16
|
||||||
self.restart_node(-1, extra_args=["-wallet=u1_v16"])
|
self.restart_node(node_v16.index, extra_args=["-wallet=u1_v16"])
|
||||||
wallet = node_v16.get_wallet_rpc("u1_v16")
|
wallet = node_v16.get_wallet_rpc("u1_v16")
|
||||||
v16_addr = wallet.getnewaddress('', "bech32")
|
v16_addr = wallet.getnewaddress('', "bech32")
|
||||||
v16_info = wallet.validateaddress(v16_addr)
|
v16_info = wallet.validateaddress(v16_addr)
|
||||||
v16_pubkey = v16_info['pubkey']
|
v16_pubkey = v16_info['pubkey']
|
||||||
self.stop_node(-1)
|
self.stop_node(node_v16.index)
|
||||||
|
|
||||||
self.log.info("Test wallet upgrade path...")
|
self.log.info("Test wallet upgrade path...")
|
||||||
# u1: regular wallet, created with v0.17
|
# u1: regular wallet, created with v0.17
|
||||||
@ -371,7 +274,7 @@ class BackwardsCompatibilityTest(BitcoinTestFramework):
|
|||||||
os.path.join(node_master_wallets_dir, "u1_v16"),
|
os.path.join(node_master_wallets_dir, "u1_v16"),
|
||||||
os.path.join(node_v16_wallets_dir, "wallets/u1_v16")
|
os.path.join(node_v16_wallets_dir, "wallets/u1_v16")
|
||||||
)
|
)
|
||||||
self.start_node(-1, extra_args=["-wallet=u1_v16"])
|
self.start_node(node_v16.index, extra_args=["-wallet=u1_v16"])
|
||||||
wallet = node_v16.get_wallet_rpc("u1_v16")
|
wallet = node_v16.get_wallet_rpc("u1_v16")
|
||||||
info = wallet.validateaddress(v16_addr)
|
info = wallet.validateaddress(v16_addr)
|
||||||
assert_equal(info, v16_info)
|
assert_equal(info, v16_info)
|
||||||
|
@ -447,11 +447,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
def get_bin_from_version(version, bin_name, bin_default):
|
def get_bin_from_version(version, bin_name, bin_default):
|
||||||
if not version:
|
if not version:
|
||||||
return bin_default
|
return bin_default
|
||||||
|
if version > 219999:
|
||||||
|
# Starting at client version 220000 the first two digits represent
|
||||||
|
# the major version, e.g. v22.0 instead of v0.22.0.
|
||||||
|
version *= 100
|
||||||
return os.path.join(
|
return os.path.join(
|
||||||
self.options.previous_releases_path,
|
self.options.previous_releases_path,
|
||||||
re.sub(
|
re.sub(
|
||||||
r'\.0$',
|
r'\.0$' if version <= 219999 else r'(\.0){1,2}$',
|
||||||
'', # remove trailing .0 for point releases
|
'', # Remove trailing dot for point releases, after 22.0 also remove double trailing dot.
|
||||||
'v{}.{}.{}.{}'.format(
|
'v{}.{}.{}.{}'.format(
|
||||||
(version % 100000000) // 1000000,
|
(version % 100000000) // 1000000,
|
||||||
(version % 1000000) // 10000,
|
(version % 1000000) // 10000,
|
||||||
@ -473,7 +477,8 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
|||||||
versions = [None] * num_nodes
|
versions = [None] * num_nodes
|
||||||
if self.is_syscall_sandbox_compiled() and not self.disable_syscall_sandbox:
|
if self.is_syscall_sandbox_compiled() and not self.disable_syscall_sandbox:
|
||||||
for i in range(len(extra_args)):
|
for i in range(len(extra_args)):
|
||||||
if versions[i] is None or versions[i] >= 219900:
|
# The -sandbox argument is not present in the v22.0 release.
|
||||||
|
if versions[i] is None or versions[i] >= 229900:
|
||||||
extra_args[i] = extra_args[i] + ["-sandbox=log-and-abort"]
|
extra_args[i] = extra_args[i] + ["-sandbox=log-and-abort"]
|
||||||
if binary is None:
|
if binary is None:
|
||||||
binary = [get_bin_from_version(v, 'bitcoind', self.options.bitcoind) for v in versions]
|
binary = [get_bin_from_version(v, 'bitcoind', self.options.bitcoind) for v in versions]
|
||||||
|
@ -23,32 +23,27 @@ import hashlib
|
|||||||
SHA256_SUMS = {
|
SHA256_SUMS = {
|
||||||
"d40f18b4e43c6e6370ef7db9131f584fbb137276ec2e3dba67a4b267f81cb644": "bitcoin-0.15.2-aarch64-linux-gnu.tar.gz",
|
"d40f18b4e43c6e6370ef7db9131f584fbb137276ec2e3dba67a4b267f81cb644": "bitcoin-0.15.2-aarch64-linux-gnu.tar.gz",
|
||||||
"54fb877a148a6ad189a1e1ab1ff8b11181e58ff2aaf430da55b3fd46ae549a6b": "bitcoin-0.15.2-arm-linux-gnueabihf.tar.gz",
|
"54fb877a148a6ad189a1e1ab1ff8b11181e58ff2aaf430da55b3fd46ae549a6b": "bitcoin-0.15.2-arm-linux-gnueabihf.tar.gz",
|
||||||
"2b843506c3f1af0eeca5854a920264f9a829f02d0d50328005950ddcbe88874d": "bitcoin-0.15.2-i686-pc-linux-gnu.tar.gz",
|
|
||||||
"87e9340ff3d382d543b2b69112376077f0c8b4f7450d372e83b68f5a1e22b2df": "bitcoin-0.15.2-osx64.tar.gz",
|
"87e9340ff3d382d543b2b69112376077f0c8b4f7450d372e83b68f5a1e22b2df": "bitcoin-0.15.2-osx64.tar.gz",
|
||||||
"566be44190fd76daa01f13d428939dadfb8e3daacefc8fa17f433cad28f73bd5": "bitcoin-0.15.2-x86_64-linux-gnu.tar.gz",
|
"566be44190fd76daa01f13d428939dadfb8e3daacefc8fa17f433cad28f73bd5": "bitcoin-0.15.2-x86_64-linux-gnu.tar.gz",
|
||||||
#
|
#
|
||||||
"0768c6c15caffbaca6524824c9563b42c24f70633c681c2744649158aa3fd484": "bitcoin-0.16.3-aarch64-linux-gnu.tar.gz",
|
"0768c6c15caffbaca6524824c9563b42c24f70633c681c2744649158aa3fd484": "bitcoin-0.16.3-aarch64-linux-gnu.tar.gz",
|
||||||
"fb2818069854a6ad20ea03b28b55dbd35d8b1f7d453e90b83eace5d0098a2a87": "bitcoin-0.16.3-arm-linux-gnueabihf.tar.gz",
|
"fb2818069854a6ad20ea03b28b55dbd35d8b1f7d453e90b83eace5d0098a2a87": "bitcoin-0.16.3-arm-linux-gnueabihf.tar.gz",
|
||||||
"75a537844313b0a84bdb61ffcdc5c4ce19a738f7ddf71007cd2edf664efd7c37": "bitcoin-0.16.3-i686-pc-linux-gnu.tar.gz",
|
|
||||||
"78c3bff3b619a19aed575961ea43cc9e142959218835cf51aede7f0b764fc25d": "bitcoin-0.16.3-osx64.tar.gz",
|
"78c3bff3b619a19aed575961ea43cc9e142959218835cf51aede7f0b764fc25d": "bitcoin-0.16.3-osx64.tar.gz",
|
||||||
"5d422a9d544742bc0df12427383f9c2517433ce7b58cf672b9a9b17c2ef51e4f": "bitcoin-0.16.3-x86_64-linux-gnu.tar.gz",
|
"5d422a9d544742bc0df12427383f9c2517433ce7b58cf672b9a9b17c2ef51e4f": "bitcoin-0.16.3-x86_64-linux-gnu.tar.gz",
|
||||||
#
|
#
|
||||||
"5a6b35d1a348a402f2d2d6ab5aed653a1a1f13bc63aaaf51605e3501b0733b7a": "bitcoin-0.17.2-aarch64-linux-gnu.tar.gz",
|
"5a6b35d1a348a402f2d2d6ab5aed653a1a1f13bc63aaaf51605e3501b0733b7a": "bitcoin-0.17.2-aarch64-linux-gnu.tar.gz",
|
||||||
"d1913a5d19c8e8da4a67d1bd5205d03c8614dfd2e02bba2fe3087476643a729e": "bitcoin-0.17.2-arm-linux-gnueabihf.tar.gz",
|
"d1913a5d19c8e8da4a67d1bd5205d03c8614dfd2e02bba2fe3087476643a729e": "bitcoin-0.17.2-arm-linux-gnueabihf.tar.gz",
|
||||||
"d295fc93f39bbf0fd937b730a93184899a2eb6c3a6d53f3d857cbe77ef89b98c": "bitcoin-0.17.2-i686-pc-linux-gnu.tar.gz",
|
|
||||||
"a783ba20706dbfd5b47fbedf42165fce70fbbc7d78003305d964f6b3da14887f": "bitcoin-0.17.2-osx64.tar.gz",
|
"a783ba20706dbfd5b47fbedf42165fce70fbbc7d78003305d964f6b3da14887f": "bitcoin-0.17.2-osx64.tar.gz",
|
||||||
"943f9362b9f11130177839116f48f809d83478b4c28591d486ee9a7e35179da6": "bitcoin-0.17.2-x86_64-linux-gnu.tar.gz",
|
"943f9362b9f11130177839116f48f809d83478b4c28591d486ee9a7e35179da6": "bitcoin-0.17.2-x86_64-linux-gnu.tar.gz",
|
||||||
#
|
#
|
||||||
"88f343af72803b851c7da13874cc5525026b0b55e63e1b5e1298390c4688adc6": "bitcoin-0.18.1-aarch64-linux-gnu.tar.gz",
|
"88f343af72803b851c7da13874cc5525026b0b55e63e1b5e1298390c4688adc6": "bitcoin-0.18.1-aarch64-linux-gnu.tar.gz",
|
||||||
"cc7d483e4b20c5dabd4dcaf304965214cf4934bcc029ca99cbc9af00d3771a1f": "bitcoin-0.18.1-arm-linux-gnueabihf.tar.gz",
|
"cc7d483e4b20c5dabd4dcaf304965214cf4934bcc029ca99cbc9af00d3771a1f": "bitcoin-0.18.1-arm-linux-gnueabihf.tar.gz",
|
||||||
"989e847b3e95fc9fedc0b109cae1b4fa43348f2f712e187a118461876af9bd16": "bitcoin-0.18.1-i686-pc-linux-gnu.tar.gz",
|
|
||||||
"b7bbcee7a7540f711b171d6981f939ca8482005fde22689bc016596d80548bb1": "bitcoin-0.18.1-osx64.tar.gz",
|
"b7bbcee7a7540f711b171d6981f939ca8482005fde22689bc016596d80548bb1": "bitcoin-0.18.1-osx64.tar.gz",
|
||||||
"425ee5ec631ae8da71ebc1c3f5c0269c627cf459379b9b030f047107a28e3ef8": "bitcoin-0.18.1-riscv64-linux-gnu.tar.gz",
|
"425ee5ec631ae8da71ebc1c3f5c0269c627cf459379b9b030f047107a28e3ef8": "bitcoin-0.18.1-riscv64-linux-gnu.tar.gz",
|
||||||
"600d1db5e751fa85903e935a01a74f5cc57e1e7473c15fd3e17ed21e202cfe5a": "bitcoin-0.18.1-x86_64-linux-gnu.tar.gz",
|
"600d1db5e751fa85903e935a01a74f5cc57e1e7473c15fd3e17ed21e202cfe5a": "bitcoin-0.18.1-x86_64-linux-gnu.tar.gz",
|
||||||
#
|
#
|
||||||
"3a80431717842672df682bdb619e66523b59541483297772a7969413be3502ff": "bitcoin-0.19.1-aarch64-linux-gnu.tar.gz",
|
"3a80431717842672df682bdb619e66523b59541483297772a7969413be3502ff": "bitcoin-0.19.1-aarch64-linux-gnu.tar.gz",
|
||||||
"657f28213823d240dd3324d14829702f9ad6f0710f8bdd1c379cb3c447197f48": "bitcoin-0.19.1-arm-linux-gnueabihf.tar.gz",
|
"657f28213823d240dd3324d14829702f9ad6f0710f8bdd1c379cb3c447197f48": "bitcoin-0.19.1-arm-linux-gnueabihf.tar.gz",
|
||||||
"10d1e53208aa7603022f4acc084a046299ab4ccf25fe01e81b3fb6f856772589": "bitcoin-0.19.1-i686-pc-linux-gnu.tar.gz",
|
|
||||||
"1ae1b87de26487075cd2fd22e0d4ead87d969bd55c44f2f1d873ecdc6147ebb3": "bitcoin-0.19.1-osx64.tar.gz",
|
"1ae1b87de26487075cd2fd22e0d4ead87d969bd55c44f2f1d873ecdc6147ebb3": "bitcoin-0.19.1-osx64.tar.gz",
|
||||||
"aa7a9563b48aa79252c8e7b6a41c07a5441bd9f14c5e4562cc72720ea6cb0ee5": "bitcoin-0.19.1-riscv64-linux-gnu.tar.gz",
|
"aa7a9563b48aa79252c8e7b6a41c07a5441bd9f14c5e4562cc72720ea6cb0ee5": "bitcoin-0.19.1-riscv64-linux-gnu.tar.gz",
|
||||||
"5fcac9416e486d4960e1a946145566350ca670f9aaba99de6542080851122e4c": "bitcoin-0.19.1-x86_64-linux-gnu.tar.gz",
|
"5fcac9416e486d4960e1a946145566350ca670f9aaba99de6542080851122e4c": "bitcoin-0.19.1-x86_64-linux-gnu.tar.gz",
|
||||||
@ -56,9 +51,22 @@ SHA256_SUMS = {
|
|||||||
"60c93e3462c303eb080be7cf623f1a7684b37fd47a018ad3848bc23e13c84e1c": "bitcoin-0.20.1-aarch64-linux-gnu.tar.gz",
|
"60c93e3462c303eb080be7cf623f1a7684b37fd47a018ad3848bc23e13c84e1c": "bitcoin-0.20.1-aarch64-linux-gnu.tar.gz",
|
||||||
"55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c": "bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz",
|
"55b577e0fb306fb429d4be6c9316607753e8543e5946b542d75d876a2f08654c": "bitcoin-0.20.1-arm-linux-gnueabihf.tar.gz",
|
||||||
"b9024dde373ea7dad707363e07ec7e265383204127539ae0c234bff3a61da0d1": "bitcoin-0.20.1-osx64.tar.gz",
|
"b9024dde373ea7dad707363e07ec7e265383204127539ae0c234bff3a61da0d1": "bitcoin-0.20.1-osx64.tar.gz",
|
||||||
"c378d4e21109f09e8829f3591e015c66632dff2925a60b64d259be05a334c30b": "bitcoin-0.20.1-osx.dmg",
|
|
||||||
"fa71cb52ee5e0459cbf5248cdec72df27995840c796f58b304607a1ed4c165af": "bitcoin-0.20.1-riscv64-linux-gnu.tar.gz",
|
"fa71cb52ee5e0459cbf5248cdec72df27995840c796f58b304607a1ed4c165af": "bitcoin-0.20.1-riscv64-linux-gnu.tar.gz",
|
||||||
"376194f06596ecfa40331167c39bc70c355f960280bd2a645fdbf18f66527397": "bitcoin-0.20.1-x86_64-linux-gnu.tar.gz",
|
"376194f06596ecfa40331167c39bc70c355f960280bd2a645fdbf18f66527397": "bitcoin-0.20.1-x86_64-linux-gnu.tar.gz",
|
||||||
|
|
||||||
|
"43416854330914992bbba2d0e9adf2a6fff4130be9af8ae2ef1186e743d9a3fe": "bitcoin-0.21.0-aarch64-linux-gnu.tar.gz",
|
||||||
|
"f028af308eda45a3c4c90f9332f96b075bf21e3495c945ebce48597151808176": "bitcoin-0.21.0-arm-linux-gnueabihf.tar.gz",
|
||||||
|
"695fb624fa6423f5da4f443b60763dd1d77488bfe5ef63760904a7b54e91298d": "bitcoin-0.21.0-osx64.tar.gz",
|
||||||
|
"f8b2adfeae021a672effbc7bd40d5c48d6b94e53b2dd660f787340bf1a52e4e9": "bitcoin-0.21.0-riscv64-linux-gnu.tar.gz",
|
||||||
|
"da7766775e3f9c98d7a9145429f2be8297c2672fe5b118fd3dc2411fb48e0032": "bitcoin-0.21.0-x86_64-linux-gnu.tar.gz",
|
||||||
|
|
||||||
|
"ac718fed08570a81b3587587872ad85a25173afa5f9fbbd0c03ba4d1714cfa3e": "bitcoin-22.0-aarch64-linux-gnu.tar.gz",
|
||||||
|
"b8713c6c5f03f5258b54e9f436e2ed6d85449aa24c2c9972f91963d413e86311": "bitcoin-22.0-arm-linux-gnueabihf.tar.gz",
|
||||||
|
"2744d199c3343b2d94faffdfb2c94d75a630ba27301a70e47b0ad30a7e0155e9": "bitcoin-22.0-osx64.tar.gz",
|
||||||
|
"2cca5f99007d060aca9d8c7cbd035dfe2f040dd8200b210ce32cdf858479f70d": "bitcoin-22.0-powerpc64-linux-gnu.tar.gz",
|
||||||
|
"91b1e012975c5a363b5b5fcc81b5b7495e86ff703ec8262d4b9afcfec633c30d": "bitcoin-22.0-powerpc64le-linux-gnu.tar.gz",
|
||||||
|
"9cc3a62c469fe57e11485fdd32c916f10ce7a2899299855a2e479256ff49ff3c": "bitcoin-22.0-riscv64-linux-gnu.tar.gz",
|
||||||
|
"59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16": "bitcoin-22.0-x86_64-linux-gnu.tar.gz",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user