Commit Graph

3031 Commits

Author SHA1 Message Date
Wladimir J. van der Laan
4fd37d0a10
Merge #20292: test: Fix intermittent feature_taproot issue
fab900802d ci: Bump timeout factor (MarcoFalke)
50eb0c2512 Small improvements to the Taproot functional tests (Pieter Wuille)
fac865b72d test: Fix intermittent feature_taproot issue (MarcoFalke)
fa1dea19fc test: Fix deser issue in create_block (MarcoFalke)
fa762a3fd4 test: Remove unused unnamed parameter from block.serialize call (MarcoFalke)

Pull request description:

  This fixes three bugs. Also, fix some unrelated code style issues.

  Please refer to the commit messages for more information.

ACKs for top commit:
  laanwj:
    Code review ACK fab900802d

Tree-SHA512: 4e22c240cf345710f3b21fc63243126b90014b3656d0865ff87156e958dd1442e6572c6c0a5701dbbe503eee931a0ceb66eeeb3553137f3d1f5afd27a9f9cada
2020-11-09 15:47:04 +01:00
Wladimir J. van der Laan
663fd92b28
Merge #20266: wallet: fix change detection of imported internal descriptors
bd93fc9945 Fix change detection of imported internal descriptors (Andrew Chow)

Pull request description:

  Import internal descriptors were having address book entries added which meant they would be detected as non-change. Fix this and add a test for it.

ACKs for top commit:
  laanwj:
    Code review ACK bd93fc9945
  meshcollider:
    utACK bd93fc9945
  promag:
    Code review ACK bd93fc9945.

Tree-SHA512: 8fa9e364be317627ec171eedffdb505976c0e7f1e55bc7e8cfdffa3aeea5db24d231f55166602cd0e97a5ba621acc871de0a765c75d0c65678f83e93c3b657c5
2020-11-09 15:14:45 +01:00
Stepan Snigirev
568a1d7261 fix ecdsa verify in test framework 2020-11-05 23:16:55 +01:00
MarcoFalke
fa00ff0399
test: Fix wallet_multiwallet test issue on Windows 2020-11-05 13:50:15 +01:00
fanquake
6954e4d16c
Merge #20283: test: Only try witness deser when checking for witness deser failure
fae45c34d1 test: Only try witness deserialize when checking for witness deserialize failure (MarcoFalke)

Pull request description:

  Witness deserialize will fail always. (This is what the test is checking for)

  Consequently, non-witness deserialize is also tried, and it might succeed accidentally. Avoid that by not trying non-witness deserialize.

  Fixes #20249

ACKs for top commit:
  jnewbery:
    utACK fae45c34d1

Tree-SHA512: 45e65b31603e3ca839776a7ed30e363b32eba20dfb67b7b55bff06715876850d4f6ba22f8ea4911a62e1f8ffff395bf187b23c46ddc766516b97057df000deb3
2020-11-05 14:56:02 +08:00
MarcoFalke
83650e4df5
Merge #20199: wallet: ignore (but warn) on duplicate -wallet parameters
58cfbc38e0 Ignoring (but warn) on duplicate -wallet parameters (Jonas Schnelli)

Pull request description:

  I expect that there are many users with load on startup wallet definitions in `bitcoin.conf` or via startup CLI argument.
  With the new `settings.json` r/w configuration file, users unloading and loading a wallet through the GUI or via the RPC calls might end up with a duplicate `-wallet` entry (one that still remains in bitcoin.conf or CLI) plus the new duplication in `settings.json` due to the unload/load.

  Steps to reproduce
  * create wallet (if via RPC set `load_on_startup` or unloadwallet/loadwallet then set `load_on_startup`).
  * stop bitcoin
  * start bitcoind again with same `--wallet=mywallet`

  I guess it is acceptable to skip duplicates.

ACKs for top commit:
  achow101:
    Tested ACK 58cfbc38e0
  meshcollider:
    Code review ACK 58cfbc38e0
  ryanofsky:
    Code review ACK 58cfbc38e0. Changes since previous review: rebased, tweaked warning message, squashed/fixed test

