aboutsummaryrefslogtreecommitdiff
path: root/test/functional
AgeCommit message (Collapse)Author
2024-01-16Merge bitcoin/bitcoin#29179: test: wallet rescan with reorged parent + ↵Ava Chow
IsFromMe child in mempool df30247705940c50c5eaafd74e2abbeb8b0cec07 [test] import descriptor wallet with reorged parent + IsFromMe child in mempool (glozow) c3d02be536ac3f35c10efa03653186a17ebbfc12 [test] rescan legacy wallet with reorged parent + IsFromMe child in mempool (Gloria Zhao) Pull request description: Originally motivated by #29019, which reverts back to having `requestMempoolTransactions` emit `transactionAddedToMempool` in `mapTx` default order instead of `GetSortedDepthAndScore` order. It's important that these notifications happen in topological order, otherwise the wallet rescan may miss transactions that belong to it. Notably, checking whether a transaction `IsFromMe` requires knowing its inputs, which may be from a mempool parent. When using `mapTx` order, a parent may come later than its child if it was added from a block disconnected in a reorg. This PR adds a test for this case. ACKs for top commit: achow101: ACK df30247705940c50c5eaafd74e2abbeb8b0cec07 furszy: Code review ACK df30247705, nits can be disregarded. Tree-SHA512: 2f1d9ef92313228adbbef94e634e5f7a9ec6e6a2c88e16aa343bdc95ffc9b9f9c82a569b412c9a3841db9d789e52f9283e8b9385731668d59355903e26e58a5d
2024-01-12[test] import descriptor wallet with reorged parent + IsFromMe child in mempoolglozow
Test that wallet rescans process transactions topologically, even if a parent's entry into the mempool is later than that of its child. This behavior is important because IsFromMe requires the ability to look up a transaction's inputs. Co-authored-by: furszy <matiasfurszyfer@protonmail.com>
2024-01-12Make v2transport default for addnode RPC when enabledPieter Wuille
2024-01-12Merge bitcoin/bitcoin#28885: mempool / rpc: followup to ↵glozow
getprioritisedtransactions and delete a mapDeltas entry when delta==0 0eebd6fe7d01ddc7f6b7f13a6ed6e705c7aeae4e test: Assert that a new tx with a delta of 0 is never added (kevkevin) cfdbcd19b32fd63954d7947dcc639aef291fb6b2 rpc: exposing modified_fee in getprioritisedtransactions (kevkevin) 252a86729a15e47ed168d8da7c4a8d6113673909 rpc: renaming txid -> transactionid (kevkevin) 2fca6c2dd03c3955d86efb0b8d2a7961e42115fd rpc: changed prioritisation-map -> "" (kevkevin) 3a118e19e100110300d3290d4c1434f963721d94 test: Directly constructing 2 entry map for getprioritisedtransactions (kevkevin) Pull request description: In this PR I am addressing some comments in https://github.com/bitcoin/bitcoin/pull/27501 as a followup. - changed `prioritisation-map` in the `RPCResult` to `""` - Directly constructing 2 entry map for getprioritisedtransactions in functional tests - renamed `txid` to `transactionid` in `RPCResult` to be more consistent with naming elsewhere - exposed the `modified_fee` field instead of having it be a useless arg - Created a new test that asserts when `prioritisedtransaction` is called with a fee_delta of 0 it is not added to mempool ACKs for top commit: glozow: reACK 0eebd6fe7d01ddc7f6b7f13a6ed6e705c7aeae4e, only change is the doc suggestion Tree-SHA512: e99056e37a8b1cfc511d87c83edba7c928b50d2cd6c2fd7c038976779850677ad37fddeb2b983e8bc007ca8567eb21ebb78d7eae9b773657c2b297299993ec05
2024-01-12[test] rescan legacy wallet with reorged parent + IsFromMe child in mempoolGloria Zhao
Test that wallet rescans process transactions topologically, even if a parent's entry into the mempool is later than that of its child. This behavior is important because IsFromMe requires the ability to look up a transaction's inputs.
2024-01-11tests: Test migration of blank walletsAndrew Chow
2024-01-11Merge bitcoin/bitcoin#29034: test: detect OS in functional tests ↵Ava Chow
consistently using `platform.system()` 878d914777a03a04ecb84217152e8b7fd73a5062 doc: test: mention OS detection preferences in style guideline (Sebastian Falbesoner) 4c65ac96f8b021c107783adce3e8afe4f8edee6e test: detect OS consistently using `platform.system()` (Sebastian Falbesoner) 37324ae3dfb0e50daaf752dc863a880559fa4637 test: use `skip_if_platform_not_linux` helper where possible (Sebastian Falbesoner) Pull request description: There are at least three ways to detect the operating system in Python3: - `os.name` (https://docs.python.org/3.9/library/os.html#os.name) - `sys.platform` (https://docs.python.org/3.9/library/sys.html#sys.platform) - `platform.system()` (https://docs.python.org/3.9/library/platform.html#platform.system) We are currently using all of them in functional tests (both in individual tests and shared test framework code), which seems a bit messy. This PR consolidates into using `platform.system()`, as it appears to be one most consistent and easy to read (see also [IRC discussion](https://bitcoin-irc.chaincode.com/bitcoin-core-dev/2023-12-08#989301;) and table below). `sys.platform` is inconsistent as it has the major version number encoded for BSD systems, which doesn't make much sense for e.g. OpenBSD, where there is no concept of major versions, but instead the version is simply increased by 0.1 on each release. Note that `os.name` is still useful to detect whether we are running a POSIX system (see `BitcoinTestFramework.skip_if_platform_not_posix`), so for this use-case it is kept as only exception. The following table shows values for common operating systems, found via ``` $ python3 -c "import os; import sys; import platform; print(os.name, sys.platform, platform.system())" ``` | OS | os.name | sys.platform | platform.system() | |--------------|---------|--------------|--------------------| | Linux 6.2.0 | posix | linux | Linux | | MacOS* | posix | darwin | Darwin | | OpenBSD 7.4 | posix | openbsd7 | OpenBSD | | Windows* | nt | win32 | Windows | \* = I neither have a MacOS nor a Windows machine available, so I extracted the values from documentation and our current code. Also I'm relying on CI for testing the relevant code-paths. Having reviewers to this this locally would be very appreciated, if this gets Concept ACKed. ACKs for top commit: kevkevinpal: ACK [878d914](https://github.com/bitcoin/bitcoin/pull/29034/commits/878d914777a03a04ecb84217152e8b7fd73a5062) achow101: ACK 878d914777a03a04ecb84217152e8b7fd73a5062 hebasto: ACK 878d914777a03a04ecb84217152e8b7fd73a5062, I have reviewed the code and it looks OK. pablomartin4btc: tACK 878d914777a03a04ecb84217152e8b7fd73a5062 Tree-SHA512: 24513d493e47f572028c843260b81c47c2c29bfb701991050255c9f9529cd19065ecbc7b3b6e15619da7f3f608b4825c345ce6fee30d8fd1eaadbd08cff400fc
2024-01-11Merge bitcoin/bitcoin#28838: test: add assumeutxo wallet testAva Chow
997b9a73e5166b4244f7c5b4fe144d524f3005f4 test: add assumeutxo wallet test (Sjors Provoost) Pull request description: Extracted from #28616, this adds a (very) basic wallet test for assume utxo. It checks some circumstances where a backup can and can't be loaded. ACKs for top commit: maflcko: lgtm ACK 997b9a73e5166b4244f7c5b4fe144d524f3005f4 achow101: ACK 997b9a73e5166b4244f7c5b4fe144d524f3005f4 theStack: Code-review ACK 997b9a73e5166b4244f7c5b4fe144d524f3005f4 Tree-SHA512: 69474e56c6a46bb4f30fc54f8e5844766ac2a5f8226bb0b168d11ae1e3d4eae58570c1f1b4cc2b2f6f51b5d0e055bbe2bbd11684265215e01d4eb81ab4b7b0bb
2024-01-11test: Assert that a new tx with a delta of 0 is never addedkevkevin
2024-01-11rpc: exposing modified_fee in getprioritisedtransactionskevkevin
Instead of having modified_fee be hidden we are now exposing it to avoid having useless code
2024-01-10Merge bitcoin/bitcoin#29204: test: wallet migration, add coverage for tx ↵Ava Chow
extra data 016cc807f77a9128d430a0df1edd133521628a33 test: wallet migration, add coverage for tx extra data (furszy) Pull request description: Quick follow-up to #28610, coming from https://github.com/bitcoin/bitcoin/pull/28610#pullrequestreview-1802823938. Verifying that the 'replaced_by_txid' and 'replaces_txid' tx data is preserved after migration, as well as the extra tx comments. ACKs for top commit: jamesob: Nice, ACK https://github.com/bitcoin/bitcoin/pull/29204/commits/016cc807f77a9128d430a0df1edd133521628a33 achow101: ACK 016cc807f77a9128d430a0df1edd133521628a33 pablomartin4btc: ACK 016cc807f77a9128d430a0df1edd133521628a33 BrandonOdiwuor: lgtm ACK 016cc807f77a9128d430a0df1edd133521628a33 Tree-SHA512: 697cabece730cbe5c5947bf98455e80a8877c0352fbe2a66362ce5ea530b67882b0bec561a67d48fee200cdad717cd62c57fd809e2a94ff83c3fad30021e1d9e
2024-01-10test: assumeutxo: spend coin from snapshot chainstate after loadingSebastian Falbesoner
Check that an UTXO that is only available in the snapshot chainstate is also visible to the mempool by submitting a spending transaction.
2024-01-08test: wallet migration, add coverage for tx extra datafurszy
Verifying that the 'replaced_by_txid' and 'replaces_txid' tx data is preserved after migration, as well as the extra tx comments.
2024-01-08Merge bitcoin/bitcoin#28610: wallet: Migrate entire address book entries to ↵fanquake
watchonly and solvables too 406b71abcb72f234ddf9245a3f57e748343c774f wallet: Migrate entire address book entries (Andrew Chow) Pull request description: Not all of the data in an address book entry was being copied to the watchonly and solvables wallets. This includes information such as whether the address was previously spent, and any receive requests that may exist. A test has been added to check that the previously spent information is copied, although it passes without the changes in this PR since this information is also regenerated when a transaction is loaded/added into a wallet. ACKs for top commit: ryanofsky: Code review ACK 406b71abcb72f234ddf9245a3f57e748343c774f. Just suggested change since last review furszy: Code review ACK 406b71ab Tree-SHA512: 13de42b16a1d8524fe0555764744139566b2e7d29741ceffc1158a905dd537136b762330568b3b5cac28cbee1bfd363a20de97d0a6c5296738cb3aa99133945b
2024-01-05Merge bitcoin/bitcoin#28890: rpc: Remove deprecated -rpcserialversionfanquake
fa46cc22bc696e6845915ae91d6b68e36bf4c242 Remove deprecated -rpcserialversion (MarcoFalke) Pull request description: The flag is problematic for many reasons: * It is deprecated * It is a global flag, requiring a restart to change, as opposed to a flag that can be set on each RPC invocation * It may be hidden in config files by accident, hard to debug, causing LND crashes and bugs, see https://github.com/bitcoin/bitcoin/issues/28730#issuecomment-1780940868 * It makes performance improvements harder to implement: https://github.com/bitcoin/bitcoin/pull/17529#issuecomment-556082818 Fix all issues by removing it. If there is a use-case, likely a per-RPC flag can be added, if needed. ACKs for top commit: ajtowns: crACK fa46cc22bc696e6845915ae91d6b68e36bf4c242 TheCharlatan: lgtm ACK fa46cc22bc696e6845915ae91d6b68e36bf4c242 Tree-SHA512: 96ba1c60356ce93954fe5c2a59045771c6d1516ad0d9dc436ef1800a1f1b0153f0d5fb78ca99d53ad54ba25fbce36962bdf1d4325aceedfc8154a61347a6a915
2023-12-17wallet, mempool: propagete `checkChainLimits` error message to walletismaelsadeeq
Update CheckPackageLimits to use util::Result to pass the error message instead of out parameter. Also update test to reflect the error message from `CTxMempool` `CheckPackageLimits` output.
2023-12-15Merge bitcoin/bitcoin#29088: tests: Don't depend on value of ↵Ava Chow
DEFAULT_PERMIT_BAREMULTISIG 7b45744df33c6a4759eae1a3984f389cbac837c2 tests: ensure functional tests set permitbaremultisig=1 when needed (Anthony Towns) 7dfabdcf860c529772a54b0e8fa235cbb4a78b4d tests: test both settings for permitbaremultisig in p2sh tests (Anthony Towns) Pull request description: Update unit and functional tests so that they continue to work if the default for `-permitbaremultisig` is changed. ACKs for top commit: maflcko: lgtm ACK 7b45744df33c6a4759eae1a3984f389cbac837c2 instagibbs: crACK https://github.com/bitcoin/bitcoin/pull/29088/commits/7b45744df33c6a4759eae1a3984f389cbac837c2 ajtowns: > crACK [7b45744](https://github.com/bitcoin/bitcoin/commit/7b45744df33c6a4759eae1a3984f389cbac837c2) achow101: ACK 7b45744df33c6a4759eae1a3984f389cbac837c2 glozow: ACK 7b45744df33c6a4759eae1a3984f389cbac837c2, changed default locally and all tests passed Tree-SHA512: f89f9e2bb11f07662cfd57390196df9e531064e1bd662e1db7dcfc97694394ae5e8014e9d209b9405aa09195bf46fc331b7fba10378065cdb270cbd0669ae904
2023-12-15tests: ensure functional tests set permitbaremultisig=1 when neededAnthony Towns
The mempool_dust and mempool_sigoplimits functional tests both use bare multisig txs, so ensure they're allowed by policy.
2023-12-14Merge bitcoin/bitcoin#28920: wallet: birth time update during tx scanningAva Chow
1ce45baed7dd2da3f1cb85c9c25110e5537451ae rpc: getwalletinfo, return wallet 'birthtime' (furszy) 83c66444d0604f0a9ec3bc3f89d4f1a810b7cda0 test: coverage for wallet birth time interaction with -reindex (furszy) 6f497377aa17cb8a590fd7717fa8ededf4249999 wallet: fix legacy spkm default birth time (furszy) 75fbf444c1e13c6ba0e79a34871534c845a13849 wallet: birth time update during tx scanning (furszy) b4306e3c8db6cbaedc8845c6d21c750b39f682bf refactor: rename FirstKeyTimeChanged to MaybeUpdateBirthTime (furszy) Pull request description: Fixing #28897. As the user may have imported a descriptor with a timestamp newer than the actual birth time of the first key (by setting 'timestamp=now'), the wallet needs to update the birth time when it detects a transaction older than the oldest descriptor timestamp. Testing Notes: Can cherry-pick the test commit on top of master. It will fail there. ACKs for top commit: Sjors: re-utACK 1ce45baed7dd2da3f1cb85c9c25110e5537451ae achow101: ACK 1ce45baed7dd2da3f1cb85c9c25110e5537451ae Tree-SHA512: 10c2382f87356ae9ea3fcb637d7edc5ed0e51e13cc2729c314c9ffb57c684b9ac3c4b757b85810c0a674020b7287c43d3be8273bcf75e2aff0cc1c037f1159f9
2023-12-14Merge bitcoin/bitcoin#29070: test: add TestNode wait_until helperAva Chow
bf0f7dbec6590a54ec890e7a2ca5d85427995334 test: add TestNode wait_until helper (Nikodemas Tuckus) Pull request description: Add `wait_until` method that wraps the `wait_until_helper_internal` call. Closes https://github.com/bitcoin/bitcoin/issues/29029. ACKs for top commit: maflcko: lgtm ACK bf0f7dbec6590a54ec890e7a2ca5d85427995334 mohamedawnallah: LGTM! Code Review ACK https://github.com/bitcoin/bitcoin/commit/bf0f7dbec6590a54ec890e7a2ca5d85427995334 achow101: ACK bf0f7dbec6590a54ec890e7a2ca5d85427995334 BrandonOdiwuor: Code review ACK bf0f7dbec6590a54ec890e7a2ca5d85427995334 Tree-SHA512: 05aab589c814f51a14e1483eb57c10b88385714e3eb2d0973c0ee2877f2b963a76837f34215fe2e6bd1c8d735f5af7dd2098331e1eda28587f39e513bc6e1a6a
2023-12-13test: add TestNode wait_until helperNikodemas Tuckus
2023-12-12test: Actually fail when a python unit test failsMarcoFalke
2023-12-11Remove deprecated -rpcserialversionMarcoFalke
2023-12-11Merge bitcoin/bitcoin#29041: test: fix intermittent error in rpc_net.py (#29030)fanquake
ea00f982d21aab51001d422225f00626a74db298 test: fix intermittent error in rpc_net.py (#29030) (Sebastian Falbesoner) Pull request description: Asserting for the debug log message "Added connection peer=" is insufficient for ensuring that this new connection will show up in a following getpeerinfo() call, as the debug message is written in the CNode ctor, which means it hasn't necessarily been added to CConnman.m_nodes at this point. Solve this by using the recently introduced `wait_for_new_peer` helper (see #29006, commit 00e0658e77f66103ebdeb29def99dc9f937c049d), which is more robust. Fixes #29030. ACKs for top commit: maflcko: lgtm ACK ea00f982d21aab51001d422225f00626a74db298 Tree-SHA512: dda307949a466fb3b24408a8c213d307e0af2155f2e8b4e52c836a22397f9d218bf9d8c54ca55bae62a96d7566f27167db9311dd8801785c327234783af5ed00
2023-12-09test: fix intermittent error in rpc_net.py (#29030)Sebastian Falbesoner
Asserting for the debug log message "Added connection peer=" is insufficient for ensuring that this new connection will show up in a following getpeerinfo() call, as the debug message is written in the CNode ctor, which means it hasn't necessarily been added to CConnman.m_nodes at this point. Solve this by using the recently introduced `wait_for_new_peer` helper, which is more robust. Fixes #29030.
2023-12-08test: fix `addnode` functional test failure on OpenBSDSebastian Falbesoner
This is the functional test counterpart of PR #28891 / commit 007d6f0e85bc329040bb405ef6016339518caa66.
2023-12-08doc: test: mention OS detection preferences in style guidelineSebastian Falbesoner
2023-12-08test: detect OS consistently using `platform.system()`Sebastian Falbesoner
2023-12-08test: use `skip_if_platform_not_linux` helper where possibleSebastian Falbesoner
Rather than re-implementing these checks, we can use this test framework's helper (introduced in commit c934087b627f7d368458781944f990b0eb479634, PR #24358) called in a test's `skip_test_if_missing_module` method instead.
2023-12-08Merge bitcoin/bitcoin#29006: test: fix v2 transport intermittent test ↵fanquake
failure (#29002) 00e0658e77f66103ebdeb29def99dc9f937c049d test: fix v2 transport intermittent test failure (#29002) (Sebastian Falbesoner) Pull request description: This PR improves the following fragile construct for detection of a new connection to the node under test in `p2p_v2_transport.py`: https://github.com/bitcoin/bitcoin/blob/6d5790956f45e3de5c6c4ee6fda21878b0d1287b/test/functional/p2p_v2_transport.py#L154-L156 Only relying on the number of peers for that suffers from race conditions, as unrelated previous peers could disconnect at anytime in-between. In the test run in #29002, the following happens: - `getpeerinfo()` is called the first time -> assigned to `num_peers` - **previous peer disconnects**, the node's peer count is now `num_peers - 1` (in most test runs, this happens before the first getpeerinfo call) - new peer connects, the node's peer count is now `num_peers` - the condition that the node's peer count is `num_peers + 1` is never true, test fails Use the more robust approach of watching for an increased highest peer id instead (again using the `getpeerinfo` RPC call), with a newly introduced context manager method `TestNode.wait_for_new_peer()`. Note that for the opposite case of a disconnect, no new method is introduced; this is currently used only once in the test and is also simpler. Still happy to take suggestions for alternative solutions. Fixes #29002. ACKs for top commit: kevkevinpal: Concept ACK [00e0658](https://github.com/bitcoin/bitcoin/pull/29006/commits/00e0658e77f66103ebdeb29def99dc9f937c049d) maflcko: Ok, lgtm ACK 00e0658e77f66103ebdeb29def99dc9f937c049d stratospher: ACK 00e0658. Tree-SHA512: 0118b87f54ea5e6e080ff44f29d6af6674c757a588534b3add040da435f4359e71bf85bc0a5eb7170f99cc9956e1a03c35cce653d642d31eed41bbed1f94f44f
2023-12-08Merge bitcoin/bitcoin#28485: test: Extends MEMPOOL msg functional testfanquake
97c0dfa8942c7fd62c920deee03b4d0c59aba641 test: Extends MEMPOOL msg functional test (Sergi Delgado Segura) Pull request description: Currently, p2p_filter.py::test_msg_mempool is not testing much. This extends the tests so the interaction between sending `MEMPOOL` messages with a filter that does not include all transactions in the mempool reacts, plus how it interacts with `INV` messages, especially after the changes introduced by #27675 ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/28485/commits/97c0dfa8942c7fd62c920deee03b4d0c59aba641 theStack: re-ACK 97c0dfa8942c7fd62c920deee03b4d0c59aba641 Tree-SHA512: 746fdc867630f40509e6341f484a238dd855ae6d1be5eca121974491e4ca272dee88af4b90dda55ea9a5a19cbff198fa91ffa0c5bf1ddf0232b2c1b215b05b9a
2023-12-06test: Extends MEMPOOL msg functional testSergi Delgado Segura
Currently, p2p_filter.py::test_msg_mempool is not testing much. This extends the tests so the interaction between sending MEMPOOL messages with a filter that does not include all transactions in the mempool reacts, plus how it interacts with INV messages
2023-12-06Merge bitcoin/bitcoin#27581: net: Continuous ASMap health checkAndrew Chow
3ea54e5db7d53da5afa321e1800c29aa269dd3b3 net: Add continuous ASMap health check logging (Fabian Jahr) 28d7e55dff826a69f3f8e58139dbffb611cc5947 test: Add tests for unfiltered GetAddr usage (Fabian Jahr) b8843d37aed1276ff8527328c956c70c6e02ee13 fuzz: Let fuzzers use filter options in GetAddr/GetAddresses (Fabian Jahr) e16f420547fc72a5a2902927aa7138e43c0fb7c8 net: Optionally include terrible addresses in GetAddr results (Fabian Jahr) Pull request description: There are certain statistics we can collect by running all our known clearnet addresses against the ASMap file. This could show issues with a maliciously manipulated file or with an old file that has decayed with time. This is just a proof of concept for now. My idea currently is to run the analysis once per day and print the results to logs if an ASMap file is used. ACKs for top commit: achow101: ACK 3ea54e5db7d53da5afa321e1800c29aa269dd3b3 mzumsande: ACK 3ea54e5db7d53da5afa321e1800c29aa269dd3b3 brunoerg: crACK 3ea54e5db7d53da5afa321e1800c29aa269dd3b3 Tree-SHA512: 777acbfac43cc43ce4a0a3612434e4ddbc65f59ae8ffc9e24f21de09011bccb297f0599cbaa82bcf40ef68e5af582c4e98556379db7ceff7d9f97574a1cf8e09
2023-12-06test: fix v2 transport intermittent test failure (#29002)Sebastian Falbesoner
Only relying on the number of peers for detecting a new connection suffers from race conditions, as unrelated previous peers could disconnect at anytime in-between. Use the more robust approach of watching for an increased highest peer id instead (again using the `getpeerinfo` RPC call), with a newly introduced context manager method `TestNode.wait_for_new_peer()`. Fixes #29009.
2023-12-05test: add regression test for the getrawtransaction segfaultMartin Zumsande
This fails on master without the previous commit.
2023-12-05rpc: getwalletinfo, return wallet 'birthtime'furszy
And add coverage for it
2023-12-05test: coverage for wallet birth time interaction with -reindexfurszy
Verifying the wallet updates the birth time accordingly when it detects a transaction with a time older than the oldest descriptor timestamp. This could happen when the user blindly imports a descriptor with 'timestamp=now'.
2023-12-05wallet: Migrate entire address book entriesAndrew Chow
2023-12-04init: don't delete PID file if it was not generatedwillcl-ark
Previously, starting a second bitcoind using the same datadir would correctly fail to init and shutdown. However during shutdown the PID file belonging to the first instance would be erroneously removed by the second process shutting down. Fix this to only delete the PID file if we created it.
2023-12-02net: Add continuous ASMap health check loggingFabian Jahr
2023-12-01Merge bitcoin/bitcoin#28784: rpc: keep `.cookie` file if it was not generatedAndrew Chow
7cb9367157eb42ee06bc6fa024522cc14a80138d rpc: keep .cookie if it was not generated (Roman Zeyde) Pull request description: Otherwise, starting bitcoind twice may cause the `.cookie` file generated by the first instance to be deleted by the second instance shutdown (after failing to obtain a lock). ACKs for top commit: willcl-ark: re-ACK 7cb9367157eb42ee06bc6fa024522cc14a80138d achow101: ACK 7cb9367157eb42ee06bc6fa024522cc14a80138d kristapsk: re-ACK 7cb9367157eb42ee06bc6fa024522cc14a80138d stickies-v: ACK 7cb9367157eb42ee06bc6fa024522cc14a80138d Tree-SHA512: 0960dbc457975b0e0535f3d814824a879d7f85c9f1191537415b3fc253429a316a8e4badde56c8bc139778f132392983cec5fbe03891fb15ff61d3bc3f6e681b
2023-12-01Merge bitcoin/bitcoin#28848: bugfix, Change up submitpackage results to ↵Andrew Chow
return results for all transactions f23ba24aa079d68697d475789cd21bd7b5075550 test_submitpackage: only make a chain of 3 txns (Greg Sanders) e67a345162912ef7c1bfa3c89c7e7c629505f0a3 doc: submitpackage vsize results are sigops-adjusted (Greg Sanders) b67db52c399089e5d4c4202ebb905794dfd050d0 RPC submitpackage: change return format to allow partial errors (Greg Sanders) Pull request description: This was prompted by errors being returned that didn't "make any sense" to me, because it would for example return a "fee too low" error, when the "real" error was the child had something invalid, which disallowed CPFP evaluation. Rather than make judgment calls on what error is important(which is currently just return the "first"!), we simply return all errors and let the callers determine what's best. Added a top level `package_msg` for quick eye-balling of general success of the package. This PR also fixes a couple bugs: 1) Currently we don't actually broadcast a transaction, even if it was entered into our mempool, if a subsequent transaction causes `PKG_TX` failure. 2) "other-wtxid" is uncovered by tests, but IIUC was previously required to return "fees" and "vsize" results, but did not. I just make those results optional. ACKs for top commit: Sjors: Light re-utACK f23ba24aa079d68697d475789cd21bd7b5075550 achow101: ACK f23ba24aa079d68697d475789cd21bd7b5075550 glozow: utACK f23ba24aa079d68697d475789cd21bd7b5075550, thanks for taking the suggestions Tree-SHA512: ebfd716a4fed9e8c2dea3d2181ba6a6171b06718d29ac2324c67b7a30b374d199f7e1739f91ab5d036be172d0479de9bc89c32263ee62143c0338b9b622d0cca
2023-11-29test_submitpackage: only make a chain of 3 txnsGreg Sanders
2023-11-29RPC submitpackage: change return format to allow partial errorsGreg Sanders
Behavior prior to this commit allows some transactions to enter into the local mempool but not be reported to the user when encountering a PackageValidationResult::PCKG_TX result. This is further compounded with the fact that any transactions submitted to the mempool during this call would also not be relayed to peers, resulting in unexpected behavior. Fix this by, if encountering a package error, reporting all wtxids, along with a new error field, and broadcasting every transaction that was found in the mempool after submission. Note that this also changes fees and vsize to optional, which should also remove an issue with other-wtxid cases.
2023-11-28Merge bitcoin/bitcoin#28554: bugfix: throw an error if an invalid parameter ↵Andrew Chow
is passed to getnetworkhashps RPC 9ac114e5cd9d8ade3a1d9f3d76a08ff59a3f1658 Throw error if invalid parameters passed to getnetworkhashps RPC endpoint (Jameson Lopp) Pull request description: When writing some scripts that iterated over many blocks to generate hashrate estimates I realized that my script was going out of range of the current chain tip height but was not encountering any errors. I believe that passing an invalid block height to this function but receiving the hashrate estimate for the chain tip instead should be considered unexpected behavior. ACKs for top commit: Sjors: re-utACK 9ac114e5cd9d8ade3a1d9f3d76a08ff59a3f1658 kevkevinpal: reACK [9ac114e](https://github.com/bitcoin/bitcoin/pull/28554/commits/9ac114e5cd9d8ade3a1d9f3d76a08ff59a3f1658) achow101: ACK 9ac114e5cd9d8ade3a1d9f3d76a08ff59a3f1658 Tree-SHA512: eefb465c2dd654fc48267f444e1809597ec5363cdd131ea9ec812458fed1e4bffbbbb0617d74687c9f7bb16274b598d8292f5eeb7953421e5d2a8dc2cc081f2b
2023-11-28Merge bitcoin/bitcoin#28805: test: Make existing functional tests compatible ↵Andrew Chow
with --v2transport 35fb9930adb3501b29d3ad20d2e74c0114f2bcbe test: enable v2 transport for p2p_timeouts.py (Martin Zumsande) 2c1669c37a9759e15ff5f4e340aeaa8778a81b9a test: enable v2 transport for rpc_net.py (Sebastian Falbesoner) cc961c26956859850202f56191981b0306a65fcf test: enable v2 transport for p2p_node_network_limited.py (Sebastian Falbesoner) 3598a1b5c932634dc7ccb991cc83df5e1a1dcaa9 test: enable --v2transport in combination with --usecli (Martin Zumsande) 68a90017519874793e34e3b439a63e5aa3a6f6a7 test: persist -v2transport over restarts and respect -v2transport=0 (Martin Zumsande) Pull request description: This makes the functional test suite compatible with BIP324, so that `python3 test_runner.py --v2transport` should succeed (currently, 12 tests fail for me on master). Includes two commits by TheStack I found in an old discussion https://github.com/bitcoin/bitcoin/pull/28331#discussion_r1326714164 Note that even though all tests should pass, the python `p2p.py` module will do v2 connections only after the merge of #24748, so that for now only connections between two full nodes will actually run v2. Some of the fixed tests were added with `--v2transport` to the test runner. Though after #24748 we might also want to consider running the entire suite with `--v2transport` in some CI. ACKs for top commit: sipa: utACK 35fb9930adb3501b29d3ad20d2e74c0114f2bcbe. Thanks for taking care of this. achow101: ACK 35fb9930adb3501b29d3ad20d2e74c0114f2bcbe theStack: ACK 35fb9930adb3501b29d3ad20d2e74c0114f2bcbe stratospher: ACK 35fb993. Tree-SHA512: 80dc0bf211fa525ff1d092043aea9f222f14c02e5832a548fb8b83b9ede1fcee03c5e8ade0d05c331bdaa492af9c1cf3d0f0b15b846673c6eacea82dd4cefbc3
2023-11-23test: Add gettransaction test for "coin-join" txMarcoFalke
2023-11-21test: Directly constructing 2 entry map for getprioritisedtransactionskevkevin
Directly constructing the map in the assertion instead of indexing by txid so that we wouldn't miss new entries in future regressions.
2023-11-17Merge bitcoin/bitcoin#28725: test: refactor: use built-in collection types ↵fanquake
for type hints (Python 3.9 / PEP 585) a478c817b2f62b7334b36e331a2e37fe8380c754 test: replace `Callable`/`Iterable` with their `collections.abc` alternative (PEP 585) (stickies-v) 4b9afb18e6b9e16d7b299820f3a1382986a451d4 scripted-diff: use PEP 585 built-in collection types for verify-binary script (Sebastian Falbesoner) d516cf83ed2da86dfefb395cd46f8a894907b88e test: use built-in collection types for type hints (Python 3.9 / PEP 585) (Sebastian Falbesoner) Pull request description: With Python 3.9 / [PEP 585](https://peps.python.org/pep-0585/), [type hinting has become a little less awkward](https://docs.python.org/3.9/whatsnew/3.9.html#type-hinting-generics-in-standard-collections), as for collection types one doesn't need to import the corresponding capitalized types (`Dict`, `List`, `Set`, `Tuple`, ...) anymore, but can use the built-in types directly (see https://peps.python.org/pep-0585/#implementation for the full list). This PR applies the replacement for all Python scripts (i.e. in the contrib and test folders) for the basic types, i.e.: - typing.Dict -> dict - typing.List -> list - typing.Set -> set - typing.Tuple -> tuple For an additional check, I ran mypy 1.6.1 on both master and the PR branch via ``` $ mypy --ignore-missing-imports --explicit-package-bases $(git ls-files "*.py") ``` and verified that the output is identical -- (from the 22 identified problems, most look like false-positives, it's probably worth it to go deeper here and address them in a follow-up though). ACKs for top commit: stickies-v: ACK a478c817b2f62b7334b36e331a2e37fe8380c754 fanquake: ACK a478c817b2f62b7334b36e331a2e37fe8380c754 Tree-SHA512: 6948c905f6abd644d84f09fcb3661d7edb2742e8f2b28560008697d251d77a61a1146ab4b070e65b0d27acede7a5256703da7bf6eb1c7c3a897755478c76c6e8
2023-11-16test: replace `Callable`/`Iterable` with their `collections.abc` alternative ↵stickies-v
(PEP 585)