aboutsummaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-03-26Merge #21390: test: Test improvements for UTXO set hash testsMarcoFalke
4f2653a89018fa4d24bd2a551832a7410b682600 test: Use deterministic chain in utxo set hash test (Fabian Jahr) 4973c5175c5fd1f4791ea26e8ddefd6fb11ac1c3 test: Remove wallet dependency of utxo set hash test (Fabian Jahr) 1a27af1d7b5ec18b4248ead1eaf0f381047b4b24 rpc: Improve gettxoutsetinfo help (Fabian Jahr) Pull request description: Follow-ups to #19145: - Small improvement on the help text of RPC gettxoutsetinfo - Using deterministic blockchain in the test `functional/feature_utxo_set_hash.py` - Removing wallet dependency in the test `functional/feature_utxo_set_hash.py` Split out of #19521. ACKs for top commit: MarcoFalke: review ACK 4f2653a89018fa4d24bd2a551832a7410b682600 👲 Tree-SHA512: 92927b3aa22b6324eb4fc9d346755313dec44d973aa69a0ebf80a8569b5f3a7cf3539721ebdba183737534b9e29b3e33f412515890f0d0b819878032a3bba8f9
2021-03-24Merge #21357: test: Unconditionally check for fRelay field in test frameworkMarcoFalke
39a9ec579f023ab262a1abd1f0c869be5b1f3f4d Unconditionally check for fRelay field in test framework (Troy Giorshev) Pull request description: picking up #20411 (rebased onto master) There is a discrepancy in the implementation of our p2p protocol between bitcoind and the testing framework. The fRelay field is an optional field at the end of a version message as of protocol version 70001. However, when deserializing a message in bitcoind, we don't check the version to see if it should have an fRelay field or not. Instead, we unconditionally attempt to deserialize into the field. This commit brings the testing framework in line with the implementation in core. This matters for a version message with the following fields: Version = 60000 fRelay = 1 Bitcoind would deserialize this into a version message with Version=60000 and fRelay=1, whereas (before this commit) our testing framework would deserialize this into a version message with Version=60000 and fRelay=0. ACKs for top commit: jnewbery: utACK 39a9ec579f023ab262a1abd1f0c869be5b1f3f4d Tree-SHA512: 13a23f1180b7121ba41cb85baa38094b41f4607a7c88b3384775177cb116e76faf5514760624f98a4e8a830767407c46753a7e0285158c33e0c6ce395de8f15c
2021-03-24Merge #21338: test: add functional test for anchors.datMarcoFalke
581791c62067403fbeb4e1fd88c1d80549627c94 test: add functional test for anchors.dat (bruno) Pull request description: This PR adds a functional test for anchors.dat. It creates a node and adds 2 outbound block-relay-only connections and 5 inbound connections. When the node is down, anchors.dat should contain the 2 addresses from the outbound block-relay-only connections. ACKs for top commit: MarcoFalke: Concept ACK 581791c62067403fbeb4e1fd88c1d80549627c94 hebasto: ACK 581791c62067403fbeb4e1fd88c1d80549627c94 Tree-SHA512: 77038b09e36ee5ae473a26d6f566c0ed283af258c34df8486706a24f72b05abab621a293ac886d03849bc45bc28be7336137252225b25aff393baa6b5238688c
2021-03-23Unconditionally check for fRelay field in test frameworkTroy Giorshev
There is a discrepancy in the implementation of our p2p protocol between bitcoind and the testing framework. The fRelay field is an optional field at the end of a version message as of protocol version 70001. However, when deserializing a message in bitcoind, we don't check the version to see if it should have an fRelay field or not. Instead we unconditionally attempt to deserialize into the field. This commit brings the testing framework in line with the implementation in core. This matters for a version message with the following fields: Version = 60000 fRelay = 1 Bitcoind would deserialize this into a version message with Version=60000 and fRelay=1, whereas (before this commit) our testing framework would deserialize this into a version message with Version=60000 and fRelay=0.
2021-03-23test: Use deterministic chain in utxo set hash testFabian Jahr
Also melts the previously separated test cases into one.
2021-03-23test: Remove wallet dependency of utxo set hash testFabian Jahr
2021-03-21Merge #21040: wallet: Fix already-loading message grammarMarcoFalke
ae9d26a8f0435e2f4b39ad1181473e6575ac67b5 wallet: Fix already-loading error message grammar (Fotis Koutoupas) Pull request description: ACKs for top commit: practicalswift: cr ACK ae9d26a8f0435e2f4b39ad1181473e6575ac67b5 prayank23: ACK https://github.com/bitcoin/bitcoin/pull/21040/commits/ae9d26a8f0435e2f4b39ad1181473e6575ac67b5 Tree-SHA512: 2f58d309dd33954f47e3ed339887b11bfdad4519f89ed3dd9bf3fb0db246d78b89653d553d02350ec84ce68bbb904db9fac00a2aad8d37f48df694d6782f35df
2021-03-19test: add functional test for anchors.datbruno
2021-03-19Merge #18335: bitcoin-cli: print useful error if bitcoind rpc work queue ↵MarcoFalke
exceeded 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a add functional test (Larry Ruane) b5a80fa7e487c37b7ac0e3874a2fabade41b9ca8 util: Handle HTTP_SERVICE_UNAVAILABLE in bitcoin-cli (Hennadii Stepanov) Pull request description: If `bitcoind` is processing 16 RPC requests, attempting to submit another request using `bitcoin-cli` produces this less-than-helpful error message: `error: couldn't parse reply from server`. This PR changes the error to: `error: server response: Work queue depth exceeded`. ACKs for top commit: fjahr: tACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a luke-jr: utACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a (no changes since previous utACK) hebasto: re-ACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a, only suggested changes since my [previous](https://github.com/bitcoin/bitcoin/pull/18335#pullrequestreview-460621350) review. darosior: ACK 8dd5946c0b7aa8f3976b14a5de4ce84b80a9c32a Tree-SHA512: 33e25f6ff05d9b56fae2bdb68b132557bb8e995f5438ac4fbbc53c304c5152a98aa43c43600c31d8a6a2830cbd48bf8ec7d89dce50190b29ec00a43830126913
2021-03-18Merge #20861: BIP 350: Implement Bech32m and use it for v1+ segwit addressesWladimir J. van der Laan
03346022d611871f2cc185440b19d928b9264d9d naming nits (Fabian Jahr) 2e7c80fb5be82ad4a3f737cab65b31f70a772a23 Add signet support to gen_key_io_test_vectors.py (Pieter Wuille) fe5e495c31de47b0ec732b943db11fe345d874af Use Bech32m encoding for v1+ segwit addresses (Pieter Wuille) 25b1c6e13ddf1626210d5e3d37298d1f3a78a94f Add Bech32m test vectors (Pieter Wuille) da2bb6976dadeec682d163c258c9afecc87d6428 Implement Bech32m encoding/decoding (Pieter Wuille) Pull request description: This implements [BIP 350](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): * For segwit v1+ addresses, a new checksum algorithm called Bech32m is used. * Segwit v0 address keep using Bech32 as specified in [BIP 173](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki). ACKs for top commit: Sjors: utACK 0334602 jnewbery: utACK 03346022d6 achow101: ACK 0334602 fjahr: re-ACK 0334602 benthecarman: ACK 03346022d611871f2cc185440b19d928b9264d9d Tree-SHA512: 4424cfd44869d813d6152fb3ed867b204036736bc2344a039b93700b6f36a43e9110478f138eb81c97c77ab27ecb776dada5ba632cb5a3a9d244924d2540a557
2021-03-16Merge #21410: test: increase rpc_timeout for fundrawtx ↵MarcoFalke
test_transaction_too_large d09120b7d1d5c94ec89f8d2c1d9060e7388be057 test: give fundraw more time for test_transaction_too_large (Jon Atack) Pull request description: to hopefully fix timeouts from a new test added in 48a0319bab of #20536 merged March 8, 2021 seen locally when running via the test runner ``` File "/home/jon/projects/bitcoin/bitcoin/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large raise JSONRPCException({ test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 30.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` and in the CI like https://bitcoinbuilds.org/index.php?ansilog=28537952-2c92-46f2-9871-8918e5ba2738.log#l2398 ``` File "/home/ubuntu/src/test/functional/rpc_fundrawtransaction.py", line 927, in test_transaction_too_large test_framework.authproxy.JSONRPCException: 'generatetoaddress' RPC took longer than 240.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` Top commit has no ACKs. Tree-SHA512: f11c923439014fe12420f986c640fd301a26282eb41516957d73b9c751087cbae3d0e316f9ccb49bcb424f488540266f70d3f97948633e77c62bd7935df90452
2021-03-16Use Bech32m encoding for v1+ segwit addressesPieter Wuille
This also includes updates to the Python test framework implementation, test vectors, and release notes.
2021-03-16test: give fundraw more time for test_transaction_too_largeJon Atack
2021-03-15Add new format string placeholders for walletnotify to include relevant ↵Maayan Keshet
block information for transactions
2021-03-11Merge #21411: test: add logging, reduce blocks, move sync_all in wallet_ groupsMarcoFalke
c62f9bc0e931f65eef63041d2c53f9a294c0e8d6 test: use fewer blocks in wallet_groups and move sync call (Jon Atack) 3a16b5ef95c1c25f8b78e591f985e80b41a6dbdd test: add missing logging to wallet_groups.py (Jon Atack) Pull request description: - add logging (particularly useful as the tests are somewhat slow) - generate 101 blocks instead of 110 - move `sync_all` call into the loop, so fewer blocks are synced on each call, to hopefully see fewer CI timeouts as in https://bitcoinbuilds.org/index.php?ansilog=88eee99e-1727-44ed-b778-3b9c75c33928.log ``` L2742 File "/home/ubuntu/src/test/functional/wallet_groups.py", line 162, in run_test L2743 self.sync_all() test_framework.authproxy.JSONRPCException: 'syncwithvalidationinterfacequeue' RPC took longer than 960.000000 seconds. Consider using larger timeout for calls that take longer to return. (-344) ``` ACKs for top commit: MarcoFalke: cr ACK c62f9bc0e931f65eef63041d2c53f9a294c0e8d6 Tree-SHA512: 711deafcd589cb8196cb207ff882e0f2ab6b70828a6abad91f83f535974cc430a56b9e8a960fd233d31d610932a0d48b49ee681aae564d145a3040288ecda8f8
2021-03-11test: use fewer blocks in wallet_groups and move sync callJon Atack
- generate 101 blocks instead of 110 - move a sync_all call into the loop so that fewer blocks are synced on each call to hopefully see fewer timeouts
2021-03-10Merge #21388: doc: Rename fuzz seed_dir to corpus_dirMarcoFalke
fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e doc: Rename fuzz seed_dir to corpus_dir (MarcoFalke) Pull request description: The fuzz corpus directory might contain hand-crafted seeds, but generally it is a set of test inputs. See also https://github.com/google/fuzzing/blob/master/docs/glossary.md#corpus ACKs for top commit: practicalswift: cr ACK fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e: patch looks correct and "why not?" :) fanquake: ACK fad0ae6bb8e10b5cb82a5ec014e59b5aafc85b5e - did not test Tree-SHA512: 38c952feb07aeeeb038b3261a12c824fab9ce5153d75f0ecf6d3f43db4f50998eeb2b14b11b7155f529189c93783fa2c11c81059021a04398c43f3505b31a2d4
2021-03-09Merge #20536: wallet: Error with "Transaction too large" if the funded tx ↵Samuel Dobson
will end up being too large after signing 48a0319babb409cf486a9eb7c776810f70b06cb2 Add a test that selects too large if BnB is used (Andrew Chow) 3e69939b78d0143d514c5d9b6c6a9844c9bb901c Fail if maximum weight is too large (Andrew Chow) 51e2cd322cfc7271af309e3a2243448a2ec0cad4 Have CalculateMaximumSignedTxSize also compute tx weight (Andrew Chow) Pull request description: Currently the `Transaction too large` is calculated on the transaction that is returned from `CreateTransaction`. This does not make sense for when `CreateTransaction` is being used for `fundrawtransaction` as no signing occurs so the final returned transaction is missing signatures. Thus users may successfully fund a transaction but fail to broadcast it after it has been fully signed. So instead we should figure out whether the transaction we are funding will be too large after it is signed. We can do this by having `CalculateMaximumSignedTxSize` also return the transaction weight and then comparing that weight against the maximum weight. ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/20536/commits/48a0319babb409cf486a9eb7c776810f70b06cb2 meshcollider: utACK 48a0319babb409cf486a9eb7c776810f70b06cb2 Xekyo: utACK with nits 48a0319babb409cf486a9eb7c776810f70b06cb2 Tree-SHA512: 1700c60b07f67e2d5c591c5ccd131ac9f1861fab3def961c3c9c4b3281ec1063fe8e4f0f7f1038cac72692340856406bcee8fb45c8104d2ad34357a0ec878ac7
2021-03-08doc: Rename fuzz seed_dir to corpus_dirMarcoFalke
2021-03-07test: add missing logging to wallet_groups.pyJon Atack
2021-03-05Merge #21345: test: bring p2p_leak.py up to dateMarcoFalke
a061a299708d39ad63f85085ae07c457308823cf test: bring p2p_leak.py up to date. (Martin Zumsande) Pull request description: After the introduction of wtxidrelay and sendaddrv2 messages during version handshake, extend p2p_leak.py test to reflect this. Also, some minor fixes and doc improvements. I also added a test that peers not completing the version handshake will be disconnected for timeout, as suggested by MarcoFalke in https://github.com/bitcoin/bitcoin/pull/19723#issuecomment-699540294. ACKs for top commit: brunoerg: Tested ACK a061a299708d39ad63f85085ae07c457308823cf theStack: Tested ACK a061a299708d39ad63f85085ae07c457308823cf Tree-SHA512: 26c601491fa8710fc972d1b8f15da6b387a95b42bbfb629ec4c668769ad3824b6dd6a33d97363bca2171e403d8d1ce08abf3e5c9cab34f98d53e0109b1c7a0e5
2021-03-05Merge #21246: doc: Correction for VerifyTaprootCommitment commentsfanquake
6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 Correction for VerifyTaprootCommitment comments (Russell O'Connor) Pull request description: According to BIP-341, 'p' is called the taproot *internal* key, not inner key. ACKs for top commit: sipa: ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 benthecarman: ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 theStack: ACK 6a0a6e7d0509e48a6cc08c6604a25671d5f8cab4 Tree-SHA512: 94f553476a8404bff4b2d5724a1a54c5f530b987a616cd00a3800095f245c06e3c7a9066c729976f32069a56029406859a70ba523151d333dc1ed874f242bce8
2021-03-04Merge #21148: Split orphan handling from net_processing into txorphanageWladimir J. van der Laan
5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8 txorphanage: comment improvements (Anthony Towns) eeeafb324ef6057f40b5c5fdd8464110e809b0f7 net_processing: move AddToCompactExtraTransactions into PeerManagerImpl (Anthony Towns) f8c0688b9490c8d4902530ba3c3b6fbd8b48e0de scripted-diff: Update txorphanage naming convention (Anthony Towns) 6bd4963c069bfd0af420e8a3fb724c3b693a1e76 txorphanage: Move functions and data into class (Anthony Towns) 03257b832debcb1470420d8657d30ba30f4be770 txorphanage: Extract EraseOrphansForBlock (Anthony Towns) 3c4c3c2fdda3a361e3802e97bc3566f815b75de1 net_processing: drop AddOrphanTx (Anthony Towns) 26d1a6ccd5fcc7abec737c0d8c67238561627d59 denialofservices_tests: check txorphanage's AddTx (Anthony Towns) 1041616d7eb66281bb4de51ffbc83df0923b2f7e txorphanage: Extract OrphanageAddTx (Anthony Towns) f294da727413210fda279afdc206a4dd12046d56 txorphanage: Extract GetOrphanTx (Anthony Towns) 83679ffc600305ec0926fd195ee31c11de2ed613 txorphanage: Extract HaveOrphanTx (Anthony Towns) ee135c8d5b39b0cb8b301a83e286285ab926dca7 txorphanage: Extract AddChildrenToWorkSet (Anthony Towns) 38a11c355acfc15134c682571b3d92f66b0e7c3c txorphanage: Add lock annotations (Anthony Towns) 81dd57e5b1ab1afa7e59468e30ef41bd34f0c8d7 txorphanage: Pass uint256 by reference instead of value (Anthony Towns) 9d5313df7eedad8562c822f5477747e924929fd3 move-only: Add txorphanage module (Anthony Towns) Pull request description: Splits orphan handling into its own module and reduces global usage. ACKs for top commit: jnewbery: utACK 5e50e2d1b9 amitiuttarwar: utACK 5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8 glozow: re ACK https://github.com/bitcoin/bitcoin/pull/21148/commits/5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8, comment updates laanwj: Code review ACK 5e50e2d1b95e7ca7709a9671ab21f1164b8d0cb8 Tree-SHA512: 92a959bb5dd414c96f78cb8dcaa68adb85faf16b8b843a2cbe0bb2aa08df13ad6bd9424d29b98f57a82ec29c942fbdbea3011883d00bf0b0feb643e295174e46
2021-03-04Merge #20969: test: check that getblockfilter RPC fails without block filter ↵MarcoFalke
index 233a886b4221190a3e53128162d708266494576e test: check that getblockfilter RPC fails without block filter index (Sebastian Falbesoner) Pull request description: If a node was started without compact block filter index (parameter `--blockfilterindex=0`), the `getblockfilter` RPC call should fail. ACKs for top commit: MarcoFalke: review ACK 233a886b4221190a3e53128162d708266494576e Tree-SHA512: c8824373fad7d1de2dcb43c1d9541d736b478235be243080d2b7479c2588eac0e5722337ec1307394b331e0002fbcabb368e4955c2dc98dd5fce76d8c089e8a1
2021-03-03test: bring p2p_leak.py up to date.Martin Zumsande
After the introduction of wtxidrelay and sendaddrv2 messages during version handshake, extend p2p_leak.py test to reflect this. Also, some minor fixes and doc improvements.
2021-03-02Merge #20685: Add I2P support using I2P SAMWladimir J. van der Laan
a701fcf01f3ea9a12e869bfa52321302cf68351c net: Do not skip the I2P network from GetNetworkNames() (Vasil Dimov) 0181e244394bd9e68e9f0d44704e7b0fd12a6b1f net: recognize I2P from ParseNetwork() so that -onlynet=i2p works (Vasil Dimov) b905363fa8b0bb03fe34b53b5410880f42e0af39 net: accept incoming I2P connections from CConnman (Vasil Dimov) 0635233a1e7e8c303073430092afd3e0fb0d927b net: make outgoing I2P connections from CConnman (Vasil Dimov) 9559bd1404fbf74b0d09fe9019a9305cb4e151ce net: add I2P to the reachability map (Vasil Dimov) 76c35c60f338937071bcfad4211ef7254d3830ec init: introduce I2P connectivity options (Vasil Dimov) c22daa2ecff1acd25426cd46f98f2587d1d324c3 net: implement the necessary parts of the I2P SAM protocol (Vasil Dimov) 5bac7e45e1d3a07115b5ff002d988438fcc92a53 net: extend Sock with a method to check whether connected (Vasil Dimov) 42c779f503eb8437b6232773a4a2472306cc9f3d net: extend Sock with methods for robust send & read until terminator (Vasil Dimov) ea1845315a109eb105113cb5fbb6f869e1cf010c net: extend Sock::Wait() to report a timeout (Vasil Dimov) 78fdfbea666201b25919dd67454eb04d6a34326f net: dedup MSG_NOSIGNAL and MSG_DONTWAIT definitions (Vasil Dimov) 34bcfab562bac9887ca9c3831cf4fd0ee7f98149 net: move the constant maxWait out of InterruptibleRecv() (Vasil Dimov) cff65c4a270887ec171293409ab84f5d0d0be7fc net: extend CNetAddr::SetSpecial() to support I2P (Vasil Dimov) f6c267db3be2d7077fd2bdbd34860eba838dea99 net: avoid unnecessary GetBindAddress() call (Vasil Dimov) 7c224fdac4699a2c4953b33ab423f9cddbf95cf7 net: isolate the protocol-agnostic part of CConnman::AcceptConnection() (Vasil Dimov) 1f75a653dd3b24ba2e4383bf951a6e5a3d5ccbcf net: get the bind address earlier in CConnman::AcceptConnection() (Vasil Dimov) 25605895afe84b1765dd9da9240af22f99489df7 net: check for invalid socket earlier in CConnman::AcceptConnection() (Vasil Dimov) 545bc5f81d60fa6ff7c5cc43a2e9eef82f911466 util: fix WriteBinaryFile() claiming success even if error occurred (Vasil Dimov) 8b6e4b3b23027da263d257b342f5d9a53e4032d5 util: fix ReadBinaryFile() returning partial contents (Vasil Dimov) 4cba2fdafa483cbdb70f581174138ec253c80d48 util: extract {Read,Write}BinaryFile() to its own files (Vasil Dimov) Pull request description: Add I2P support by using the [I2P SAM](https://geti2p.net/en/docs/api/samv3) protocol. Unlike Tor, for incoming connections we get the I2P address of the peer (and they also receive ours when we are the connection initiator). Two new options are added: ``` -i2psam=<ip:port> I2P SAM proxy to reach I2P peers and accept I2P connections (default: none) -i2pacceptincoming If set and -i2psam is also set then incoming I2P connections are accepted via the SAM proxy. If this is not set but -i2psam is set then only outgoing connections will be made to the I2P network. Ignored if -i2psam is not set. Notice that listening for incoming I2P connections is done through the SAM proxy, not by binding to a local address and port (default: true) ``` # Overview of the changes ## Make `ReadBinary()` and `WriteBinary()` reusable We would need to dump the I2P private key to a file and read it back later. Move those two functions out of `torcontrol.cpp`. ``` util: extract {Read,Write}BinaryFile() to its own files util: fix ReadBinaryFile() returning partial contents util: fix WriteBinaryFile() claiming success even if error occurred ``` ## Split `CConnman::AcceptConnection()` Most of `CConnman::AcceptConnection()` is agnostic of how the socket was accepted. The other part of it deals with the details of the `accept(2)` system call. Split those so that the protocol-agnostic part can be reused if we accept a socket by other means. ``` net: check for invalid socket earlier in CConnman::AcceptConnection() net: get the bind address earlier in CConnman::AcceptConnection() net: isolate the protocol-agnostic part of CConnman::AcceptConnection() net: avoid unnecessary GetBindAddress() call ``` ## Implement the I2P [SAM](https://geti2p.net/en/docs/api/samv3) protocol (not all of it) Just the parts that would enable us to make outgoing and accept incoming I2P connections. ``` net: extend CNetAddr::SetSpecial() to support I2P net: move the constant maxWait out of InterruptibleRecv() net: dedup MSG_NOSIGNAL and MSG_DONTWAIT definitions net: extend Sock::Wait() to report a timeout net: extend Sock with methods for robust send & read until terminator net: extend Sock with a method to check whether connected net: implement the necessary parts of the I2P SAM protocol ``` ## Use I2P SAM to connect to and accept connections from I2P peers Profit from all of the preceding commits. ``` init: introduce I2P connectivity options net: add I2P to the reachability map net: make outgoing I2P connections from CConnman net: accept incoming I2P connections from CConnman net: recognize I2P from ParseNetwork() so that -onlynet=i2p works net: Do not skip the I2P network from GetNetworkNames() ``` ACKs for top commit: laanwj: re-ACK a701fcf01f3ea9a12e869bfa52321302cf68351c jonatack: re-ACK a701fcf01f3ea9a12e869bfa52321302cf68351c reviewed diff per `git range-diff ad89812 2a7bb34 a701fcf`, debug built and launched bitcoind with i2pd v2.35 running a dual I2P+Torv3 service with the I2P config settings listed below (did not test `onlynet=i2p`); operation appears nominal (same as it has been these past weeks), and tested the bitcoind help outputs grepping for `-i i2p` and the rpc getpeerinfo and getnetworkinfo helps Tree-SHA512: de42090c9c0bf23b43b5839f5b4fc4b3a2657bde1e45c796b5f3c7bf83cb8ec6ca4278f8a89e45108ece92f9b573cafea3b42a06bc09076b40a196c909b6610e
2021-03-02Merge #21310: zmq test: fix sync-up by matching notification to generated blockMarcoFalke
8a8c6383f6f9da10b931f00ca1220408fede8f35 zmq test: fix sync-up by matching notification to generated block (Sebastian Falbesoner) Pull request description: This is a follow-up PR for #21008, fixes #21216. In the course of investigating the problem with jnewbery (analyzing the Cirrus log https://cirrus-ci.com/task/4660108304056320), it turned out that the "sync up" procedure of repeatedly generating a block and waiting for a notification with timeout is too brittle in its current form, as the following scenario could happen: - generate block A - receive notification, timeout happens => repeat procedure - generate block B - node publishes block A notification - receive notification, we receive the one caused by block A (!!!) => sync-up procedure is completed - node publishes block B notification - the actual test starts - on the first notification reception, the one caused by block B is received, rather than the one actually caused by test code => assertion failure This change in the PR ensures that after each test block generation, we wait for the notification that is actually caused by that block and ignore others from possibly earlier blocks. The matching is kind of ugly, it assumes that one out of four components in the block is contained in the notification: the block hash, the tx id, the raw block data or the raw transaction data. (Unfortunately we have to support all publisher topics.) I'm aware that this is quite a lot of code now only for establishing a robust test setup. OTOH I wouldn't know of a better method right now, suggestions are very welcome. Note for potential reviewers: for both reproducing the issue on master branch and verifying on PR branch, one can simply generate two blocks in the sync-up procedure rather than one. ACKs for top commit: MarcoFalke: Concept ACK 8a8c6383f6f9da10b931f00ca1220408fede8f35 Tree-SHA512: a2eb78ba06dfd0fda7b1c111b6bbfb5dab4ab08500cc19c7ea02c3239495d5c74cc7d45250a8b3ecc78ca42d97ee6719bf73db8a137839e5e09a3cfcf08ed29e
2021-03-01net: Do not skip the I2P network from GetNetworkNames()Vasil Dimov
So that help texts include "i2p" in: * `./bitcoind -help` (in `-onlynet` description) * `getpeerinfo` RPC * `getnetworkinfo` RPC Co-authored-by: Jon Atack <jon@atack.com>
2021-03-01init: introduce I2P connectivity optionsVasil Dimov
Introduce two new options to reach the I2P network: * `-i2psam=<ip:port>` point to the I2P SAM proxy. If this is set then the I2P network is considered reachable and we can make outgoing connections to I2P peers via that proxy. We listen for and accept incoming connections from I2P peers if the below is set in addition to `-i2psam=<ip:port>` * `-i2pacceptincoming` if this is set together with `-i2psam=<ip:port>` then we accept incoming I2P connections via the I2P SAM proxy.
2021-03-01Correction for VerifyTaprootCommitment commentsRussell O'Connor
According to BIP-341, 'p' is called the taproot *internal* key, not inner key.
2021-03-01Merge #18466: rpc: fix invalid parameter error codes for ↵Wladimir J. van der Laan
{sign,verify}message RPCs a5cfb40e27bd281354bd0d14d91f83efb6bfce9f doc: release note for changed {sign,verify}message error codes (Sebastian Falbesoner) 9e399b9b2d386b28c0c0ff59fc75d31dbec31d9c test: check parameter validity in rpc_signmessage.py (Sebastian Falbesoner) e62f0c71f10def124b1c1219d790cef246a32c3e rpc: fix {sign,message}verify RPC errors for invalid address/signature (Sebastian Falbesoner) Pull request description: RPCs that accept address parameters usually return the intended error code `RPC_INVALID_ADDRESS_OR_KEY` (-5) if a passed address is invalid. The two exceptions to the rule are `signmessage` and `verifymessage`, which return `RPC_TYPE_ERROR` (-3) in this case instead. Oddly enough `verifymessage` returns `RPC_INVALID_ADDRESS_OR_KEY` when the _signature_ was malformed, where `RPC_TYPE_ERROR` would be more approriate. This PR fixes these inaccuracies and as well adds tests to `rpc_signmessage.py` that check the parameter validity and error codes for the related RPCs `signmessagewithprivkey`, `signmessage` and `verifymessage`. master branch: ``` $ ./bitcoin-cli signmessage invalid_addr message error code: -3 error message: Invalid address $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message error code: -3 error message: Invalid address $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message error code: -5 error message: Malformed base64 encoding ``` PR branch: ``` $ ./bitcoin-cli signmessage invalid_addr message error code: -5 error message: Invalid address $ ./bitcoin-cli verifymessage invalid_addr dummy_sig message error code: -5 error message: Invalid address $ ./bitcoin-cli verifymessage 12c6DSiU4Rq3P4ZxziKxzrL5LmMBrzjrJX invalid_sig message error code: -3 error message: Malformed base64 encoding ``` ACKs for top commit: laanwj: Code review ACK a5cfb40e27bd281354bd0d14d91f83efb6bfce9f meshcollider: utACK a5cfb40e27bd281354bd0d14d91f83efb6bfce9f Tree-SHA512: bae0c4595a2603cea66090f6033785601837b45fd853052312b3a39d8520566c581994b68f693dd247c22586c638c3b7689c849085cce548cc36b9bf0e119d2d
2021-03-01zmq test: fix sync-up by matching notification to generated blockSebastian Falbesoner
It turned out that the "sync up" procedure of repeatedly generating a block and waiting for a notification once with timeout is too naive in its current form, as the following scenario could happen: - generate block A - receive notification, timeout happens -> repeat procedure - generate block B - node publishes block A notification - receive notification, we receive the one caused by block A -> sync-up procedure is completed - node publishes block B - the actual test starts - on the first notification reception, one caused by block B is received, rather than the one actually caused by test code, leading to failure This change ensures that after each test block generation, we wait for the notification that is actually caused by that block and ignore others from possibly earlier blocks. Co-authored-by: Jon Atack <jon@atack.com>
2021-02-27Merge #21297: test: feature_blockfilterindex_prune.py improvementsMarcoFalke
88c4b9b761964d0b3011126796f272cfca2a9fa2 test: remove unneeded node from feature_blockfilterindex_prune.py (Jon Atack) ace3f4cbdf476ea8b954d98dfaa931076f87a080 test: improve assertions in feature_blockfilterindex_prune.py (Jon Atack) Pull request description: - improves the assertions - removes an unneeded node, reducing from two to one, and some unneeded `extra_arg` code ACKs for top commit: MarcoFalke: ACK 88c4b9b761964d0b3011126796f272cfca2a9fa2 brunoerg: Tested ACK 88c4b9b761964d0b3011126796f272cfca2a9fa2 Tree-SHA512: 295700da3a5f583ee02ae2d184db93cce0e13aba69115d5db07f83e96a66b4b850adaff2c3725b6585799565b9ee654b1fee8a6245eaba8c21e1cb5ce524eb2b
2021-02-27txorphanage: Move functions and data into classAnthony Towns
Collects all the orphan handling globals into a single member var in net_processing, and ensures access is encapuslated into the interface functions. Also adds doxygen comments for methods.
2021-02-26Merge #21277: wallet: listdescriptors uses normalized descriptor formWladimir J. van der Laan
a69c3b35f8974b378a87a3e42d331bd4147e07df wallet: listdescriptors uses normalized descriptor form (Ivan Metlushko) Pull request description: Rationale: show importable descriptors with `listdescriptors` RPC It uses #19136 to derive xpub at the last hardened step. **Before**: ``` [ { "desc": "wpkh(tpubD6NzVbkrYhZ4YUQRJL49TWw1VR5v3QKUNYaGGMUfJUm19x5ZqQ2hEiPiYbAQvD2nHoPGQGPg3snLPM8sjmYpvx7XQhkmyfk8xhsUwKbXzyh/84'/1'/0'/0/*)#p4cn3erf", "timestamp": 1613982591, "active": true, "internal": false, "range": [ 0, 999 ], "next": 0 }, ... ] ``` **After**: ``` [ { "desc": "wpkh([d4ade89c/84'/1'/0']tpubDDUEYcVXy6Vh5meHvcXN3sAr4k3fWwLZGpAHbkAHL8EnkDxp4d99CjNhJHfM2fUJicANvAKnCZS6XaVAgwAeKYc1KesGCN5qbQ25qQHrRxM/0/*)#8wq8rcft", "timestamp": 1613982591, "active": true, "internal": false, "range": [ 0, 999 ], "next": 0 }, ... ] ``` ACKs for top commit: achow101: ACK a69c3b35f8974b378a87a3e42d331bd4147e07df Tree-SHA512: 4f92e726cb8245aa0b520729cfd272945f0c66830f0555544e0618883aca516318543fa6ab1862058c64b4e4ed54ad1da953e032f4846eef7454122031c1b005
2021-02-25test: remove unneeded node from feature_blockfilterindex_prune.pyJon Atack
2021-02-25test: improve assertions in feature_blockfilterindex_prune.pyJon Atack
2021-02-25Merge #21254: test: Avoid connecting to real network when running testsMarcoFalke
fa730e915766b012ff145e3c2af782668defb21f test: Avoid connecting to real network when running tests (MarcoFalke) fa1b713941f71b077da07e9dedb743c7e99c3ca8 test: Assume node is running in subtests (MarcoFalke) Pull request description: Introduced in #19884 ACKs for top commit: Sjors: ACK fa730e915766b012ff145e3c2af782668defb21f Tree-SHA512: fe132a9ffe2fae1ab16857a3dec9839526fdf74d27a1ae794fbffca8356f639c4b916dc888b260281e9cc793916706c18d1687ebb5a076d4e1c481d218d308d3
2021-02-25Merge #21252: test: Add missing wait for sync to feature_blockfilterindex_pruneMarcoFalke
fa560cc6c493764efc2f2f1702d45286060fe15f test: Intermittent issue in feature_blockfilterindex_prune (MarcoFalke) Pull request description: https://cirrus-ci.com/task/4962244553342976?command=ci#L5131 The index is built in a background thread, so we have to wait for it. ACKs for top commit: jonatack: ACK fa560cc6c493764efc2f2f1702d45286060fe15f Tree-SHA512: e7a246fe43a28511581fe34b1f5a85303b1874b2535330afc0405269cce7306984ecc6af389791321e3aa4b224819e89d9b89dd5bc080d60baa20bd007412787
2021-02-25Merge #21200: test: Speed up rpc_blockchain.py by removing miniwallet.generate()Wladimir J. van der Laan
faa137eb9eac5554504b062a6dc865ca87fd572b test: Speed up rpc_blockchain.py by removing miniwallet.generate() (MarcoFalke) fa1fe80c757df0adcbfaf41b5c5c8a468bc07b6f test: Change address type from P2PKH to P2WSH in rpc_blockchain (MarcoFalke) fa4d8f3169e38cbdbae20258efebe7070c49f522 test: Cache 25 mature coins for ADDRESS_BCRT1_P2WSH_OP_TRUE (MarcoFalke) fad25153f5c8e88f72cf666b16b0b0dbdc45d3b1 test: Remove unused bug workaround (MarcoFalke) faabce7d07c5776e4116b1a7ad1f6c408a4a4e46 test: Start only the number of nodes that are needed (MarcoFalke) Pull request description: Speed up various tests: * Remove unused nodes, which only consume time on start/stop * Remove unused "bug workarounds" * Remove the need for `miniwallet.generate()` by adding `miniwallet.scan_blocks()`. (On my system, with valgrind, generating 105 blocks takes 3.31 seconds. Rescanning 5 blocks takes 0.11 seconds.) ACKs for top commit: laanwj: Code review ACK faa137eb9eac5554504b062a6dc865ca87fd572b Tree-SHA512: ead1988d5aaa748ef9f8520af1e0bf812cf1d72e281ad22fbd172b7306d850053040526f8adbcec0b9a971c697a0ee7ee8962684644d65b791663eedd505a025
2021-02-23Merge #21053: rpc, test: document {previous,next}blockhash as optionalMarcoFalke
ba7e17e073f833eccd4c7c111ae9058c3f123371 rpc, test: document {previous,next}blockhash as optional (Sebastian Falbesoner) Pull request description: This PR updates the result help of the following RPCs w.r.t. the `previousblockhash` and `nextblockhash` fields: - getblockheader - getblock Also adds trivial tests on genesis block (should not contain "previousblockhash") and best block (should not contain "nextblockhash"). Top commit has no ACKs. Tree-SHA512: ef42c5c773fc436e1b4a67be14e2532e800e1e30e45e54a57431c6abb714d2c069c70d40ea4012d549293b823a1973b3f569484b3273679683b28ed40abf46bb
2021-02-23rpc: send: support external signerSjors Provoost
2021-02-23rpc: signerdisplayaddressSjors Provoost
2021-02-23wallet: ExternalSigner: add GetDescriptors methodSjors Provoost
2021-02-23test: external_signer wallet flag is immutableSjors Provoost
2021-02-23rpc: add external_signer option to createwalletSjors Provoost
2021-02-23rpc: signer: add enumeratesigners to list external signersSjors Provoost
2021-02-23rpc: add external signer RPC filesSjors Provoost
2021-02-23test: add external signer testSjors Provoost
Includes a mock to mimick the HWI interace.
2021-02-23wallet: listdescriptors uses normalized descriptor formIvan Metlushko