aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2024-04-23Merge bitcoin/bitcoin#24313: Improve display address handling for external ↵Ava Chow
signer 4357158c4712d479522d5cd441ad4dd1693fdd05 wallet: return and display signer error (Sjors Provoost) dc55531087478d01fbde4f5fbb75375b672960c3 wallet: compare address returned by displayaddress (Sjors Provoost) 6c1a2cc09a00baa6ff3ff34455c2243b43067fb5 test: use h marker for external signer mock (Sjors Provoost) Pull request description: * HWI returns the requested address: as a sanity check, we now compare that to what we expected * external signer documentation now reflects that HWI alternatives must implement this check * both RPC and GUI will now return an error text, rather than just fail (the GUI even failed silently in some cases) ACKs for top commit: brunoerg: ACK 4357158c4712d479522d5cd441ad4dd1693fdd05 achow101: ACK 4357158c4712d479522d5cd441ad4dd1693fdd05 Tree-SHA512: 4f56edf3846745c8e7d08ef55cf29e8bb468256457149377c5f02da097931f9ca0c06bdbd856dc2385cde4fd11e4dc3b634c5a48814ff27f5562c8a25d43da93
2024-04-23Merge bitcoin/bitcoin#29688: test: remove duplicated ban testAva Chow
e30e8625bbc42045b8b757a8d7e80c20cc61cebf test: remove duplicated ban test (brunoerg) Pull request description: Test the ban list is preserved through restart has been done by both `rpc_setban` and `p2p_disconnect_ban`. Since `p2p_disconnect_ban` does it in a more elegant way, we can keep only it and remove the other one. https://github.com/bitcoin/bitcoin/blob/bf1b6383dbbfdd0c96a161d4693a48bf3a6b6150/test/functional/p2p_disconnect_ban.py#L74-L110 ACKs for top commit: achow101: ACK e30e8625bbc42045b8b757a8d7e80c20cc61cebf tdb3: ACK for e30e8625bbc42045b8b757a8d7e80c20cc61cebf. hernanmarino: tested ACK e30e8625bbc42045b8b757a8d7e80c20cc61cebf BrandonOdiwuor: ACK e30e8625bbc42045b8b757a8d7e80c20cc61cebf alfonsoromanz: ACK e30e8625bbc42045b8b757a8d7e80c20cc61cebf Tree-SHA512: e89624f23011e6ffd76c31b2933b8386711e1d2c03366d6b3ea850484a4fd571f69971cdbc75ce2f546d541cb3fc7f4d495a5a011217d879746414e3286ac111
2024-04-22Merge bitcoin/bitcoin#29777: test: refactor: introduce and use ↵Ava Chow
`calculate_input_weight` helper 6d91cb781c30966963f28e7577c7aa3829fa9390 test: add unit tests for `calculate_input_weight` (Sebastian Falbesoner) f81fad5e0f3be1f7aed59f9da00396c75c2a6406 test: introduce and use `calculate_input_weight` helper (Sebastian Falbesoner) Pull request description: Rather than manually estimating an input's weight by adding up all the involved components (fixed-size skeleton, compact-serialized lengths, and the actual scriptSig / witness stack items) we can simply take use of the serialization classes `CTxIn` / `CTxInWitness` instead, to achieve the same with significantly less code. The new helper is used in the functional tests rpc_psbt.py and wallet_send.py, where the previous manual estimation code was duplicated. Unit tests are added in the second commit. ACKs for top commit: kevkevinpal: tACK [6d91cb7](https://github.com/bitcoin/bitcoin/pull/29777/commits/6d91cb781c30966963f28e7577c7aa3829fa9390) QureshiFaisal: tACK [6d91cb7](https://github.com/bitcoin/bitcoin/pull/29777/commits/6d91cb781c30966963f28e7577c7aa3829fa9390) achow101: ACK 6d91cb781c30966963f28e7577c7aa3829fa9390 AngusP: tACK 6d91cb781c30966963f28e7577c7aa3829fa9390 rkrux: tACK [6d91cb7](https://github.com/bitcoin/bitcoin/pull/29777/commits/6d91cb781c30966963f28e7577c7aa3829fa9390) Tree-SHA512: 04424e4d94d0e13745a9c11df2dd3697c98552bbb0e792c4af67ecbb66060adc3cc0cefc202cdee2d9db0baf85b8bedf2eb339ac4b316d986b5f10f6b70c5a33
2024-04-22Merge bitcoin/bitcoin#29933: test: Fix intermittent timeout in ↵Ava Chow
p2p_tx_download.py fa6c300a9926a1d35fdd0a80f59ea39769bd2596 test: Fix intermittent timeout in p2p_tx_download.py (MarcoFalke) Pull request description: Currently the test passes, but may fail during shutdown, because blocks and transactions are synced with `NUM_INBOUND` * `self.num_nodes` peers, which may take a long time. There is no need for this test to have this amount of inbounds. So avoid the extraneous inbounds to speed up the test and avoid the intermittent test failures. ACKs for top commit: instagibbs: ACK fa6c300a9926a1d35fdd0a80f59ea39769bd2596 fjahr: Thanks, ACK fa6c300a9926a1d35fdd0a80f59ea39769bd2596 achow101: ACK fa6c300a9926a1d35fdd0a80f59ea39769bd2596 theStack: ACK fa6c300a9926a1d35fdd0a80f59ea39769bd2596 Tree-SHA512: 0a480fd1db293ed8571ae629557cf81d5a79ec883e9e635f22c8a7cf48427161249ad2180b66c67661306f696c977b8e06ad520bd11911f119c9c95b3ffc9134
2024-04-22Merge bitcoin/bitcoin#29898: test: Fix intermittent issue in p2p_handshake.pyglozow
6b02c11d667adff24daf611f9b14815d27963674 test: Fix intermittent issue in p2p_handshake.py (stratospher) Pull request description: When establishing outbound connections [`TestNode` --------> `P2PConnection`], `P2PConnection` listens for a single connection from `TestNode` on a [port which is fixed based on `p2p_idx`](https://github.com/bitcoin/bitcoin/blob/312f54278fd972ba3557c6a5b805fd244a063959/test/functional/test_framework/p2p.py#L746). If we reuse the same port when disconnecting and establishing connections again, we might hit this scenario where: - disconnection is done on python side for `P2PConnection` - disconnection not complete on c++ side for `TestNode` - we're trying to establish a new connection on same port again Prevent this scenario from happening by ensuring disconnection on c++ side for TestNode as well. One way to reproduce this on master would be adding a sleep statement before disconnection happens on c++ side. ```diff diff --git a/src/net.cpp b/src/net.cpp index e388f05b03..62507d1f39 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2112,6 +2112,7 @@ void CConnman::SocketHandlerConnected(const std::vector<CNode*>& nodes, if (!pnode->fDisconnect) { LogPrint(BCLog::NET, "socket closed for peer=%d\n", pnode->GetId()); } + std::this_thread::sleep_for(std::chrono::milliseconds(1000)); pnode->CloseSocketDisconnect(); } else if (nBytes < 0) ``` ACKs for top commit: maflcko: lgtm ACK 6b02c11d667adff24daf611f9b14815d27963674 mzumsande: Tested ACK 6b02c11d667adff24daf611f9b14815d27963674 BrandonOdiwuor: Tested ACK 6b02c11d667adff24daf611f9b14815d27963674 theStack: Tested ACK 6b02c11d667adff24daf611f9b14815d27963674 glozow: ACK 6b02c11d667adff24daf611f9b14815d27963674 Tree-SHA512: 69509edb61ba45739fd585b6cc8a254f412975c124a5b5a52688288ecaaffd264dd76019b8290cc34c26c3ac2dfe477965ee5a11d7aabdd8e4d2a75229a4a068
2024-04-22Merge bitcoin/bitcoin#27679: ZMQ: Support UNIX domain socketsAva Chow
21d0e6c7b7c7af7f6e54a45829b4fbfba6923b86 doc: release notes for PR 27679 (Matthew Zipkin) 791dea204ecde9b500ec243b4e16fc601998ec84 test: cover unix sockets in zmq interface (Matthew Zipkin) c87b0a0ff4cb6d83bb59360ac4453f6daa871177 zmq: accept unix domain socket address for notifier (Matthew Zipkin) Pull request description: This is a follow-up to https://github.com/bitcoin/bitcoin/pull/27375, allowing ZMQ notifications to be published to a UNIX domain socket. Fortunately, libzmq handles unix sockets already, all we really have to do to support it is allow the format in the actual option. [libzmq](https://libzmq.readthedocs.io/en/latest/zmq_ipc.html) uses the prefix `ipc://` as opposed to `unix:` which is [used by Tor](https://gitlab.torproject.org/tpo/core/tor/-/blob/main/doc/man/tor.1.txt?ref_type=heads#L1475) and now also by [bitcoind](https://github.com/bitcoin/bitcoin/blob/a85e5a7c9ab75209bc88e49be6991ba0a467034e/doc/release-notes-27375.md?plain=1#L5) so we need to switch that internally. As far as I can tell, [LND](https://github.com/lightninglabs/gozmq/blob/d20a764486bf506bc045642e455bc7f0d21b232a/zmq.go#L38) supports `ipc://` and `unix://` (notice the double slashes). With this patch, LND can connect to bitcoind using unix sockets: Example: *bitcoin.conf*: ``` zmqpubrawblock=unix:/tmp/zmqsb zmqpubrawtx=unix:/tmp/zmqst ``` *lnd.conf*: ``` bitcoind.zmqpubrawblock=ipc:///tmp/zmqsb bitcoind.zmqpubrawtx=ipc:///tmp/zmqst ``` ACKs for top commit: laanwj: Code review ACK 21d0e6c7b7c7af7f6e54a45829b4fbfba6923b86 tdb3: crACK for 21d0e6c7b7c7af7f6e54a45829b4fbfba6923b86. Changes lgtm. Will follow up with some testing within the next few days as time allows. achow101: ACK 21d0e6c7b7c7af7f6e54a45829b4fbfba6923b86 guggero: Tested and code review ACK 21d0e6c7b7c7 Tree-SHA512: ffd50222e80dd029d903e5ddde37b83f72dfec1856a3f7ce49da3b54a45de8daaf80eea1629a30f58559f4b8ded0b29809548c0638cd1c2811b2736ad8b73030
2024-04-22test: Fix intermittent timeout in p2p_tx_download.pyMarcoFalke
2024-04-19Merge bitcoin/bitcoin#29827: test: p2p: add test for rejected tx request ↵glozow
logic (`m_recent_rejects` filter) 60ca5d55081275a011ccfc9546e0c4a8c4030493 test: p2p: add test for rejected tx request logic (`m_recent_rejects` filter) (Sebastian Falbesoner) e9dc511a7e9a562f953ff93f358102f555f583e6 fixup: get all utxos up front in fill_mempool, discourage wallet mixing (glozow) Pull request description: Motivated by the discussion in #28970 (https://github.com/bitcoin/bitcoin/pull/28970#discussion_r1553911167), this PR adds test coverage for the logic around the `m_recent_rejects` filter, in particular that the filter is cleared after a new block comes in: https://github.com/bitcoin/bitcoin/blob/f0794cbd405636a7f528a60f2873050b865cf7e8/src/net_processing.cpp#L2199-L2206 As expected, the second part of the test fails if the following patch is applied: ```diff diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 6996af38cb..5cb1090e70 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -2202,7 +2202,7 @@ bool PeerManagerImpl::AlreadyHaveTx(const GenTxid& gtxid) // or a double-spend. Reset the rejects filter and give those // txs a second chance. hashRecentRejectsChainTip = m_chainman.ActiveChain().Tip()->GetBlockHash(); - m_recent_rejects.reset(); + //m_recent_rejects.reset(); } const uint256& hash = gtxid.GetHash(); ``` I'm still not sure in which file this test fits best, and if there is already test coverage for the first part of the test somewhere. Happy for any suggestions. ACKs for top commit: maflcko: ACK 60ca5d55081275a011ccfc9546e0c4a8c4030493 🍳 glozow: code review ACK 60ca5d55081275a011ccfc9546e0c4a8c4030493 instagibbs: ACK 60ca5d55081275a011ccfc9546e0c4a8c4030493 Tree-SHA512: 9cab43858e8f84db04a708151e6775c9cfc68c20ff53096220eac0b2c406f31aaf9223e8e04be345e95bf0a3f6dd15efac50b0ebeb1582a48a4560b3ab0bcba5
2024-04-19test: Fix intermittent issue in p2p_handshake.pystratospher
If we reuse the same port when disconnecting and establishing connections again, we might hit this scenario: - disconnection is done on python side for P2PConnection - disconnection is not complete on c++ side for TestNode - we're trying to establish a new connection on same port again Prevent this scenario from happening by ensuring disconnection on c++ side for TestNode as well.
2024-04-17Merge bitcoin/bitcoin#29893: test: fix intermittent failure in ↵glozow
p2p_compactblocks_hb.py 1ae5b208d339fa984d9caf4fab89b0b2ba9cc197 test: fix intermittent failure in p2p_compactblocks_hb.py (Martin Zumsande) Pull request description: Fixes #29860 As a result of node1 receiving a block, it sends out SENDCMPCT messages to some of its peers to update the high-bandwidth status. We need to wait until those are received and processed by the peers to avoid intermittent failures. Before, we'd only wait until all peers have synced with the new block (within `generate`) which is not sufficient. I could reproduce the failure by adding a `std::this_thread::sleep_for(std::chrono::milliseconds(1000));` sleep to the [net_processing code](https://github.com/bitcoin/bitcoin/blob/c7567d9223a927a88173ff04eeb4f54a5c02b43d/src/net_processing.cpp#L3763) that processes `NetMsgType::SENDCMPCT`. ACKs for top commit: instagibbs: ACK 1ae5b208d339fa984d9caf4fab89b0b2ba9cc197 alfonsoromanz: Tested ACK 1ae5b208d339fa984d9caf4fab89b0b2ba9cc197 glozow: ACK 1ae5b208d339fa984d9caf4fab89b0b2ba9cc197 Tree-SHA512: 47c29616e73a5e0ff966fc231e4f672c1a6892511e5c10a3905b30ad6b2a3d1267fa0a88bd8f64b523fe580199d22a43545c84e361879e5096483152065c4b9a
2024-04-16test: cover unix sockets in zmq interfaceMatthew Zipkin
2024-04-16Merge bitcoin/bitcoin#29726: assumeutxo: Fix -reindex before snapshot was ↵Ryan Ofsky
validated b7ba60f81a33db876f88b5f9af1e5025d679b5be test: add coverage for -reindex and assumeutxo (Martin Zumsande) e57f951805b429534c75ec1e6b2a1f16ae24efb5 init, validation: Fix -reindex option with an existing snapshot (Martin Zumsande) Pull request description: In c711ca186f8d8a28810be0beedcb615ddcf93163 logic was introduced that `-reindex` and `-reindex-chainstate` will delete the snapshot chainstate. This doesn't work currently, instead of deleting the snapshot chainstate the node crashes with an assert (this can be triggered by applying the added test commit on master). Fix this, and another bug that would prevent the new active chainstate from having a mempool after `-reindex` has deleted the snapshot (also covered by the test). ACKs for top commit: fjahr: re-ACK b7ba60f81a33db876f88b5f9af1e5025d679b5be hernanmarino: crACK b7ba60f81a33db876f88b5f9af1e5025d679b5be . Good fix BrandonOdiwuor: re-ACK b7ba60f81a33db876f88b5f9af1e5025d679b5be byaye: Tested ACK b7ba60f81a33db876f88b5f9af1e5025d679b5be Tree-SHA512: c168f36997d7677d590af37b10427870f5d30123abf1c76032a16661e486735373bfa7e049e6aca439526fbcb6d619f970bf9d042196c851bf058a75a32fafdc
2024-04-16test: fix intermittent failure in p2p_compactblocks_hb.pyMartin Zumsande
As a result of node1 receiving a block, it sends out SENDCMPCT messages to its peers to update the status. We need to wait until those are received and processed by the peers to avoid intermittent failures.
2024-04-16wallet: return and display signer errorSjors Provoost
Both RPC and GUI now render a useful error message instead of (silently) failing. Replace bool with util::Result<void> to clarify that this either succeeds or returns an error message.
2024-04-16wallet: compare address returned by displayaddressSjors Provoost
Update external signer documentation to reflect this requirement, which HWI already implements.
2024-04-16test: use h marker for external signer mockSjors Provoost
Consistent with #26076
2024-04-15test: p2p: add test for rejected tx request logic (`m_recent_rejects` filter)Sebastian Falbesoner
2024-04-15fixup: get all utxos up front in fill_mempool, discourage wallet mixingglozow
Co-authored-by: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2024-04-15Merge bitcoin/bitcoin#29869: rpc, bugfix: Enforce maximum value for setmocktimeglozow
c2e0489b7125cceaeef355fc274dd8988822fff4 [rpc, bugfix] Enforce maximum value for setmocktime (dergoegge) Pull request description: The maximum value for our mocktime must be representable in nanoseconds, otherwise we end up with negative values returned from `NodeClock::now()`. Found through fuzzing: ``` $ echo "c2V0bW9ja3RpbWVcZTptYf9w/3NldG3///////////////9p////ZP///ymL//////89////Nv9L////////LXkBAABpAA==" | base64 --decode > rpc-8cab9148ab4418ebd1923c213e9d3fe9c9b49b39.crash $ FUZZ=rpc ./src/test/fuzz/fuzz rpc-8cab9148ab4418ebd1923c213e9d3fe9c9b49b39.crash fuzz_libfuzzer: util/time.cpp:28: static NodeClock::time_point NodeClock::now(): Assertion `ret > 0s' failed. ``` ACKs for top commit: maflcko: re-ACK c2e0489b7125cceaeef355fc274dd8988822fff4 brunoerg: crACK c2e0489b7125cceaeef355fc274dd8988822fff4 glozow: ACK c2e0489b7125cceaeef355fc274dd8988822fff4 Tree-SHA512: d7e237ca37bedd74a6b085fb6e726a142705371044c77488f593f35afe70aeca756fdba86920294b1d322c7a9b2cde9ce4e1b7d410a6ccc1fd7c6f3a6e77200a
2024-04-15Merge bitcoin/bitcoin#29699: test: check disconnection when sending ↵glozow
sendaddrv2 after verack b4c9ace6ff36c54755e4b12f204212c1b938f509 test: check disconnection when sending sendaddrv2 after verack (brunoerg) Pull request description: This PR adds test coverage for: https://github.com/bitcoin/bitcoin/blob/71b63195b30b2fa0dff20ebb262ce7566dd5d673/src/net_processing.cpp#L3796-L3807 ACKs for top commit: maflcko: lgtm ACK b4c9ace6ff36c54755e4b12f204212c1b938f509 byaye: Tested ACK b4c9ace6ff36c54755e4b12f204212c1b938f509 Tree-SHA512: 2ad49a269cb64794b8d626941cf532acafdbe6e97f3da5ccb52f3201a6773d2f5e3d7d62ce4289334b85d578790d4dd5833f6b8ba54bd49a8418a20aee0c3e5f
2024-04-15[rpc, bugfix] Enforce maximum value for setmocktimedergoegge
2024-04-11Merge bitcoin/bitcoin#29849: Fix typos in `subprocess.hpp`merge-script
13f5391bbb45cd8aebc6ae70cad08aff632ebd55 Fix typos in `subprocess.hpp` (Hennadii Stepanov) Pull request description: Resolves one item in the https://github.com/bitcoin/bitcoin/pull/28981#pullrequestreview-1991272752: > - Remove linter exclusions and fix all issues. Based on upstream https://github.com/arun11299/cpp-subprocess/pull/101. ACKs for top commit: fanquake: ACK 13f5391bbb45cd8aebc6ae70cad08aff632ebd55 Tree-SHA512: 2ee27a5b7d1ba6f47a5148add155c918eadaaffb94a4b5dd3edea00e63440b87291c559361bf25a8db1567debff78cf7e9466dc34f14331ca1d426994837df93
2024-04-11Merge bitcoin/bitcoin#29735: AcceptMultipleTransactions: Fix workspace not ↵glozow
being set as client_maxfeerate failure 4ba1d0b55339c3ea90e2bcd64662a06f0f90dd46 fuzz: Add coverage for client_maxfeerate (Greg Sanders) 91d7d8f22a1c528db14fa743c66cd861ea00e84b AcceptMultipleTransactions: Fix workspace client_maxfeerate (Greg Sanders) f3aa5bd5eb6d1088f98a4dc7daaab0e17a7d5529 fill_mempool: assertions and docsctring update (Greg Sanders) a3da63e8febe475f2250f6432bca237d31fa9107 Move fill_mempool to util function (Greg Sanders) 73b68bd8b4f9447e30091c7f8c3dc91a086bd93b fill_mempool: remove subtest-specific comment (Greg Sanders) Pull request description: Bug causes an `Assume()` failure due to the expectation that the individual result should be invalid when done over `submitpackage` via rpc. Bug introduced by https://github.com/bitcoin/bitcoin/pull/28950 , and I discovered it rebasing https://github.com/bitcoin/bitcoin/pull/28984 since it's easier to hit in that test scenario. Tests in place were only checking `AcceptSingleTransaction`-level checks due to package evaluation only triggering when minfee is too high for the parent transaction. Added test along with fix, moving the fill_mempool utility into a common area for re-use. ACKs for top commit: glozow: reACK 4ba1d0b55339c3ea90e2bcd64662a06f0f90dd46 theStack: ACK 4ba1d0b55339c3ea90e2bcd64662a06f0f90dd46 ismaelsadeeq: re-ACK https://github.com/bitcoin/bitcoin/commit/4ba1d0b55339c3ea90e2bcd64662a06f0f90dd46 via [diff](https://github.com/bitcoin/bitcoin/compare/4fe7d150eb3c85a6597d8fc910fe1490358197ad..4ba1d0b55339c3ea90e2bcd64662a06f0f90dd46) Tree-SHA512: 3729bdf7f25d04e232f173ccee04ddbb2afdaafa3d04292a01cecf58fb11b3b2bc133e8490277f1a67622b62d17929c242dc980f9bb647896beea4332ee35306
2024-04-11Fix typos in `subprocess.hpp`Hennadii Stepanov
2024-04-10Merge bitcoin/bitcoin#28981: Replace Boost.Process with cpp-subprocessmerge-script
d5a715536e497c160a2520f81334aab6c7490213 build: remove boost::process dependency for building external signer support (Sebastian Falbesoner) 70434b1c443d9251a880d0193af771f574c40617 external_signer: replace boost::process with cpp-subprocess (Sebastian Falbesoner) cc8b9875b104c31f0a5b5e4195a8278ec55f35f7 Add `cpp-subprocess` header-only library (Hennadii Stepanov) Pull request description: Closes https://github.com/bitcoin/bitcoin/issues/24907. This PR is based on **theStack**'s [work](https://github.com/bitcoin/bitcoin/issues/24907#issuecomment-1466087049). The `subprocess.hpp` header has been sourced from the [upstream repo](https://github.com/arun11299/cpp-subprocess) with the only modification being the removal of convenience functions, which are not utilized in our codebase. Windows-related changes will be addressed in subsequent follow-ups. ACKs for top commit: achow101: reACK d5a715536e497c160a2520f81334aab6c7490213 Sjors: re-tACK d5a715536e497c160a2520f81334aab6c7490213 theStack: Light re-ACK d5a715536e497c160a2520f81334aab6c7490213 fanquake: ACK d5a715536e497c160a2520f81334aab6c7490213 - with the expectation that this code is going to be maintained as our own. Next PRs should: Tree-SHA512: d7fb6fecc3f5792496204190afb7d85b3e207b858fb1a75efe483c05260843b81b27d14b299323bb667c990e87a07197059afea3796cf218ed8b614086bd3611
2024-04-09AcceptMultipleTransactions: Fix workspace client_maxfeerateGreg Sanders
If we do not set the Failure for the workspace when there is a client_maxfeerate related error, we hit an Assume() to the contrary. Properly set it.
2024-04-09fill_mempool: assertions and docsctring updateGreg Sanders
2024-04-09Move fill_mempool to util functionGreg Sanders
2024-04-09Merge bitcoin/bitcoin#29821: fuzz: Some `test/fuzz/test_runner.py` improvementsfanquake
47cedee776c6253232beb6039ea708c578211327 fuzz: Introduce `BITCOINFUZZ` environment variable (Hennadii Stepanov) 1573e9a11e7a204a51f815a4c48c4b7054303ca9 fuzz, refactor: Deduplicate fuzz binary path creation (Hennadii Stepanov) Pull request description: These changes are split from https://github.com/bitcoin/bitcoin/pull/29774 and can be beneficial on their own. The new `BITCOINFUZZ` environment variable complements the already existing set of variables used by tests: https://github.com/bitcoin/bitcoin/blob/b5d21182e5a66110ce2796c2c99da39c8ebf0d72/test/functional/test_framework/test_framework.py#L238-L243 ACKs for top commit: maflcko: lgtm ACK 47cedee776c6253232beb6039ea708c578211327 davidgumberg: utACK https://github.com/bitcoin/bitcoin/pull/29821/commits/47cedee776c6253232beb6039ea708c578211327 Tree-SHA512: 45809cfd13dc4a45c44cc433184352e84726cb95bea80fd8f581c59a0b8b0a5495260ff66922f9c57c38adbdbdd102439238f370fd49d6ea27a241a5e6249895
2024-04-09Merge bitcoin/bitcoin#29498: test: Update --tmpdir doc string to say ↵fanquake
directory must not exist d4e36ae80d4b3f03647fd9057461edf7ecd794a3 test: Update --tmpdir doc string to say directory must not exist (kevkevin) Pull request description: The error message given if passing an existing dir to --tmpdir is confusing so this makes it clear that the directory must not already exist This change is motivated by this comment https://github.com/bitcoin/bitcoin/pull/29335#issuecomment-1960913020 ACKs for top commit: maflcko: lgtm ACK d4e36ae80d4b3f03647fd9057461edf7ecd794a3 davidgumberg: ACK https://github.com/bitcoin/bitcoin/pull/29498/commits/d4e36ae80d4b3f03647fd9057461edf7ecd794a3 Tree-SHA512: fb31fd079767abbf94076615817943f35f5c9262fc97e65c631a18d33b3a343fe6a2d151613256e632d2b372ab2de0435f4712309b4a77ed3c663fd93a7dcdd1
2024-04-08fill_mempool: remove subtest-specific commentGreg Sanders
2024-04-07Merge bitcoin/bitcoin#29822: test: remove immediate tx relay workaround in ↵fanquake
wallet_groups.py 93fae5ae7c31fa1b1095770f00adeac1cfeda4b9 test: remove immediate tx relay workaround in wallet_groups.py (Sebastian Falbesoner) Pull request description: Reverts commit ab4efad51b9ba276ffeb6871931e13772493f7cc (PR #26970). This workaround is not needed anymore, as since #27114 the test sets the noban permission for both in- and outbound connections via the `noban_tx_relay` setting, and we don't have to rely on this topology hack anymore. See commit c985eb854cc86deb747caea5283c17cf51b6a983 (kudos to brunoerg!). Can be tested by executing `$ time ./test/functional/wallet_groups.py` both on master and PR and verifying that the execution time is roughly equal. ACKs for top commit: maflcko: lgtm ACK 93fae5ae7c31fa1b1095770f00adeac1cfeda4b9 brunoerg: utACK 93fae5ae7c31fa1b1095770f00adeac1cfeda4b9 Tree-SHA512: b949fd05b4308815ba02d0ee4d1318f642b930288dd03223f46db7db745177af1c070bc7058743ac27963c5ad90564089867cc12f31fee94812a16919c353bab
2024-04-07Merge bitcoin/bitcoin#29791: test: Bump timeouts in feature_index_prune and ↵fanquake
wallet_importdescriptors 49c0b8b2288e60ae22fcac5d03811cf36ecec058 test: Bump timeouts in feature_index_prune and wallet_importdescriptors (Christopher Bergqvist) Pull request description: Timeout issues where encountered when running functional tests with `--jobs=16 --extended`. Note that running `--extended` without `--jobs=16` does not trigger the issues. Tested under NixOS on a Xeon CPU with 16 logical cores. (A few tests are skipped locally as I haven't enabled BPF and a few other things). ## Measurements Line in `feature_index_prune.py` took 101.6s, 96.6s, 103.0s across 3 runs on my machine. Default limit is 60, suggested to increase limit to 150 seconds. Line in the `wallet_importdescriptors.py --descriptors` took 5.4s, 5.7s, 6.0s across 3 runs. Suggested to increase from 5 to 10 seconds. ## Logs Output slightly modified by separate change that lets code run past given timeouts and the provides more information - "Took 101.6 seconds to complete, 69.4% over the given limit.". <details> <summary> Click to expand. </summary> ### feature_index_prune.py ``` 52/305 - feature_index_prune.py failed, Duration: 250 s stdout: 2024-04-01T22:25:24.010000Z TestFramework (INFO): PRNG seed is: 990421162716295219 2024-04-01T22:25:24.014000Z TestFramework (INFO): Initializing test directory /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302 2024-04-01T22:25:24.913000Z TestFramework (INFO): check if we can access blockfilters and coinstats when pruning is enabled but no blocks are actually pruned 2024-04-01T22:26:48.417000Z TestFramework (INFO): prune some blocks 2024-04-01T22:26:48.460000Z TestFramework (INFO): check if we can access the tips blockfilter and coinstats when we have pruned some blocks 2024-04-01T22:26:48.483000Z TestFramework (INFO): check if we can access the blockfilter and coinstats of a pruned block 2024-04-01T22:26:59.175000Z TestFramework (INFO): make sure trying to access the indices throws errors 2024-04-01T22:27:50.422000Z TestFramework (INFO): prune exactly up to the indices best blocks while the indices are disabled 2024-04-01T22:27:52.596000Z TestFramework (INFO): make sure that we can continue with the partially synced indices after having pruned up to the index height 2024-04-01T22:29:34.242000Z TestFramework.utils (ERROR): wait_until() failed. Predicate: ''' self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150) ''' 2024-04-01T22:29:34.244000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 132, in main self.run_test() File "/home/chris/Documents/Code/bitcoin-core/test/functional/feature_index_prune.py", line 117, in run_test self.sync_index(height=1500) File "/home/chris/Documents/Code/bitcoin-core/test/functional/feature_index_prune.py", line 34, in sync_index self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 780, in wait_until return wait_until_helper_internal(test_function, timeout=timeout, timeout_factor=self.options.timeout_factor) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/util.py", line 305, in wait_until_helper_internal raise AssertionError(m) AssertionError: Predicate ''' self.wait_until(lambda: self.nodes[1].getindexinfo() == expected_stats)#, timeout=150) ''' not true after 60 seconds. Took 101.6 seconds to complete, 69.4% over the given limit. 2024-04-01T22:29:34.298000Z TestFramework (INFO): Stopping nodes 2024-04-01T22:29:34.511000Z TestFramework (WARNING): Not cleaning up dir /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302 2024-04-01T22:29:34.511000Z TestFramework (ERROR): Test failed. Test logging available at /mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302/test_framework.log 2024-04-01T22:29:34.511000Z TestFramework (ERROR): 2024-04-01T22:29:34.512000Z TestFramework (ERROR): Hint: Call /home/chris/Documents/Code/bitcoin-core/test/functional/combine_logs.py '/mnt/tmp/test_runner_₿_🏃_20240402_002516/feature_index_prune_302' to consolidate all logs 2024-04-01T22:29:34.512000Z TestFramework (ERROR): 2024-04-01T22:29:34.512000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 2024-04-01T22:29:34.512000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 2024-04-01T22:29:34.512000Z TestFramework (ERROR): stderr: 53/305 - p2p_blockfilters.py passed, Duration: 130 s ``` ### wallet_importdescriptors.py --descriptors ``` 297/305 - wallet_importdescriptors.py --descriptors failed, Duration: 76 s stdout: 2024-04-01T22:48:27.663000Z TestFramework (INFO): PRNG seed is: 8528678505617325332 2024-04-01T22:48:27.664000Z TestFramework (INFO): Initializing test directory /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98 2024-04-01T22:48:28.021000Z TestFramework (INFO): Setting up wallets 2024-04-01T22:48:28.100000Z TestFramework (INFO): Mining coins 2024-04-01T22:48:29.714000Z TestFramework (INFO): Import should fail if a descriptor is not provided 2024-04-01T22:48:29.725000Z TestFramework (INFO): Should import a p2pkh descriptor 2024-04-01T22:48:29.740000Z TestFramework (INFO): Test can import same descriptor with public key twice 2024-04-01T22:48:29.760000Z TestFramework (INFO): Test can update descriptor label 2024-04-01T22:48:29.785000Z TestFramework (INFO): Internal addresses cannot have labels 2024-04-01T22:48:29.788000Z TestFramework (INFO): Internal addresses should be detected as such 2024-04-01T22:48:29.854000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor without checksum 2024-04-01T22:48:29.855000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor that has range specified 2024-04-01T22:48:29.858000Z TestFramework (INFO): Should not import a p2sh-p2wpkh descriptor and have it set to active 2024-04-01T22:48:29.860000Z TestFramework (INFO): Should import a (non-active) p2sh-p2wpkh descriptor 2024-04-01T22:48:29.984000Z TestFramework (INFO): Should import a 1-of-2 bare multisig from descriptor 2024-04-01T22:48:30.002000Z TestFramework (INFO): Should not treat individual keys from the imported bare multisig as watchonly 2024-04-01T22:48:30.005000Z TestFramework (INFO): Ranged descriptors cannot have labels 2024-04-01T22:48:30.014000Z TestFramework (INFO): Private keys required for private keys enabled wallet 2024-04-01T22:48:30.027000Z TestFramework (INFO): Ranged descriptor import should warn without a specified range 2024-04-01T22:48:30.065000Z TestFramework (INFO): Should not import a ranged descriptor that includes xpriv into a watch-only wallet 2024-04-01T22:48:30.070000Z TestFramework (INFO): Should not import a descriptor with hardened derivations when private keys are disabled 2024-04-01T22:48:30.108000Z TestFramework (INFO): Verify we can only extend descriptor's range 2024-04-01T22:48:30.364000Z TestFramework (INFO): Check we can change descriptor internal flag 2024-04-01T22:48:30.536000Z TestFramework (INFO): Key ranges should be imported in order 2024-04-01T22:48:30.708000Z TestFramework (INFO): Check we can change next_index 2024-04-01T22:48:30.838000Z TestFramework (INFO): Check imported descriptors are not active by default 2024-04-01T22:48:30.870000Z TestFramework (INFO): Check can activate inactive descriptor 2024-04-01T22:48:30.903000Z TestFramework (INFO): Check can deactivate active descriptor 2024-04-01T22:48:30.924000Z TestFramework (INFO): Verify activation state is persistent 2024-04-01T22:48:30.973000Z TestFramework (INFO): Should import a descriptor with a WIF private key as spendable 2024-04-01T22:48:30.987000Z TestFramework (INFO): Test can import same descriptor with private key twice 2024-04-01T22:48:32.173000Z TestFramework (INFO): Test that multisigs can be imported, signed for, and getnewaddress'd 2024-04-01T22:48:43.803000Z TestFramework (INFO): Multisig with distributed keys 2024-04-01T22:48:48.895000Z TestFramework (INFO): We can create and use a huge multisig under P2WSH 2024-04-01T22:49:05.628000Z TestFramework (INFO): Under P2SH, multisig are standard with up to 15 compressed keys 2024-04-01T22:49:20.258000Z TestFramework (INFO): Amending multisig with new private keys 2024-04-01T22:49:23.306000Z TestFramework (INFO): Combo descriptors cannot be active 2024-04-01T22:49:23.313000Z TestFramework (INFO): Descriptors with no type cannot be active 2024-04-01T22:49:23.348000Z TestFramework (INFO): Test importing a descriptor to an encrypted wallet 2024-04-01T22:49:43.957000Z TestFramework (ERROR): Assertion failed Traceback (most recent call last): File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_framework.py", line 132, in main self.run_test() File "/home/chris/Documents/Code/bitcoin-core/test/functional/wallet_importdescriptors.py", line 691, in run_test with self.nodes[0].assert_debug_log(expected_msgs=["Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)"], timeout=5):#10): File "/nix/store/rac8pxbi1vapwrlqzbrkycbyg521djzw-python3-3.11.6/lib/python3.11/contextlib.py", line 144, in __exit__ next(self.gen) File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_node.py", line 493, in assert_debug_log self._raise_assertion_error(f'Expected messages "{expected_msgs}" found too late, took {now - start:.1f} seconds, {((now - start) / (time_end - start)) - 1:.1%} over the given limit. Log:\n\n{print_log}\n\n') File "/home/chris/Documents/Code/bitcoin-core/test/functional/test_framework/test_node.py", line 188, in _raise_assertion_error raise AssertionError(self._node_msg(msg)) AssertionError: [node 0] Expected messages "['Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks)']" found too late, took 5.4 seconds, 8.9% over the given limit. Log: - 2024-04-01T22:49:33.066512Z [http] [httpserver.cpp:306] [http_request_cb] [http] Received a POST request for /wallet/encrypted_wallet from 127.0.0.1:47658 - 2024-04-01T22:49:33.066668Z [httpworker.0] [rpc/request.cpp:187] [parse] [rpc] ThreadRPCServer method=importdescriptors user=__cookie__ - 2024-04-01T22:49:33.070999Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT INTO main VALUES(?, ?) - 2024-04-01T22:49:33.071061Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: DELETE FROM main WHERE key = ? - 2024-04-01T22:49:33.071137Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: BEGIN TRANSACTION - 2024-04-01T22:49:33.074190Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) - 2024-04-01T22:49:33.075564Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) ...<thousands of almost identical lines>... - 2024-04-01T22:49:38.416139Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) - 2024-04-01T22:49:38.416528Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) - 2024-04-01T22:49:38.427946Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: COMMIT TRANSACTION - 2024-04-01T22:49:38.429778Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) - 2024-04-01T22:49:38.429916Z [httpworker.0] [wallet/sqlite.cpp:57] [TraceSqlCallback] [/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/node0/regtest/wallets/encrypted_wallet/wallet.dat] SQLite Statement: INSERT or REPLACE into main values(?, ?) - 2024-04-01T22:49:38.430001Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] Setting spkMan to active: id = c6149b35399517457b0b1d8ccdd7efda25a2f20fc7f8167adda8e79b10e260b7, type = legacy, internal = false - 2024-04-01T22:49:38.430134Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] RescanFromTime: Rescanning last 329 blocks - 2024-04-01T22:49:38.430170Z [httpworker.0] [wallet/wallet.h:933] [WalletLogPrintf] [encrypted_wallet] Rescan started from block 0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206... (slow variant inspecting all blocks) - 2024-04-01T22:49:38.441914Z [httpworker.0] [wallet/scriptpubkeyman.h:258] [WalletLogPrintf] [encrypted_wallet] MarkUnusedAddresses: Detected a used keypool item at index 4000, mark all keypool items up to this item as used 2024-04-01T22:49:44.029000Z TestFramework (INFO): Stopping nodes 2024-04-01T22:49:44.132000Z TestFramework (WARNING): Not cleaning up dir /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98 2024-04-01T22:49:44.132000Z TestFramework (ERROR): Test failed. Test logging available at /mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98/test_framework.log 2024-04-01T22:49:44.132000Z TestFramework (ERROR): 2024-04-01T22:49:44.133000Z TestFramework (ERROR): Hint: Call /home/chris/Documents/Code/bitcoin-core/test/functional/combine_logs.py '/mnt/tmp/test_runner_₿_🏃_20240402_004231/wallet_importdescriptors_98' to consolidate all logs 2024-04-01T22:49:44.133000Z TestFramework (ERROR): 2024-04-01T22:49:44.133000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log. 2024-04-01T22:49:44.133000Z TestFramework (ERROR): https://github.com/bitcoin/bitcoin/issues 2024-04-01T22:49:44.133000Z TestFramework (ERROR): stderr: Remaining jobs: [feature_pruning.py, feature_dbcrash.py, feature_assumeutxo.py, rpc_scantxoutset.py, feature_coinstatsindex.py, p2p_node_network_limited.py --v1transport, p2p_node_network_limited.py --v2transport, feature_config_args.py] 298/305 - p2p_node_network_limited.py --v1transport passed, Duration: 24 s ``` </details> ## Related Almost identical timeout in `feature_index_prune.py` in #27091 on MacOS, and for `wallet_importdescriptors.py --descriptors` in #27282 on Alpine & CI. ACKs for top commit: maflcko: lgtm ACK 49c0b8b2288e60ae22fcac5d03811cf36ecec058 tdb3: ACK for 49c0b8b2288e60ae22fcac5d03811cf36ecec058 itornaza: approach ACK 49c0b8b2288e60ae22fcac5d03811cf36ecec058 BrandonOdiwuor: crACK 49c0b8b2288e60ae22fcac5d03811cf36ecec058 Tree-SHA512: f62ade74701588d76bfe838b7e7bbda1db38fd98688fd5d13c2c008064027add2ee9d053dee602d84919fab4c9bf53183c31819d94a6174066f237d0f6a62086
2024-04-06test: remove immediate tx relay workaround in wallet_groups.pySebastian Falbesoner
Reverts commit ab4efad51b9ba276ffeb6871931e13772493f7cc (PR #26970). This workaround is not needed anymore, as since #27114 the test sets the noban permission for both in- and outbound connections via the `noban_tx_relay` setting, and we don't have to rely on these topology hacks anymore. See commit c985eb854cc86deb747caea5283c17cf51b6a983.
2024-04-06fuzz: Introduce `BITCOINFUZZ` environment variableHennadii Stepanov
The `BITCOINFUZZ` environment variable allows to override the default path to the fuzz binary. It complements the already existing set of variables used by tests: - BITCOIND - BITCOINCLI - BITCOINUTIL - BITCOINWALLET
2024-04-06fuzz, refactor: Deduplicate fuzz binary path creationHennadii Stepanov
2024-04-05test: add unit tests for `calculate_input_weight`Sebastian Falbesoner
2024-04-05test: introduce and use `calculate_input_weight` helperSebastian Falbesoner
Rather than manually estimating an input's weight by adding up all the involved components (fixed-size skeleton, compact-serialized lengths, and the actual scriptSig / witness stack items) we can simply take use of the serialization classes `CTxIn` / `CTxInWitness` instead, to achieve the same with significantly less code. The new helper is used in the functional tests rpc_psbt.py and wallet_send.py, where the previous manual estimation code was duplicated.
2024-04-02test: Bump timeouts in feature_index_prune and wallet_importdescriptorsChristopher Bergqvist
Timeout issues where encountered when running functional tests with `--jobs=16 --extended`. Line in `feature_index_prune.py` took 101.6s, 96.6s, 103.0s across 3 runs on my machine, default limit is 60. Line in the `wallet_importdescriptors.py --descriptors` took 5.4s, 5.7s, 6.0s across 3 runs.
2024-04-02Merge bitcoin/bitcoin#29750: test: makes timeout a forced named argument in ↵fanquake
tests methods that use it 61560d5e939034e1a94d95cdc5c498095ab4fddb test: makes timeout a forced named argument in tests methods that use it (Sergi Delgado Segura) Pull request description: This makes calls to such methods more explicit and less error-prone. Motivated by https://github.com/bitcoin/bitcoin/pull/29736#discussion_r1540654057 ACKs for top commit: maflcko: lgtm ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb brunoerg: ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb BrandonOdiwuor: crACK 61560d5e939034e1a94d95cdc5c498095ab4fddb AngusP: ACK 61560d5e939034e1a94d95cdc5c498095ab4fddb stratospher: tested ACK 61560d5. Tree-SHA512: 8d6ec3fe1076c868ddbd3050f3c242dbd83cc123f560db3d3b0ed74968e6050dc9ebf4e7c716af9cc1b290c97d736c2fc2ac936b0b69ebdbceed934dae7d55d9
2024-04-01Merge bitcoin/bitcoin#29753: test: fix StopIteration exception in ↵fanquake
p2p_node_network_limited.py 2eb5175de87c798af328de3f2147aac7879eaa10 test: fix StopIteration exception in p2p_node_network_limited.py (furszy) Pull request description: Fixes #29731 The `next()` call throws an exception if the default parameter is omitted and the iterator is exhausted. Fix it by providing a default value. The failure can be tested by commenting out lines 90 and 91 in the test (the `self.connect_nodes(2, 0)`). Since there is no connection, the node in question retrieves a single element in the 'getchaintips()' call. This scenario without the fix, aborts the test right away, throwing an `StopIteration` exception, and with the fix, the test properly waits until the timeout (`wait_until()` call). ACKs for top commit: maflcko: review ACK 2eb5175de87c798af328de3f2147aac7879eaa10 brunoerg: crACK 2eb5175de87c798af328de3f2147aac7879eaa10 BrandonOdiwuor: crACK 2eb5175de87c798af328de3f2147aac7879eaa10 tdb3: Tested ACK for 2eb5175de87c798af328de3f2147aac7879eaa10. Tree-SHA512: b0873eb4d3334146fd250cd2cd23add3e744877033c8bfa4eb8dff36633100604adf49dd7846856ddfa88c9768663f095db705c00eef3641618df8fc13f8c2c5
2024-04-01Merge bitcoin/bitcoin#29738: doc: fix typosfanquake
601edd8ee8810b5c6b2184ce8d7f7b45e70913cf ci: use codespell 2.2.6 (fanquake) 52fa0d285f4e8109ebdd8b1e43c897f6bfaa8e65 doc: fix some typos (crazeteam) b5ed13a2408a141d737341137b26b2f0249c8167 doc: Fix typos (RoboSchmied) Pull request description: Combines the recent PRs to fix typos so they can be merged. ACKs for top commit: brunoerg: crACK 601edd8ee8810b5c6b2184ce8d7f7b45e70913cf tdb3: crACK 601edd8ee8810b5c6b2184ce8d7f7b45e70913cf kristapsk: cr utACK 601edd8ee8810b5c6b2184ce8d7f7b45e70913cf Tree-SHA512: d054b1dad1336d6b9291cc5d5252d4debf6424a993d4edd6a97d7c15055a7fc48a333d30967f72e7dc9c6c1d9a9038ca8bb5e219c529f4c2365ea48404a508d0
2024-03-29Merge bitcoin/bitcoin#29130: wallet: Add `createwalletdescriptor` and ↵Ryan Ofsky
`gethdkeys` RPCs for adding new automatically generated descriptors 746b6d88395607abbd3c13bbdcdd4ca83e9bc9e4 test: Add test for createwalletdescriptor (Ava Chow) 2402b6306215a9ee8d5f4068ea81f4e7f324adeb wallet: Test upgrade of pre-taproot wallet to have tr() descriptors (Ava Chow) 460ae1bf67c0051033c1802d44787d173abb9248 wallet, rpc: Add createwalletdescriptor RPC (Ava Chow) 8e1a475062e62321e58a0624385cc3fa0885aa12 wallet: Be able to retrieve single key from descriptors (Ava Chow) 85b1fb19dd3a3f3c68da1c5e60a6eb911e1119a6 wallet: Add GetActiveHDPubKeys to retrieve xpubs from active descriptors (Ava Chow) 73926f2d31b61ff78d5f0c8f9b5e3130fb1f9620 wallet, descspkm: Refactor wallet descriptor generation to standalone func (Andrew Chow) 54e74f46ea10e479be682750c1279165f29bb2f4 wallet: Refactor function for single DescSPKM setup (Andrew Chow) 3b09d0eb7f2c1d6ebdab73d18db28e5bf7d74f18 tests: Test for gethdkeys (Ava Chow) 5febe28c9e131fb93fac9c35f80c42759654f150 wallet, rpc: Add gethdkeys RPC (Ava Chow) 66632e5c24c1b59afef1e89b562fbd0117ab6ef5 wallet: Add IsActiveScriptPubKeyMan (Ava Chow) fa6a259985b61235ebc21eae2a76014cc9437d5f desc spkm: Add functions to retrieve specific private keys (Ava Chow) fe67841464cc0f970a1c233caba92cb78e9c78dc descriptor: Be able to get the pubkeys involved in a descriptor (Ava Chow) ef6745879d87cdb6f1061337867a689167e965a1 key: Add constructor for CExtKey that takes CExtPubKey and CKey (Ava Chow) Pull request description: This PR adds a `createwalletdescriptor` RPC which allows users to add new automatically generated descriptors to their wallet, e.g. to upgrade a 0.21.x wallet to contain a taproot descriptor. This RPC takes 3 arguments: the output type to create a descriptor for, whether the descriptor will be internal or external, and the HD key to use if the user wishes to use a specific key. The HD key is an optional parameter. If it is not specified, the wallet will use the key shared by the active descriptors, if they are all single key. For most users in the expected upgrade scenario, this should be sufficient. In more advanced cases, the user must specify the HD key to use. Currently, specified HD keys must already exist in the wallet. To make it easier for the user to know, `gethdkeys` is also added to list out the HD keys in use by all of the descriptors in the wallet. This will include all HD keys, whether we have the private key, for it, which descriptors use it and their activeness, and optionally the extended private key. In this way, users with more complex wallets will be still be able to get HD keys from their wallet for use in other scenarios, and if they want to use `createwalletdescriptor`, they can easily get the keys that they can specify to it. See also https://github.com/bitcoin/bitcoin/pull/26728#issuecomment-1866961865 ACKs for top commit: Sjors: re-utACK 746b6d88395607abbd3c13bbdcdd4ca83e9bc9e4 furszy: ACK 746b6d8 ryanofsky: Code review ACK 746b6d88395607abbd3c13bbdcdd4ca83e9bc9e4, and this looks ready to merge. There were various suggested changes since last review where main change seems to be switching `gethdkeys` output to use normalized descriptors (removing hardened path components). Tree-SHA512: f2849101e6fbf1f59cb031eaaaee97af5b1ae92aaab54c5716940d210f08ab4fc952df2725b636596cd5747b8f5beb1a7a533425bc10d09da02659473516fbda
2024-03-28test: add coverage for -reindex and assumeutxoMartin Zumsande
Co-authored-by: Fabian Jahr <fjahr@protonmail.com>
2024-03-28test: check disconnection when sending sendaddrv2 after verackbrunoerg
2024-03-27test: fix StopIteration exception in p2p_node_network_limited.pyfurszy
The `next()` call throws an exception if the default parameter is omitted and the iterator is exhausted. Fix it by providing a default value. The failure can be tested by commenting out lines 90 and 91 in the test (the `self.connect_nodes(2, 0)``). Since there is no connection, the node in question retrieves a single element in the 'getchaintips()' call. This scenario without the fix, aborts the test right away, throwing an StopIteration exception, and with the fix, the test properly waits until the timeout (wait_until() call).
2024-03-27Merge bitcoin/bitcoin#27307: wallet: track mempool conflicts with wallet ↵Ryan Ofsky
transactions 5952292133d6cc889f51ae771f2e0557311e1efe wallet, rpc: show mempool conflicts in `gettransaction` result (ishaanam) 54e07ee22ff16fc68583ade0d2b8ffffc81d444a wallet: track mempool conflicts (ishaanam) d64922b5903e5ffc8d2ce0e6761f99f173b60800 wallet refactor: use CWalletTx member functions to determine tx state (ishaanam) ffe5ff1fb622a8da11b66289e1b778e45e449811 scripted-diff: wallet: s/TxStateConflicted/TxStateBlockConflicted (ishaanam) 180973a94180f9849bf7cb0dab7c9177a942efb8 test: Add tests for wallet mempool conflicts (ishaanam) Pull request description: The `mempool_conflicts` variable is added to `CWalletTx`, it is a set of txids of txs in the mempool conflicting with the wallet tx or a wallet tx's parent. This PR only changes how mempool-conflicted txs are dealt with in memory. `IsSpent` now returns false for an output being spent by a mempool conflicted transaction where it previously returned true. A txid is added to `mempool_conflicts` during `transactionAddedToMempool`. A txid is removed from `mempool_conflicts` during `transactionRemovedFromMempool`. This PR also adds a `mempoolconflicts` field to the `gettransaction` wallet RPC result. Builds on #27145 Second attempt at #18600 ACKs for top commit: achow101: ACK 5952292133d6cc889f51ae771f2e0557311e1efe ryanofsky: Code review ACK 5952292133d6cc889f51ae771f2e0557311e1efe. Just small suggested changes since last review furszy: ACK 59522921 Tree-SHA512: 615779606723dbb6c2e302681d8e58ae2052ffee52d721ee0389746ddbbcf4b4c4afacf01ddf42b6405bc6f883520524186a955bf6b628fe9b3ae54cffc56a29
2024-03-27test: makes timeout a forced named argument in tests methods that use itSergi Delgado Segura
This makes calls to such methods more explicit and less error prone
2024-03-27external_signer: replace boost::process with cpp-subprocessSebastian Falbesoner
This primarily affects the `RunCommandParseJSON` utility function.
2024-03-27Add `cpp-subprocess` header-only libraryHennadii Stepanov
Upstream repo: https://github.com/arun11299/cpp-subprocess Commit: 4025693decacaceb9420efedbf4967a04cb028e7 The "Convenience Functions" section is unused in our codebase, so it has been removed.