Tree-SHA512: f94e5a999bdd7dc291f0bc142911b0a8033929350d6f6a35b58c4a06a3c8f83147be0f0c402d4e946dedbbcc85b7e023b672c731b6d7a8984d4780017c961cfb
2020-11-05 07:51:07 +01:00
MarcoFalke
fa2ecadd0d
test: Fix intermittent rpc_net issue 2020-11-04 13:21:54 +01:00
Samuel Dobson
5d32009f1a
Merge #20220: wallet, rpc: explicit fee rate follow-ups/fixes for 0.21
0be29000c0 rpc: update conf_target helps for correctness/consistency (Jon Atack)
778b9be406 wallet, rpc: fix send subtract_fee_from_outputs help (Jon Atack)
603c005083 wallet: add rpc send explicit fee rate coverage (Jon Atack)
dd341e602d wallet: add sendtoaddress/sendmany explicit fee rate coverage (Jon Atack)
44e7bfa603 wallet: add walletcreatefundedpsbt explicit fee rate coverage (Jon Atack)
6e1ea4273e test: refactor for walletcreatefundedpsbt fee rate coverage (Jon Atack)
3ac7b0c6f1 wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() (Jon Atack)
2d8eba8f84 wallet: combine redundant bumpfee invalid params and args tests (Jon Atack)
1697a40b6f wallet: improve bumpfee error/help, add explicit fee rate coverage (Jon Atack)
fc5721723d wallet: fix SetFeeEstimateMode() error message (Jon Atack)
052427eef1 wallet, bugfix: fix bumpfee with explicit fee rate modes (Jon Atack)

