Skip to content

test: fix interface_bitcoin_cli.py --descriptors and add to test runner - #23686

Merged
maflcko merged 2 commits into
bitcoin:masterfrom
theStack:202112-test-fix-interface_bitcoin_cli-with-descriptors
Dec 7, 2021
Merged

maflcko merged 2 commits into
bitcoin:masterfrom
theStack:202112-test-fix-interface_bitcoin_cli-with-descriptors

Conversation

@theStack

@theStack theStack commented Dec 6, 2021

Copy link
Copy Markdown
Contributor

The functional test interface_bitcoin_cli.py currently fails on master branch, if descriptor wallets are used (argument --descriptors), see #23684. This is due to the fact that different change output types are used for created transactions (P2WPKH for legacy wallets, P2TR for descriptor wallets; the former doesn't have a ScriptPubKeyMan for bech32m), resulting in different tx sizes and hence also fees. Fix this by explicitely setting the output type via passing both -addresstype=bech32 and -changetype=bech32 as argument. The former would not be needed by now, but makes the test more deterministic and avoids a failure if bech32m becomes the default address type.

Fixes #23684, should also pave the way for #23682.

@maflcko

maflcko commented Dec 7, 2021

Copy link
Copy Markdown
Member

lgtm

@maflcko
maflcko merged commit 877f3aa into bitcoin:master Dec 7, 2021
@maflcko

maflcko commented Dec 7, 2021

Copy link
Copy Markdown
Member

https://cirrus-ci.com/task/5707611839397888?logs=ci#L2648

46/228 - interface_bitcoin_cli.py --legacy-wallet failed, Duration: 1 s
stdout:
2021-12-07T08:49:36.678000Z TestFramework (INFO): Initializing test directory /private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/test_runner/test_runner_₿_🏃_20211207_004607/interface_bitcoin_cli_180
2021-12-07T08:49:36.946000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 131, in main
    self.setup()
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 288, in setup
    self.setup_network()
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 382, in setup_network
    self.setup_nodes()
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 409, in setup_nodes
    self.import_deterministic_coinbase_privkeys()
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 426, in import_deterministic_coinbase_privkeys
    self.init_wallet(node=i)
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_framework.py", line 433, in init_wallet
    n.createwallet(wallet_name=wallet_name, descriptors=self.options.descriptors, load_on_startup=True)
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/test_node.py", line 704, in createwallet
    return self.__getattr__('createwallet')(wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors, load_on_startup, external_signer)
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/coverage.py", line 49, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/private/var/folders/tn/f_9sf1xx5t14qm_6f83q3b840000gn/T/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-apple-darwin19/test/functional/test_framework/authproxy.py", line 144, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: Compiled without bdb support (required for legacy wallets) (-4)

@theStack
theStack deleted the 202112-test-fix-interface_bitcoin_cli-with-descriptors branch December 7, 2021 11:52
maflcko pushed a commit to bitcoin-core/gui that referenced this pull request Dec 8, 2021
…ecified wallet type availability

b57bf25 test: interface_bitcoin_cli.py: check specified wallet type availability (Sebastian Falbesoner)

Pull request description:

  Currently the test `interface_bitcoin_cli.py` performs the wallet-relevant parts if _any_ wallet type support is compiled in, independently of
  whether the test is run with legacy or descriptor wallet specified. This leads to a failure if the test is started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support, see e.g
   bitcoin/bitcoin#23686 (comment)

  Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available.

  Should further pave the way for #23682.

ACKs for top commit:
  achow101:
    ACK b57bf25

Tree-SHA512: ddb5a94ba61133eff8de79d4946b3b9d476232b26e83bf768894cac4691e72602f88b6c02c72b992e12c2feb9bff1f0a2e0a265948a00954311104add1347184
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
…scriptors` and add to test runner

ca0ef70 test: add interface_bitcoin_cli.py --descriptors to test_runner.py (Sebastian Falbesoner)
54fb2ed test: fix test interface_bitcoin_cli.py for descriptor wallets (Sebastian Falbesoner)

Pull request description:

  The functional test interface_bitcoin_cli.py currently fails on master branch, if descriptor wallets are used (argument `--descriptors`), see #23684. This is due to the fact that different change output types are used for created transactions (P2WPKH for legacy wallets, P2TR for descriptor wallets; the former doesn't have a ScriptPubKeyMan for bech32m), resulting in different tx sizes and hence also fees. Fix this by explicitely setting the output type via passing both `-addresstype=bech32` and `-changetype=bech32` as argument. The former would not be needed by now, but makes the test more deterministic and avoids a failure if bech32m becomes the default address type.

  Fixes #23684, should also pave the way for #23682.

Top commit has no ACKs.

Tree-SHA512: 39b780e25e4c7094cb3378e0f10d4a8aebac1500b7b2d68de47e54e23b9b5efe5afcf8765bb8398eeaf56968e2586a1b294a0f8773c7d90f4188a0f00b8501ff
RandyMcMillan pushed a commit to RandyMcMillan/mempool-tab that referenced this pull request Dec 23, 2021
…ecified wallet type availability

3e63dbc test: interface_bitcoin_cli.py: check specified wallet type availability (Sebastian Falbesoner)

Pull request description:

  Currently the test `interface_bitcoin_cli.py` performs the wallet-relevant parts if _any_ wallet type support is compiled in, independently of
  whether the test is run with legacy or descriptor wallet specified. This leads to a failure if the test is started with the `--legacy-wallet` parameter, but bitcoind is compiled without BDB support, see e.g
   bitcoin/bitcoin#23686 (comment)

  Fix this by checking if the specified wallet type (BDB for legacy wallet, SQLite for descriptor wallet) is available.

  Should further pave the way for #23682.

ACKs for top commit:
  achow101:
    ACK 3e63dbc

Tree-SHA512: ddb5a94ba61133eff8de79d4946b3b9d476232b26e83bf768894cac4691e72602f88b6c02c72b992e12c2feb9bff1f0a2e0a265948a00954311104add1347184
@bitcoin bitcoin locked and limited conversation to collaborators Dec 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: AssertionError: not(59.99992540 == 59.999928) in interface_bitcoin_cli

3 participants