aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2023-05-23Merge bitcoin/bitcoin#27177: test: fix intermittent issue in ↵Andrew Chow
`feature_bip68_sequence` 272eb5561667482f8226bcf98eea00689dccefb8 test: fix `include_immature_coinbase` logic in `get_utxos` (brunoerg) a951c34f179dad0c7059b04a7f1e6b0804462168 test: fix `interface_usdt_mempool` by mining a block after each test (brunoerg) 1557bf1196bc2bdf00fd32f3b5d525796b4d194c test: fix mature utxos addition to wallet in `mempool_package_limits` (brunoerg) 60ced9007d518d542ce489b91076f9bbaf3312e3 test: fix intermittent issue in `feature_bip68_sequence` (brunoerg) Pull request description: Fixes #27129 To avoid `bad-txns-premature-spend-of-coinbase` error, when getting a utxo (using `get_utxo`) to create a new transaction `get_utxo` shouldn't return (if possible) by default immature coinbase. ACKs for top commit: achow101: ACK 272eb5561667482f8226bcf98eea00689dccefb8 pinheadmz: re-ACK 272eb5561667482f8226bcf98eea00689dccefb8 Tree-SHA512: eae821c7833bf084d8b907c94876ed010a7925d2177c3013a0c61b69d9571df006da83397a19487d93b0d1fa415951152f0b8ad0de2a55d86c39f6917934f050
2023-05-23Merge bitcoin/bitcoin#27717: test: Make `util/test_runner.py` honor ↵fanquake
`BITCOINUTIL` and `BITCOINTX` 4f2f615d1362afe92cabe9eab50087f8bfe454fd test: Make `util/test_runner.py` honor `BITCOINUTIL` and `BITCOINTX` (Hennadii Stepanov) Pull request description: This PR is a continuation of changes to our testing frameworks (https://github.com/bitcoin/bitcoin/pull/27554, https://github.com/bitcoin/bitcoin/pull/27561) that allow them to work correctly in a multi-config build environment that is possible for [upcoming](https://github.com/bitcoin/bitcoin/pull/25797) CMake-based build system. That means that built for different configurations binaries (e.g., "Debug" and "Release") can coexist in separated directories. The commit has been pulled from https://github.com/hebasto/bitcoin/pull/15 and it seems [useful](https://github.com/hebasto/bitcoin/pull/15#discussion_r1200251404) by itself as: > I believe the rationale for allowing to drop in the executables via env var is to allow to test the guix-produced, or other third-party-produced executables... The current implementation of the `test/functional/test_framework/test_framework.py` script uses the same approach: https://github.com/bitcoin/bitcoin/blob/09351f51d279612973ecd76811dc075dff08209f/test/functional/test_framework/test_framework.py#L231-L246 ACKs for top commit: MarcoFalke: lgtm ACK 4f2f615d1362afe92cabe9eab50087f8bfe454fd TheCharlatan: ACK 4f2f615d1362afe92cabe9eab50087f8bfe454fd stickies-v: ACK 4f2f615d1362afe92cabe9eab50087f8bfe454fd Tree-SHA512: 99ee9a727b266700649d8f2ec528dfaeb04a1e48f0cb1d4eeaece65917165be647c10c4548429a9e8b30d094597f67e860c1db03ac689ebb409b223ce1b63aa9
2023-05-22Merge bitcoin/bitcoin#25796: rpc: add `descriptorprocesspsbt` rpcAndrew Chow
1bce12acd3e271a7c88d9400b4e3a5645bc8a911 test: add test for `descriptorprocesspsbt` RPC (ishaanam) fb2a3a70e860aa87fb7a21f6554ed9f3ce901e2d rpc: add descriptorprocesspsbt rpc (ishaanam) Pull request description: This PR implements an RPC called `descriptorprocesspsbt`. This RPC is based off of `walletprocesspsbt`, but instead of interacting with the wallet to update, sign and finalize a psbt, it instead accepts an array of output descriptors and uses that information along with information from the mempool, txindex, and the utxo set to do so. `utxoupdatepsbt` also updates a psbt in this manner, but doesn't sign or finalize it. Because of this overlap, a helper function that is added in this PR is called by both `utxoupdatepsbt` and `descriptorprocesspsbt`. Whether or not the helper function signs a psbt is dictated by if the HidingSigningProvider passed to it contains any private information. There is also a test added in this PR for this new RPC that uses p2wsh, p2wpkh, and legacy outputs. Edit: see https://github.com/bitcoin/bitcoin/pull/25796#issuecomment-1228830963 ACKs for top commit: achow101: re-ACK 1bce12acd3e271a7c88d9400b4e3a5645bc8a911 instagibbs: reACK https://github.com/bitcoin/bitcoin/pull/25796/commits/1bce12acd3e271a7c88d9400b4e3a5645bc8a911 Tree-SHA512: e1d0334739943e71f2ee68b4db7637ebe725da62e7aa4be071f71c7196d2a5970a31ece96d91e372d34454cde8509e95ab0eebd2c8edb94f7d5a781a84f8fc5d
2023-05-22test: Make `util/test_runner.py` honor `BITCOINUTIL` and `BITCOINTX`Hennadii Stepanov
This change allows to drop in the executables via environment variables in the same way as for functional tests.
2023-05-19test: Explicitly specify directory where to search tests forHennadii Stepanov
This change allows `test_runner.py` to work from an out-of-source build directory using a symlink, a hard link or a copy on any platform.
2023-05-19test: fix `include_immature_coinbase` logic in `get_utxos`brunoerg
Use current block height to compute the confirmation count instead of using the value from utxo object
2023-05-19test: fix `interface_usdt_mempool` by mining a block after each testbrunoerg
Co-authored-by: josibake <josibake@protonmail.com>
2023-05-19test: fix mature utxos addition to wallet in `mempool_package_limits`brunoerg
2023-05-19test: fix intermittent issue in `feature_bip68_sequence`brunoerg
To avoid `bad-txns-premature-spend-of-coinbase` error, when getting a utxo (using `get_utxo`) to create a new transaction `get_utxo` shouldn't return by default immature coinbase.
2023-05-19Merge bitcoin/bitcoin#27695: test: Add test to check tx in the last block ↵fanquake
can be downloaded fa4c16b186a34f4172deda617166813c8cb92c59 test: Add test to check tx in the last block can be downloaded (MarcoFalke) fadc8490ab4fdd91aaf446e08108657b304a3ded test: Split up test_notfound_on_unannounced_tx test case (MarcoFalke) Pull request description: If a peer received an `inv` about a transaction, which was included in a block before receiving the corresponding `getdata`, it can be beneficial to send this transaction to the peer to aid compact block relay. Add a test for this to avoid breaking it in the future. ACKs for top commit: sdaftuar: ACK fa4c16b186a34f4172deda617166813c8cb92c59 instagibbs: ACK fa4c16b186a34f4172deda617166813c8cb92c59 Tree-SHA512: 1ec16dcc216dd29c849928e753158d45c409612e9ac528db16e5af465bb5b69cd42241ac6f67e5a4583b8e558eeba49fa0a0889a4247b3fb0053b2758eec9490
2023-05-18Merge bitcoin/bitcoin#27640: test: Return dict in MiniWallet::send_tofanquake
faf4315c88d8c81c2ff84870bc81aef3cf719816 test: Return dict in MiniWallet::send_to (MarcoFalke) Pull request description: Returning a tuple has many issues: * If only one value is needed, it can not be indexed by name * If another value is added to the return value, all call sites need to be updated Bite the bullet now and update all call sites to fix the above issues. ACKs for top commit: brunoerg: crACK faf4315c88d8c81c2ff84870bc81aef3cf719816 theStack: Code-review ACK faf4315c88d8c81c2ff84870bc81aef3cf719816 stickies-v: Code review ACK faf4315c88d8c81c2ff84870bc81aef3cf719816 Tree-SHA512: 8ce1aca237df21f04b3990d0e5fcb49cc408fe6404399d3769a64eae1b5218941157d9785fce1bd9e45140cf70e06c3aa42646ee8f7b57855beb784fc3ef0261
2023-05-18test: Add test to check tx in the last block can be downloadedMarcoFalke
2023-05-18test: Split up test_notfound_on_unannounced_tx test caseMarcoFalke
2023-05-17index: Enable reindex-chainstate with active indexesMartin Zumsande
This is achieved by letting the index sync thread wait until reindex-chainstate is finished. This also disables the pruning check when reindexing the chainstate (which is incompatible with prune mode) because there would be no chain at this point in init.
2023-05-17index: Use first block from locator instead of looking for fork pointMartin Zumsande
The index sync code has logic to go back the chain to the forking point, while also updating index-specific state, which is necessary to prevent possible corruption of the coinstatsindex. Also add a test for this (a reorg happens while the index is deactivated) that would not pass before this change.
2023-05-15add `lief` to `spelling.ignore-words`brunoerg
2023-05-15test: fix spelling in `interface_usdt_utxocache`brunoerg
2023-05-15doc, test: Document steps to reproduce TSan warning for `libdb`Hennadii Stepanov
2023-05-12test: Return dict in MiniWallet::send_toMarcoFalke
2023-05-08Merge bitcoin/bitcoin#26076: Switch hardened derivation marker to hAndrew Chow
fe49f06c0e91b96feb8d8f1bd478c3173f14782c doc: clarify PR 26076 release note (Sjors Provoost) bd13dc2f46ea10302a928fcf0f53b7aed77ad260 Switch hardened derivation marker to h in descriptors (Sjors Provoost) Pull request description: This makes it easier to handle descriptor strings manually, especially when importing from another Bitcoin Core wallet. For example the `importdescriptors` RPC call is easiest to use `h` as the marker: `'["desc": ".../0h/..."]'`, avoiding the need for escape characters. With this change `listdescriptors` will use `h`, so you can copy-paste the result, without having to add escape characters or switch `'` to 'h' manually. Both markers can still be parsed. The `hdkeypath` field in `getaddressinfo` is also impacted by this change, except for legacy wallets. The latter is to prevent accidentally breaking ancient software that uses our legacy wallet. See discussion in #15740 ACKs for top commit: achow101: ACK fe49f06c0e91b96feb8d8f1bd478c3173f14782c darosior: re-ACK fe49f06c0e91b96feb8d8f1bd478c3173f14782c Tree-SHA512: f78bc873b24a6f7a2bf38f5dd58f2b723e35e6b10e4d65c36ec300e2d362d475eeca6e5afa04b3037ab4bee0bf8ebc93ea5fc18102a2111d3d88fc873c08dc89
2023-05-06test: add test for `descriptorprocesspsbt` RPCishaanam
2023-05-05Merge bitcoin/bitcoin#27554: test: Treat `bitcoin-wallet` binary in the same ↵fanquake
way as others f6d7636be4eb0b19878428906dd5e394df7d07a2 test: Treat `bitcoin-wallet` binary in the same way as others (Hennadii Stepanov) dda961cec5fef318c0b043a09367d14daa87f089 test, refactor: Add `set_binary_paths` function (Hennadii Stepanov) Pull request description: This PR makes the `bitcoin-wallet` binary path customizable in the same way how it can be done now with other ones, including `bitcoind`, `bitcoin-cli` and `bitcoin-util`. ACKs for top commit: stickies-v: re-ACK f6d7636be4eb0b19878428906dd5e394df7d07a2 Tree-SHA512: 480fae14c5440e530ba78a2be19eaaf642260070435e533fc7ab98ddcc2fcac7ad83f2c7e7c6706db3167e8391d7d4abf8784889796c218c2d5bba043144e787
2023-05-05Merge bitcoin/bitcoin#26653: test, init: perturb file to ensure failure ↵fanquake
instead of only deleting them c371cae07a7ba045130568b6abc470eaa4f95ef4 test, init: perturb file to ensure failure instead of only deleting them (brunoerg) Pull request description: In `feature_init.py` there is a TODO about perturbing the files instead of only testing by deleting them. ```py # TODO: at some point, we should test perturbing the files instead of removing # them, e.g. # # contents = target_file.read_bytes() # tweaked_contents = bytearray(contents) # tweaked_contents[50:250] = b'1' * 200 # target_file.write_bytes(bytes(tweaked_contents)) # # At the moment I can't get this to work (bitcoind loads successfully?) so # investigate doing this later. ``` This PR adds it by writing into the file random bytes and checking whether it throws an error when starting. ACKs for top commit: MarcoFalke: lgtm ACK c371cae07a7ba045130568b6abc470eaa4f95ef4 Tree-SHA512: d691eee60b91dd9d1b200588608f56b0a10dccd9761a75254b69e0ba5e5866cae14d2f90cb2bd7ec0f95b0617c2562cd33f20892ffd16355b6df770d3806a0ff
2023-05-05test: Treat `bitcoin-wallet` binary in the same way as othersHennadii Stepanov
This change makes the `bitcoin-wallet` binary path customizable in the same way how it can be done now with other ones, including `bitcoind`, `bitcoin-cli` and `bitcoin-util`.
2023-05-05test, refactor: Add `set_binary_paths` functionHennadii Stepanov
This change factors out the repeated code into a new `set_binary_paths` function.
2023-05-04Merge bitcoin/bitcoin#27422: test: add coverage to rpc_scantxoutset.pyfanquake
7e3d4f8e86e86f32d8911abd458b9e7c939ef3d5 test: add coverage to ensure the first arg of scantxoutset is needed (ismaelsadeeq) Pull request description: Include a test that checks whether the first argument of scantxoutset RPC call "start" is required. The rpc call should fail if the "start" argument is not provided. ACKs for top commit: MarcoFalke: lgtm ACK 7e3d4f8e86e86f32d8911abd458b9e7c939ef3d5 Tree-SHA512: 6a456af9f3ccd5437be2edcd61936eb9f9c21ab926a6056c2c11b6b5121d1caca4e1f2ffd09015f9414af152c635a20e1da041eefdef980afbe8a0e8ccce07bd
2023-05-04Merge bitcoin/bitcoin#27325: test: various `converttopsbt` check cleanups in ↵Andrew Chow
rpc_psbt.py afc2dd54848fa70ed408ae259420ff8648f21efc test: various `converttopsbt` check cleanups in rpc_psbt.py (Sebastian Falbesoner) Pull request description: In the functional test rpc_psbt.py, some comments around the `converttopsbt` RPC checks are wrong or outdated and can be removed: > _Error could be either "TX decode failed" (segwit inputs causes > parsing to fail) or "Inputs must not have scriptSigs and > scriptWitnesses"_ Decoding a valid TX with at least one input always succeeds with the [heuristic](https://github.com/bitcoin/bitcoin/blob/e352f5ab6b60ec1cc549997275e945238508cdee/src/core_read.cpp#L126), i.e. this comment is not right and we can assert for the error string "Inputs must not have scriptSigs and scriptWitnesses" on the calls below. > _We must set iswitness=True because the serialized transaction has > inputs and is therefore a witness transaction_ This is also unneeded (and confusing, w.r.t. "is therefore a witness transaction"?), for a TX with one input there is no need to set the `iswitness` parameter. For sake of completeness, we still keep one variant where iswitness is explicitly set to true. Lastly, there is a superflous `converttopsbt` call on the raw tx which is the same as just [about ~10 lines above](https://github.com/bitcoin/bitcoin/blob/master/test/functional/rpc_psbt.py#L393-L397), so it can be removed. ACKs for top commit: ismaelsadeeq: tested ACK afc2dd54848fa70ed408ae259420ff8648f21efc achow101: ACK afc2dd54848fa70ed408ae259420ff8648f21efc Tree-SHA512: 467efefdb3f61efdb79145044b90fc8dc2f0c425f078117a99112b0074e7d4a32c34e464f665fbf8de70d06caaa5d4ad5908c1d75d2e7607eccb0837480afab3
2023-05-03Merge bitcoin/bitcoin#27553: test: Simplify feature_fastprune.pyfanquake
fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1 test: Simplify feature_fastprune.py (MarcoFalke) Pull request description: The goal of the test is a single regression check to see if a RPC times out. It shouldn't do more than calling the RPC (and the minimum work needed to get there). Fix that by removing all blocktools imports and a `for` loop. ACKs for top commit: pinheadmz: ACK fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1 theStack: ACK fa17767154e21e9ed00782a9e4cf9a3d1d66f5d1 Tree-SHA512: c9c0154102199b250015ece53005a14d52d857dfa986f3b02a2cb899f16ac8e040d24eb826f35ba15e5ee22ee6a59bf8f74bb8d576b9a12ac6e888beeaaf81cc
2023-05-02Merge bitcoin/bitcoin#26094: rpc: Return block hash & height in getbalances, ↵Andrew Chow
gettransaction and getwalletinfo 710b83938ab5bbc4bd324d8b2e69461a2a1d2eec rpc: return block hash & height in getbalances, gettransaction & getwalletinfo JSONs (Harris) Pull request description: Reopens #18570 and closes #18567. I have rebased the original PR. Not sure why the original got closed as it was about to get merged. ACKs for top commit: achow101: ACK 710b83938ab5bbc4bd324d8b2e69461a2a1d2eec Tree-SHA512: d4478d990be98b1642e9ffb2930987f4a224e8bd64e2e35a5dda927a54c509ec9d712cd0eac35dc2bb89f00a1678e530ce14d7445f1dd93aa3a4cce2bc9b130d
2023-05-02Merge bitcoin/bitcoin#27453: test: added coverage to rpc_scantxoutset.pyfanquake
24d55fb9cfab88f546df35be5c0069b9b645438c test: added coverage to rpc_scantxoutset.py (kevkevin) Pull request description: Included a test that checks if an invalid first argument is entered we receive a rpc error. The rpc should fail if "start", "status" or "abort" is not the first command. Relavant: mentioned in https://github.com/bitcoin/bitcoin/pull/27422 ACKs for top commit: MarcoFalke: lgtm ACK 24d55fb9cfab88f546df35be5c0069b9b645438c theStack: ACK 24d55fb9cfab88f546df35be5c0069b9b645438c Tree-SHA512: 4b804235d3fa17c7bf492068ab47c1f87cb6cfc1a428c51e273ec059d3c41f581bcc467bb5d6d8bbf2fab14c60cd1c52a30c50009efe1c9b5adee70c88897ad9
2023-05-02Merge bitcoin/bitcoin#27542: test: add ripemd160 to test framework modules listfanquake
82e6e3cae50d30b28b98f0cb7789c28e68170d5e test: add ripemd160 to test framework modules list (Sebastian Falbesoner) Pull request description: Currently test runner doesn't execute the unit tests of the ripemd160 module, so add it to the list. All other framework modules that contain unit tests are included, as can be easily checked via `$ git grep unittest.TestCase ./test/functional/test_framework/` This is a late follow-up to PR #23716 (commit ad3e9e1f214d739e098c6ebbd300da5df1026a44). ACKs for top commit: MarcoFalke: lgtm ACK 82e6e3cae50d30b28b98f0cb7789c28e68170d5e Tree-SHA512: 10940e215f728291c7149931a356bfc42795c098bda76d760dfa68f86443a3755e1cd35cb9a8a7b2f48880beb53f3bee3842de2d74bcadd45c7b05c13ff04203
2023-05-02test: Simplify feature_fastprune.pyMarcoFalke
2023-05-02test: add ripemd160 to test framework modules listSebastian Falbesoner
Currently test runner doesn't execute the unit tests of the ripemd160 module, so add it to the list. All other framework modules that contain unit tests are included, as can be easily checked via `git grep unittest.TestCase ./test/functional/test_framework/` This is a late follow-up to PR #23716 (commit ad3e9e1f214d739e098c6ebbd300da5df1026a44).
2023-05-02test: added coverage to rpc_scantxoutset.pykevkevin
Included a test that checks if an invalid first argument is entered we receive a rpc error. The rpc should fail if "start", "status" or "abort" is not the first command.
2023-05-02Merge bitcoin/bitcoin#27191: blockstorage: Adjust fastprune limit if block ↵fanquake
exceeds blockfile size 8f14fc86225d8fe77353f61ebd6b0bdda8d13aa9 test: cover fastprune with excessive block size (Matthew Zipkin) 271c23e87f61276d7acab74e115b25a35144c8b4 blockstorage: Adjust fastprune limit if block exceeds blockfile size (Martin Zumsande) Pull request description: The debug-only `-fastprune` option used in several tests is not always safe to use: If a `-fastprune` node receives a block larger than the maximum blockfile size of `64kb` bad things happen: The while loop in `BlockManager::FindBlockPos` never terminates, and the node runs oom because memory for `m_blockfile_info` is allocated in each iteration of the loop. The same would happen if a naive user used `-fastprune` on anything other than regtest (so this can be tested by syncing on signet for example, the first block that crashes the node is at height 2232). Change the approach by raising the blockfile size to the size of the block, if that block otherwise wouldn't fit (idea by TheCharlatan). ACKs for top commit: ryanofsky: Code review ACK 8f14fc86225d8fe77353f61ebd6b0bdda8d13aa9. Added new assert, test, and comment since last review TheCharlatan: ACK 8f14fc86225d8fe77353f61ebd6b0bdda8d13aa9 pinheadmz: ACK 8f14fc86225d8fe77353f61ebd6b0bdda8d13aa9 Tree-SHA512: df2fea30613ef9d40ebbc2416eacb574f6d7d96847db5c33dda22a29a2c61a8db831aa9552734ea4477e097f253dbcb6dcb1395d43d2a090cc0588c9ce66eac3
2023-05-01Merge bitcoin/bitcoin#27538: test: Remove modinv python util helper functionfanquake
dc14ba08e6e502f3e31d935bcd053a287c6610ca test: remove modinv python util helper function (Fabian Jahr) Pull request description: Since #27483 was merged the `modinv()` body is just one line calling pythons own implementation of `pow()`. We can just remove the function as it doesn't seem to add any value. Additionally the comment in the function is now outdated and the test is only testing two ways of doing modular inverse but both using python's `pow()` function. ACKs for top commit: theStack: ACK dc14ba08e6e502f3e31d935bcd053a287c6610ca Tree-SHA512: e8b470c72dc3f9fd53699d0684650517b1ea35ad1d4c01cf9472c80d3e4474c0c72e429c0bd201eb99d204c87eee0d68285e6a388e4c506f30e14b2bff9c1c32
2023-05-01Merge bitcoin/bitcoin#26733: test: Add test for `sendmany` rpc that uses ↵Andrew Chow
`subtractfeefrom` parameter 057057a2d7e23c2e29cbfd29a5124b3947a33757 Add test for `sendmany` rpc that uses `subtractfeefrom` parameter (Yusuf Sahin HAMZA) Pull request description: This PR adds test that uses `sendmany` rpc to send **BTC** to multiple addresses using `subtractfeefrom` parameter, then checks receiver addresses balances to make sure fees are subtracted correctly. ACKs for top commit: achow101: ACK 057057a2d7e23c2e29cbfd29a5124b3947a33757 Tree-SHA512: 51167120d489f0ff7b8b9855424d07cb55a8965984f904643cddf45e7a08c350eaded498c350ec9c660edf72c2f128ec142347c9c79d5043d9f6cd481b15cd7e
2023-05-01Merge bitcoin/bitcoin#26604: test: add coverage for `-bantime`fanquake
9c18992bbaf649f8c5461d5e4dc39eb1a07ffc77 test: add coverage for `-bantime` (brunoerg) Pull request description: This PR adds test coverage for `-bantime`. This flag sets the time in seconds how long the IP is banned (in the case you don't explicitly set `bantime` when using `setban`). ACKs for top commit: MarcoFalke: lgtm ACK 9c18992bbaf649f8c5461d5e4dc39eb1a07ffc77 Tree-SHA512: e95f8608aa5df9b09cc5577daae662ed79ef5d5c69ee5e704d7c69520b9b51cc142e9e6be69d80356eda25a5215c4770b1a208638560c48cd3bc8f6d195a371f
2023-05-01Merge bitcoin/bitcoin#26780: rpc: simplify scan blocksAndrew Chow
b922f6b5262884f42d7483f1e9af35650bdb53a7 rpc: scanblocks, add "completed" flag to the result obj (furszy) ce50acc54fa313a92d48ed03e46ce8aabcf267e5 rpc: scanblocks, do not traverse the whole chain block by block (furszy) Pull request description: Coming from https://github.com/bitcoin/bitcoin/pull/23549#pullrequestreview-1105712566 The current `scanblocks` flow walks-through every block in the active chain until hits the chain tip or processes 10k blocks, then calls `lookupFilterRange` function to obtain all filters from that particular range. This is only done to obtain the heights range to look up the block filters. Which is unneeded. As `scanblocks` only lookup block filters in the active chain, we can directly calculate the lookup range heights, by using the chain tip, without requiring to traverse the chain block by block. ACKs for top commit: achow101: ACK b922f6b5262884f42d7483f1e9af35650bdb53a7 TheCharlatan: ACK b922f6b5262884f42d7483f1e9af35650bdb53a7 Tree-SHA512: 0587e6d9cf87a59184adb2dbc26a4e2bce3a16233594c6c330f69feb49bf7dc63fdacf44fc20308e93441159ebc604c63eb7de19204d3e745a2ff16004892b45
2023-05-01Merge bitcoin/bitcoin#27195: bumpfee: allow send coins back to yourselfAndrew Chow
be72663a1521bc6cdf16d43a4feae7c5b57735c0 test: bumpfee, add coverage for "send coins back to yourself" (furszy) 7bffec6715a75bb2c8631177d39f984aabc656ba bumpfee: enable send coins back to yourself (furszy) Pull request description: Simple example: 1) User_1 sends 0.1 btc to user_2 on a low fee transaction. 2) After few hours, the tx is still in the mempool, user_2 is not interested anymore, so user_1 decides to cancel it by sending coins back to himself. 3) User_1 has the bright idea of opening the explorer and copy the change output address of the transaction. Then call bumpfee providing such output (in the "outputs" arg). Currently, this is not possible. The wallet fails with "Unable to create transaction. Transaction must have at least one recipient" error. The error reason is because we discard the provided output from the recipients list and set it inside the coin control so the process adds it later (when the change is calculated). But.. there is no later if the tx has no outputs. ACKs for top commit: ishaanam: reACK be72663a1521bc6cdf16d43a4feae7c5b57735c0 achow101: ACK be72663a1521bc6cdf16d43a4feae7c5b57735c0 Tree-SHA512: c2c38290a998f9b426a830d9624c7feb730158980ac186f8fb0138d5e200935d6538307bc60a2c3d0b7b6ee2b4ffb77a1e98baf8feb1d20a7d825f6055ac377f
2023-04-30rpc: scanblocks, add "completed" flag to the result objfurszy
To tell the user whether the process was aborted or not. Plus, as the process can be aborted prior to the end range, have also changed the "to_height" result value to return the last scanned block instead of the end range block.
2023-04-28test: remove modinv python util helper functionFabian Jahr
2023-04-28Merge bitcoin/bitcoin#27483: Bump python minimum version to 3.8fanquake
fac395e5eb2cd3210ba6345f777a586a9bec84e3 ci: Bump ci/lint/Dockerfile (MarcoFalke) fa6eb6516727a8675dc6e46634d8343e282528ab test: Use python3.8 pow() (MarcoFalke) 88881cf7ac029aea660c2413ca8e2a5136fcd41b Bump python minimum version to 3.8 (MarcoFalke) Pull request description: There is no pressing reason to drop support for 3.7, however there are several maintenance issues: * There is no supported operating system that ships 3.7 by default. (debian:buster is EOL and unmaintained to the extent that it doesn't run in the CI environment. See https://github.com/bitcoin/bitcoin/pull/27340#issuecomment-1484988445) * Compiling python 3.7 from source is also unsupported on at least macos, according to https://github.com/bitcoin/bitcoin/pull/24017#issuecomment-1107820790 * Recent versions of lief require 3.8, see https://github.com/bitcoin/bitcoin/pull/27507#issuecomment-1517561645 Fix all maintenance issues by bumping the minimum. ACKs for top commit: RandyMcMillan: ACK fac395e fjahr: ACK fac395e5eb2cd3210ba6345f777a586a9bec84e3 fanquake: ACK fac395e5eb2cd3210ba6345f777a586a9bec84e3 Tree-SHA512: c198decdbbe29d186d73ea3f6549d8a38479383495d14a965a2f9211ce39637b43f13a4c2a5d3bf56e2d468be4bbe49b4ee8e8e19ec69936ff43ddf2b714c712
2023-04-27Merge bitcoin/bitcoin#26314: test: perturb anchors.dat to test error during ↵fanquake
initialization 33fdfc7986455191df8ce339261bc0561115cf7f test: perturb anchors.dat to test it doesn't throw an error during initialization (brunoerg) Pull request description: Got some inspiration from `feature_init`. This PR tests whether perturbing `anchors.dat` doesn't throw any error during initialization. https://github.com/bitcoin/bitcoin/blob/3f1f5f6f1ec49d0fb2acfddec4021b3582ba0553/src/addrdb.cpp#L223-L235 ACKs for top commit: MarcoFalke: lgtm ACK 33fdfc7986455191df8ce339261bc0561115cf7f Tree-SHA512: e6584debb37647677581fda08366b45b42803022cc4c4f1d5a7bd5e9e04d64da77656dad2b804855337487bdcfc891f300a2e03668d6122de769dd14f39af9ed
2023-04-27Merge bitcoin/bitcoin#26794: test: test banlist database recreationfanquake
4bdcf571584cbe44ad5533a3c991d3b0b4b2c84f test: test banlist database recreation (brunoerg) Pull request description: This PR adds test coverage for 'banlist database recreation'. If it wasn't able to read ban db (in `LoadBanlist`), so it should create a new (an empty, ofc) one. https://github.com/bitcoin/bitcoin/blob/d8bdee0fc889def7c5f5076da13db4fce0a3728a/src/banman.cpp#L28-L45 ACKs for top commit: MarcoFalke: lgtm ACK 4bdcf571584cbe44ad5533a3c991d3b0b4b2c84f Tree-SHA512: d9d0cd0c4b3797189dff00d3a634878188e7cf51e78346601fc97e2bf78c495561705214062bb42ab8e491e0d111f8bfcf74dbc801768bc02cf2b45f162aad85
2023-04-27Merge bitcoin/bitcoin#25937: test: add coverage for rpc error when trying to ↵fanquake
rescan beyond pruned data cca4f82b828669ae23f6ac64fb83e068b81ae189 test: add coverage for rpc error when trying to rescan beyond pruned data (brunoerg) Pull request description: This PR adds test coverage for the following rpc error: https://github.com/bitcoin/bitcoin/blob/15692e2641592394bdd4da0a7c2d371de8e576dd/src/wallet/rpc/transactions.cpp#L896-L899 ACKs for top commit: MarcoFalke: lgtm ACK cca4f82b828669ae23f6ac64fb83e068b81ae189 aureleoules: ACK cca4f82b828669ae23f6ac64fb83e068b81ae189 Tree-SHA512: 724a055e9f6cddf1935699e8769015115f24f6485a0bd87e8660072ee44a15c1bddfdda848acc101ea7184b7e65a33b5b0d80b563d2ba3ecdab7a631378d6476
2023-04-26rpc: return block hash & height in getbalances, gettransaction & ↵Harris
getwalletinfo JSONs Co-authored-by: Aurèle Oulès <aurele@oules.com>
2023-04-26Merge bitcoin/bitcoin#25158: rpc, wallet: add abandoned field for all ↵Andrew Chow
categories of transaction in ListTransaction 0c520679ab5f0ba99584cb356ec28ef089f14735 doc: add release notes for `abandoned` field in `gettransaction` and `listtransactions` (brunoerg) a1aaa7f51f4205ae4d27fbceb2c3a97bc114e828 rpc, wallet: add `abandoned` field for all categories of transactions in ListTransactions (brunoerg) Pull request description: Fixes #25130 ACKs for top commit: achow101: re-ACK 0c520679ab5f0ba99584cb356ec28ef089f14735 Tree-SHA512: 1864460d76decab7898737c96517d722055eb8f81ca52248fe1035723258c6cd4a93251e06a86ecbbb0b0a80af1466b2c86fb142ace4ccb74cc40d5dc3967d7f
2023-04-26Merge bitcoin/bitcoin#26933: mempool: disallow txns under min relay fee, ↵glozow
even in packages bf77fc9cb45209b9c560208c65abc94209cd7919 [test] mempool full in package accept (glozow) b51ebccc28e66c1822ab22d2d178be55c6618196 [validation] set PackageValidationState when mempool full (glozow) 563a2ee4f564c8ea5f8313d711b196e260568c04 [policy] disallow transactions under min relay fee, even in packages (glozow) c4554fe894d7af8e666f5d424deccddf516713ef [test] package cpfp bumps parents <mempoolminfee but >=minrelaytxfee (glozow) ac463e87df728689701810c3961155c49fdc5b31 [test util] mock mempool minimum feerate (glozow) Pull request description: Part of package relay, see #27463. Note that this still allows packages to bump transactions that are below the dynamic mempool minimum feerate, which means this still solves the "mempool is congested and my presigned 1sat/vB tx is screwed" problem for all transactions. On master, the package policy (only accessible through regtest-only RPC submitpackage) allows 0-fee (or otherwise below min relay feerate) transactions if they are bumped by a child. However, with default package limits, we don't yet have a DoS-resistant way of ensuring these transactions remain bumped throughout their time in the mempool. Primarily, the fee-bumping child may later be replaced by another transaction that doesn't bump the parent(s). The parent(s) could potentially stay bumped by other transactions, but not enough to ever be selected by the `BlockAssembler` (due to `blockmintxfee`). For example, (tested [here](https://github.com/glozow/bitcoin/commits/26933-motivation)): - The mempool accepts 24 below-minrelayfeerate transactions ("0-fee parents"), all bumped by a single high-fee transaction ("the fee-bumping child"). The fee-bumping child also spends a confirmed UTXO. - Two additional children are added to each 0-fee parent. These children each pay a feerate slightly above the minimum relay feerate (e.g. 1.9sat/vB) such that, for each 0-fee parent, the total fees of its two children divided by the total size of the children and parent is above the minimum relay feerate. - If a block template is built now, all transactions would be selected. - A transaction replaces the the fee-bumping child, spending only the confirmed UTXO and not any of the outputs from the 0-fee parents. - The 0-fee parents now each have 2 children. Their descendant feerates are above minrelayfeerate, which means that they remain in the mempool, even if the mempool evicts all below-minrelayfeerate packages. - If a block template is built now, none of the 0-fee parents or their children would be selected. - Even more low-feerate descendants can be added to these below-minrelayfeerate packages and they will not be evicted until they expire or the mempool reaches capacity. Unless we have a DoS-resistant way of ensuring package CPFP-bumped transactions are always bumped, allowing package CPFP to bump below-minrelayfeerate transactions can result in these problematic situations. See #27018 which proposes a partial solution with some limitations, and contains discussion about potential improvements to eviction strategy. While no adequate solution exists, for now, avoid these situations by requiring all transactions to meet min relay feerate. ACKs for top commit: ajtowns: reACK bf77fc9cb45209b9c560208c65abc94209cd7919 instagibbs: re-ACK https://github.com/bitcoin/bitcoin/pull/26933/commits/bf77fc9cb45209b9c560208c65abc94209cd7919 Tree-SHA512: 28940f41493a9e280b010284316fb8caf1ed7b2090ba9a4ef8a3b2eafc5933601074b142f4f7d4e3c6c4cce99d3146f5c8e1393d9406c6f2070dd41c817985c9
2023-04-23test: simplify uint256 (de)serialization routinesSebastian Falbesoner
These routines look fancy, but do nothing more than converting between byte objects of length 32 to/from integers in little endian byte order and can be replaced by simple one-liners, using the int.{from,to}_bytes methods (available since Python 3.2).