Pull request description:

  Follow-up to #11413 providing a base to build on for #19543:

  - bugfix for `bumpfee` raising a JSON error with explicit feerates, fixes issue #20219
  - adds explicit feerate test coverage for `bumpfee`, `fundrawtransaction`, `walletcreatefundedpsbt`, `send`, `sendtoaddress`, and `sendmany`
  - improves a few related RPC error messages and `ParseConfirmTarget()` / error message
  - fixes/improves the explicit fee rate information in the 6 RPC helps, of which 2 were also missing `conf_target` sat/B units

  This provides a spec and regression coverage for the potential next step of a universal `sat/vB` feerate argument (see #19543), as well as immediate coverage and minimum fixes for 0.21.

ACKs for top commit:
  kallewoof:
    Concept/Tested ACK 0be29000c0
  meshcollider:
    Code review + functional test run ACK 0be29000c0

Tree-SHA512: efd965003e991cba51d4504e2940f06ab3d742e34022e96a673606b44fad85596aa03a8c1809f06df7ebcf21a38e18a891e54392fe3d6fb4d120bbe4ea0cf5e0
2020-11-04 16:35:23 +13:00
Samuel Dobson
17c6fb176a
Merge #20282: wallet: change upgradewallet return type to be an object
2ead31fb1b [wallet] Return object from upgradewallet RPC (Sishir Giri)

Pull request description:

  Change the return type of upgradewallet to be an object for future extensibility.

  Also return any error string returned from the `UpgradeWallet()` function.

ACKs for top commit:
  MarcoFalke:
    ACK 2ead31fb1b
  meshcollider:
    Tested ACK 2ead31fb1b

Tree-SHA512: bcc7432d2f35093ec2463ea19e894fa885b698c0e8d8e4bd2f979bd4d722cbfed53ec589d6280968917893c64649dc9e40800b8d854273b0f9a1380f51afbdb1
2020-11-04 14:51:42 +13:00
Pieter Wuille
50eb0c2512 Small improvements to the Taproot functional tests
The "whitelist" and "connect_nodes" is not needed in feature_taproot.py,
so remove it.

The changes to key.py are required when running the unit tests from the
test folder. Failure on current master:

[test]$ python -m unittest functional/test_framework/key.py
.E
======================================================================
ERROR: test_schnorr_testvectors (functional.test_framework.key.TestFrameworkKey)
Implement the BIP340 test vectors (read from bip340_test_vectors.csv).
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/functional/test_framework/key.py", line 526, in test_schnorr_testvectors
    with open(os.path.join(sys.path[0], 'test_framework', 'bip340_test_vectors.csv'), newline='', encoding='utf8') as csvfile:
FileNotFoundError: [Errno 2] No such file or directory: 'test/test_framework/bip340_test_vectors.csv'

----------------------------------------------------------------------
Ran 2 tests in 0.775s

FAILED (errors=1)
2020-11-03 12:26:17 +01:00
MarcoFalke
fac865b72d
test: Fix intermittent feature_taproot issue
The transaction is too large to fit into the mempool, so put it into a
block.

https://travis-ci.org/github/bitcoin/bitcoin/jobs/740987240#L7217

test  2020-11-03T01:31:08.645000Z TestFramework (ERROR): JSONRPC error
        Traceback (most recent call last):
          File "./test/functional/test_framework/test_framework.py", line 126, in main
            self.run_test()
          File "./test/functional/feature_taproot.py", line 1448, in run_test
            self.nodes[1].sendtoaddress(address=addr, amount=int(self.nodes[1].getbalance() * 70000000) / 100000000)
          File "./test/functional/test_framework/coverage.py", line 47, in __call__
            return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
          File "./test/functional/test_framework/authproxy.py", line 146, in __call__
            raise JSONRPCException(response['error'], status)
        test_framework.authproxy.JSONRPCException: Transaction too large (-6)
2020-11-03 12:26:17 +01:00
MarcoFalke
fa1dea19fc
test: Fix deser issue in create_block
Without the fix a hex-string can not be parsed:

File "./test/functional/test_framework/blocktools.py", line 82, in create_block
    txo.deserialize(io.BytesIO(tx))
TypeError: a bytes-like object is required, not 'str'

Also, remove io import and repace it with our FromHex() helper
2020-11-03 12:25:55 +01:00
MarcoFalke
fa762a3fd4
test: Remove unused unnamed parameter from block.serialize call
All blocks and transactions are serialized with witness, no need to set
this
2020-11-03 12:23:21 +01:00
Jonas Schnelli
58cfbc38e0 Ignoring (but warn) on duplicate -wallet parameters 2020-11-03 12:06:32 +01:00
Wladimir J. van der Laan
ef4c7c4e0b
Merge #18788: tests: Update more tests to work with descriptor wallets
c7b7e0a692 tests: Make only desc wallets for wallet_multwallet.py --descriptors (Andrew Chow)
d4b67ad214 Avoid creating legacy wallets in wallet_importdescriptors.py (Andrew Chow)
6c9c12bf87 Update feature_backwards_compatibility for descriptor wallets (Andrew Chow)
9a4c631e1c Update wallet_labels.py to not require descriptors=False (Andrew Chow)
242aed7cc1 tests: Add a --legacy-wallet that is mutually exclusive with --descriptors (Andrew Chow)
388053e172 Disable some tests for tool_wallet when descriptors (Andrew Chow)
47d3243160 Make raw multisig tests legacy wallet only in rpc_rawtransaction.py (Andrew Chow)
59d3da5bce Do addmultisigaddress tests in legacy wallet mode in wallet_address_types.py (Andrew Chow)
25bc5dccbf Use importdescriptors when in descriptor wallet mode in wallet_createwallet.py (Andrew Chow)
0bd1860300 Avoid dumpprivkey and watchonly behavior in rpc_signrawtransaction.py (Andrew Chow)
08067aebfd Add script equivalent of functions in address.py (Andrew Chow)
86968882a8 Add descriptor wallet output to tool_wallet.py (Andrew Chow)
3457679870 Use separate watchonly wallet for multisig in feature_nulldummy.py (Andrew Chow)
a42652ec10 Move import and watchonly tests to be legacy wallet only in wallet_balance.py (Andrew Chow)
4b871909d6 Use importdescriptors for descriptor wallets in wallet_bumpfee.py (Andrew Chow)
c2711e4230 Avoid dumpprivkey in wallet_listsinceblock.py (Andrew Chow)
553dbf9af4 Make import tests in wallet_listtransactions.py legacy wallet only (Andrew Chow)
dc81418fd0 Use a separate watchonly wallet in rpc_fundrawtransaction.py (Andrew Chow)
a357111047 Update wallet_importprunedfunds to avoid dumpprivkey (Andrew Chow)

Pull request description:

  I went through all the tests and checked whether they passed with descriptor wallets. This partially informed some changes in #16528. Some tests needed changes to work with descriptor wallets. These were primarily due to import and watchonly behavior. There are some tests and test cases that only test legacy wallet behavior so those tests won't be run with descriptor wallets.

  This PR updates more tests to have to the `--descriptors` switch in `test_runner.py`. Additionally a mutually exclusive `--legacy-wallet` option has been added to force legacy wallets. This does nothing currently but will be useful in the future when descriptor wallets are the default. For the tests that rely on legacy wallet behavior, this option is being set so that we don't forget in the future. Those tests are `feature_segwit.py`, `wallet_watchonly.py`, `wallet_implicitsegwit.py`, `wallet_import_with_label.py`, and `wallet_import_with_label.py`.

  If you invert the `--descriptors`/`--legacy-wallet` default so that descriptor wallets are the default, all tests (besides the legacy wallet specific ones) will pass.

ACKs for top commit:
  MarcoFalke:
    review ACK c7b7e0a692 🎿
  laanwj:
    ACK c7b7e0a692

Tree-SHA512: 2f4e87815005d1d0a2543ea7947f7cd7593d8cf5312228ef85f8e096f19739b225769961943049cb44f6f07a35b8de988e2246ab9aca5bb5a0b2e62694d5637d
2020-11-02 18:50:37 +01:00
MarcoFalke
fae45c34d1
test: Only try witness deserialize when checking for witness deserialize failure 2020-11-02 14:19:44 +01:00
MarcoFalke
c5ec0367d7
Merge #20165: Only relay Taproot spends if next block has it active
3d0556d410 Increase feature_taproot inactive test coverage (Pieter Wuille)
525cbd425e Only relay Taproot spends if next block has it active (Pieter Wuille)

Pull request description:

  There should be no change to mempool transaction behavior for witness v1 transactions as long as no activation is defined. Until that point, we should treat the consensus rules as under debate, and for soft-fork safety, that means spends should be treated as non-standard.

  It's possible to go further: don't relay them unless the consensus rules are actually active for the next block. This extends non-relay to the period where a deployment is defined, started, locked in, or failed. I see no downsides to this, and the code change is very simple.

ACKs for top commit:
  Sjors:
    utACK 3d0556d410
  MarcoFalke:
    review ACK 3d0556d410 🏓
  jnewbery:
    utACK 3d0556d410

Tree-SHA512: ca625a2981716b4b44e8f3722718fd25fd04e25bf3ca1684924b8974fca49f7c1d438fdd9dcdfbc091a442002e20d441d42c41a0e2096e74a61068da6c60267a
2020-11-02 10:12:06 +01:00
Sishir Giri
2ead31fb1b [wallet] Return object from upgradewallet RPC 2020-11-02 08:38:38 +00:00
Andrew Chow
c7b7e0a692 tests: Make only desc wallets for wallet_multwallet.py --descriptors 2020-11-01 17:54:19 -05:00
Andrew Chow
d4b67ad214 Avoid creating legacy wallets in wallet_importdescriptors.py 2020-11-01 17:54:19 -05:00
Andrew Chow
6c9c12bf87 Update feature_backwards_compatibility for descriptor wallets 2020-11-01 17:54:19 -05:00
Andrew Chow
9a4c631e1c Update wallet_labels.py to not require descriptors=False 2020-11-01 17:54:19 -05:00
Andrew Chow
242aed7cc1 tests: Add a --legacy-wallet that is mutually exclusive with --descriptors
Although legacy wallet is still the default, for future use, add a
--legacy-wallet option to the test framework. Additional tests for
descriptor wallets have been enabled with the --descriptors option.
Tests that must be legacy wallet only are being started with
--legacy-wallet. Even though this option does not currently do anything,
this will be helpful in the future when descriptor wallets become the
default.
2020-11-01 17:54:19 -05:00
Andrew Chow
388053e172 Disable some tests for tool_wallet when descriptors
Some tests are legacy wallet only (and make legacy wallets) so they
shouldn't be run when doing descriptor wallet tests.
2020-11-01 17:54:19 -05:00
Andrew Chow
47d3243160 Make raw multisig tests legacy wallet only in rpc_rawtransaction.py
The traditional multisig workflow doesn't work with descriptor wallets
so make these tests legacy wallet only.
2020-11-01 17:54:19 -05:00
Andrew Chow
59d3da5bce Do addmultisigaddress tests in legacy wallet mode in wallet_address_types.py
addmultisigaddress is not available in descriptor wallets, so only run
these when testing legacy wallets
2020-11-01 17:54:19 -05:00
Andrew Chow
25bc5dccbf Use importdescriptors when in descriptor wallet mode in wallet_createwallet.py
sethdseed and importmulti are not available for descriptor wallets, so
when doing descriptor wallet tests, use importdescriptors instead.

Also changes some output to match what descriptor wallets will return.
2020-11-01 17:54:19 -05:00
Andrew Chow
0bd1860300 Avoid dumpprivkey and watchonly behavior in rpc_signrawtransaction.py
dumpprivkey and watchonly behavior don't work with descriptor wallets.

Test for multisigs is modified to not rely on watchonly behavior for
those multisigs. This has a side effect of removing listunspent, but
that's not the target of this test, so that's fine.
2020-11-01 17:54:19 -05:00
Andrew Chow
08067aebfd Add script equivalent of functions in address.py 2020-11-01 17:54:19 -05:00
Andrew Chow
86968882a8 Add descriptor wallet output to tool_wallet.py
Descriptor wallets output slightly different information in the wallet
tool, so check that output when in descriptor wallet mode.
2020-11-01 17:54:19 -05:00
Andrew Chow
3457679870 Use separate watchonly wallet for multisig in feature_nulldummy.py
Create and import the multisig into a separate watchonly wallet so that
feature_nulldummy.py works with descriptor wallets.

blocktools.create_raw_transaction is also updated to use multiple nodes
and wallets and to use PSBT so that this test passes.
2020-11-01 17:54:19 -05:00
Andrew Chow
a42652ec10 Move import and watchonly tests to be legacy wallet only in wallet_balance.py
Imports and watchonly behavior are legacy wallet only, so make them only
run when the test is in legacy wallet mode.
2020-11-01 17:54:19 -05:00
Andrew Chow
4b871909d6 Use importdescriptors for descriptor wallets in wallet_bumpfee.py
If using descriptor wallets, use importdescriptors instead of
importmulti.
2020-11-01 17:54:19 -05:00
Andrew Chow
c2711e4230 Avoid dumpprivkey in wallet_listsinceblock.py
Generate a privkey in the test framework instead of using dumpprivkey so
that descriptor wallets work in this test.
2020-11-01 17:54:19 -05:00
Andrew Chow
553dbf9af4 Make import tests in wallet_listtransactions.py legacy wallet only
Existing import* RPCs are disabled for descriptor wallets, so only do
these tests for legacy wallets.
2020-11-01 17:54:19 -05:00
Andrew Chow
dc81418fd0 Use a separate watchonly wallet in rpc_fundrawtransaction.py
Import things into a separate watchonly wallet to work with descriptor
wallets.
2020-11-01 17:54:19 -05:00
Andrew Chow
a357111047 Update wallet_importprunedfunds to avoid dumpprivkey
Removes the use of dumpprivkey so that descriptor wallets can pass on
this. Also does a few descriptor wallet specific changes due to
different IsMine semantics.
2020-11-01 17:54:19 -05:00
Pieter Wuille
3d0556d410 Increase feature_taproot inactive test coverage 2020-10-30 15:52:38 -07:00
Pieter Wuille
525cbd425e Only relay Taproot spends if next block has it active 2020-10-30 15:52:19 -07:00
Andrew Chow
bd93fc9945 Fix change detection of imported internal descriptors 2020-10-29 17:55:13 -04:00
Andrew Chow
7411876c75 Ensure a legacy wallet for BDB format check 2020-10-29 14:59:29 -04:00
Andrew Chow
586640381a Skip --descriptor tests if sqlite is not compiled 2020-10-29 12:34:16 -04:00
MarcoFalke
42b66a6b81
Merge #20186: wallet: Make -wallet setting not create wallets
01476a88a6 wallet: Make -wallet setting not create wallets (Russell Yanofsky)

Pull request description:

  This changes `-wallet` setting to only load existing wallets, not create new ones.

  - Fixes settings.json corner cases reported by sjors & promag: https://github.com/bitcoin-core/gui/issues/95, https://github.com/bitcoin/bitcoin/pull/19754#issuecomment-685858578, https://github.com/bitcoin/bitcoin/pull/19754#issuecomment-685858578

  - Prevents accidental creation of wallets reported most recently by jb55 http://www.erisian.com.au/bitcoin-core-dev/log-2020-09-14.html#l-355

  - Simplifies behavior after #15454. #15454 took the big step of disabling creation of the default wallet. This PR extends it to avoid creating other wallets as well. With this change, new wallets just aren't created on startup, instead of sometimes being created, sometimes not. #15454 release notes are updated here and are simpler.

  This change should be targeted for 0.21.0. It's a bug fix and simplifies behavior of the #15937 / #19754 / #15454 features added in 0.21.0.

  ---

  This PR is implementing the simplest, most basic alternative listed in https://github.com/bitcoin-core/gui/issues/95#issuecomment-694236940. Other improvements mentioned there can build on top of this.

ACKs for top commit:
  achow101:
    ACK 01476a88a6
  hebasto:
    re-ACK 01476a88a6
  MarcoFalke:
    review ACK 01476a88a6 🏂

Tree-SHA512: 0d50f4e5dfbd04a2efd9fd66c02085a0ed705807bdec1cf5770d0ae8cb6af07080fb81306349937bf66acdb713d03fb35636f6442b650d0820e66cbae09c2f87
2020-10-29 15:01:39 +01:00
Wladimir J. van der Laan
6196cf77e5
Merge #19753: p2p: don't add AlreadyHave transactions to recentRejects
d419fdedbe [net processing] Don't add AlreadyHave txs to recentRejects (Troy Giorshev)

Pull request description:

  If we already have a transaction, don't add it to recentRejects

  Now, we only add a transaction to our recentRejects filter if we didn't already have it, meaning that it is added at most once, as intended.

ACKs for top commit:
  jnewbery:
    Code review ACK d419fdedbe
  laanwj:
    Code review ACK d419fdedbe

Tree-SHA512: cff5c1ba36c4700e2d6ab3eec4a3e51e1bef28fb3cc1bc850c84e06d6e5a9f6c32825207c253cc9cdf596b2eaadb6b5be68b3f8ca752b4ef6c31cf85138e3c99
2020-10-29 11:40:15 +01:00
Jon Atack
603c005083
wallet: add rpc send explicit fee rate coverage 2020-10-29 00:22:08 +01:00
Jon Atack
dd341e602d
wallet: add sendtoaddress/sendmany explicit fee rate coverage 2020-10-29 00:22:04 +01:00
Jon Atack
44e7bfa603
wallet: add walletcreatefundedpsbt explicit fee rate coverage 2020-10-29 00:22:02 +01:00
Jon Atack
6e1ea4273e
test: refactor for walletcreatefundedpsbt fee rate coverage 2020-10-29 00:22:00 +01:00
Jon Atack
3ac7b0c6f1
wallet: fundrawtx fee rate coverage, fixup ParseConfirmTarget() 2020-10-29 00:21:57 +01:00
John Newbery
778cd0d88d [tests] Remove getnettotals/getpeerinfo consistency test
We make no guarantees about consistency between RPC calls.
2020-10-28 10:18:09 +00:00