Page MenuHomePhabricator

Add a --descriptors option to more tests
Changes PlannedPublic

Authored by PiRK on Sep 30 2021, 08:36.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This is a backport of core#16528 [43b/43]
https://github.com/bitcoin/bitcoin/pull/16528/commits/223588b1bbc63dc57098bbd0baa48635e0cc0b82

This is the second part of the backport started in D10213, addressing
two of the remaining tests:

  • wallet_basic.py
  • wallet_keypool.py

wallet_basic.py required adding round_satoshi when dividing the wallet balance by two, because previous changes in the test when using --descriptors cause the wallet to now have an odd number of satoshis.

For wallet_keypool.py, it only make sense to import one type of descriptor instead of the 3 types imported by Core, because we only have the LEGACY output type. We miss BECH32 (wpkh(...) descriptors) and P2SH_SEGWIT (sh(wpkh(...)) descriptors)

The remaining test requires some fixing before it can be backported.

Depends on D10213

Test Plan

ninja check-functional

Event Timeline

PiRK requested review of this revision.Sep 30 2021, 08:36
PiRK planned changes to this revision.Oct 4 2021, 12:06
PiRK edited the summary of this revision. (Show Details)

use satoshi_round in wallet_basic instead of making a special case for --descriptors.

Import only pkh descriptors in wallet_keypool so that outputs remain p2kh even with --descriptors, and no adjusting of fees is required to make the test pass both with and without the option.
TODO: understand why there still is a fee adjustement required at the end of the test (I have a similar problem in rpc_psbt`)

PiRK planned changes to this revision.Oct 4 2021, 16:55

Failed tests logs:

====== Bitcoin ABC functional tests: wallet_keypool.py ======

------- Stdout: -------
2021-10-04T17:00:25.745000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_82
2021-10-04T17:00:28.411000Z TestFramework (INFO): pkh([c34adbd4/0'/0'/5']03394bf695ac191539346633748bb544bd7a551ca649b305f5f37423dc3b9ec663)#fe5v3tmu
2021-10-04T17:00:28.568000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:00:28.618000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:00:28.920000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_82
2021-10-04T17:00:28.920000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_82/test_framework.log
2021-10-04T17:00:28.920000Z TestFramework (ERROR): 
2021-10-04T17:00:28.920000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_82' to consolidate all logs
2021-10-04T17:00:28.920000Z TestFramework (ERROR): 
2021-10-04T17:00:28.920000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:00:28.920000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:00:28.920000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests: wallet_keypool.py --descriptors ======

------- Stdout: -------
2021-10-04T17:01:09.760000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_177
2021-10-04T17:01:12.750000Z TestFramework (INFO): pkh([0c5f9a1e/0'/6']027f8b4b5f9b9a46d565e821bc9f6e5239ec54fbe8694fe6b8a1419d1e5f0f1e61)#00z0su09
2021-10-04T17:01:12.926000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:01:12.977000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:01:13.179000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_177
2021-10-04T17:01:13.179000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_177/test_framework.log
2021-10-04T17:01:13.179000Z TestFramework (ERROR): 
2021-10-04T17:01:13.179000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-debug/test/tmp/test_runner_₿₵_  _20211004_165610/wallet_keypool_177' to consolidate all logs
2021-10-04T17:01:13.179000Z TestFramework (ERROR): 
2021-10-04T17:01:13.179000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:01:13.179000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:01:13.179000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: wallet_keypool.py
Bitcoin ABC functional tests: wallet_keypool.py --descriptors

Failed tests logs:

====== Bitcoin ABC functional tests: wallet_keypool.py ======

------- Stdout: -------
2021-10-04T17:01:53.226000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_82
2021-10-04T17:01:55.511000Z TestFramework (INFO): pkh([81660beb/0'/0'/1']022619943c6441737e40b2444972d570ea9ed2dfa859e6f0af4b08aa07373c293f)#3qur0nev
2021-10-04T17:01:55.671000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:01:55.722000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:01:55.923000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_82
2021-10-04T17:01:55.923000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_82/test_framework.log
2021-10-04T17:01:55.923000Z TestFramework (ERROR): 
2021-10-04T17:01:55.923000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_82' to consolidate all logs
2021-10-04T17:01:55.923000Z TestFramework (ERROR): 
2021-10-04T17:01:55.924000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:01:55.924000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:01:55.924000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests: wallet_keypool.py --descriptors ======

------- Stdout: -------
2021-10-04T17:02:22.694000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_177
2021-10-04T17:02:25.017000Z TestFramework (INFO): pkh([0c5f9a1e/0'/4']03e22f8f7ed60b52dfab9c52dd176e11f4d2e0bbc59e1df12994cc9616bf1ac4c1)#5fwamc2t
2021-10-04T17:02:25.123000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:02:25.174000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:02:25.376000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_177
2021-10-04T17:02:25.376000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_177/test_framework.log
2021-10-04T17:02:25.376000Z TestFramework (ERROR): 
2021-10-04T17:02:25.377000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_165903/wallet_keypool_177' to consolidate all logs
2021-10-04T17:02:25.377000Z TestFramework (ERROR): 
2021-10-04T17:02:25.377000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:02:25.377000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:02:25.377000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: wallet_keypool.py ======

------- Stdout: -------
2021-10-04T17:05:38.889000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_82
2021-10-04T17:05:41.081000Z TestFramework (INFO): pkh([21ffe227/0'/0'/5']0251cde4dbc8bd97f40e732752706b9a60cd7c1f81261e8d237a2e786c5bedc43e)#pzm2cazu
2021-10-04T17:05:41.197000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:05:41.248000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:05:41.349000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_82
2021-10-04T17:05:41.349000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_82/test_framework.log
2021-10-04T17:05:41.349000Z TestFramework (ERROR): 
2021-10-04T17:05:41.349000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_82' to consolidate all logs
2021-10-04T17:05:41.349000Z TestFramework (ERROR): 
2021-10-04T17:05:41.350000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:05:41.350000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:05:41.350000Z TestFramework (ERROR):
====== Bitcoin ABC functional tests with the next upgrade activated: wallet_keypool.py --descriptors ======

------- Stdout: -------
2021-10-04T17:06:07.985000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_177
2021-10-04T17:06:10.352000Z TestFramework (INFO): pkh([0c5f9a1e/0'/2']03ae85bde54f29d08a30344d33bd0c4449f94ca6c6172c61cd9e48ca24373583f1)#s3jhg6ha
2021-10-04T17:06:10.454000Z TestFramework (ERROR): JSONRPC error
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 128, in main
    self.run_test()
  File "/work/test/functional/wallet_keypool.py", line 186, in run_test
    options={"subtractFeeFromOutputs": [0], "feeRate": 492.96})
  File "/work/test/functional/test_framework/coverage.py", line 47, in __call__
    return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
  File "/work/test/functional/test_framework/authproxy.py", line 163, in __call__
    raise JSONRPCException(response['error'], status)
test_framework.authproxy.JSONRPCException: The transaction amount is too small to send after the fee has been deducted (-4)
2021-10-04T17:06:10.505000Z TestFramework (INFO): Stopping nodes
2021-10-04T17:06:10.706000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_177
2021-10-04T17:06:10.706000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_177/test_framework.log
2021-10-04T17:06:10.706000Z TestFramework (ERROR): 
2021-10-04T17:06:10.707000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20211004_170248/wallet_keypool_177' to consolidate all logs
2021-10-04T17:06:10.707000Z TestFramework (ERROR): 
2021-10-04T17:06:10.707000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2021-10-04T17:06:10.707000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2021-10-04T17:06:10.707000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: wallet_keypool.py
Bitcoin ABC functional tests: wallet_keypool.py --descriptors
Bitcoin ABC functional tests with the next upgrade activated: wallet_keypool.py
Bitcoin ABC functional tests with the next upgrade activated: wallet_keypool.py --descriptors

PiRK planned changes to this revision.Oct 5 2021, 08:34

still need to find an explanation for why importing a desc instead of importing keys with importmulti causes a slightly different fee calculation. I verified that the generated transaction has the same size.

PiRK planned changes to this revision.Dec 6 2021, 10:12