aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2024-09-04Merge bitcoin/bitcoin#30804: fuzz: Rename fuzz_seed_corpus to fuzz_corporamerge-script
8888beea8d477b1d4a2dfd2a0bb5f686de62f3ff scripted-diff: fuzz: Rename fuzz_seed_corpus to fuzz_corpora (MarcoFalke) Pull request description: Now that cmake was a breaking change for all fuzz scripts, it seems fine to bundle it with another breaking change to rename the fuzz corpora directory, as discussed and approved in https://github.com/bitcoin-core/qa-assets/issues/200: * The word "seed" in the old name doesn't really apply. In reality it is a collection of fuzz input seeds, as well as fuzz inputs. * The rename will also allow in the future (when there is a need and desire) to provide a minimal set of possibly hand-crafted or otherwise non-fuzz-generated fuzz seed inputs to some fuzz targets (and possibly store them in a separate folder and validate that their format is still accurate and matches the fuzz target code). * Finally, "corpus" is renamed to corpora, to clarify that the folder holds the fuzz inputs for several fuzz targets. ACKs for top commit: brunoerg: ACK 8888beea8d477b1d4a2dfd2a0bb5f686de62f3ff marcofleon: ACK 8888beea8d477b1d4a2dfd2a0bb5f686de62f3ff Tree-SHA512: abc693ca5d946850f04b6349e2a98f8fbc2ba9991be5a025bc0f357e341cbe7510f2f5f0e47b997d07136736d818df361270f372b8fb70860995a0605ca81e4d
2024-09-04Merge bitcoin/bitcoin#30802: doc: Clarify libbitcoin_consensus in ↵merge-script
design/libraries.md fa78ed83be1f6831416a6f6632e2161f12d359e4 doc: Clarify libbitcoin_consensus in design/libraries.md (MarcoFalke) Pull request description: Now that the shared library has been removed in commit 80f8b92f4f2311b9e9a25361c9dd973244e6f95c, update the documentation to drop the no-longer applicable prefix "Stable...". ACKs for top commit: hebasto: ACK fa78ed83be1f6831416a6f6632e2161f12d359e4. fanquake: ACK fa78ed83be1f6831416a6f6632e2161f12d359e4 Tree-SHA512: d7b946d50f734c0474ff6155a655a2bb873f76e071bfeeca1dd42ea5fdd32bc1e45129826bb54e3f111265d19c2aba2d02cb77ad7663f9fc40c8c875e5fddda2
2024-09-03Merge bitcoin/bitcoin#30675: http: set TCP_NODELAY when creating HTTP serverAva Chow
03d49d0f25ab5660524d5ddd171de677a808b984 http: set TCP_NODELAY when creating HTTP server (Roman Zeyde) Pull request description: Otherwise, the default HTTP server config may result in high latency, due to Nagle's algorithm (on the server) and delayed ACK (on the client): [1] https://www.extrahop.com/blog/tcp-nodelay-nagle-quickack-best-practices [2] https://eklitzke.org/the-caveats-of-tcp-nodelay Without the fix, fetching a small block takes ~40ms (when connection keep-alive is enabled): ``` $ ab -k -c 1 -n 100 http://localhost:8332/rest/block/00000000000002b5898f7cdc80d9c84e9747bc6b9388cc989971d443f05713ee.bin Server Software: Server Hostname: localhost Server Port: 8332 Document Path: /rest/block/00000000000002b5898f7cdc80d9c84e9747bc6b9388cc989971d443f05713ee.bin Document Length: 25086 bytes Concurrency Level: 1 Time taken for tests: 4.075 seconds Complete requests: 100 Failed requests: 0 Keep-Alive requests: 100 Total transferred: 2519200 bytes HTML transferred: 2508600 bytes Requests per second: 24.54 [#/sec] (mean) Time per request: 40.747 [ms] (mean) Time per request: 40.747 [ms] (mean, across all concurrent requests) Transfer rate: 603.76 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 0 41 4.1 41 42 Waiting: 0 0 0.1 0 1 Total: 0 41 4.1 41 42 Percentage of the requests served within a certain time (ms) 50% 41 66% 41 75% 41 80% 41 90% 42 95% 42 98% 42 99% 42 100% 42 (longest request) ``` With the fix, it takes ~0.2ms: ``` $ ab -k -c 1 -n 1000 http://localhost:8332/rest/block/00000000000002b5898f7cdc80d9c84e9747bc6b9388cc989971d443f05713ee.bin Benchmarking localhost (be patient) Completed 100 requests Completed 200 requests Completed 300 requests Completed 400 requests Completed 500 requests Completed 600 requests Completed 700 requests Completed 800 requests Completed 900 requests Completed 1000 requests Finished 1000 requests Server Software: Server Hostname: localhost Server Port: 8332 Document Path: /rest/block/00000000000002b5898f7cdc80d9c84e9747bc6b9388cc989971d443f05713ee.bin Document Length: 25086 bytes Concurrency Level: 1 Time taken for tests: 0.194 seconds Complete requests: 1000 Failed requests: 0 Keep-Alive requests: 1000 Total transferred: 25192000 bytes HTML transferred: 25086000 bytes Requests per second: 5147.05 [#/sec] (mean) Time per request: 0.194 [ms] (mean) Time per request: 0.194 [ms] (mean, across all concurrent requests) Transfer rate: 126625.50 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.0 0 0 Processing: 0 0 0.0 0 0 Waiting: 0 0 0.0 0 0 Total: 0 0 0.0 0 0 Percentage of the requests served within a certain time (ms) 50% 0 66% 0 75% 0 80% 0 90% 0 95% 0 98% 0 99% 0 100% 0 (longest request) ``` ACKs for top commit: achow101: ACK 03d49d0f25ab5660524d5ddd171de677a808b984 theStack: re-ACK 03d49d0f25ab5660524d5ddd171de677a808b984 tdb3: ACK 03d49d0f25ab5660524d5ddd171de677a808b984 Tree-SHA512: bbf3d78b8521f569430850ec4315a75711303547df1a3de213a4ad34c9700105e374e0a649352fd05f8e4badb5b59debd3720e1c5d392c5113d7816648f7fcaa
2024-09-03Merge bitcoin/bitcoin#26619: log: expand BCLog::LogFlags (categories) to 64 bitsAva Chow
b31a0cd0378184b2b9eb8f4bd3120cbd32c62005 log: expand BCLog::LogFlags (categories) to 64 bits (Larry Ruane) Pull request description: Increase the maximum number of logging categories from 32 to 64. We're currently using 29 of the 32 available logging categories (there are only 3 remaining). It would be good to increase the limit soon; the fourth PR to be merged that adds a new logging category will be blocked until something like this is done. This PR also adds a `TEST` category that uses the new range (`1ULL << 63`) in case there's a hidden assumption somewhere that the `BCLog::LogFlags` type is 32 bits. (Also added a test for this test category.) It also provides an example showing that the expression must be `1ULL << <shift>` for shift value 31 and beyond. ACKs for top commit: achow101: ACK b31a0cd0378184b2b9eb8f4bd3120cbd32c62005 vasild: ACK b31a0cd0378184b2b9eb8f4bd3120cbd32c62005 ryanofsky: Code review ACK b31a0cd0378184b2b9eb8f4bd3120cbd32c62005, just dropping mask_bit constant since last review. I still think theStack: Code-review ACK b31a0cd0378184b2b9eb8f4bd3120cbd32c62005 Tree-SHA512: de422dbeb479848d370aed42d415f42461457ab0eda62b245dc7ff9f0e111626e7d4c0d62ff13082ec664d05fbb0db04c71eb4b6f22eb8f19198826a67c4035e
2024-09-03Merge bitcoin/bitcoin#30742: kernel: Use spans instead of vectors for ↵Ava Chow
passing block headers to validation functions a2955f09792b6232f3a45aa44a498b466279a8b7 validation: Use span for ImportBlocks paths (TheCharlatan) 20515ea3f5bd426f6e3746cf5cddd2324dacae31 validation: Use span for CalculateClaimedHeadersWork (TheCharlatan) 52575e96e72a0402c448f86728b2e84836b1e817 validation: Use span for ProcessNewBlockHeaders (TheCharlatan) Pull request description: Makes it friendlier for potential future users of the kernel library if they do not store the headers in a std::vector, but can guarantee contiguous memory. Take this opportunity to also change the argument of ImportBlocks previously taking a `std::vector` to a `std::span`. ACKs for top commit: stickies-v: re-ACK a2955f09792b6232f3a45aa44a498b466279a8b7 - no changes except further walking the ~file~ path of modernizing variable names. maflcko: ACK a2955f09792b6232f3a45aa44a498b466279a8b7 🕑 achow101: ACK a2955f09792b6232f3a45aa44a498b466279a8b7 danielabrozzoni: ACK a2955f09792b6232f3a45aa44a498b466279a8b7 Tree-SHA512: 8b07f4ad26e270b65600d1968cd78847b85caca5bfbb83fd9860389f26656b1d9a40b85e0990339f50403d18cedcd2456990054f3b8b0bedce943e50222d2709
2024-09-03Merge bitcoin/bitcoin#29553: assumeutxo: Add dumptxoutset height param, ↵Ava Chow
remove shell scripts 94b0adcc371540732453d70309c4083d4bd9cd6b rpc, refactor: Prevent potential race conditions in dumptxoutset (Fabian Jahr) e868a6e070a91c00555e72181f9b14bbf0373fdc doc: Improve assumeutxo guide and add more docs/comments (Fabian Jahr) b29c21fc92dcc3da95bd032ba41675a8b9a0a24b assumeutxo: Remove devtools/utxo_snapshot.sh (Fabian Jahr) 20a1c77aa7dec2449071187a439d17f7aeaee648 contrib: Remove test_utxo_snapshots.sh (Fabian Jahr) 842685035244e151f4a10019af2dfe0563f11a82 test: Test for dumptxoutset at specific height (Fabian Jahr) 993cafe7e45ab0af1e862c7def3de688f47c0443 RPC: Add type parameter to dumptxoutset (Fabian Jahr) fccf4f91d21c351d742943d35476f53d40963b8b RPC: Extract ReconsiderBlock helper (Fabian Jahr) 446ce51c21cd2466cb12fa0166fd069d42b603bf RPC: Extract InvalidateBlock helper (Fabian Jahr) Pull request description: This adds a height parameter to the `dumptxoutset` RPC. This internalizes the workflow that was previously done by scripts: roll back the chain to the height we actually want the snapshot from, create the snapshot, roll forward to the real tip again. The nice thing about internalizing this functionality is that we can write tests for the code and it gives us more options to make the functionality robust. The shell scripts we have so far will be more cumbersome to maintain in the long run, especially since we will only notice later when we have broken them. I think it's safe to remove these `test_utxo_snapshots.sh` as well when we have this option in `dumptxoutset` because we have also added some good additional functional test coverage for this functionality. ACKs for top commit: Sjors: re-utACK 94b0adcc371540732453d70309c4083d4bd9cd6b achow101: ACK 94b0adcc371540732453d70309c4083d4bd9cd6b mzumsande: ACK 94b0adcc371540732453d70309c4083d4bd9cd6b pablomartin4btc: re-ACK 94b0adcc371540732453d70309c4083d4bd9cd6b Tree-SHA512: a4c9af5f687d1ca7bfb579a36f363882823386b5fa80c05de531b05a2782b5da6ff5baf3ada4bca8f32f63975d86f1948175abed9affe51fc958472b5f838dab
2024-09-03scripted-diff: fuzz: Rename fuzz_seed_corpus to fuzz_corporaMarcoFalke
-BEGIN VERIFY SCRIPT- ren() { sed -i "s:\<$1\>:$2:g" $( git grep -l "$1" ) ; } ren fuzz_seed_corpus fuzz_corpora ren FUZZ_SEED_CORPUS_DIR FUZZ_CORPORA_DIR -END VERIFY SCRIPT-
2024-09-03doc: Clarify libbitcoin_consensus in design/libraries.mdMarcoFalke
2024-09-03Merge bitcoin/bitcoin#30778: build: Fix linking for `fuzz` target when ↵merge-script
building with MSan 787dfaf084a3952319778da9cbcda9d7d619e4ee ci: Do not override `-g -O1` set in `MSAN_FLAGS` (Hennadii Stepanov) 26c460aa8b5decfd08d931b9b3f80be5c13c7528 build: Fix linking for `fuzz` target when building with MSan (Hennadii Stepanov) Pull request description: The first commit fixes https://github.com/bitcoin/bitcoin/issues/30760. The second commit: 1. Preserves `-g -O1` set in `MSAN_FLAGS`. Since configuration-specific flags override general flags, these are set to empty strings. A similar approach is used in the OSS-Fuzz repository. 2. Sets the "Debug" build configuration when depends are built with `DEBUG=1`, ensuring that `linux_debug_CPPFLAGS` from depends are passed to the main build system. ACKs for top commit: maflcko: review-only ACK 787dfaf084a3952319778da9cbcda9d7d619e4ee fanquake: ACK 787dfaf084a3952319778da9cbcda9d7d619e4ee - as a follow up it would be good to: Tree-SHA512: c324390d1dbda30f82025d8482ddb0cfa0395f9ba225a2ddce05a123c65e0622a6a1d5f0fa03f09e21d62792431cf3da5c49e41a3ac7f7a958d0392a0430f29c
2024-09-03Merge bitcoin/bitcoin#30741: doc: update documentation and scripts related ↵merge-script
to build directories 6a68343ffbf3291eb243d90c00df50e672ff3944 doc: Prepend 'build/' to binary paths under 'src/' in docs (Lőrinc) 91b3bc2b9c572d9244e1cf542655c1b32e87aaf7 doc: Update documentation generation example in developer-notes.md (Lőrinc) Pull request description: In [the other readmes](https://github.com/bitcoin/bitcoin/blob/6ce50fd9d0ae6850d54bf883e7a7c1bcb6912c5c/src/test/README.md?plain=1#L19) we've provided a default build directory instead, unified the `developer-notes.md` to specify it explicitly. In the next commit I've used this default to go over each reference to our binaries and changed their in-source references to the build directory. Some of these changes were in example outputs - I haven't validated that the outputs are still the same. I haven't modified the build folders in the devtools. ACKs for top commit: maflcko: review ACK 6a68343ffbf3291eb243d90c00df50e672ff3944 pablomartin4btc: ACK 6a68343ffbf3291eb243d90c00df50e672ff3944 fanquake: ACK 6a68343ffbf3291eb243d90c00df50e672ff3944 - we still need to followup with other scripts/devtools, and likely unify what we are doing in some way, but this is an improvement. Tree-SHA512: 905d9c68cafe1e405e98d6aa089d7a36a34c9e03403df5c67ac2c9a98cfa54a0305b647cb92247dcb9f49e9b509a8ba88367392b95618c67059684c67b6c36fb
2024-09-02build: Fix linking for `fuzz` target when building with MSanHennadii Stepanov
2024-09-02Merge bitcoin/bitcoin#30750: scripted-diff: LogPrint -> LogDebugmerge-script
fa09cb41f58d0483ffe134eb274b9048c5260faa refactor: Remove unused LogPrint (MarcoFalke) 333341589010b1d9b21b68ae6649992fd2653756 scripted-diff: LogPrint -> LogDebug (MarcoFalke) Pull request description: `LogPrint` has many issues: * It seems to indicate that something is being "printed", however config options such as `-printtoconsole` actually control what and where something is logged. * It does not mention the log severity (debug). * It is a deprecated alias for `LogDebug`, according to the dev notes. * It wastes review cycles, because reviewers sometimes point out that it is deprecated. * It makes the code inconsistent, when both are used, possibly even in lines right next to each other (like in `InitHTTPServer`) Fix all issues by removing the deprecated alias. I checked all conflicting pull requests and at the time of writing there are no conflicts, except in pull requests that are marked as draft, are yet unreviewed, or are blocked on feedback for other reasons. So I think it is fine to do now. ACKs for top commit: stickies-v: ACK fa09cb41f58d0483ffe134eb274b9048c5260faa danielabrozzoni: utACK fa09cb41f58d0483ffe134eb274b9048c5260faa TheCharlatan: ACK fa09cb41f58d0483ffe134eb274b9048c5260faa Tree-SHA512: 14270f4cfa3906025a0b994cbb5b2e3c8c2427c0beb19c717a505a2ccbfb1fd1ecf2fd03f6c52d22cde69a8d057e50d2207119fab2c2bc8228db3f10d4288d0f
2024-09-02Merge bitcoin/bitcoin#30664: build: Remove Autotools-based build systemmerge-script
faa382ae7642da0e436ea2c7f7eac67386280a7e ci, doc: Drop reference to `src/.bear-tidy-config` (Hennadii Stepanov) d71ac768424333b65a6d88c9752cc9c7fdb276f3 build: Remove Autotools-based build system (Hennadii Stepanov) e268b48419b802857c329a7ae27d3dbe4c1a9a4b doc: Adjust `doc/design/libraries.md` (Hennadii Stepanov) d209e4f1566f9240f105bb93ed61bda9b4bb272b doc: Drop mentions of `share/genbuild.sh` (Hennadii Stepanov) Pull request description: This PR deletes the Autotools-based build system. The MSVC build system is deleted in https://github.com/bitcoin/bitcoin/pull/30731. ACKs for top commit: maflcko: re-ACK faa382ae7642da0e436ea2c7f7eac67386280a7e 🍦 TheCharlatan: ACK faa382ae7642da0e436ea2c7f7eac67386280a7e fanquake: ACK faa382ae7642da0e436ea2c7f7eac67386280a7e Tree-SHA512: 53df977b5b199a1c38f7f61a042a62b24831c559ba65a461b4ac1c96a1a56e2dfd676df79f1358fd1cc1749ff27e7b548086157f337d4f596c1054cb3d2d5739
2024-09-01rpc, refactor: Prevent potential race conditions in dumptxoutsetFabian Jahr
Co-authored-by: Ryan Ofsky <ryan@ofsky.org>
2024-09-01doc: Improve assumeutxo guide and add more docs/commentsFabian Jahr
Also fixes some outdated information in the remaining design doc.
2024-09-01RPC: Add type parameter to dumptxoutsetFabian Jahr
2024-09-01RPC: Extract ReconsiderBlock helperFabian Jahr
2024-09-01RPC: Extract InvalidateBlock helperFabian Jahr
2024-08-31Merge bitcoin/bitcoin#30377: refactor: Replace ParseHex with consteval ↵Ryan Ofsky
""_hex literals 8756ccd71218c8e013181473720b10d3c4a94957 scripted-diff: Replace ParseHex[<std::byte>]("str") -> "str"_hex[_u8] (Hodlinator) 9cb687351f7ff50d19b5c5997ed69cfdab75bbf2 refactor: Prepare for ParseHex -> ""_hex scripted-diff (Hodlinator) 50bc017040ae300c795e3709233b80619db24518 refactor: Hand-replace some ParseHex -> ""_hex (Hodlinator) 5b74a849cf5c54543280ba6488ae7f87361b1e2f util: Add consteval ""_hex[_v][_u8] literals (l0rinc) dc5f6f681275f56ff389500e3dd98fbe791f4a45 test refactor: util_tests - parse_hex clean up (Hodlinator) 2b5e6eff36abe4c23b8789ef1babfafedc90b973 refactor: Make XOnlyPubKey tolerate constexpr std::arrays (Hodlinator) 403d86f1ccf0b73f042d42a9722bb007ba8c7a31 refactor: vector -> span in CCrypter (Hodlinator) bd0830bbd4105af1953b6b897ba6bc35098cbe13 refactor: de-Hungarianize CCrypter (Hodlinator) d99c81697148a9695c0fba614dff9fbe728a3acd refactor: Improve CCrypter related lines (Hodlinator) 7e1d9a84689d77a9349a3a09fd5f9dd3f9c293aa refactor: Enforce lowercase hex digits for consteval uint256 (Hodlinator) Pull request description: Motivation: * Validates and converts the hex string into bytes at compile time instead of at runtime like `ParseHex()`. * Eliminates runtime dependencies: https://github.com/bitcoin/bitcoin/pull/30377#issuecomment-2214432177, https://github.com/bitcoin/bitcoin/pull/30048#discussion_r1592108480 * Has stricter requirements than `ParseHex()` (disallows whitespace and uppercase hex digits) and replaces it in a bunch of places. * Makes it possible to derive other compile time constants. * Minor: should shave off a few runtime CPU cycles. `""_hex` produces `std::array<std::byte>` as the momentum in the codebase is to use `std::byte` over `uint8_t`. Also makes `uint256` hex string constructor disallow uppercase hex digits. Discussed: https://github.com/bitcoin/bitcoin/pull/30560#discussion_r1701323070 Surprisingly does not change the size of the Guix **bitcoind** binary (on x86_64-linux-gnu) by 1 single byte. Spawned already merged PRs: #30436, #30482, #30532, #30560. ACKs for top commit: l0rinc: ACK 8756ccd71218c8e013181473720b10d3c4a94957 stickies-v: Rebase re-ACK 8756ccd71218c8e013181473720b10d3c4a94957, no changes since a096215c9c71a2ec03e76f1fd0bcdda0727996e0 ryanofsky: Code review ACK 8756ccd71218c8e013181473720b10d3c4a94957, just rebasing since last review and taking advantage of CScript constructors in #29369, also tweaking a code comment Tree-SHA512: 9b2011b7c37e0ef004c669f8601270a214b388916316458370f5902c79c2856790b1b2c7c123efa65decad04886ab5eff95644301e0d84358bb265cf1f8ec195
2024-08-30build: Remove Autotools-based build systemHennadii Stepanov
2024-08-30validation: Use span for ImportBlocks pathsTheCharlatan
Makes it friendlier for potential future users of the kernel library if they do not store the headers in a std::vector, but can guarantee contiguous memory.
2024-08-30validation: Use span for CalculateClaimedHeadersWorkTheCharlatan
Makes it friendlier for potential future users of the kernel library if they do not store the headers in a std::vector, but can guarantee contiguous memory.
2024-08-30validation: Use span for ProcessNewBlockHeadersTheCharlatan
Makes it friendlier for potential future users of the kernel library if they do not store the headers in a std::vector, but can guarantee contiguous memory.
2024-08-29refactor: Remove unused LogPrintMarcoFalke
2024-08-29doc: Prepend 'build/' to binary paths under 'src/' in docsLőrinc
2024-08-29scripted-diff: LogPrint -> LogDebugMarcoFalke
-BEGIN VERIFY SCRIPT- sed -i 's/\<LogPrint\>/LogDebug/g' $( git grep -l '\<LogPrint\>' -- ./contrib/ ./src/ ./test/ ':(exclude)src/logging.h' ) -END VERIFY SCRIPT-
2024-08-29doc: Drop mentions of `share/genbuild.sh`Hennadii Stepanov
2024-08-28scripted-diff: Replace ParseHex[<std::byte>]("str") -> "str"_hex[_u8]Hodlinator
Ideally all call sites should accept std::byte instead of uint8_t but those transformations are left to future PRs. -BEGIN VERIFY SCRIPT- sed -i --regexp-extended 's/\bParseHex\(("[^"]*")\)/\1_hex_u8/g' $(git grep -l ParseHex -- :src ':(exclude)src/test/util_tests.cpp') sed -i --regexp-extended 's/\bParseHex<std::byte>\(("[^"]*")\)/\1_hex/g' $(git grep -l ParseHex -- :src ':(exclude)src/test/util_tests.cpp') sed -i --regexp-extended 's/\bScriptFromHex\(("[^"]*")\)/ToScript(\1_hex)/g' src/test/script_tests.cpp -END VERIFY SCRIPT- Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Co-Authored-By: Ryan Ofsky <ryan@ofsky.org>
2024-08-28refactor: Prepare for ParseHex -> ""_hex scripted-diffHodlinator
- Adds using namespace. - Extracts ToScript helper function from ScriptFromHex, to be used heavily in the next commit. - Changes ScriptFromHex from using ParseHex to TryParseHex, now asserting the string is valid. - Use even number of hex digits in comment (and apply replacement from next commit to only touch line once).
2024-08-28refactor: Hand-replace some ParseHex -> ""_hexHodlinator
The following scripted-diff commit will replace ParseHex("...") with "..."_hex_u8, but this replacement will not work in cases where vectors are needed instead of arrays, and is not ideal in cases where std::byte is accepted. For example, it is currently necessary to use _hex_v_u8 when calling CScript operator<< because that operator does not currently support std::array or std::byte. Conversely, it is incorrect to use _hex_v instead of _hex in net_processing.cpp for the MakeAndPushMessage argument, because if the argument is a std::vector it is considered variable-length and serialized with a size prefix, but if the argument is a std::array or Span is it considered fixed length and serialized without a prefix. By the same logic, it is also safe to change the NUMS_H constant in pubkey.cpp from a std::vector to std::array because it is never serialized.
2024-08-28util: Add consteval ""_hex[_v][_u8] literalsl0rinc
""_hex is a compile-time user-defined literal returning std::array<std::byte>, equivalent of ParseHex. Variants: - ""_hex_v returns std::vector<std::byte> - ""_hex_u8 returns std::array<uint8_t> - ""_hex_v_u8 returns std::vector<uint8_t> - Directly serializable as a size-prefixed OP_PUSH CScript payload using operator<<. Also extracts from_hex into shared util::ConstevalHexDigit function. Co-Authored-By: hodlinator <172445034+hodlinator@users.noreply.github.com> Co-Authored-By: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Co-Authored-By: Ryan Ofsky <ryan@ofsky.org> Co-Authored-By: stickies-v <stickies-v@protonmail.com>
2024-08-28test refactor: util_tests - parse_hex clean upHodlinator
* Use BOOST_CHECK_EQUAL_COLLECTIONS and BOOST_CHECK_EQUAL instead of deprecated BOOST_CHECK. * Avoid repeating expected values. * Break out repeated HEX_PARSE_INPUT and rename ParseHex_expected to HEX_PARSE_OUTPUT. Done in preparation for adding a couple more tests in the next commit. Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2024-08-28refactor: Make XOnlyPubKey tolerate constexpr std::arraysHodlinator
Length was already asserted inside of base_blob-ctor.
2024-08-28refactor: vector -> span in CCrypterHodlinator
TestEncryptSingle: Remove no longer needed plaintext2-variable that existed because vectors had different allocators.
2024-08-28refactor: de-Hungarianize CCrypterHodlinator
Beyond renaming it also adjusts whitespace and adds braces to conform to current doc/developer-notes.md. TestEncrypt: Change iterator type to auto in ahead of vector -> span conversion. Only touches functions that will be modified in next commit.
2024-08-28refactor: Improve CCrypter related linesHodlinator
Lines will be touched in next 2 commits.
2024-08-28refactor: Enforce lowercase hex digits for consteval uint256Hodlinator
Also changes compile-time asserts with comments into throws.
2024-08-28doc: fix a few simple codespell warningsLőrinc
2024-08-28Merge bitcoin/bitcoin#30734: doc: fix a few likely documentation typos ↵merge-script
related to CMake migration 7ee5c3c5b2fb477a283df8861e28005ef514bd20 Fix a few likely documentation typos (Lőrinc) Pull request description: Found them during CMake migration - and ran a quick spellcheck for the rest to cover any remaining ones ACKs for top commit: maflcko: lgtm ACK 7ee5c3c5b2fb477a283df8861e28005ef514bd20 Tree-SHA512: c6e7aa1e952e0d093745c4e6004c3907b7a215c6f998cc205307c0c68abcc067bf3f56e22af0deb1710186e8a871306f4bae8a35c74581e5299abcbbcddfaa75
2024-08-28Merge bitcoin/bitcoin#30571: test: [refactor] Use m_rng directlymerge-script
948238a683b6c99f4e91114aa75680c6c2d73714 test: Remove FastRandomContext global (Ryan Ofsky) fa0fe08eca48064b2a42789571fea017e455d820 scripted-diff: [test] Use g_rng/m_rng directly (MarcoFalke) fa54cab4734f02422f28fdffc0f11e6d3d51b8f0 test: refactor: Accept any RandomNumberGenerator in RandMoney (MarcoFalke) 68f77dd21e4aaf4f09d36d6e5ddd7d260824b94b test: refactor: Pass rng parameters to test functions (Ryan Ofsky) fa19af555dff6d6c722caf36319b158699d2aa95 test: refactor: Move g_insecure_rand_ctx.Reseed out of the helper that calls MakeRandDeterministicDANGEROUS (MarcoFalke) 3dc527f4602297ffcec3a578eadc480a620d01ec test: refactor: Give unit test functions access to test state (Ryan Ofsky) fab023e177d7eaef73902869ae1c95693f1e268b test: refactor: Make unsigned promotion explicit (MarcoFalke) fa2cb654eca8dd6ed89101cd6d199ba1de0b81e0 test: Add m_rng alias for the global random context (MarcoFalke) fae7e3791c9ed8053166773fcfb583ad19d006dd test: Correct the random seed log on a prevector test failure (MarcoFalke) Pull request description: This is mostly a style-cleanup for the tests' random generation: 1) `g_insecure_rand_ctx` in the tests is problematic, because the name is a leftover when the generator was indeed insecure. However, now the generator is *deterministic*, because the seed is either passed in or printed (c.f. RANDOM_CTX_SEED). Stating that deterministic randomness is insecure in the tests seems redundant at best. Fix it by just using `m_rng` for the name. 2) The global random context has many one-line aliases, such as `InsecureRand32`. This is problematic, because the same line of code may use the context directly and through a wrapper at the same time. For example in net_tests (see below). This inconsistency is harmless, but confusing. Fix it by just removing the one-line aliases. ``` src/test/net_tests.cpp: auto msg_data_1 = g_insecure_rand_ctx.randbytes<uint8_t>(InsecureRandRange(100000)); ```` 3) The wrapper for randmoney has the same problem that the same unit test uses the context directly and through a wrapper at the same time. Also, it has a single type of Rng hardcoded. Fix it by accepting any type. ACKs for top commit: hodlinator: ACK 948238a683b6c99f4e91114aa75680c6c2d73714 ryanofsky: Code review ACK 948238a683b6c99f4e91114aa75680c6c2d73714. Only changes since last review were changing a comments a little bit. marcofleon: Code review ACK 948238a683b6c99f4e91114aa75680c6c2d73714. Only changes since my last review are the improvements in `prevector_tests`. Tree-SHA512: 69c6b46a42cb743138ee8c87ff26a588dbe083e3efb3dca49b8a133ba5d3b09e8bf01c590ec7e121a7d77cb1fd7dcacd927a9ca139ac65e1f7c6d1ec46f93b57
2024-08-28Merge bitcoin/bitcoin#22838: descriptors: Be able to specify change and ↵glozow
receiving in a single descriptor string a0abcbd3822bd17a1d73c42ccd5b040a150b0501 doc: Mention multipath specifier (Ava Chow) 0019f61fc546b4d5f42eb4086f42560863fe0efb tests: Test importing of multipath descriptors (Ava Chow) f97d5c137d605ac48f1122a836c9aa5f834957ba wallet, rpc: Allow importdescriptors to import multipath descriptors (Ava Chow) 32dcbca3fb918bc899a0637f876db31c3419aafd rpc: Allow importmulti to import multipath descriptors correctly (Ava Chow) 64dfe3ce4bed9ac168d0b08def8af7485db94ef1 wallet: Move internal to be per key when importing (Ava Chow) 16922455253f47fae0466c4ec6c3adfadcfe9182 tests: Multipath descriptors for scantxoutset and deriveaddresses (Ava Chow) cddc0ba9a9dca3ca5873d768b3b504cdb2ab947b rpc: Have deriveaddresses derive receiving and change (Ava Chow) 360456cd221501fde3efe11bdba5c6d999dbb323 tests: Multipath descriptors for getdescriptorinfo (Ava Chow) a90eee444c965bbd7bcddf9656eca9cee14c3aec tests: Add unit tests for multipath descriptors (Ava Chow) 1bbf46e2dae4599d04c79aaacf7c5db00b2e707f descriptors: Change Parse to return vector of descriptors (Ava Chow) 0d640c6f02bc20e5c1be773443dd74d8806d953b descriptors: Have ParseKeypath handle multipath specifiers (Ava Chow) a5f39b103461a98689fd5d382e8da29037f55bea descriptors: Change ParseScript to return vector of descriptors (Ava Chow) 0d55deae157f4f8226b2419d55e7dc0dfb6e4aec descriptors: Add DescriptorImpl::Clone (Ava Chow) 7e86541f723d62c7ec6768f7f592c09ba2047d9e descriptors: Add PubkeyProvider::Clone (Ava Chow) Pull request description: It is convenient to have a descriptor which specifies both receiving and change addresses in a single string. However, as discussed in https://github.com/bitcoin/bitcoin/issues/17190#issuecomment-895515768, it is not feasible to use a generic multipath specification like BIP 88 due to combinatorial blow up and that it would result in unexpected descriptors. To resolve that problem, this PR proposes a targeted solution which allows only a single pair of 2 derivation indexes to be inserted in the place of a single derivation index. So instead of two descriptor `wpkh(xpub.../0/0/*)` and `wpkh(xpub.../0/1/*)` to represent receive and change addresses, this could be written as `wpkh(xpub.../0/<0;1>/*)`. The multipath specifier is of the form `<NUM;NUM>`. Each `NUM` can have its own hardened specifier, e.g. `<0;1h>` is valid. The multipath specifier can also only appear in one path index in the derivation path. This results in the parser returning two descriptors. The first descriptor uses the first `NUM` in all pairs present, and the second uses the second `NUM`. In our implementation, if a multipath descriptor is not provided, a pair is still returned, but the second element is just `nullptr`. The wallet will not output the multipath descriptors (yet). Furthermore, when a multipath descriptor is imported, it is expanded to the two descriptors and each imported on its own, with the second descriptor being implicitly for internal (change) addresses. There is no change to how the wallet stores or outputs descriptors (yet). Note that the path specifier is different from what was proposed. It uses angle brackets and the semicolon because these are unused characters available in the character set and I wanted to avoid conflicts with characters already in use in descriptors. Closes #17190 ACKs for top commit: darosior: re-ACK a0abcbd3822bd17a1d73c42ccd5b040a150b0501 mjdietzx: reACK a0abcbd3822bd17a1d73c42ccd5b040a150b0501 pythcoiner: reACK a0abcbd furszy: Code review ACK a0abcbd glozow: light code review ACK a0abcbd3822 Tree-SHA512: 84ea40b3fd1b762194acd021cae018c2f09b98e595f5e87de5c832c265cfe8a6d0bc4dae25785392fa90db0f6301ddf9aea787980a29c74f81d04b711ac446c2
2024-08-28Fix a few likely documentation typosLőrinc
2024-08-28fuzz: Add missing fuzz targets to cmake buildMarcoFalke
2024-08-28Merge bitcoin/bitcoin#30454: build: Introduce CMake-based build systemmerge-script
41051290ab3b6c36312cec26a27f787cea9961b4 cmake: Ignore build subdirectories within source directory (Hennadii Stepanov) 6ce50fd9d0ae6850d54bf883e7a7c1bcb6912c5c doc: Update for CMake-based build system (Hennadii Stepanov) 9730288a0cd3f33021ef00fb2d95e5216d10ab61 ci: Migrate CI scripts to CMake (Hennadii Stepanov) c360837ca5c91c9878ae8088bb5482e96fd87c96 cmake, lint: Adjust `lint_includes_build_config` (Hennadii Stepanov) 3885441ee0d35a40904995ede68120fea471dde7 cmake: Add presets for native Windows builds (Hennadii Stepanov) 7681746b20dd58e7d3e6d2852f07fb876383a133 cmake: Add vcpkg manifest file (Hennadii Stepanov) 8b6f1c4353836bae6aa683cbc65251165bd031ba cmake: Add `Coverage` and `CoverageFuzz` scripts (Hennadii Stepanov) 65bdbc1ff23b0a817f4d9a4682e6f630c9bbdd59 cmake: Add `docs` build target (Hennadii Stepanov) fb75ebbc33557ddd56f505100ad3631a0028eb86 cmake: Add compiler diagnostic flags (Hennadii Stepanov) e821f0a37a026fa0480c7f6f6c938da7c77e0d52 cmake: Migrate Guix build scripts to CMake (Hennadii Stepanov) 747adb6ffe9b06d476fc5eaebbaf9a62b91a78c5 cmake: Add `Maintenance` module (Hennadii Stepanov) 1f60b30df0cb58a7381a1bfbd6d34f002232e862 cmake: Add `APPEND_{CPP,C,CXX,LD}FLAGS` cache variables (Hennadii Stepanov) 2b43c45b13ad00cfd9928a03da8a480977724cb1 cmake: Add `AddWindowsResources` module (Hennadii Stepanov) 973a3b0c5dcbf6b3fd155b2dda4c2e94a0b0ee5f cmake: Implement `install` build target (Hennadii Stepanov) 84ac35cfd4dfa6f235f6e5a00b571846358f45ce cmake: Add cross-compiling support (Hennadii Stepanov) 0d01c228a7d39bb4918b5cb9f6db25cb8c30567a build: Generate `toolchain.cmake` in depends (Hennadii Stepanov) 91a799247dc5e4627e6b2f221669c8ff9238bc8d depends: Add host-specific `cmake_system_version` variables (Hennadii Stepanov) 9b31209b4caaa02b3044acd2375a7f595cdbd520 depends: Rename `cmake_system` -> `cmake_system_name` (Hennadii Stepanov) 4a5208a81d5bfeef270c64d48dce3444d6d03511 Revert "build, qt: Do not install *.prl files" (Hennadii Stepanov) 6522af62af1c3a6e2525bfffdb2295751b6fa49b depends: Amend handling flags environment variables (Hennadii Stepanov) 90cec4d251a541adfc5953e24dc01840a8cb4af2 cmake: Add `MULTIPROCESS` option (Hennadii Stepanov) bb1a450dcb111746869547c8b538b5d2472cf8e6 cmake: Build `bitcoin-chainstate` executable (Hennadii Stepanov) aed38ea58cbde068fe12b5299b246b4e3649a09c cmake: Build `bitcoinkernel` library (Hennadii Stepanov) 975d67369b8f3a33a21fd7618c299c0ec138292c cmake: Build `test_bitcoin-qt` executable (Hennadii Stepanov) 10fcc668a3430b72eaf7effc83f00cedeb27c7dc cmake: Add `WITH_DBUS` option (Hennadii Stepanov) 5bb5a4bc75a523e30eab561763927252ce105c4d cmake: Add `libqrencode` optional package support (Hennadii Stepanov) 57a6e2ef4abbfd2b12ee6489366bc6609bead263 cmake: Build `bitcoin-qt` executable (Hennadii Stepanov) 30f642952cb5bf39479bdbe467b3950f0d09324a cmake: Add `WERROR` option (Hennadii Stepanov) c98d4a4c341e524348d0342e145d439816a44c83 cmake: Add `REDUCE_EXPORTS` option (Hennadii Stepanov) a01cb6e63ff3940f0773b37e2fe1e148f17acad9 cmake: Add `HARDENING` option (Hennadii Stepanov) a8a2e364acf55bbe18404ab21f852d52257bcb6d cmake: Add Python-based tests (Hennadii Stepanov) 3d853795707c5a1828dcd09c1f68bb07dee472cd cmake: Add fuzzing options (Hennadii Stepanov) 908530e312a3d4561f9c1feeb2a76ce899f21c68 cmake: Add `SANITIZERS` option (Hennadii Stepanov) 8bb0e85631e7c1bee16e136454b2466776be1d65 cmake: Build `bench_bitcoin` executable (Hennadii Stepanov) 801735163a81650619a6c9587e8f1df9ee182694 cmake: Add external signer support (Hennadii Stepanov) 353e0c9e9679864a777e17c1bb7c6ba8b6eac96d cmake: Add `systemtap-sdt` optional package support (Hennadii Stepanov) d2fda82b4954f4af7e7d340cf42b9cb34d96cde1 cmake: Add `libzmq` optional package support (Hennadii Stepanov) ae7b39a0e106d798b6e9cc03ee783d9081e41480 cmake: Add `libminiupnpc` optional package support (Hennadii Stepanov) 6480e1dcdb03f43ce3d0aad96b8668d017d11750 cmake: Add `libnatpmp` optional package support (Hennadii Stepanov) e73e9304a11af65f9b086460ff349f9f700709ce cmake: Build `bitcoin-util` executable (Hennadii Stepanov) 027c6d7caa0355c35b00f2689eddccc3d1227aef cmake: Build `bitcoin-tx` executable (Hennadii Stepanov) d10c5c34c3d899db8bcff47ac8c6ba396a6da4b6 cmake: Add wallet functionality (Hennadii Stepanov) ab2e99b0d95714e16a7d1a1313d7da938b0485cb cmake: Create test suite for `ctest` (Hennadii Stepanov) 959370bd76d30ced34208db45fb4fd097fbad31b cmake: Build `test_bitcoin` executable (Hennadii Stepanov) b27bf9700dbbfa9a0243815f78c8b62abe78d8bc cmake: Build `bitcoin-cli` executable (Hennadii Stepanov) a9813df826c885b1609e55a83d87cd9cbc90adfd cmake: Build `bitcoind` executable (Hennadii Stepanov) 97829ce2d5a8dc3b0307b5d57c6686b96b7cf850 cmake: Add `FindLibevent` module (Hennadii Stepanov) 3118e40c6157c8ab9e264518d1065d2b0fc07795 cmake: Build `bitcoin_consensus` library (Hennadii Stepanov) 809a2f192903145f88f30bc10d3cf1ab9ed06881 cmake: Build `bitcoin_util` static library (Hennadii Stepanov) 0a9a521a704ca8a27124c1498a86e87ad46d4c34 cmake: Build `bitcoin_crypto` library (Hennadii Stepanov) 958971f476a29cb5bb76f3ae80ae968317ca1930 cmake: Build `univalue` static library (Hennadii Stepanov) 752747fda801f2c0ecce91c96bcc9ef93e27462b cmake: Generate `obj/build.h` header (Hennadii Stepanov) 1f0a78edf3cd2c24236ac512acf420eb9ed86ab3 cmake: Build `minisketch` static library (Hennadii Stepanov) 12bfbc81540f037c95e7796ae0b9f05ce3fb1b4a cmake: Build `leveldb` static library (Hennadii Stepanov) 51985c5304dfc52bd45f505b3115989637d79ff5 cmake: Build `crc32c` static library (Hennadii Stepanov) db7a198f29c62c5f762eaa25d1d83c57e2f1e211 cmake: Build `secp256k1` subtree (Hennadii Stepanov) dbb7ed14e8562439238eec70b202c50f172e3def cmake: Add `ccache` support (Hennadii Stepanov) cedfdf6c72535d0797a271c6bb9d84c4b406a8ea cmake: Redefine/adjust per-configuration flags (Hennadii Stepanov) b6b5e732c8b49a2cc14f34ac72b2189389c6b27d cmake: Add global compiler and linker flags (Hennadii Stepanov) f98327931bd0b5d90678ddd1770e9862266b396e cmake: Add `TryAppendLinkerFlag` module (Hennadii Stepanov) 4a0af29697b62d32af6f60d3ec70cd2ed4d7243c cmake: Add `TryAppendCXXFlags` module (Hennadii Stepanov) 35cffc497d8db3cf3eee35c1513e3435558f056b cmake: Add POSIX threads support (Hennadii Stepanov) fd72d00ffe34c84e292b305f6797201040d31a72 cmake: Add position independent code support (Hennadii Stepanov) 07069e2bb0bbdacf16cf34efd3a33390de030217 cmake: Add introspection module (Hennadii Stepanov) 27d687fc1f6aceaed7725e1e904a093ead68d6e6 cmake: Add `config/bitcoin-config.h` support (Hennadii Stepanov) fe5cdace5ffba46fb7981efb816621962d3873e3 cmake: Print compiler and linker flags in summary (Hennadii Stepanov) 70683884c5fd78dbf7816434464e6511b9d4e486 cmake: Introduce interface libraries to encapsulate common flags (Hennadii Stepanov) a2317e27b7fb86df4e32cd1674c06e09cb808248 cmake: Add root `CMakeLists.txt` file (Hennadii Stepanov) Pull request description: This PR introduces a new CMake-based build system, which is a drop-in replacement for the current Autotools-based build system. ML announcement: https://groups.google.com/g/bitcoindev/c/hgKkfQWzrTo As discussed during the recent CoreDev meetup in April, the switch from Autotools to CMake is intended to happen as soon as possible after branching 28.x off, which means that 29.0 will be built using CMake. This PR branch is essentially the [staging branch](https://github.com/hebasto/bitcoin/tree/cmake-staging), with every change reviewed and tested by a group of contributors, including (in alphabetical order): - [**achow101**](https://github.com/achow101) - [**fanquake**](https://github.com/fanquake) - [**maflcko**](https://github.com/maflcko) - [**m3dwards**](https://github.com/m3dwards) - [**pablomartin4btc**](https://github.com/pablomartin4btc) - [**real-or-random**](https://github.com/real-or-random) - [**ryanofsky**](https://github.com/ryanofsky) - [**sipsorcery**](https://github.com/sipsorcery) - [**TheCharlatan**](https://github.com/TheCharlatan) - [**theStack**](https://github.com/theStack) - [**theuni**](https://github.com/theuni) - [**vasild**](https://github.com/vasild) Reviewing in a separate staging repo was suggested in https://github.com/bitcoin/bitcoin/pull/27060#issuecomment-1431798320. The accompanying changes to the OSS-Fuzz project are available in https://github.com/hebasto/oss-fuzz/pull/8. Please refer to the [build options parity table](https://gist.github.com/hebasto/2ef97d3a726bfce08ded9df07f7dab5e). The "auto" value is no longer available; non-default values must be specified explicitly. Additionally, the new default values have been chosen to suit the everyday build experience for the majority of developers. System requirements for using the CMake-based build system: - CMake >= 3.22 (if not available in your system's repository, it can be downloaded from https://cmake.org/download/) - a build tool of your choice: - any Make (GNU Make is no longer a requirement); GNU Make is still required to build depends - Ninja (https://ninja-build.org/) - MSBuild - Xcode A note for Windows users: The default installation of the latest version of MSVC 17.10.4 includes both CMake 3.28.3 and the vcpkg package manager). --- We, the build system developers, kindly ask reviewers to refrain from making suggestions that are not directly related to the migration process or can be implemented separately. Bugs in the scripts and errors in the updated documentation should be the focus of this PR. Please be advised that comments not aligned with this PR's goal may be ignored. Thank you all for your understanding. ACKs for top commit: maflcko: review ACK 41051290ab3b6c36312cec26a27f787cea9961b4 🐥 sipsorcery: ACK 41051290ab3b6c36312cec26a27f787cea9961b4. vasild: ACK 41051290ab3b6c36312cec26a27f787cea9961b4 TheCharlatan: ACK 41051290ab3b6c36312cec26a27f787cea9961b4 pablomartin4btc: tACK 41051290ab3b6c36312cec26a27f787cea9961b4 i-am-yuvi: tACK [`4105129`](https://github.com/bitcoin/bitcoin/commit/41051290ab3b6c36312cec26a27f787cea9961b4) theuni: ACK 41051290ab3b6c36312cec26a27f787cea9961b4. fanquake: ACK 41051290ab3b6c36312cec26a27f787cea9961b4 Tree-SHA512: 6c1445054436c6c00ad63bfa0f19d64091a2b25c9bd694f85bf2218ac358ffb774d6c000685b3ca1e9b50401babed989fa2a0694b774c211d226bfd1944c9b39
2024-08-28Merge bitcoin/bitcoin#29071: refactor: Remove Span operator==, Use ↵merge-script
std::ranges::equal fad0cf6f2619df8df435a2da6da49eeb5510a10f refactor: Use std::ranges::equal in GetNetworkForMagic (MarcoFalke) fadf0a7e15d66ba3230153e789b785e6cf8ab84c refactor: Remove Span operator==, Use std::ranges::equal (MarcoFalke) Pull request description: `std::span` removed the comparison operators, so it makes sense to remove them for the `Span` "backport" as well. Using `std::ranges::equal` also has the benefit that some `Span` temporary constructions can now be dropped. This is required to move from `Span` toward `std::span`. ACKs for top commit: hodlinator: Untested Code Review re-ACK fad0cf6 stickies-v: ACK fad0cf6f2619df8df435a2da6da49eeb5510a10f TheCharlatan: ACK fad0cf6f2619df8df435a2da6da49eeb5510a10f Tree-SHA512: 5b9d1826ceac2aabae2295bc89893dd23ac3a1cc0d41988331cdbdc21be531aa91795d5273819f349f79648c6c4f30ed31af6e7a3816153e92080061b92ffe00
2024-08-28Merge bitcoin/bitcoin#30725: fuzz: fix timeout in `crypto_fschacha20poly1305`merge-script
8dec4e1294a6c6895b4fe23f38cd067dc8f2352f fuzz: fix timeout in `crypto_fschacha20poly1305` (brunoerg) Pull request description: Fixes #30505 This PR fixes a timeout in `crypto_fschacha20poly1305` by reducing the number of iterations. I left it running for a while and noticed it speeds up the target and do not impact coverage. ACKs for top commit: maflcko: lgtm ACK 8dec4e1294a6c6895b4fe23f38cd067dc8f2352f stratospher: ACK 8dec4e1. saw similar coverage stats (these are from different machines, saw more similar from same machine). Tree-SHA512: 66cd689f10f09cf880c1f2c77aa481336a95a7e10b655d156b2dc9cd38165670000019a6fb3775485ccb5cce248939a52a31ebd755a6befed6274cc841d21d97
2024-08-28Merge bitcoin/bitcoin#30721: refactor: Testnet4 - Replace uint256S("str") -> ↵merge-script
uint256{"str"} 49f9b645ea3f42c1b9e0a83b26af8fc8f6fa159d refactor: Testnet4 - Replace uint256S("str") -> uint256{"str"} (Hodlinator) Pull request description: Ran scripted-diff from 2d9d752e4fc30aabf2ddd36ca7a63432d26d4fea: ``` sed -i --regexp-extended -e 's/\buint256S\("(0x)?([^"]{64})"\)/uint256{"\2"}/g' $(git grep -l uint256S) ``` Follow-up to Testnet4 introduction #29775 which overlapped with work on `uint256` `consteval` ctor #30560 (the latter includes the scripted-diff commit). Going forward `uint256{}` should be used for constants instead of `uint256S()`. ACKs for top commit: maflcko: review-ACK 49f9b645ea3f42c1b9e0a83b26af8fc8f6fa159d 🐮 fjahr: ACK 49f9b645ea3f42c1b9e0a83b26af8fc8f6fa159d Tree-SHA512: 94fe5d9f1fb85e9ce5c3c4c5e4c31667e8cbb55ee691a4b5b3ae4172ccac38230281071023663965917f188b4c19bdf67afd4e3cdf69d89e97c65faea88af833
2024-08-27Merge bitcoin/bitcoin#30569: node: reduce unsafe uint256S usageAva Chow
18d65d27726bf9fc7629b8e794047a10c9cf6156 test: use uint256::FromUserHex for RANDOM_CTX_SEED (stickies-v) 6819e5a329c3bf38e47a07434e2a3c0031f808d0 node: use uint256::FromUserHex for -assumevalid parsing (stickies-v) 2e58fdb544b538dba9823bcd5754d074272bfc04 util: remove unused IsHexNumber (stickies-v) 8a44d7d3c1e5d5af6779c3e4befe514c9dafb8ff node: use uint256::FromUserHex for -minimumchainwork parsing (stickies-v) 70e2c87737e77ee85812cc328c4ddfaea7147533 refactor: add uint256::FromUserHex helper (stickies-v) 85b7cbfcbe3f94770bdf73dedd8bda0193a44627 test: unittest chainstatemanager_args (stickies-v) Pull request description: Since fad2991ba073de0bd1f12e42bf0fbaca4a265508, `uint256S` has been [deprecated](https://github.com/bitcoin/bitcoin/pull/30482/commits/fad2991ba073de0bd1f12e42bf0fbaca4a265508#diff-800776e2dda39116e889839f69409571a5d397de048a141da7e4003bc099e3e2R138) because it is less robust than the `base_blob::FromHex()` introduced in [the same PR](https://github.com/bitcoin/bitcoin/pull/30482). Specifically, it tries to recover from length-mismatches, recover from untrimmed whitespace, 0x-prefix and garbage at the end, instead of simply requiring exactly 64 hex-only characters. _(see also #30532)_ This PR carves out the few `uint256S` callsites that may potentially prove a bit more controversial to change because they deal with user input and backwards incompatible behaviour change. The main behaviour change introduced in this PR is: - `-minimumchainwork` will raise an error when input is longer than 64 hex digits - `-assumevalid` will raise an error when input contains invalid hex characters, or when it is longer than 64 hex digits - test: the optional RANDOM_CTX_SEED env var will now cause tests to abort when it contains invalid hex characters, or when it is longer than 64 hex digits After this PR, the remaining work to remove `uint256S` completely is almost entirely mechanical and/or test related. I will open that PR once #30560 is merged because it builds on that. ACKs for top commit: hodlinator: re-ACK 18d65d27726bf9fc7629b8e794047a10c9cf6156 l0rinc: ACK 18d65d27726bf9fc7629b8e794047a10c9cf6156 achow101: ACK 18d65d27726bf9fc7629b8e794047a10c9cf6156 ryanofsky: Code review ACK 18d65d27726bf9fc7629b8e794047a10c9cf6156. Very nice change that cleans up the API, adds checking for invalid values, makes parsing of values more consistent, and adds test coverage. Tree-SHA512: ec118ea3d56e1dfbc4c79acdbfc797f65c4d2107b0ca9577c848b4ab9b7cb8d05db9f3c7fe8441a09291aca41bf671572431f4eddc59be8fb53abbea76bbbf86
2024-08-27Merge bitcoin/bitcoin#29369: refactor: Allow CScript construction from any ↵Ava Chow
std::input_iterator fa7b9b99a2ed466d1765d748f4a59c2f581b974f refactor: Require std::input_iterator for all InputIterator in prevector (MarcoFalke) d4444419001ca2af4c601a996461b67110645a52 refactor: Allow CScript construction from any std::input_iterator (MarcoFalke) Pull request description: Currently only (pre)vector iterators and raw pointers are accepted. However, this makes it harder to construct from input iterators provided by other classes, such as `std::span`. Fix that. ACKs for top commit: delta1: reACK fa7b9b9 achow101: ACK fa7b9b99a2ed466d1765d748f4a59c2f581b974f hodlinator: ACK fa7b9b99a2ed466d1765d748f4a59c2f581b974f ryanofsky: Code review ACK fa7b9b99a2ed466d1765d748f4a59c2f581b974f Tree-SHA512: 2760861f8bce42fb27dc0825e61621cb157f1ac3619a0834df38eb8319b6dcf9de43d90397a4c160f43340880c1553df638848e9057a27c792214331243ef4a5
2024-08-27Merge bitcoin/bitcoin#30716: bench: [refactor] iwyuAva Chow
fab0e834b8cf906c286ebbeed86eca8d65854f75 bench: [refactor] iwyu (MarcoFalke) Pull request description: Missing includes are problematic, because: * Upcoming releases of a C++ standard library implementation often minimize their internal header dependencies. For example, `_LIBCPP_REMOVE_TRANSITIVE_INCLUDES` (https://libcxx.llvm.org/DesignDocs/HeaderRemovalPolicy.html). This can lead to compile failures, which are easy to fix for developers, but may not be for users. For example, commit 138f8671569f7ebb8c84e9d80c44cddeda9e3845 had to add missing includes to accommodate GCC 15 (and the commit had to be backported). * A Bitcoin Core developer removing a feature from a module and wanting to drop the now unused includes may not be able to do so without touching other unrelated files, because those files rely on the transitive includes. Moreover, missing or extraneous includes are problematic, because they may be confusing the code reader as to what the real dependencies are. Finally, extraneous includes may slow down the build. Fix all issues in `bench`, by applying the rule include-what-you-use (iwyu). Follow-up pull requests will handle the other places. ACKs for top commit: hodlinator: ACK fab0e834b8cf906c286ebbeed86eca8d65854f75 achow101: ACK fab0e834b8cf906c286ebbeed86eca8d65854f75 TheCharlatan: ACK fab0e834b8cf906c286ebbeed86eca8d65854f75 hebasto: ACK fab0e834b8cf906c286ebbeed86eca8d65854f75. brunoerg: crACK fab0e834b8cf906c286ebbeed86eca8d65854f75 stickies-v: ACK fab0e834b8cf906c286ebbeed86eca8d65854f75 Tree-SHA512: f079c05d3ddebafabbd5a6c76d43d17337d1a962b97ba0ee27612f91c58491e7ce4e4229be54bd6e75a15512798c6f59925d0a076a37c050f8b9ef455ae5c9a2