aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-07-23refactor: Change base_blob::SetHex() to take std::string_viewHodlinator
Clarify that hex strings are parsed as little-endian.
2024-07-23test: uint256 - Garbage suffixes and zero paddingHodlinator
2024-07-23Merge bitcoin/bitcoin#30504: doc: use proper doxygen formatting for ↵merge-script
CTxMemPool::cs 6a5e9e40e1dd3d397020703feb9aa0b6f4577c98 doc: use proper doxygen formatting for CTxMemPool::cs (Vasil Dimov) Pull request description: Having `@par title` followed by an empty line renders improperly in Doxygen - it results in a paragraph with a title but without a body. https://www.doxygen.nl/manual/commands.html#cmdpar This also results in a compiler warning (or error) with Clang 19: ``` ./txmempool.h:368:34: error: empty paragraph passed to '@par' command [-Werror,-Wdocumentation] 368 | * @par Consistency guarantees | ~~~~~~~~~~~~~~~~~~~~~~~~~~^ 1 error generated. ``` ACKs for top commit: maflcko: review ACK 6a5e9e40e1dd3d397020703feb9aa0b6f4577c98 tdb3: ACK 6a5e9e40e1dd3d397020703feb9aa0b6f4577c98 Tree-SHA512: 2c4c9e5fd4bd44754800a9bcfff74df101afc060b84451c45aa098e4ceb05a47f28a36f8473b31222552fad6339b752a148e6b1c7d41c2003f515b3eb4060902
2024-07-23refactor: Make uint256_tests no longer use deprecated BOOST_CHECK()Hodlinator
2024-07-23test: Add test for TxidFromString() behaviorRyan Ofsky
2024-07-23doc: use proper doxygen formatting for CTxMemPool::csVasil Dimov
Having `@par title` followed by an empty line renders improperly in Doxygen - it results in a paragraph with a title but without a body. https://www.doxygen.nl/manual/commands.html#cmdpar This also results in a compiler warning (or error) with Clang 19: ``` ./txmempool.h:368:34: error: empty paragraph passed to '@par' command [-Werror,-Wdocumentation] 368 | * @par Consistency guarantees | ~~~~~~~~~~~~~~~~~~~~~~~~~~^ 1 error generated. ```
2024-07-23Merge bitcoin/bitcoin#30474: fuzz: Speed up PickValue in txorphanmerge-script
fa33a63bd9458f3487a0592983c1363cd30a3c74 fuzz: Speed up PickValue in txorphan (MarcoFalke) Pull request description: `PickValue` will advance a begin iterator on the `outpoints` set, which is expensive, because it only has a `++` operator. As it is called in a loop of `num_in` (~`outpoints.size()`), the runtime is `O(outpoints.size() ^ 2)`. Fix it by making the runtime linear. ACKs for top commit: glozow: ACK fa33a63bd9458f3487a0592983c1363cd30a3c74, thanks for taking the suggestion dergoegge: utACK fa33a63bd9458f3487a0592983c1363cd30a3c74 Tree-SHA512: 33f440d97c6834d907d43a8d29e4fb2c995f0d244460bd079af100f13d3607a53e44a0db52f4eb5c487d98df0ff4f2f6d987bf94b922ae9f4506f1295ad6214c
2024-07-23fuzz: Speed up PickValue in txorphanMarcoFalke
Co-Authored-By: l0rinc <pap.lorinc@gmail.com>
2024-07-22Merge bitcoin/bitcoin#30494: fuzz: reduce keypool size in `scriptpubkeyman` ↵merge-script
target dcb4ec944984961e3b40452425a219e15e6ab508 fuzz: reduce keypool size in scriptpubkeyman target (brunoerg) Pull request description: Fixes #30476 This PR reduces keypool size in scriptpubkeyman fuzz target to avoid spend a lot of time in `TopUp` (which is obviously called by many spkm functions). For reference: This PR: ``` INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 1845055748 INFO: Loaded 1 modules (1225616 inline 8-bit counters): 1225616 [0x106346fe0, 0x106472370), INFO: Loaded 1 PC tables (1225616 PCs): 1225616 [0x106472370,0x107725c70), ./src/test/fuzz/fuzz: Running 1 inputs 10 time(s) each. Running: ./qa-assets/fuzz_seed_corpus/scriptpubkeyman/c9b8928cecb1edc192fb2d5816b4b7878cdfcf50 Executed ./qa-assets/fuzz_seed_corpus/scriptpubkeyman/c9b8928cecb1edc192fb2d5816b4b7878cdfcf50 in 250 ms ``` Master: ``` INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 2004906948 INFO: Loaded 1 modules (1225603 inline 8-bit counters): 1225603 [0x104196f80, 0x1042c2303), INFO: Loaded 1 PC tables (1225603 PCs): 1225603 [0x1042c2308,0x105575b38), ./src/test/fuzz/fuzz: Running 1 inputs 10 time(s) each. Running: ./qa-assets/fuzz_seed_corpus/scriptpubkeyman/c9b8928cecb1edc192fb2d5816b4b7878cdfcf50 Executed ./qa-assets/fuzz_seed_corpus/scriptpubkeyman/c9b8928cecb1edc192fb2d5816b4b7878cdfcf50 in 21016 ms ``` ACKs for top commit: maflcko: review ACK dcb4ec944984961e3b40452425a219e15e6ab508 dergoegge: utACK dcb4ec944984961e3b40452425a219e15e6ab508 Tree-SHA512: d818b228d5f1dd0d5c665d8e54cf5dd8e378604039eaac114fc34366ece4420b9b2519d898f2dc2410960b873f0b91bbad4a534a35658477aed6ef48f3458137
2024-07-22Merge bitcoin/bitcoin#30488: depends: Fix CMake-generated `libevent*.pc` filesmerge-script
8c935e625ea75d180144f0526d6a0d5fd58c1f29 depends: Fix CMake-generated `libevent*.pc` files (Hennadii Stepanov) Pull request description: Broken out of #30454. This is a backport of the merged upstream PR: https://github.com/libevent/libevent/pull/1622. Note that after #29835 we might end up dropping pkg-config and using the installed CMake files directly, but that depends on whether or not enough distros actually ship those files. Either way, having fixed up .pc files won't hurt. ACKs for top commit: hebasto: ACK 8c935e625ea75d180144f0526d6a0d5fd58c1f29. fanquake: ACK 8c935e625ea75d180144f0526d6a0d5fd58c1f29 Tree-SHA512: 259c2ad78fb9e90370a7205dc71c40acda1a872f6509435133bc1c4c2c3de57366e80679aa083e13ed85e7966883dc470c0147ee171a2ed0171a18cd5ffc99b3
2024-07-22Merge bitcoin/bitcoin#30500: Fix lint-spelling warningsmerge-script
bccfca0382bbf00092db6e7828fc79b6ce399c5d Fix lint-spelling warnings (Lőrinc) Pull request description: These warnings were often polluting the CI output, e.g. https://github.com/bitcoin/bitcoin/pull/30499/checks?check_run_id=27745036545 > ./test/lint/lint-spelling.py before the change: ``` doc/design/libraries.md:100: targetted ==> targeted doc/developer-notes.md:495: dependant ==> dependent src/bench/sign_transaction.cpp:49: hashIn ==> hashing, hash in src/bitcoin-chainstate.cpp:213: hashIn ==> hashing, hash in src/bitcoin-chainstate.cpp:213: hashIn ==> hashing, hash in src/coins.cpp:24: viewIn ==> viewing, view in src/coins.cpp:24: viewIn ==> viewing, view in src/coins.cpp:29: viewIn ==> viewing, view in src/coins.cpp:29: viewIn ==> viewing, view in src/coins.h:44: outIn ==> outing, out in src/coins.h:44: outIn ==> outing, out in src/coins.h:45: outIn ==> outing, out in src/coins.h:45: outIn ==> outing, out in src/coins.h:215: viewIn ==> viewing, view in src/coins.h:220: viewIn ==> viewing, view in src/primitives/transaction.h:37: hashIn ==> hashing, hash in src/primitives/transaction.h:37: hashIn ==> hashing, hash in src/protocol.cpp:51: hashIn ==> hashing, hash in src/protocol.cpp:51: hashIn ==> hashing, hash in src/protocol.h:497: hashIn ==> hashing, hash in src/qt/forms/optionsdialog.ui:344: incomin ==> incoming src/qt/optionsdialog.cpp:445: proxys ==> proxies src/rpc/mining.cpp:987: hashIn ==> hashing, hash in src/rpc/mining.cpp:987: hashIn ==> hashing, hash in src/script/interpreter.h:298: amountIn ==> amounting, amount in src/script/interpreter.h:298: amountIn ==> amounting, amount in src/script/interpreter.h:299: amountIn ==> amounting, amount in src/script/interpreter.h:299: amountIn ==> amounting, amount in src/script/sigcache.h:70: amountIn ==> amounting, amount in src/script/sigcache.h:70: amountIn ==> amounting, amount in src/signet.cpp:144: amountIn ==> amounting, amount in src/test/fuzz/util/net.cpp:386: occured ==> occurred src/test/fuzz/util/net.cpp:398: occured ==> occurred src/util/vecdeque.h:79: deques ==> dequeues src/util/vecdeque.h:160: deques ==> dequeues src/util/vecdeque.h:184: deques ==> dequeues src/util/vecdeque.h:194: deques ==> dequeues src/validation.cpp:2130: re-declared ==> redeclared src/validation.h:348: outIn ==> outing, out in src/validation.h:349: outIn ==> outing, out in test/functional/wallet_bumpfee.py:851: atleast ==> at least ``` ACKs for top commit: Sjors: ACK bccfca0382bbf00092db6e7828fc79b6ce399c5d josibake: ACK https://github.com/bitcoin/bitcoin/pull/30500/commits/bccfca0382bbf00092db6e7828fc79b6ce399c5d Tree-SHA512: 71d5f0d3319db50eaf9bcb9cb61da5da01767c60f5a782955a3f20e7149882049e33ebcc1788a71f109da2d7010fd1119c0a68c181f7a692de966cbd7e7511ae
2024-07-22Merge bitcoin/bitcoin#30501: lint: Add missing docker.io prefix to ↵merge-script
ci/lint_imagefile fa7bee13bf745d8d244fa8d3579a21016a0cb66d lint: Use git clone --depth=1 (MarcoFalke) fadb7c2a91123639a673d0bab2403499040207bf lint: Add missing docker.io prefix to ci/lint_imagefile (MarcoFalke) Pull request description: Currently, the `ci/lint_imagefile` may pick the wrong (non-native) architecture due to the missing prefix. For example, assuming the user has previously pulled an s390x image: ``` $ podman run --rm 'docker.io/s390x/debian:bookworm' dpkg --print-architecture exec /usr/bin/dpkg: exec format error ``` Now, `debian:bookworm` will refer to the same image: ``` $ podman run --rm 'debian:bookworm' dpkg --print-architecture exec /usr/bin/dpkg: exec format error ``` However, `docker.io/debian:bookworm` works fine: ``` $ podman run --rm 'docker.io/debian:bookworm' dpkg --print-architecture arm64 ``` (Also includes a nit-fix from https://github.com/bitcoin/bitcoin/pull/30499#discussion_r1686470495) ACKs for top commit: paplorinc: utACK fa7bee13bf745d8d244fa8d3579a21016a0cb66d hebasto: ACK fa7bee13bf745d8d244fa8d3579a21016a0cb66d. Tree-SHA512: 4b6d562c14c67bef984ad25f6a3a1ef7f1059dc2859c603c45083b36bcacafa3248fc74176e2e4626fdc39507e9353f458ddbc4077f805c03e970df46af02224
2024-07-22Merge bitcoin/bitcoin#29723: depends: build zeromq with CMakemerge-script
0388ad0d65b6c9ee802ca641eb01d69fcdd5605d depends: switch zmq to CMake (Cory Fields) fefb3bbe5b538f8faa59de191914ad0c22c3ade6 depends: add zeromq no librt patch (fanquake) a522ef15424110f76172b3c0603fa08f7291c9fc depends: add zeromq cmake minimum patch (fanquake) cbbc229adf4c12ad4bd7edde71425b8ef217edfc depends: add zeromq windows usage patch (fanquake) 2de68d6d388b9a33c57234d3161f6ffc4c2a0246 depends: add zeromq builtin sha1 patch (fanquake) 0c8605253ae887dac316264cb969b752027d277a depends: add zeromq mktemp macos patch (fanquake) Pull request description: This picks up a change, which is a switch to building zeromq with CMake. It includes a number of patches, some which have already been upstreamed (see each patch for details). ACKs for top commit: hebasto: ACK 0388ad0d65b6c9ee802ca641eb01d69fcdd5605d. Tree-SHA512: 5567e432b4e4e0446c41d502bd61810a80b329dea2399b5d9d9f6e79acc450d1c6ba861c8238ba895de98338cfc5dc44ad2bf86ee8c222ecb3fbf47d6eb60da4
2024-07-22lint: Use git clone --depth=1MarcoFalke
No need to download and store more than that.
2024-07-22lint: Add missing docker.io prefix to ci/lint_imagefileMarcoFalke
2024-07-22Merge bitcoin/bitcoin#30499: lint: Use consistent out-of-tree build for ↵merge-script
python and test_runner fa8d73e86e1c11cdfe8154ab84edc1948283454b lint: Use consistent out-of-tree build for python and test_runner (MarcoFalke) fa0f859885ee2c39c2d1cc704797c2461f3c473e doc: Clarify intent of ./ci/lint_run_all.sh (MarcoFalke) fa9ad59f8796e0c7e9463f47beda7dfb81ad69a9 lint: Use $CI_RETRY_EXE when building ./ci/lint_imagefile (MarcoFalke) Pull request description: Fixes https://github.com/bitcoin/bitcoin/issues/30496 Seems odd to sometimes do an out-of-tree build (via `./ci/lint_imagefile`, see `test/lint/README.md`) and sometimes not (via Cirrus CI, see `./ci/lint_run_all.sh`). Fix it by doing an out-of-tree build consistently in the same location. Also, fix `$CI_RETRY_EXE`, while touching this. ACKs for top commit: josibake: utACK https://github.com/bitcoin/bitcoin/commit/fa8d73e86e1c11cdfe8154ab84edc1948283454b willcl-ark: utACK fa8d73e86e1c11cdfe8154ab84edc1948283454b paplorinc: utACK fa8d73e86e1c11cdfe8154ab84edc1948283454b Tree-SHA512: 4181ca14299a798850f5e05f180f3305a3378081ca8dabf6ab2da6115997cc17f6ef0f10db9b2b31618e59231083e5c4a971432d27b4d77903e655be21155abb
2024-07-22lint: Use consistent out-of-tree build for python and test_runnerMarcoFalke
This mirrors the build by ./ci/lint_imagefile, which is done out-of-tree in "/". Otherwise, there could be errors due to a dirty tree.
2024-07-22Fix lint-spelling warningsLőrinc
These warnings were often polluting the CI output, e.g. https://github.com/bitcoin/bitcoin/pull/30499/checks?check_run_id=27745036545 > ./test/lint/lint-spelling.py before the change: ``` doc/design/libraries.md:100: targetted ==> targeted doc/developer-notes.md:495: dependant ==> dependent src/bench/sign_transaction.cpp:49: hashIn ==> hashing, hash in src/bitcoin-chainstate.cpp:213: hashIn ==> hashing, hash in src/bitcoin-chainstate.cpp:213: hashIn ==> hashing, hash in src/coins.cpp:24: viewIn ==> viewing, view in src/coins.cpp:24: viewIn ==> viewing, view in src/coins.cpp:29: viewIn ==> viewing, view in src/coins.cpp:29: viewIn ==> viewing, view in src/coins.h:44: outIn ==> outing, out in src/coins.h:44: outIn ==> outing, out in src/coins.h:45: outIn ==> outing, out in src/coins.h:45: outIn ==> outing, out in src/coins.h:215: viewIn ==> viewing, view in src/coins.h:220: viewIn ==> viewing, view in src/primitives/transaction.h:37: hashIn ==> hashing, hash in src/primitives/transaction.h:37: hashIn ==> hashing, hash in src/protocol.cpp:51: hashIn ==> hashing, hash in src/protocol.cpp:51: hashIn ==> hashing, hash in src/protocol.h:497: hashIn ==> hashing, hash in src/qt/forms/optionsdialog.ui:344: incomin ==> incoming src/qt/optionsdialog.cpp:445: proxys ==> proxies src/rpc/mining.cpp:987: hashIn ==> hashing, hash in src/rpc/mining.cpp:987: hashIn ==> hashing, hash in src/script/interpreter.h:298: amountIn ==> amounting, amount in src/script/interpreter.h:298: amountIn ==> amounting, amount in src/script/interpreter.h:299: amountIn ==> amounting, amount in src/script/interpreter.h:299: amountIn ==> amounting, amount in src/script/sigcache.h:70: amountIn ==> amounting, amount in src/script/sigcache.h:70: amountIn ==> amounting, amount in src/signet.cpp:144: amountIn ==> amounting, amount in src/test/fuzz/util/net.cpp:386: occured ==> occurred src/test/fuzz/util/net.cpp:398: occured ==> occurred src/util/vecdeque.h:79: deques ==> dequeues src/util/vecdeque.h:160: deques ==> dequeues src/util/vecdeque.h:184: deques ==> dequeues src/util/vecdeque.h:194: deques ==> dequeues src/validation.cpp:2130: re-declared ==> redeclared src/validation.h:348: outIn ==> outing, out in src/validation.h:349: outIn ==> outing, out in test/functional/wallet_bumpfee.py:851: atleast ==> at least ```
2024-07-22doc: Clarify intent of ./ci/lint_run_all.shMarcoFalke
2024-07-22lint: Use $CI_RETRY_EXE when building ./ci/lint_imagefileMarcoFalke
Previous code was confusing and brittle. For example, the full import "source ./ci/test/00_setup_env.sh" and $PATH overwrite was not needed. Fix it by simply copying the exe to /ci_retry and use that in $CI_RETRY_EXE. This is also a fix, because previously ci/lint_imagefile did use an empty $CI_RETRY_EXE.
2024-07-22Merge bitcoin/bitcoin#30463: qa: Functional test improvementsglozow
a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7 qa: Do not assume running `feature_asmap.py` from source directory (Hennadii Stepanov) 9bf7ca6cad888d460f57d249264dc0062025bb3f qa: Consider `cache` and `config.ini` relative to invocation directory (Hennadii Stepanov) a0473442d1c22043f5a288bd9255c006fd85d947 scripted-diff: Add `__file__` argument to `BitcoinTestFramework.init()` (Hennadii Stepanov) Pull request description: This PR includes changes split from https://github.com/bitcoin/bitcoin/pull/30454. They improve the functional test framework, allowing users to [run individual functional tests](https://github.com/hebasto/bitcoin/issues/146) from the build directory in the new CMake-based build system. This functionality is not available for out-of-source builds using the current Autotools-based build system, which always requires write permissions for the source directory. Nevertheless, this PR can be tested as suggested in https://github.com/bitcoin/bitcoin/pull/30463#issuecomment-2232618421: 1. Make an out-of-source build: ``` $ ./autogen.sh $ mkdir ../build && cd ../build $ ../bitcoin/configure $ make ``` 2. Create a symlink in the build directory to a functional test: ``` $ ln --symbolic ../../../bitcoin/test/functional/wallet_disable.py ./test/functional/ ``` 3. Run this symlink: ``` $ ./test/functional/wallet_disable.py ``` The last command fails on the master branch: ``` Traceback (most recent call last): File "/home/hebasto/git/build/./test/functional/wallet_disable.py", line 31, in <module> DisableWalletTest().main() ^^^^^^^^^^^^^^^^^^^ File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 106, in __init__ self.parse_args() File "/home/hebasto/git/bitcoin/test/functional/test_framework/test_framework.py", line 210, in parse_args config.read_file(open(self.options.configfile)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: '/home/hebasto/git/bitcoin/test/config.ini' ``` and succeeds with this PR. ACKs for top commit: maflcko: tested ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c 🎨 glozow: ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7, tested with the steps in op stickies-v: ACK a8e3af1a82dd584a1cc3ffbe587e66889f72e3c7 Tree-SHA512: 899e4efc09edec13ea3f5b47825d03173fb21d3569c360deda7fa6a56b99b4d24e09ad4f0883bad1ee926b1c706e47ba07c6a6160c63c07c82b3cf4ae5816e91
2024-07-22Merge bitcoin/bitcoin#30473: fuzz: Limit parse_univalue input lengthmerge-script
fa80b16b20dffcb85b80f75fee64ed333f2062f9 fuzz: Limit parse_univalue input length (MarcoFalke) Pull request description: The new limit should be more than enough, and hopefully avoids fuzz input bloat, such as `parse_univalue/0426365704e09ddd704a058cc2add1cbf104c1a9`. C.f. https://cirrus-ci.com/task/6178647134961664?logs=ci#L3805 ``` Run parse_univalue with args ['/ci_container_base/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/src/test/fuzz/fuzz', '-runs=1', PosixPath('/ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/parse_univalue')]INFO: Running with entropic power schedule (0xFF, 100). INFO: Seed: 572704560 INFO: Loaded 1 modules (623498 inline 8-bit counters): 623498 [0x561cba23a518, 0x561cba2d28a2), INFO: Loaded 1 PC tables (623498 PCs): 623498 [0x561cba2d28a8,0x561cbac56148), INFO: 3224 files found in /ci_container_base/ci/scratch/qa-assets/fuzz_seed_corpus/parse_univalue INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 1048576 bytes INFO: seed corpus: files: 3224 min: 1b max: 1050370b total: 25114084b rss: 112Mb #1024pulse cov: 10458 ft: 33444 corp: 906/32Kb exec/s: 341 rss: 154Mb #2048pulse cov: 12081 ft: 55461 corp: 1668/192Kb exec/s: 227 rss: 228Mb Slowest unit: 15 s: artifact_prefix='./'; Test unit written to ./slow-unit-9df6997f2f4726843e82b3dfde46862599904d56 Slowest unit: 309 s: artifact_prefix='./'; Test unit written to ./slow-unit-0426365704e09ddd704a058cc2add1cbf104c1a9 #3226INITED cov: 12246 ft: 66944 corp: 2358/3510Kb exec/s: 6 rss: 1610Mb #3226DONE cov: 12246 ft: 66944 corp: 2358/3510Kb lim: 282379 exec/s: 6 rss: 1610Mb Done 3226 runs in 477 second(s) ACKs for top commit: dergoegge: utACK fa80b16b20dffcb85b80f75fee64ed333f2062f9 brunoerg: utACK fa80b16b20dffcb85b80f75fee64ed333f2062f9 Tree-SHA512: b2ffbaaa4876be61be0e6c975ab65a842562d14079a13836202f8b5b5ef75e068e73df75c9bcc702379e123fcdb1dcd66951e31533fb4aaa6afe17dff160f7d0
2024-07-20fuzz: reduce keypool size in scriptpubkeyman targetbrunoerg
2024-07-20Merge bitcoin/bitcoin#30491: Fix MSVC warning C4273 "inconsistent dll linkage"merge-script
7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b Fix MSVC warning C4273 "inconsistent dll linkage" (Hennadii Stepanov) Pull request description: Broken out of https://github.com/bitcoin/bitcoin/pull/30454. When using CMake, the user can select the MSVC runtime library to be: 1) Statically-linked (with the corresponding `x64-windows-static` vcpkg triplet) or 2) Dynamically-linked (with the corresponding `x64-windows` vcpkg triplet) In the latter case, the compiler emits the [C4273](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273) warning. As the "Necessary on some platforms" comment does not apply to MSVC, skip the declaration for MSVC. The MSVC build system in the master branch supports the statically-linked runtime only: https://github.com/bitcoin/bitcoin/blob/ed739d14b58b5e772a65b85bb421703963b06852/build_msvc/common.init.vcxproj.in#L65 ACKs for top commit: sipa: utACK 7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b sipsorcery: utACK 7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b. theuni: utACK 7703884ab19cd7ffddc5c52ba57dec82fbc8dc2b Tree-SHA512: a42e1a0d48973217462e703c418f3e9ef9cb5236267c1bf32912aacaf68976cdd2b9229168523f7c2a99ee3f2fb1bf8add4f342796bdb1e4063ca026b761db51
2024-07-20Merge bitcoin/bitcoin#30490: depends: bump libmultiprocess for CMake fixesmerge-script
d318c4ef56465ccad1a1d4d27c52216e0b69ad4e depends: bump libmultiprocess for CMake fixes (Cory Fields) Pull request description: Broken out of #30454 . Bumped [even further](https://github.com/bitcoin/bitcoin/pull/30454/commits/4883197abc63aedbc395f37f6d2aded5db5270aa#r1684802528) after https://github.com/chaincodelabs/libmultiprocess/pull/98 was merged upstream. hebasto Presumably this approach works now with the CMake branch? ACKs for top commit: ryanofsky: Code review ACK d318c4ef56465ccad1a1d4d27c52216e0b69ad4e. Tree-SHA512: 4b5491f73c0063d09e8339829cd831b1f4c441dd7b55a22037c9337c80cce19bb00a3e5cf925efa77d6d4e89ab45482f40f5799bc14948f8cabcbad3c3549430
2024-07-19Fix MSVC warning C4273 "inconsistent dll linkage"Hennadii Stepanov
When using CMake, the user can select the MSVC runtime library to be: 1) Statically-linked (with the corresponding `x64-windows-static` vcpkg triplet) or 2) Dynamically-linked (with the corresponding `x64-windows` vcpkg triplet) In the latter case, the compiler emits the C4273 warning. As the "Necessary on some platforms" comment does not apply to MSVC, skip the declaration for MSVC.
2024-07-19depends: bump libmultiprocess for CMake fixesCory Fields
2024-07-19depends: Fix CMake-generated `libevent*.pc` filesHennadii Stepanov
See https://github.com/libevent/libevent/pull/1622.
2024-07-19fuzz: Deglobalize signature cache in sigcache testTheCharlatan
The body of the fuzz test should ideally be a pure function. If data is persisted in the cache over many iterations, and there is a crash, reproducing it from the input might be difficult.
2024-07-19fuzz: Limit parse_univalue input lengthMarcoFalke
2024-07-19log: Remove NOLINT(bitcoin-unterminated-logprintf)MarcoFalke
2024-07-19depends: switch zmq to CMakeCory Fields
The CMake WIN32_WINNT autodetection is broken, and must be set manually. We may want to set is explicitly in any case, but the brokenness should also be fixed upstream. Also patch out depends paths, that would cause non-determinism. Co-authored-by: fanquake <fanquake@gmail.com>
2024-07-19fuzz: Use BasicTestingSetup for coins_view targetTheCharlatan
2024-07-19test: Add arguments for creating a slimmer setupTheCharlatan
Adds more testing options for creating an environment without networking and a validation interface. This is useful for improving the performance of the utxo snapshot fuzz test, which constructs a new TestingSetup on each iteration.
2024-07-19depends: add zeromq no librt patchfanquake
2024-07-19depends: add zeromq cmake minimum patchfanquake
2024-07-19depends: add zeromq windows usage patchfanquake
2024-07-19depends: add zeromq builtin sha1 patchfanquake
2024-07-19depends: add zeromq mktemp macos patchfanquake
2024-07-19Merge bitcoin/bitcoin#29880: depends: build FreeType with CMakemerge-script
ff4f3deb7b8adfcc90fb745440ce4be1176552ca depends: use CMake to build FreeType (fanquake) Pull request description: Switches Freetype to be built with CMake. ACKs for top commit: theuni: ACK ff4f3deb7b8adfcc90fb745440ce4be1176552ca hebasto: ACK ff4f3deb7b8adfcc90fb745440ce4be1176552ca, I've verified the actual compile options, they look sane. Tree-SHA512: e9e4348975998539fde88a84d110d53dbac50ae9cc3fa692d15e09313d6fdb6acb3bb23533786a645fc836091075b4487d6de42ef78ba3a44de46d06360aef4f
2024-07-19logging: use std::string_viewAnthony Towns
2024-07-19logging: Apply formatting to early log messagesAnthony Towns
The formatting of log messages isn't defined until StartLogging() is called; so can't be correctly applied to early log messages from prior to that call. Instead of saving the output log message, save the inputs to the logging invocation (including time, mocktime and thread name), and format those inputs into a log message when StartLogging() is called.
2024-07-19logging: Limit early logging bufferAnthony Towns
Log messages created prior to StartLogging() being called go into a buffer. Enforce a limit on the size of this buffer.
2024-07-19test: Add loadtxoutset test with tip on snapshot blockFabian Jahr
Also pulls out the guarding assert and calls it explicitly before the test function is called. This is already done before the existing call of the test function so it was not needed there.
2024-07-19test: Remove already resolved assumeutxo todo commentsFabian Jahr
- "Valid snapshot file, but referencing a snapshot block that turns out to be invalid, or has an invalid parent" has been addressed in #30267 - "An ancestor of snapshot block" - If chain tip refers to blocks in this context then any successful load is addressing this because if we have synced past the snapshot base block we fail because we don't need assumeutxo anymore. And if this is about headers then this is the `test_headers_not_synced()` case. - "A descendant of the snapshot block" - If this refers to blocks the `test_snapshot_with_less_work()` addressed this and if it is just headers in this case again it would be represented in all of the successful loads in the test. Co-authored-by: Alfonso Roman Zubeldia <alfonsoromanz24@gmail.com>
2024-07-18Merge bitcoin/bitcoin#30245: net: Allow -proxy=[::1] on nodes with IPV6 lo onlyAva Chow
23333b7ed243071c9b4e4f04c727556d8065acbb net: Allow DNS lookups on nodes with IPV6 lo only (Max Edwards) Pull request description: This is similar to (but does not fix) https://github.com/bitcoin/bitcoin/issues/13155 which I believe is the same issue but in libevent. The issue is on a host that has IPV6 enabled but only a loopback IP address `-proxy=[::1]` will fail as `[::1]` is not considered valid by `getaddrinfo` with `AI_ADDRCONFIG` flag. I think the loopback interface should be considered valid and we have a functional test that will try to test this: `feature_proxy.py`. To replicate the issue, run `feature_proxy.py` inside a docker container that has IPV6 loopback ::1 address without specifically giving that container an external IPV6 address. This should be the default with recent versions of docker. IPV6 on loopback interface was enabled in docker engine 26 and later ([https://docs.docker.com/engine/release-notes/26.0/#bug-fixes-and-enhancements-2](https://docs.docker.com/engine/release-notes/26.0/#bug-fixes-and-enhancements-2)). `AI_ADDRCONFIG` was introduced to prevent slow DNS lookups on systems that were IPV4 only. References: Man section on `AI_ADDRCONFIG`: ``` If hints.ai_flags includes the AI_ADDRCONFIG flag, then IPv4 addresses are returned in the list pointed to by res only if the local system has at least one IPv4 address configured, and IPv6 addresses are returned only if the local system has at least one IPv6 address configured. The loopback address is not considered for this case as valid as a configured address. This flag is useful on, for ex‐ ample, IPv4-only systems, to ensure that getaddrinfo() does not return IPv6 socket addresses that would always fail in connect(2) or bind(2). ``` [AI_ADDRCONFIG considered harmful Wiki entry by Fedora](https://fedoraproject.org/wiki/QA/Networking/NameResolution/ADDRCONFIG) [Mozilla discussing slow DNS without AI_ADDRCONFIG and also localhost issues with it](https://bugzilla.mozilla.org/show_bug.cgi?id=467497) ACKs for top commit: achow101: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb tdb3: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb pinheadmz: ACK 23333b7ed243071c9b4e4f04c727556d8065acbb Tree-SHA512: 5ecd8c72d1e1c28e3ebff07346381d74eaddef98dca830f6d3dbf098380562fa68847d053c0d84cc8ed19a45148ceb5fb244e4820cf63dccb10ab3db53175020
2024-07-18Merge bitcoin/bitcoin#30320: assumeutxo: Don't load a snapshot if it's not ↵Ava Chow
in the best header chain 55b6d7be68a6f6c3882588ffd5b9349d885ed953 validation: Don't load a snapshot if it's not in the best header chain. (Martin Zumsande) Pull request description: This was suggested by me in the discussion of #30288, which has more context. If the snapshot is not an ancestor of the most-work header (`m_best_header`), syncing from that alternative chain leading to `m_best_header` should be prioritised. Therefore it's not useful loading the snapshot in this situation. If the other chain turns out to be invalid or the chain with the snapshot retrieves additional headers so that it's the most-work one again (see functional test), `m_best_header` will change and loading the snapshot will be possible again. Because of the work required to generate a conflicting headers chain, a situation with two conflicting chains should only be possible under extreme circumstances, such as major forks. ACKs for top commit: fjahr: re-ACK 55b6d7be68a6f6c3882588ffd5b9349d885ed953 achow101: ACK 55b6d7be68a6f6c3882588ffd5b9349d885ed953 alfonsoromanz: Re ACK 55b6d7be68a6f6c3882588ffd5b9349d885ed953 Tree-SHA512: 4fbea5ab1038ae353fc949a186041cf9b397e7ce4ac59ff36f881c9437b4f22ada922490ead5b2661389eb1ca0f3d1e7e7e6a4261057678643e71594a691ac36
2024-07-18Merge bitcoin/bitcoin#30444: rest: Reject negative outpoint index early in ↵Ava Chow
getutxos parsing fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 refactor: Use util::Split to avoid a harmless unsigned-integer-overflow (MarcoFalke) fab54db9f1d0e634f4a697480dbb87b87940dc5c rest: Reject negative outpoint index in getutxos parsing (MarcoFalke) Pull request description: In `rest_getutxos` outpoint indexes such as `+N` or `-N` are accepted. This should be harmless, because any index out of range should be treated as a non-existent utxo. However, a negative index can't exist ever, so it seems better to reject all signs, whether `+` or `-`. ACKs for top commit: achow101: ACK fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 hodlinator: ut-ACK fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 tdb3: re ACK fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 danielabrozzoni: ACK fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 brunoerg: reACK fac932bf93d9bd8cb7bef93f04ecf48ea2ccf1d1 Tree-SHA512: 8f1a75248cb61e1c4beceded6ed170db83b07f30fbcf93a26acfffc00ec4546572366eff87907a7e1423d7d3a2a9e57a0a7a9bacb787c86463f842d7161c16bc
2024-07-18Merge bitcoin/bitcoin#30453: test: Non-Shy version senderglozow
faed5d3870fb32fb5278961ee23e38fd9ea6ca15 test: Non-Shy version sender (MarcoFalke) Pull request description: After `add_outbound_p2p_connection`, the test framework normally sends a version message only in reply to a received version. This is fine, but the protocol does not require this and tolerates a version to be sent earlier. However, this is untested, and the missing test coverage leads to bugs being missed. For example https://github.com/bitcoin/bitcoin/pull/30394#pullrequestreview-2166824948 Fix it by adding a test. ACKs for top commit: brunoerg: ACK faed5d3870fb32fb5278961ee23e38fd9ea6ca15 tdb3: ACK faed5d3870fb32fb5278961ee23e38fd9ea6ca15 theStack: tACK faed5d3870fb32fb5278961ee23e38fd9ea6ca15 glozow: ACK faed5d3870f Tree-SHA512: dbf527a39c932e994a1e8248ba78058000811a4bf69275278f1fd1e545716ac4d2d3be5dcf362976bbafa2a49f91d13e3601daf71d29e9c556179b01af62c03c
2024-07-18Merge bitcoin/bitcoin#30356: refactor: add coinbase constraints to ↵Ryan Ofsky
BlockAssembler::Options c504b6997b1acc9771ad1f52efaa4be2b4966c6c refactor: add coinbase constraints to BlockCreateOptions (Sjors Provoost) 6b4c817d4b978adf69738677c74855ef0675f333 refactor: pass BlockCreateOptions to createNewBlock (Sjors Provoost) 323cfed5959b25c98235ec988b408fc5e3391e3c refactor: use CHECK_NONFATAL to avoid single-use symbol (Sjors Provoost) Pull request description: When generating a block template through e.g. getblocktemplate RPC, we reserve 4000 weight units and 400 sigops. Pools use this space for their coinbase outputs. At least one pool patched their Bitcoin Core node to adjust these hardcoded values. They eventually [produced an invalid block](https://bitcoin.stackexchange.com/questions/117837/how-many-sigops-are-in-the-invalid-block-783426) which exceeded the sigops limit. The existince of such patches suggests it may be useful to make this value configurable. This PR would make such a change easier. However, the main motivation is that in the Stratum v2 spec requires the pool to communicate the maximum bytes they intend to add to the coinbase outputs. Specifically the `CoinbaseOutputDataSize` message which is part of the [Template Distribution Protocol](https://github.com/stratum-mining/sv2-spec/blob/main/07-Template-Distribution-Protocol.md#71-coinbaseoutputdatasize-client---server) has a field `coinbase_output_max_additional_size`. A proposed change to the spec adds the max additional sigops as well: https://github.com/stratum-mining/sv2-spec/pull/86. Whether that change makes it into the spec is not important though, as adding both to `BlockAssembler::Options` makes sense. The first commit is a test refactor followup for #30335, related to the code that's changed here, but not required. The second commit introduces BlockCreateOptions, with just `use_mempool`. The thirds commit adds `coinbase_max_additional_weight` and `coinbase_output_max_additional_sigops` to `BlockCreateOptions`. They use the originally hardcoded values, and no existing caller overrides these defaults. This changes in #29432. ACKs for top commit: itornaza: tested ACK c504b6997b1acc9771ad1f52efaa4be2b4966c6c ryanofsky: Code review ACK c504b6997b1acc9771ad1f52efaa4be2b4966c6c ismaelsadeeq: Code review ACK c504b6997b1acc9771ad1f52efaa4be2b4966c6c Tree-SHA512: de2fa085f47048c91d95524e03f909f6f27f175c1fefa3d6106445e7eb5cf5b710eda6ea5b641cf3b4704a4e4e0181a0c829003b9fd35465f2a46167e5d64487