aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-02-01Merge bitcoin/bitcoin#26910: wallet: migrate wallet, exit early if no legacy ↵Andrew Chow
data exist 6d31900e52efa2c7c7a220d8c8ad6353c412a2aa wallet: migrate wallet, exit early if no legacy data exist (furszy) Pull request description: The process first creates a backup file then return an error, without removing the recently created file, when notices that the db is already running sqlite. ACKs for top commit: john-moffett: ACK 6d31900e52efa2c7c7a220d8c8ad6353c412a2aa achow101: ACK 6d31900e52efa2c7c7a220d8c8ad6353c412a2aa ishaanam: crACK 6d31900e52efa2c7c7a220d8c8ad6353c412a2aa Tree-SHA512: 9fb52e80de96e129487ab91bef13647bc4570a782003b1e37940e2a00ca26283fd24ad39bdb63a984ae0a56140b518fd0d74aa2fc59ab04405b2c179b7d3c54a
2023-01-31Merge bitcoin/bitcoin#26956: test: refactor: introduce `replace_in_config` ↵MarcoFalke
helper b530d9605db863fd8d0e45e73ff2eb9462d1ad4c test: refactor: introduce `replace_in_config` helper (Sebastian Falbesoner) Pull request description: Currently two functional tests (p2p_permissions.py and wallet_crosschain.py) include quite similar code for substituting strings in a TestNode's bitcoind configuration file, so refactoring that out to a dedicated helper method seems to make sense (probably other tests could need that too in the future). ACKs for top commit: kouloumos: ACK b530d9605db863fd8d0e45e73ff2eb9462d1ad4c Tree-SHA512: 5ca65a2ef3292460e5720d5c6acf7326335001858e8f71ab054560117f9479dbadb1dacd8c9235f67f3fcfd08dbc761b62704f379cbf619bba8804f16a25bc7b
2023-01-30Merge bitcoin/bitcoin#26499: wallet: Abandon descendants of orphaned coinbasesglozow
b0fa5989e1b77a343349bd36f8bc407f9366a589 test: Check that orphaned coinbase unconf spend is still abandoned (Andrew Chow) 9addbd78901124a48fd41a82a9557fcf3490191d wallet: Automatically abandon orphaned coinbases and their children (Andrew Chow) Pull request description: When a block is reorged out of the main chain, any descendants of the coinbase will no longer be valid. Currently they are only marked as inactive, which means that our balance calculations will still include them. In order to be excluded from the balance calculation, they need to either be abandoned or conflicted. This PR goes with the abandoned method. Note that even when they are included in balance calculations, coin selection will not select outputs belonging to these transactions because they are not in the mempool. Fixes #14148 ACKs for top commit: furszy: ACK b0fa5989 with a not-blocking nit. aureleoules: reACK b0fa5989e1b77a343349bd36f8bc407f9366a589 ishaanam: ACK b0fa5989e1b77a343349bd36f8bc407f9366a589 Tree-SHA512: 68f12e7aa8df392d8817dc6ac0becce8dbe83837bfa538f47027e6730e5b2e1b1a090cfcea2dc598398fdb66090e02d321d799f087020d7e1badcf96e598c3ac
2023-01-28test: refactor: introduce `replace_in_config` helperSebastian Falbesoner
2023-01-27test: fix intermittent errors in p2p_ibd_stalling.pyMartin Zumsande
Using is_connected instead of num_test_p2p_connections ensures that python has taken notice that the p2p was disconnected.
2023-01-27Merge bitcoin/bitcoin#25880: p2p: Make stalling timeout adaptive during IBDAndrew Chow
39b93649c4b98cd82c64b957fd9f6a6fd3c2a359 test: add functional test for IBD stalling logic (Martin Zumsande) 0565951f34e6d155dc825964c5d8b1dd00931682 p2p: Make block stalling timeout adaptive (Martin Zumsande) Pull request description: During IBD, there is the following stalling mechanism if we can't proceed with assigning blocks from a 1024 lookahead window because all of these blocks are either already downloaded or in-flight: We'll mark the peer from which we expect the current block that would allow us to advance our tip (and thereby move the 1024 window ahead) as a possible staller. We then give this peer 2 more seconds to deliver a block (`BLOCK_STALLING_TIMEOUT`) and if it doesn't, disconnect it and assign the critical block we need to another peer. Now the problem is that this second peer is immediately marked as a potential staller using the same mechanism and given 2 seconds as well - if our own connection is so slow that it simply takes us more than 2 seconds to download this block, that peer will also be disconnected (and so on...), leading to repeated disconnections and no progress in IBD. This has been described in #9213, and I have observed this when doing IBD on slower connections or with Tor - sometimes there would be several minutes without progress, where all we did was disconnect peers and find new ones. The `2s` stalling timeout was introduced in #4468, when blocks weren't full and before Segwit increased the maximum possible physical size of blocks - so I think it made a lot of sense back then. But it would be good to revisit this timeout now. This PR makes the timout adaptive (idea by sipa): If we disconnect a peer for stalling, we now double the timeout for the next peer (up to a maximum of 64s). If we connect a block, we half it again up to the old value of 2 seconds. That way, peers that are comparatively slower will still get disconnected, but long phases of disconnecting all peers shouldn't happen anymore. Fixes #9213 ACKs for top commit: achow101: ACK 39b93649c4b98cd82c64b957fd9f6a6fd3c2a359 RandyMcMillan: Strong Concept ACK 39b93649c4b98cd82c64b957fd9f6a6fd3c2a359 vasild: ACK 39b93649c4b98cd82c64b957fd9f6a6fd3c2a359 naumenkogs: ACK 39b93649c4b98cd82c64b957fd9f6a6fd3c2a359 Tree-SHA512: 85bc57093b2fb1d28d7409ed8df5a91543909405907bc129de7c6285d0810dd79bc05219e4d5aefcb55c85512b0ad5bed43a4114a17e46c35b9a3f9a983d5754
2023-01-26Merge bitcoin/bitcoin#26923: test: refactor: simplify ↵MarcoFalke
p2p_{tx_download,eviction}.py by using MiniWallet 8609f24be2a761e84e052f965587540d5b3b5315 test: refactor: simplify p2p_eviction.py by using MiniWallet (Sebastian Falbesoner) 7aa4b32cd4e46f6494aff73968a70d6fc66caaa6 test: refactor: simplify p2p_tx_download.py by using MiniWallet (Sebastian Falbesoner) Pull request description: Similar to #26892, this PR simplies the functional tests p2p_tx_download.py and p2p_eviction.py by using MiniWallet in order to avoid manual low-level tx creation. For the latter, rather than mining 100 blocks manually, the pre-mined chain of the test framework is used. These instances were found via `$ git grep signrawtransactionwithkey ./test/functional`. AFAICT, there are no other instances where MiniWallet could replace tx creation trivially. ACKs for top commit: MarcoFalke: review ACK 8609f24be2a761e84e052f965587540d5b3b5315 Tree-SHA512: dfb0103fe7f0625d125e8e4408baed8bfc1ff579954af17d0ead5277e05f933b2c2d98a0093e8109e947635f1718d5c58d837ab825f26077fac0a40575bd3e6f
2023-01-25Merge bitcoin/bitcoin#26929: rpc: Throw more user friendly arg type check ↵fanquake
error (1.5/2) fafeddfe0e6748e9769ad3dd526a6c0eaf6f4aac rpc: Throw more user friendly arg type check error (MarcoFalke) Pull request description: The arg type check error doesn't list which arg (position or name) failed. Fix that. ACKs for top commit: stickies-v: ACK fafeddfe0e6748e9769ad3dd526a6c0eaf6f4aac - although I think the functional test isn't in a logical place (but not blocking) Tree-SHA512: 17425aa145aab5045940ec74fff28f0e3b2b17ae55f91c4bb5cbcdff0ef13732f8e31621d85964dc2c04333ea37dbe528296ac61be27541384b44e37957555c8
2023-01-25Merge bitcoin/bitcoin#26829: init: Remove unnecessary sensitive flag from ↵MarcoFalke
rpcbind b9d567454159f062ce84353f5821d6e6daf433bd init: Remove sensitive flag from rpcbind (Andrew Chow) Pull request description: `-rpcbind` is currently flagged as a sensitive option which means that its value will be masked when the command line args are written to the debug.log file. However this is not useful as if `rpcbind` is actually activated, the bound IP addresses will be written to the log anyways. The test `feature_config_args.py` did not catch this contradiction as the test node was not started with `rpcallowip` and so `rpcbind` was not acted upon. This also brings `rpcbind` inline with `bind` as that is not flagged as sensitive either. ACKs for top commit: Sjors: re-utACK b9d567454159f062ce84353f5821d6e6daf433bd willcl-ark: ACK b9d5674 theStack: ACK b9d567454159f062ce84353f5821d6e6daf433bd Tree-SHA512: 50ab5ad2e18ae70649deb1ac429d404b5f5c41f32a4943b2041480580152df22e72d4aae493379d0b23fcb649ab342376a82119760fbf6dfdcda659ffd3e244a
2023-01-23init: Remove sensitive flag from rpcbindAndrew Chow
2023-01-23test: Avoid rpc timeout in p2p_headers_sync_with_minchainworkMarcoFalke
2023-01-21test: Fix intermittent feature_rbf issueMarcoFalke
2023-01-20rpc: Throw more user friendly arg type check errorMarcoFalke
2023-01-19Merge bitcoin/bitcoin#26906: test: add an easy way to run linters locallyMarcoFalke
b68e5a7feff3e93027e75da0cd9a590fef99aac1 lint: specify the right commit range when running locally (James O'Beirne) dff7ed5732c01b3ba47ef9e9ddb687d073d7739d test: add an easy way to run linters locally (James O'Beirne) Pull request description: Adds a Dockerfile configuration ~~(originally written mostly by fanquake)~~ that allows straightforward running of linters with compatible versions locally. This removes a ton of annoyance when trying to appease CI, because many of the linter versions are quite old and difficult to maintain locally. I realize that people may not be thrilled to add more ancillary tooling to the repo, but I think this makes a lot of sense given the linter versions listed in this container configuration are dictated by this repo (within the CI configuration), so having these things live in two separate places is a recipe for version mismatches. Eventually we can likely just use this container on CI directly to avoid any chance of inconsistencies between local dev experience and CI. ACKs for top commit: aureleoules: ACK b68e5a7feff3e93027e75da0cd9a590fef99aac1 stickies-v: ACK b68e5a7fe john-moffett: ACK b68e5a7feff3e93027e75da0cd9a590fef99aac1 Tree-SHA512: 7ef7a5dae023d81fdb6296d5d92dfa074ee321c7993e607c9f014d0f21c91558611aa00fc3ce1edc7b5e68371aea0d27fa1931291a79bb867a6c783bb536775f
2023-01-19test: refactor: simplify p2p_eviction.py by using MiniWalletSebastian Falbesoner
Also, use the pre-mined chain of the test framework rather than mining 100 blocks manually on each run.
2023-01-19test: refactor: simplify p2p_tx_download.py by using MiniWalletSebastian Falbesoner
2023-01-19Merge bitcoin/bitcoin#23395: util: Add -shutdownnotify optionMarcoFalke
d96d97ad30c4a079450bc2bf02e3e2a45f7efd2d doc: Add release note for shutdownnotify. (klementtan) 0bd73e2c453e8a88312edf43d184c33109f12ad6 util: Add -shutdownnotify option. (klementtan) Pull request description: **Description**: Similar to `-startupnotify`, this PR adds a new option to allow users to specify a command to be executed when Bitcoin Core shuts down. **Note**: The `shutdownnotify` commands will not be executed if bitcoind shut down due to *unexpected* reasons (ie `killall -9 bitcoind`). ### Testing: **Normal shutdown commands** ``` # start bitcoind with shutdownnotify optioin ./src/bitcoind -signet -shutdownnotify="touch foo.txt" # shutdown bitcoind ./src/bitcoin-cli -signet stop # check that foo.txt has been created ``` **Final RPC call** Commands: ``` $ ./src/bitcoind -signet -nolisten -noconnect -shutdownnotify="./src/bitcoin-cli -signet getblockchaininfo > tmp.txt" $ ./src/bitcoin-cli stop $ cat tmp.txt ``` <details> <summary>Screen Shot</summary> ![image](https://user-images.githubusercontent.com/49265907/141186183-cbc6f82c-400d-4a8b-baba-27c0346c2c8a.png) </details> ACKs for top commit: achow101: ACK d96d97ad30c4a079450bc2bf02e3e2a45f7efd2d 1440000bytes: ACK https://github.com/bitcoin/bitcoin/pull/23395/commits/d96d97ad30c4a079450bc2bf02e3e2a45f7efd2d theStack: re-ACK d96d97ad30c4a079450bc2bf02e3e2a45f7efd2d Tree-SHA512: 16f7406fd232e8b97aea5e58854c84755b0c35c88cb3ef9ee123b29a1475a376122b1e100da860cc336d4d657e6046a70e915fdb9b70c9fd097c6eef1b028161
2023-01-18wallet: migrate wallet, exit early if no legacy data existfurszy
otherwise the process will create a backup file then return an error when notices that the db is already running sqlite.
2023-01-18test: add an easy way to run linters locallyJames O'Beirne
Adds a Dockerfile configuration that allows straightforward running of linters with compatible versions locally. This removes a ton of annoyance when trying to appease CI, because many of the linter versions are quite old and difficult to maintain locally. I realize that people may not be thrilled to more ancillary tooling to the repo, but I think this makes a lot of sense given the linter versions listed in this container configuration are dictated by this repo (within the CI configuration), so having these things live in two separate places is a recipe for version mismatches. Eventually we can likely just use this container on CI directly to avoid any chance of inconsistencies between local dev experience and CI.
2023-01-18scripted-diff: Use new python 3.7 keywordsMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i 's/universal_newlines/text/g' $(git grep -l universal_newlines) -END VERIFY SCRIPT-
2023-01-17Merge bitcoin/bitcoin#26625: test: Run mempool_packages.py with MiniWalletfanquake
fa6b4021142154f52fc35360e409907360808801 test: Run mempool_packages.py with MiniWallet (MarcoFalke) fa448c27d2cdd70698a4188c7478996ff8804556 test: Return fee from MiniWallet (MarcoFalke) faec09f240213e8540e8559a3b4396ee93950cb4 test: Return chain of MiniWallet txs from MiniWallet chain method (MarcoFalke) faa12d4ccd2ed14a4b892816b4771d7ff8d0d8a0 test: Refactor MiniWallet sign_tx (MarcoFalke) fa2d82103fcd3b9084edd2268443f61ca5af969c test: Return wtxid from create_self_transfer_multi (MarcoFalke) Pull request description: This allows to run the test even when no wallet is compiled in. Also, it is a lot nicer to read now. ACKs for top commit: glozow: reACK fa6b402 Tree-SHA512: de0338068fd51db01d64ce270f94fd2982a63a6de597325cd1e1f11127e9075bd4aeacace0ed76d09a2db8b962b27237cf11edb4c1fe1a01134d397f8a11bd05
2023-01-17test: Add test for missing and omitted required argMarcoFalke
2023-01-17Merge bitcoin/bitcoin#26884: test: wallet: add coverage for ↵MarcoFalke
`-spendzeroconfchange` setting 603d29519931e6ab6a58db09b9d3eb9b355fe566 test: wallet: add coverage for `-spendzeroconfchange` setting (Sebastian Falbesoner) 50112034bcdd177311679610ef2f3c2c42d6819e test: remove `-spendzeroconfchange` setting from mempool_limit.py (Sebastian Falbesoner) Pull request description: This PR adds missing test coverage for the `-spendzeroconfchange` setting (in particular the non-default case `=0`). Note that in contrast to the name, the setting does not only apply to change outputs, but in fact to _all_ unconfirmed outputs that we sent to ourselves, i.e. we can trigger the testing path simply with a single recipient address. The first commit removes the setting from the functional test mempool_limit.py, where it doesn't have any effect, since the test was changed to use MiniWallet in commit dddca3899c4738e512313a85aeb006310e34e31f. ACKs for top commit: brunoerg: crACK 603d29519931e6ab6a58db09b9d3eb9b355fe566 Tree-SHA512: 15d9c8bd5eb37c6b228bf887eb27debee0a391c82356662785da4553ee2558e611834c3936ef7136812b46f877bab7aa5f3088bbd278b81f296bdda96cc8e1c3
2023-01-17Merge bitcoin/bitcoin#26039: refactor: Run type check against RPCArgs (1/2)fanquake
fa9f6d7bcdba5f18c46fff1dcc0ac6d3dd8db75d rpc: Run type check against RPCArgs (MarcoFalke) faf96721a66dcc215ea9d6affb30f9a00cc37000 test: Fix wrong types passed to RPCs (MarcoFalke) Pull request description: It seems brittle to require `RPCTypeCheck` being called inside the code logic. Without compile-time enforcement this will lead to places where it is forgotten and thus to inconsistencies and bugs. Fix this by removing the calls to `RPCTypeCheck` and doing the check internally. The changes should be reviewed as refactoring changes. However, if they change behavior, it will be a bugfix. For example the changes here happen to also detect/fix bugs like the one fixed in commit 3b5fb6e77a93f58b3d03b1eec3595f5c45e633a9. ACKs for top commit: ajtowns: ACK fa9f6d7bcdba5f18c46fff1dcc0ac6d3dd8db75d Tree-SHA512: fb2c0981fe6e24da3ca7dbc06898730779ea4e02ea485458505a281cf421015e44dad0221a04023fc547ea2c660d94657909843fc85d92b847611ec097532439
2023-01-17test: Run mempool_packages.py with MiniWalletMarcoFalke
2023-01-17test: Return fee from MiniWalletMarcoFalke
2023-01-17test: Return chain of MiniWallet txs from MiniWallet chain methodMarcoFalke
2023-01-17test: Refactor MiniWallet sign_txMarcoFalke
To make the code less verbose and easier to read.
2023-01-17test: Return wtxid from create_self_transfer_multiMarcoFalke
This is not used right now, but may be in the future. Also, it simplifies the create_self_transfer return logic
2023-01-17Merge bitcoin/bitcoin#26886: test: add `rescan utxos` inside MiniWallet's ↵MarcoFalke
initialization 6bd098a838881ba615c01354560a70d47256f90f test: simplify tests by using the pre-mined chain (kouloumos) 42029a7fd42e93426bdfb40d1918d739d20962af test: remove redundant blocks generation logic (kouloumos) 0377d6bb420b9a2fb79af0ebe088d2b20ec808a5 test: add `rescan_utxos` in MiniWallet's initialization (kouloumos) Pull request description: When a pre-mined blockchain is used (default behavior), it [contains coinbase outputs in blocks 76-10](https://github.com/bitcoin/bitcoin/blob/07c54de550035c3441f34ef6c34209666267eb38/test/functional/test_framework/test_framework.py#L809-L813) to [the MiniWallet's default address](https://github.com/bitcoin/bitcoin/blob/07c54de550035c3441f34ef6c34209666267eb38/test/functional/test_framework/wallet.py#L99-L101). That's why we always* `rescan_utxos()` after initializing the MiniWallet, in order for the MiniWallet to account for those mature UTXOs. > The tests following this usage pattern can be seen with: > ```git grep -n "MiniWallet(" $(git grep -le "rescan_utxos()" $(git grep -Le "self.setup_clean_chain = True"))``` **This PR adds `rescan_utxos()` inside MiniWallet's initialization to simplify usage when the MiniWallet is used with a pre-mined chain.** ### secondary changes - *There are a few tests that use the pre-mined blockchain but do not `rescan_utxos()`, they instead generate new blocks to create mature UTXOs. > Those were written before the `rescan_utxos()` method was introduced with https://github.com/bitcoin/bitcoin/pull/22955 (fac66d0a39cb0b4bc565b57087ba84dd932e9b6d) and can be seen with: > `git grep -n "MiniWallet(" $(git grep -Le "rescan_utxos()" $(git grep -Le "self.setup_clean_chain = True"))` > After including `rescan_utxos()` inside MiniWallets initilization, this blocks generation logic is not needed as the MiniWallet already accounts for enough mature UTXOs to perform the tests. **Therefore the now redundant blocks generation logic is removed from those tests with the second commit.** - The rest of the MiniWallet tests use a clean chain (`self.setup_clean_chain = True`) and can be seen with `git grep -n "MiniWallet(" $(git grep -le "self.setup_clean_chain = True")` From those, there are a few that start from a clean chain and then create enough mature UTXOs for the MiniWallet with this kind of logic: https://github.com/bitcoin/bitcoin/blob/07c54de550035c3441f34ef6c34209666267eb38/test/functional/mempool_expiry.py#L36-L40 **Those tests are simplified in the third commit to instead utilize the mature UTXOs of the pre-mined chain.** ACKs for top commit: MarcoFalke: ACK 6bd098a838881ba615c01354560a70d47256f90f 🕷 theStack: re-ACK 6bd098a838881ba615c01354560a70d47256f90f Tree-SHA512: 7f9361e36910e4000c33a32efdde4449f4a8a763bb42df96de826fcde469f9362f701b8c99e2a2c482d2d5a42a83ae5ae3844fdbed187ed0ff231f386c222493
2023-01-16Merge bitcoin/bitcoin#26325: rpc: Return accurate results for scanblocksAndrew Chow
5ca7a7be76f2521dca895daa70949fd11df0844c rpc: Return accurate results for scanblocks (Aurèle Oulès) Pull request description: Implements #26322. Adds a `filter_false_positives` mode to `scanblocks` to accurately verify results from blockfilters. If the option is enabled, pre-results given by blockfilters will be filtered out again by checking vouts and vins of all transactions of the relevant blocks against the given descriptors. ### Master ```bash ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]' { "from_height": 0, "to_height": 2376055, "relevant_blocks": [ "000000000001bc35077dec4104e0ab1f667ae27059bd907f9a8fac55c802ae36", "00000000000120a9c50542d73248fb7c37640c252850f0cf273134ad9febaf61", "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed", "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3" ] } ``` ### PR (without `filter_false_positives` mode) Same as master ```bash ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]' filter_false_positives=false { "from_height": 0, "to_height": 2376055, "relevant_blocks": [ "000000000001bc35077dec4104e0ab1f667ae27059bd907f9a8fac55c802ae36", "00000000000120a9c50542d73248fb7c37640c252850f0cf273134ad9febaf61", "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed", "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3" ] } ``` ### PR (with `filter_false_positives` mode) ```bash ./src/bitcoin-cli -testnet -named scanblocks action=start scanobjects='["addr(tb1qcxf2gv93c26s6mqz7y6etpqdf70zmn67dualgr)"]' filter_false_positives=true { "from_height": 0, "to_height": 2376058, "relevant_blocks": [ "0000000000000082f7af3835da8b6146b0bfb243b8842f09c495fa1e74d454ed", "0000000000000094c32651728193bfbe91f6789683b8d6ac6ae2d22ebd3cb5d3" ] } ``` Also adds a test to check that the blockhash of a transaction will be included in the `relevant_blocks` whether the `filter_false_positives` mode is enabled or not. ACKs for top commit: achow101: ACK 5ca7a7be76f2521dca895daa70949fd11df0844c theStack: re-ACK 5ca7a7be76f2521dca895daa70949fd11df0844c furszy: Code review ACK 5ca7a7be Tree-SHA512: e8f3cceddddd66f59509717b6314d89e2fef241e13cee81b18fd95e8362cbb95cc40f884342ce6cf892a86febd9e2d434afce05d51892240e67f72ae991852e7
2023-01-16Merge bitcoin/bitcoin#25375: rpc: add minconf/maxconf options to sendall and ↵Andrew Chow
fund transaction calls cfe5aebc79c510bd2156e199c3324d7ee1f8d2ad rpc: add minconf and maxconf options to sendall (ishaanam) a07a413466a0edd47eab9189b46a70aafbbe22b7 Wallet/RPC: Allow specifying min & max chain depth for inputs used by fund calls (Juan Pablo Civile) Pull request description: This PR adds a "minconf" option to `fundrawtransaction`, `walletcreatefundedpsbt`, and `sendall`. Alternative implementation of #14641 Fixes #14542 Edit: This PR now also adds this option to `send` ACKs for top commit: achow101: ACK cfe5aebc79c510bd2156e199c3324d7ee1f8d2ad Xekyo: ACK cfe5aebc79c510bd2156e199c3324d7ee1f8d2ad furszy: diff ACK cfe5aebc, only a non-blocking nit. Tree-SHA512: 836e610926eec3a62308fba88ddbd6a13d8f4dac37352d0309599f893cde9c1df5e9c298fda6e076493068e4d213e4afa7290a9e3bdb5a95a5d507da3f7b59e8
2023-01-16test: simplify tests by using the pre-mined chainkouloumos
2023-01-16test: remove redundant blocks generation logickouloumos
those tests already have enough mature utxos from the pre-mined chain.
2023-01-16test: add `rescan_utxos` in MiniWallet's initializationkouloumos
this simplifies usage when MiniWallet is used with a pre-mined chain.
2023-01-16Merge bitcoin/bitcoin#26657: test: Run feature_bip68_sequence.py with MiniWalletMarcoFalke
4159ccd03142899028019a7cb44ee4120e68505a test: Run feature_bip68_sequence.py with MiniWallet (Miles Liu) fc0caaf4aa3d4b26a8673cca48df1a4f0b964a59 test: Add "include mempool" flag to MiniWallet rescan_utxos (Miles Liu) d0a909ae54a34ecd925c9d5064d530eaeeba46eb test: Add "include immature coinbase" flag to MiniWallet get_utxos (Miles Liu) e5b9127d9e9d25bf8825b671ddb97529e877f593 test: Add signs P2TR and RAWSCRIPT to MiniWallet sign_tx (Miles Liu) Pull request description: This PR enables one more of the non-wallet functional tests (feature_bip68_sequence.py) to be run even when no wallet is compiled in by using the MiniWallet instead, as proposed in #20078. ACKs for top commit: achow101: ACK 4159ccd03142899028019a7cb44ee4120e68505a MarcoFalke: review ACK 4159ccd03142899028019a7cb44ee4120e68505a 🤸 Tree-SHA512: e891b189381e961c840b45fc30d058363707fd54c1c4bdc3d29623b03309981f1d3ebfac27e6aecf621bdbcd7e31754a3ef7c53f86346f7dd241c137e64c92bd
2023-01-16Merge bitcoin/bitcoin#26631: test: add coverage for dust mempool policy ↵MarcoFalke
(`-dustrelayfee` setting) d6fc1d6a3393c571a1691a6bda60433216643616 test: add coverage for dust mempool policy (`-dustrelayfee` setting) (Sebastian Falbesoner) 8a5dbe28793d2e2ad85242f2191a6e1956b980dc test: add `CScript` method for checking for witness program (Sebastian Falbesoner) Pull request description: This PR adds missing test coverage for the `-dustrelayfee` setting, which specifies the fee-rate used to define dust. Output scripts for all common types that are treated as standard by default (P2PK, P2(W)PKH, P2(W)SH, P2TR, bare multisig, null data, unknown witness versions v2+) are created and then checked for dust-mempool-policy each via the `testmempoolaccept` RPC: a tx with an output's nValue equal to the dust threshold should be accepted, one with an nValue of just one 1 satoshi below that should be rejected with reason `dust`. This is repeatedly done for a fixed (but obviously somewhat arbitrary) list of different `-dustrelayfee` settings on a single node, including the default and zero (i.e. no dust limit) settings. Note that the first commit introduces a necessary `CScript` helper method `IsWitnessProgram` (using PascalCase in Python is likely controversial; in this case the style for the already existing method `GetSigOpCount` was followed, which also refers to a method in the core `CScript` class). Some historical information about dust, contributed by pablomartin4btc: "The concept of dust was first introduced in https://github.com/bitcoin/bitcoin/pull/2577. This [commit](https://github.com/bitcoin/bitcoin/pull/9380/commits/eb30d1a5b215c6dd3763d7f7948f2dd8cb61f6bf) from https://github.com/bitcoin/bitcoin/pull/9380 introduced the -dustrelayfee option. Previous to that PR, the dust feerate was whatever -minrelaytxfee was set to." ACKs for top commit: LarryRuane: ACK d6fc1d6a3393c571a1691a6bda60433216643616 glozow: ACK d6fc1d6a3393c571a1691a6bda60433216643616 kouloumos: ACK d6fc1d6a3393c571a1691a6bda60433216643616 Tree-SHA512: 35ea2b2497dfb466395af5665bb217f7250aa7cab9dc43539a5658ab69a454e3623ff58fce7489fcc1105b37f8cb4840a93cec658c5df1de611732bc6439ccad
2023-01-16Merge bitcoin/bitcoin#26892: test: refactor: simplify p2p_permissions.py by ↵MarcoFalke
using MiniWallet 8cbd926a2c5f230dbb39c88eff9c5955068e7e41 test: refactor: simplify p2p_permissions.py by using MiniWallet (Sebastian Falbesoner) Pull request description: This PR simplies the functional test p2p_permissions.py by using MiniWallet in order to avoid manual low-level tx creation. Also, rather than mining 100 blocks manually, the pre-mined chain of the test framework is used, which speeds up the test a little (~2-3 seconds faster on my machine). ACKs for top commit: MarcoFalke: ACK 8cbd926a2c5f230dbb39c88eff9c5955068e7e41 Tree-SHA512: 36cbc2a0f6fb0251c8696cd017163ed30529690736bafd36e80b53007bd02b9030b68fe93b90dc50323526c8b7d8e0abd8f20890d46ff6015d5c632b64a08535
2023-01-15test: Remove redundant function callKolby ML
2023-01-15test: refactor: simplify p2p_permissions.py by using MiniWalletSebastian Falbesoner
Also, use the pre-mined chain of the test framework rather than mining 100 blocks manually on each run.
2023-01-13test: wallet: add coverage for `-spendzeroconfchange` settingSebastian Falbesoner
2023-01-13test: remove `-spendzeroconfchange` setting from mempool_limit.pySebastian Falbesoner
Since this test was changed to use MiniWallet instead of the Bitcoin Core wallet (see commit d447ded6babebe7c7948e585c9e78bf34dbef226), the setting doesn't have any effect and hence can be removed.
2023-01-12test: skip sqlite3 tests if it isn't availablefanquake
Fixes #26819. Related too #26873.
2023-01-12Merge bitcoin/bitcoin#26854: test: Fix intermittent timeout in ↵MarcoFalke
p2p_permissions.py fa1bf4e7052e617dd0e5c8c54969d84314af9577 test: Fix intermittent timeout in p2p_permissions.py (MarcoFalke) Pull request description: The sync is based on `bytesrecv_per_msg["verack"]`. However, the bytes are counted before processing the message, so they are not sufficient to ensure the connection is fully up. ACKs for top commit: mzumsande: ACK fa1bf4e7052e617dd0e5c8c54969d84314af9577 aureleoules: ACK fa1bf4e7052e617dd0e5c8c54969d84314af9577 Tree-SHA512: eb1ed537032c76a449b1ed5e42ff062e9b8b3c7e11fde2a5b8183ae0d6fbe31dba39e2c758836160cd8157d9ac5cc1f5d1916415861b8d711b7370c88f5e9790
2023-01-11Merge bitcoin/bitcoin#26675: wallet: For feebump, ignore abandoned ↵Andrew Chow
descendant spends f9ce0eadf4eb58d1e2207c27fabe69a5642482e7 For feebump, ignore abandoned descendant spends (John Moffett) Pull request description: Closes #26667 To be eligible for fee-bumping, a transaction must not have any of its outputs (eg - change) spent in other unconfirmed transactions in the wallet. This behavior is currently [enforced](https://github.com/bitcoin/bitcoin/blob/9e229a542ff2107be43eff2e4b992841367f0366/src/wallet/feebumper.cpp#L25-L28) and [tested](https://github.com/bitcoin/bitcoin/blob/9e229a542ff2107be43eff2e4b992841367f0366/test/functional/wallet_bumpfee.py#L270-L286). However, this check shouldn't apply to spends in abandoned descendant transactions, as explained by #26667. `CWallet::IsSpent` already carves out an exception for abandoned transactions, so we can just use that. I've also added a new test to cover this case. ACKs for top commit: Sjors: re-utACK f9ce0eadf4eb58d1e2207c27fabe69a5642482e7 achow101: ACK f9ce0eadf4eb58d1e2207c27fabe69a5642482e7 furszy: ACK f9ce0ead Tree-SHA512: 19d957d1cf6747668bb114e27a305027bfca5a9bed2b1d9cc9e1b0bd4666486c7c4b60b045a7fe677eb9734d746f5de76390781fb1e9e0bceb4a46d20acd1749
2023-01-11rpc: add minconf and maxconf options to sendallishaanam
2023-01-11Wallet/RPC: Allow specifying min & max chain depth for inputs used by fund callsJuan Pablo Civile
Enables users to craft BIP-125 replacements with changes to the output list, ensuring that if additional funds are needed they will be added.
2023-01-11test: Fix wrong types passed to RPCsMarcoFalke
2023-01-11test: Fix intermittent timeout in p2p_permissions.pyMarcoFalke
2023-01-11Merge bitcoin/bitcoin#26730: test: add coverage for `purpose` arg in ↵MarcoFalke
`listlabels` c467cfffcebb30f829eeb8160166a6b941d97ed6 test: add coverage for `purpose` arg in `listlabels` (brunoerg) Pull request description: This PR adds test coverage for `listlabels` command when specifying the `purpose` (send and receive). https://github.com/bitcoin/bitcoin/blob/dcdfd72861c09a7945b9facc3726177a2d06fa64/src/wallet/rpc/addresses.cpp#L698-L704 ACKs for top commit: kristapsk: ACK c467cfffcebb30f829eeb8160166a6b941d97ed6 Tree-SHA512: 7e7143c1264692f7b22952e7c70dbe9ed3f5dcd2e3b69962a47be9f9c21b3f4a9089ca87962fbc8ff9116e7d2dbeb7f36d6a132c9ac13724a255cfe1b32373a8