aboutsummaryrefslogtreecommitdiff
path: root/src/test/fuzz
AgeCommit message (Collapse)Author
2021-05-24Merge bitcoin/bitcoin#21186: net/net processing: Move addr data into ↵fanquake
net_processing 0829516d1f3868c1c2ba507feee718325d81e329 [refactor] Remove unused ForEachNodeThen() template (John Newbery) 09cc66c00e1d5fabe11ffcc32cad060e6b483b20 scripted-diff: rename address relay fields (John Newbery) 76568a3351418c878d30ba0373cf76988f93f90e [net processing] Move addr relay data and logic into net processing (John Newbery) caba7ae8a505a4b4680a9d7618f65c4e8579a1e2 [net processing] Make RelayAddress() a member function of PeerManagerImpl (John Newbery) 86acc9646968213aaa4408635915b1bfd75a10c9 [net processing] Take NodeId instead of CNode* as originator for RelayAddress() (John Newbery) Pull request description: This continues the work of moving application layer data into net_processing, by moving all addr data into the new Peer object added in #19607. For motivation, see #19398. ACKs for top commit: laanwj: Code review ACK 0829516d1f3868c1c2ba507feee718325d81e329 mzumsande: ACK 0829516d1f3868c1c2ba507feee718325d81e329, reviewed the code and ran tests. sipa: utACK 0829516d1f3868c1c2ba507feee718325d81e329 hebasto: re-ACK 0829516d1f3868c1c2ba507feee718325d81e329 Tree-SHA512: efe0410fac288637f203eb37d1999910791e345872d37e1bd5cde50e25bb3cb1c369ab86b3a166ffd5e06ee72e4508aa2c46d658be6a54e20b4f220d2f57d0a6
2021-05-24Merge bitcoin/bitcoin#21848: refactor: Make CFeeRate constructor ↵MarcoFalke
architecture-independent fafd121026c4f1e25d498983e4f88c119516552b refactor: Make CFeeRate constructor architecture-independent (MarcoFalke) Pull request description: Currently the constructor is architecture dependent. This is confusing for several reasons: * It is impossible to create a transaction larger than the max value of `uint32_t`, so a 64-bit `size_t` is not needed * Policy (and consensus) code should be arch-independent * The current code will print spurious compile errors when compiled on 32-bit systems: ``` policy/feerate.cpp:23:22: warning: result of comparison of constant 9223372036854775807 with expression of type 'size_t' (aka 'unsigned int') is always true [-Wtautological-constant-out-of-range-compare] assert(nBytes_ <= uint64_t(std::numeric_limits<int64_t>::max())); ``` Fix all issues by making it arch-independent. Also, fix `{}` style according to dev notes. ACKs for top commit: theStack: re-ACK fafd121026c4f1e25d498983e4f88c119516552b promag: Code review ACK fafd121026c4f1e25d498983e4f88c119516552b. Tree-SHA512: e16f75bad9ee8088b87e873906d9b5633449417a6996a226a2f37d33a2b7d4f2fd91df68998a77e52163de20b40c57fadabe7fe3502e599cbb98494178591833
2021-05-24scripted-diff: Replace `GetDataDir()` calls with `gArgs.GetDataDirNet()` callsKiminuo
-BEGIN VERIFY SCRIPT- git ls-files -- 'src' ':(exclude)src/util/system.h' ':(exclude)src/util/system.cpp' | xargs sed -i 's/GetDataDir()/gArgs.GetDataDirNet()/g'; -END VERIFY SCRIPT-
2021-05-22Merge bitcoin/bitcoin#21953: fuzz: Add utxo_snapshot targetMarcoFalke
fa91994b1b9b6da3bb2a2f722d9251d7d0f2167e fuzz: Add utxo_snapshot target (MarcoFalke) Pull request description: ACKs for top commit: jamesob: ACK https://github.com/bitcoin/bitcoin/pull/21953/commits/fa91994b1b9b6da3bb2a2f722d9251d7d0f2167e Tree-SHA512: a00f077102a4e4e321bd1464c3fa11e7a5b9e04324b9be87aa28cfdc77630db7fc772d3a3768dc6ec36bbdd2d67b7e0719f0cf3fd87b4a1087365b934e137b5c
2021-05-21Merge bitcoin/bitcoin#22004: fuzz: Speed up transaction fuzz targetMarcoFalke
bbbb51877a96c3473aeea5914f751eec7835b5c4 fuzz: Speed up transaction fuzz target (MarcoFalke) Pull request description: `hashBlock` and `include_addresses` are orthogonal, so no need to do an exhaustive "search". Might fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34491 ACKs for top commit: practicalswift: cr ACK bbbb51877a96c3473aeea5914f751eec7835b5c4: patch looks correct, and `TxToUniv` surprisingly wide in the `transaction_fuzz_target` flame graph! Putting it on a diet makes sense. Tree-SHA512: 1e7c30c7fecf96364a9a1597c0a22139389fdeb67db59f3c2c6fc088196e3332877b2865991a957980d542f99a2f48cc066dd7cc16c695a5113190fe06205089
2021-05-21Merge bitcoin/bitcoin#21936: fuzz: Terminate immediately if a fuzzing ↵MarcoFalke
harness tries to create a TCP socket (belt and suspenders) 393992b049d3bcf0b2a3439be128d13d6567f0b1 fuzz: Terminate immediately if a fuzzing harness ever tries to create a TCP socket (belt and suspenders) (practicalswift) Pull request description: Terminate immediately if a fuzzing harness ever to create a TCP socket (belt and suspenders). Obviously this _should_ never happen, but if it _does_ happen we want immediate termination instead of a TCP socket :) ACKs for top commit: MarcoFalke: ACK 393992b049d3bcf0b2a3439be128d13d6567f0b1 Tree-SHA512: 5bbff1f7e9a58b3eae24f742b7daf3fc870424c985f29bed5931e47a708d9c0984bfd8762f43658cffa9c69d32f86d56deb48bc7e43821e3398052174b6a160e
2021-05-21Merge bitcoin/bitcoin#22003: txmempool: add thread safety annotationsMarcoFalke
793b2682841b0bdd7eb93163e34728765cfe52b2 txmempool: add thread safety annotations (Anthony Towns) Pull request description: Add missing thread safety guards to CTxMempool members. ACKs for top commit: MarcoFalke: cr ACK 793b2682841b0bdd7eb93163e34728765cfe52b2 hebasto: re-ACK 793b2682841b0bdd7eb93163e34728765cfe52b2, only suggested changes since my [previous](https://github.com/bitcoin/bitcoin/pull/22003#pullrequestreview-664529633) review. Tree-SHA512: c5eb197c63375c80c325a276f322177e84e0181c94a124720b1a364e964ac223fc6fdfd89bd0e152b76959fb6b97bfbf82dd36ec105ed6e2dc045ede717df4ae
2021-05-21txmempool: add thread safety annotationsAnthony Towns
2021-05-20fuzz: Terminate immediately if a fuzzing harness ever tries to create a TCP ↵practicalswift
socket (belt and suspenders)
2021-05-20Merge bitcoin/bitcoin#21843: p2p, rpc: enable GetAddr, GetAddresses, and ↵W. J. van der Laan
getnodeaddresses by network ce6bca88e8c685c69686e0b8dc095ffc3e2ac34d doc: release note for getnodeaddresses by network (Jon Atack) 3f89c0e9902338ad8a507a938dceeeb3191eece6 test: improve getnodeaddresses coverage, test by network (Jon Atack) 6c98c099918bd20e2d3aa123643d6e3594e080e4 rpc: enable filtering getnodeaddresses by network (Jon Atack) 80ba294854e5025bcada58f1403858e6ea1d4380 p2p: allow CConnman::GetAddresses() by network, add doxygen (Jon Atack) a49f3ddbbabfb971a537f0a6c7affb24e20ff192 p2p: allow CAddrMan::GetAddr() by network, add doxygen (Jon Atack) c38981e748f438d972ba12ba998c8a8a597e01c1 p2p: pull time call out of loop in CAddrMan::GetAddr_() (João Barbosa) d35ddca91ebbcf8d8b790c3b9f8cf218fafb7a53 p2p: enable CAddrMan::GetAddr_() by network, add doxygen (Jon Atack) Pull request description: This patch allows passing a network argument to CAddrMan::GetAddr(), CConnman::GetAddresses(), and rpc getnodeaddresses to return only addresses of that network. It also contains a performance optimisation by promag. ACKs for top commit: laanwj: Code review and lightly tested ACK ce6bca88e8c685c69686e0b8dc095ffc3e2ac34d vasild: ACK ce6bca88e8c685c69686e0b8dc095ffc3e2ac34d Tree-SHA512: 40e700d97091248429c73cbc0639a1f03ab7288e636a7b9026ad253e9708253c6b2ec98e7d9fb2d56136c0f762313dd648915ac98d723ee330d713813a43f99d
2021-05-20fuzz: Speed up transaction fuzz targetMarcoFalke
2021-05-19Merge bitcoin/bitcoin#21970: fuzz: Add missing CheckTransaction before ↵MarcoFalke
CheckTxInputs fae4ee545a652cc2934773b0e1fdb9004b0c5ba6 fuzz: Add missing CheckTransaction before CheckTxInputs (MarcoFalke) faacb7eadb04a8af666e7bb59bcd79915fe3a80a fuzz: Sanity check result of CheckTransaction (MarcoFalke) Pull request description: This bug was introduced by myself in commit eeee8f5be1d4ccfb7e237248be5c6bef45b0fbb8 (https://github.com/bitcoin/bitcoin/pull/21553) Reproducer: https://github.com/bitcoin/bitcoin/files/6492249/clusterfuzz-testcase-minimized-coins_view-6109460079706112.log Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34301 ACKs for top commit: practicalswift: cr ACK fae4ee545a652cc2934773b0e1fdb9004b0c5ba6: patch looks correct :) Tree-SHA512: 9ece7a5c4bfa60f5e5ffeba3f0ee52a07944c9bd6102588dd7ff7405695e6b32449945b7c41bd25baf38814df5a2436521e655ceff87223ad03c69ed39053023
2021-05-19Merge bitcoin/bitcoin#21659: net: flag relevant Sock methods with [[nodiscard]]W. J. van der Laan
e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a net: flag relevant Sock methods with [[nodiscard]] (Vasil Dimov) Pull request description: Flag relevant Sock methods with `[[nodiscard]]` to avoid issues like the one fixed in https://github.com/bitcoin/bitcoin/pull/21631. ACKs for top commit: practicalswift: cr ACK e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a: the only changes made are additions of `[[nodiscard]]` and `(void)` where appropriate laanwj: Code review ACK e286cd0d7b4e12c8efe5e7ac3066a100e0ba2c0a Tree-SHA512: addc361968d24912bb625b42f4db557791556bf0ffad818252a89a32d76ac22758ec70f8282dcfbfd77eebec20a8e6bb7557c8ed08d50a58de95378c34955973
2021-05-19p2p: allow CConnman::GetAddresses() by network, add doxygenJon Atack
2021-05-19p2p: allow CAddrMan::GetAddr() by network, add doxygenJon Atack
2021-05-19Merge bitcoin/bitcoin#21506: p2p, refactor: make NetPermissionFlags an enum ↵W. J. van der Laan
class 7075f604e8d0b21b2255fa57e20cd365dc10a288 scripted-diff: update noban documentation in net_processing.cpp (Jon Atack) a95540cf435029f06e56749802d71315ca76b0dd scripted-diff: rename NetPermissionFlags enumerators (Jon Atack) 810d0929c1626bba141af3f779a3c9cd6ece7e75 p2p, refactor: make NetPermissionFlags a uint32 enum class (Jon Atack) 7b55a9449778c5ac89799ce4c607c8c8d797ddfb p2p: NetPermissions::HasFlag() pass flags param by value (Jon Atack) 91f6e6e6d1720e1154ad3f70a5098e9028efa84a scripted-diff: add NetPermissionFlags scopes where not already present (Jon Atack) Pull request description: While reviewing #20196, I noticed the `NetPermissionFlags` enums are frequently called as if they were scoped, yet are still global. This patch upgrades `NetPermissionFlags` to a scoped class enum and updates the enumerator naming, similarly to #19771. See https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#enum-enumerations for more info. This change would eliminate the class of bugs like https://github.com/bitcoin/bitcoin/pull/20196#discussion_r610770148 and #21644, as only defined operations on the flags would compile. ACKs for top commit: laanwj: Code review ACK 7075f604e8d0b21b2255fa57e20cd365dc10a288 vasild: ACK 7075f604e8d0b21b2255fa57e20cd365dc10a288 Tree-SHA512: 7fcea66ee499f059efc78c934b5f729b3c8573fe304dee2c27c837c2f662b89324790568246d75b2a574cf9f059b42d3551d928996862f4358055eb43521e6f4
2021-05-18refactor: Make CFeeRate constructor architecture-independentMarcoFalke
2021-05-17fuzz: Add missing CheckTransaction before CheckTxInputsMarcoFalke
2021-05-17fuzz: Sanity check result of CheckTransactionMarcoFalke
2021-05-16fuzz: Add utxo_snapshot targetMarcoFalke
2021-05-14Merge bitcoin/bitcoin#21929: fuzz: Remove incorrect float round-trip ↵W. J. van der Laan
serialization test fae814c9a6c8ce4822f1fc6b88cfbbde7cc2d49c fuzz: Remove incorrect float round-trip serialization test (MarcoFalke) Pull request description: It tests the wrong way of the round-trip: `int -> float -> int`, but only `float -> int -> float` is allowed and used. See also `src/test/fuzz/float.cpp`. Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34118 ACKs for top commit: laanwj: Anyhow, ACK fae814c9a6c8ce4822f1fc6b88cfbbde7cc2d49c Tree-SHA512: 8412a7985be2225109f382b7c7ea6d6fcfbea15711671fdf2f41dd1a9adbb3b4489592863751d78bedaff98e9b0b13571d9cae06ffd92db8fbf7ce0f47874a41
2021-05-12scripted-diff: rename NetPermissionFlags enumeratorsJon Atack
- drop redundant PF_ permission flags prefixes - drop ALL_CAPS naming per https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Renum-caps - rename IsImplicit to Implicit -BEGIN VERIFY SCRIPT- s() { git grep -l "$1" src | xargs sed -i "s/$1/$2/g"; } s 'PF_NONE' 'None' s 'PF_BLOOMFILTER' 'BloomFilter' s 'PF_RELAY' 'Relay' s 'PF_FORCERELAY' 'ForceRelay' s 'PF_DOWNLOAD' 'Download' s 'PF_NOBAN' 'NoBan' s 'PF_MEMPOOL' 'Mempool' s 'PF_ADDR' 'Addr' s 'PF_ISIMPLICIT' 'Implicit' s 'PF_ALL' 'All' -END VERIFY SCRIPT-
2021-05-12fuzz: Remove incorrect float round-trip serialization testMarcoFalke
2021-05-12fuzz: Run const CScript member functions only onceMarcoFalke
2021-05-11fuzz: Avoid timeout in EncodeBase58MarcoFalke
2021-05-11Merge bitcoin/bitcoin#21892: fuzz: Avoid excessively large min fee rate in ↵MarcoFalke
tx_pool 99993f066405863c66ccaec0a8427129f4515768 fuzz: Avoid excessively large min fee rate in tx_pool (MarcoFalke) Pull request description: Any fee rate above 1 BTC / kvB is clearly nonsense, so no need to fuzz this. Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34078 ACKs for top commit: practicalswift: cr ACK 99993f066405863c66ccaec0a8427129f4515768: patch looks correct despite no `fa` prefix in commit hash Tree-SHA512: bd3651d354b13d889ad1708d2b385ad0479de036de74a237346eefad5dbfb1df76ec02b55ec00487ec598657ef6102f992302b14c4e47f913a9962f81f4157e6
2021-05-11Merge bitcoin/bitcoin#21909: fuzz: Limit max insertions in timedata fuzz testMarcoFalke
fa95555a491dc01952703f476836e607ac34eab4 fuzz: Limit max insertions in timedata fuzz test (MarcoFalke) Pull request description: It is debatable whether a size of the median filter other than `200` (the only size used in production) should be fuzzed. For now add a minimal patch to cap the max insertions. Otherwise the complexity is N^2 log(N), where N is the size of the fuzz input. Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34167 ACKs for top commit: practicalswift: cr ACK fa95555a491dc01952703f476836e607ac34eab4: patch looks correct Tree-SHA512: be7737e9f4c906053e355641de84dde31fed37ed6be4c5e92e602ca7675dffdaf06b7063b9235ef541b05d3d5fd689c99479317473bb15cb5271b8baabffd0f2
2021-05-11Merge bitcoin/bitcoin#21644: p2p, bugfix: use NetPermissions::HasFlag() in ↵W. J. van der Laan
CConnman::Bind() 36fb036d25e2a3016b36873456e5a9e6251ffef8 p2p: allow NetPermissions::ClearFlag() only with PF_ISIMPLICIT (Jon Atack) 4e0d5788ba5771c81bc0ff2e6523cf9accddae46 test: add net permissions noban/download unit test coverage (Jon Atack) dde69f20a01acca64ac21cb13993c6e4f8709f23 p2p, bugfix: use NetPermissions::HasFlag() in CConnman::Bind() (Jon Atack) Pull request description: This is a bugfix follow-up to #16248 and #19191 that was noticed in #21506. Both v0.21 and master are affected. Since #19191, noban is a multi-flag that implies download, so the conditional in `CConnman::Bind()` using a bitwise AND on noban will return the same result for both the noban status and the download status. This means that download peers are incorrectly not being added to local addresses because they are mistakenly seen as noban peers. The second commit adds unit test coverage to illustrate and test the noban/download relationship and the `NetPermissions` operations involving them. The final commit adds documentation and disallows calling `NetPermissions::ClearFlag()` with any second param other than `NetPermissionFlags` "implicit" -- per current usage in the codebase -- because `ClearFlag()` should not be called with any second param that is a subflag of a multiflag, e.g. "relay" or "download," as that would leave the result in an invalid state corresponding to none of the existing NetPermissionFlags. Thanks to Vasil Dimov for noticing this. ACKs for top commit: theStack: re-ACK 36fb036d25e2a3016b36873456e5a9e6251ffef8 ☕ vasild: ACK 36fb036d25e2a3016b36873456e5a9e6251ffef8 hebasto: ACK 36fb036d25e2a3016b36873456e5a9e6251ffef8, I have reviewed the code and it looks OK, I agree it can be merged. kallewoof: Code review ACK 36fb036d25e2a3016b36873456e5a9e6251ffef8 Tree-SHA512: 5fbc7ddbf31d06b35bf238f4d77ef311e6b6ef2e1bb9893f32f889c1a0f65774a3710dcb21d94317fe6166df9334a9f2d42630809e7fe8cbd797dd6f6fc49491
2021-05-11fuzz: Limit max insertions in timedata fuzz testMarcoFalke
2021-05-10Merge bitcoin/bitcoin#21891: fuzz: Remove strprintf test cases that are ↵W. J. van der Laan
known to fail facfc0f65dd0a7d54c0f6d56bff793e57b12ee12 fuzz: Remove strprintf test cases that are known to fail (MarcoFalke) Pull request description: They are still waiting to be fixed (see https://github.com/c42f/tinyformat/issues/70 ), so no need for us to carry them around in our source code. They can be added back once upstream is fixed. Hopefully fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=34082 ACKs for top commit: laanwj: Code review ACK facfc0f65dd0a7d54c0f6d56bff793e57b12ee12 Tree-SHA512: d9d3d35555b6d58740a041ae45797ca85149f60990e2ed632c5dadf363e1d2362d2447681d7ceaa1fbffcd6e7bc8da5bc15d3923b68829a86c25b364a599afc8
2021-05-09fuzz: Avoid excessively large min fee rate in tx_poolMarcoFalke
2021-05-09fuzz: Remove strprintf test cases that are known to failMarcoFalke
2021-05-09fuzz: Limit ParseISO8601DateTime fuzzing to 32-bitMarcoFalke
2021-05-08fuzz: Remove unused --enable-danger-fuzz-link-all optionMarcoFalke
2021-05-07fuzz: Add WRITE_ALL_FUZZ_TARGETS_AND_ABORTMarcoFalke
2021-05-06Merge bitcoin/bitcoin#21798: fuzz: Create a block template in tx_pool targetsMarcoFalke
fa03d0acd6bd8bb6d3d5227512f042ff537ad993 fuzz: Create a block template in tx_pool targets (MarcoFalke) fa61ce5cf5c1d73d352173806571bcd7799ed2ee fuzz: Limit mocktime to MTP in tx_pool targets (MarcoFalke) fab646b8ea293bb2b03707c6ef6790982625e492 fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding a maximum size (MarcoFalke) fae2c8bc54e6c0fe69a82bd1b232c52edd1acd34 fuzz: Allow to pass min/max to ConsumeTime (MarcoFalke) Pull request description: Relatively simple check to ensure a block can always be created from the mempool ACKs for top commit: practicalswift: Tested ACK fa03d0acd6bd8bb6d3d5227512f042ff537ad993 Tree-SHA512: e613376ccc88591cbe594db14ea21ebc9b2b191f6325b3aa4ee0cd379695352ad3b480e286134ef6ee30f043d486cf9792a1bc7e44445c41045ac8c3b931c7ff
2021-05-05fuzz: Create a block template in tx_pool targetsMarcoFalke
2021-05-05Merge bitcoin/bitcoin#21817: refactor: Replace &foo[0] with foo.data()MarcoFalke
fac30eec42c486ec1bfd696293040a7aa0f04625 refactor: Replace &foo[0] with foo.data() (MarcoFalke) faece47c4706783e0460ed977390a44630b2d44c refactor: Avoid &foo[0] on C-Style arrays (MarcoFalke) face9611093377e8502d91f2ff56f9319a56357c refactor: Use only one temporary buffer in CreateObfuscateKey (MarcoFalke) fa05dddc42770809fdae4d9c35155f8117960019 refactor: Use CPubKey vector constructor where possible (MarcoFalke) fabb6dfe6e734eadd91448122f2ce8c1612c39a6 script: Replace address-of idiom with vector data() method (Guido Vranken) Pull request description: The main theme of this refactor is to replace `&foo[0]` with `foo.data()`. The first commit is taken from #21781 with the rationale: * In CSignatureCache::ComputeEntryECDSA, change the way a vector pointer is resolved to prevent invoking undefined behavior if the vector is empty. The other commits aim to remove all `&foo[0]`, where `foo` is any kind of byte representation. The rationale: * Sometimes alternative code without any raw data pointers is easier to read (refer to the respective commit message for details) * If the raw data pointer is needed, `foo.data()` should be preferred, as pointed out in the developer notes. This addresses the instances that have been missed in commit 592404f03f2b734351d734f0c9ca1fdce997321b, and https://github.com/bitcoin/bitcoin/pull/9804 ACKs for top commit: laanwj: Code review ACK fac30eec42c486ec1bfd696293040a7aa0f04625 practicalswift: cr ACK fac30eec42c486ec1bfd696293040a7aa0f04625: patch looks correct promag: Code review ACK fac30eec42c486ec1bfd696293040a7aa0f04625. Tree-SHA512: e7e73146edbc78911a8e8c728b0a1c6b0ed9a88a008e650aa5dbffe72425bd42c76df70199a9cf7e02637448d7593e0eac52fd0f91f59240283e1390ee21bfa5
2021-05-04fuzz: Limit toxic test globals to their respective scopeMarcoFalke
2021-05-04refactor: Replace &foo[0] with foo.data()MarcoFalke
2021-05-03Merge bitcoin/bitcoin#21810: fuzz: Various RPC fuzzer follow-upsMarcoFalke
5252f86eb616a1112e427c268c8e8825f2a63d67 fuzz: Reduce maintenance requirements by allowing RPC annotations also for conditionally available RPC commands (such as wallet commands) without the fragility of #ifdef forests (practicalswift) 54549dda310e2becee9cb4997d1408a90e91934f fuzz: RPC fuzzer post-merge follow-ups. Remove unused includes. Update list of fuzzed RPC commands. (practicalswift) Pull request description: Various RPC fuzzer follow-ups: * Remove unused includes. * Update list of fuzzed RPC commands. * Reduce maintenance requirements by allowing RPC annotations also for conditionally available RPC commands (such as wallet commands) without the fragility of `#ifdef` forests. Context: https://github.com/bitcoin/bitcoin/pull/21169#pullrequestreview-646723483 ACKs for top commit: MarcoFalke: Concept ACK 5252f86eb616a1112e427c268c8e8825f2a63d67 Tree-SHA512: 286d70798131706ffb157758e1c73f7f00ed96ce120c7d9dc849e672b283f1362df47b206cfec9da44d5debb5869225e721761dcd5c38a7d5d1019dc6c912ab2
2021-04-30Merge bitcoin/bitcoin#19521: Coinstats IndexW. J. van der Laan
5f96d7d22d8e05876c6fc014e70488699950fe38 rpc: gettxoutsetinfo rejects hash_serialized_2 for specific height (Fabian Jahr) 23fe50436be641d7417152adc683192649ba206a test: Add test for coinstatsindex behavior in reorgs (Fabian Jahr) 90c966b0f3cfbd6bce5883f46d8527c6853a86a2 rpc: Allow gettxoutsetinfo and getblockstats for stale blocks (Fabian Jahr) b9362392aef2689bc106c20925859ede555d082b index, rpc: Add use_index option for gettxoutsetinfo (Fabian Jahr) bb7788b121a30489bc81a1f46dde6a9b19ae4ec1 test: Test coinstatsindex robustness across restarts (Fabian Jahr) e0938c29099635150014ffc9bb0cafa8049ec55a test: Add tests for block_info in gettxoutsetinfo (Fabian Jahr) 2501576eccb08af80471c7b7b843b189ad6758c0 rpc, index: Add verbose amounts tracking to Coinstats index (Fabian Jahr) 655d929836a71af23d2035d2e2e99ad8b8c340c3 test: add coinstatsindex getindexinfo coverage, improve current tests (Jon Atack) ca01bb8d689f93e1c7669b0ba7a4994c0206dabd rpc: Add Coinstats index to getindexinfo (Fabian Jahr) 57a026c30fef3138bb8db46e6865acb9dc2674f8 test: Add unit test for Coinstats index (Fabian Jahr) 6a4c0c09ab4d073a26c3c4a02783d5dcd88f6eef test: Add functional test for Coinstats index (Fabian Jahr) 3f166ecc125fce6ccd995687fa16572090a5d099 rpc: gettxoutsetinfo can be requested for specific blockheights (Fabian Jahr) 3c914d58ff323255b32e717d0ce28209ec0abdaa index: Coinstats index can be activated with command line flag (Fabian Jahr) dd58a4de21469d6d848ae309edc47f558628221d index: Add Coinstats index (Fabian Jahr) a8a46c4b3cfda4b95c92a36f8cebd3606377e57d refactor: Simplify ApplyStats and ApplyHash (Fabian Jahr) 9c8a265fd21a87228c18a1661df99fedc1866baf refactor: Pass hash_type to CoinsStats in stats object (Fabian Jahr) 2e2648a9021dfbb6e17dfa81472f057dacbc34e0 crypto: Make MuHash Remove method efficient (Fabian Jahr) Pull request description: This is part of the coinstats index project tracked in #18000 While the review of the new UTXO set hash algorithm (MuHash) takes longer recently #19328 was merged which added the possibility to run `gettxoutsetinfo` with a specific hash type. As the first type it added `hash_type=none` which skips the hashing of the UTXO set altogether. This alone did not make `gettxoutsetinfo` much faster but it allows the use of an index for the remaining coin statistics even before a new hashing algorithm has been added. Credit to Sjors for the idea to take this intermediate step. Features summary: - Users can start their node with the option `-coinstatsindex` which syncs the index in the background - After the index is synced the user can use `gettxoutsetinfo` with `hash_type=none` or `hash_type=muhash` and will get the response instantly out of the index - The user can specify a height or block hash when calling `gettxoutsetinfo` to see coin statistics at a specific block height ACKs for top commit: Sjors: re-tACK 5f96d7d22d8e05876c6fc014e70488699950fe38 jonatack: Code review re-ACK 5f96d7d22d8e05876c6fc014e70488699950fe38 per `git range-diff 13d27b4 07201d3 5f96d7d` promag: Tested ACK 5f96d7d22d8e05876c6fc014e70488699950fe38. Light code review ACK 5f96d7d22d8e05876c6fc014e70488699950fe38. Tree-SHA512: cbca78bee8e9605c19da4fbcd184625fb280200718396c694a56c7daab6f44ad23ca9fb5456d09f245d8b8d9659fdc2b3f3ce5e953c1c6cf4003dbc74c0463c2
2021-04-30[refactor] Remove unused ForEachNodeThen() templateJohn Newbery
2021-04-30[net processing] Move addr relay data and logic into net processingJohn Newbery
2021-04-29fuzz: Reduce maintenance requirements by allowing RPC annotations also for ↵practicalswift
conditionally available RPC commands (such as wallet commands) without the fragility of #ifdef forests
2021-04-28Merge bitcoin/bitcoin#18847: compressor: use a prevector in CompressScript ↵MarcoFalke
serialization [ZAP1] 83a425d25af033086744c1c8c892015014ed46bd compressor: use a prevector in compressed script serialization (William Casarin) Pull request description: This function was doing millions of unnecessary heap allocations during IBD. I'm start to catalog unnecessary heap allocations as a pet project of mine: as-zero-as-possible-alloc IBD. This is one small step. before: ![May01-174536](https://user-images.githubusercontent.com/45598/80850964-9a38de80-8bd3-11ea-8eec-08cd38ee1fa1.png) after: ![May01-174610](https://user-images.githubusercontent.com/45598/80850974-a91f9100-8bd3-11ea-94a1-e2077391f6f4.png) ~should I type alias this?~ *I type aliased it* This is a part of the Zero Allocations Project #18849 (ZAP1). This code came up as a place where many allocations occur. ACKs for top commit: Empact: ACK https://github.com/bitcoin/bitcoin/pull/18847/commits/83a425d25af033086744c1c8c892015014ed46bd elichai: tACK 83a425d25af033086744c1c8c892015014ed46bd sipa: utACK 83a425d25af033086744c1c8c892015014ed46bd Tree-SHA512: f0ffa6ab0ea1632715b0b76362753f9f6935f05cdcc80d85566774401155a3c57ad45a687942a1806d3503858f0bb698da9243746c8e2edb8fdf13611235b0e0
2021-04-28fuzz: Limit mocktime to MTP in tx_pool targetsMarcoFalke
This is needed for the next commit to generate blocks. Also, apply the same mocking strategies to both targets.
2021-04-28fuzz: Use correct variant of ConsumeRandomLengthString instead of hardcoding ↵MarcoFalke
a maximum size This is technically a breaking change. This allows the fuzz engine to pick the right size, also larger sizes, if needed.
2021-04-28fuzz: Allow to pass min/max to ConsumeTimeMarcoFalke
2021-04-28fuzz: RPC fuzzer post-merge follow-ups. Remove unused includes. Update list ↵practicalswift
of fuzzed RPC commands.