backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849#7257
backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849#7257vijaydasmp wants to merge 8 commits intodashpay:developfrom
Conversation
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
e782b6b to
9ec07ba
Compare
13f5391 Fix typos in `subprocess.hpp` (Hennadii Stepanov) Pull request description: Resolves one item in the bitcoin#28981 (review): > - Remove linter exclusions and fix all issues. Based on upstream arun11299/cpp-subprocess#101. ACKs for top commit: fanquake: ACK 13f5391 Tree-SHA512: 2ee27a5b7d1ba6f47a5148add155c918eadaaffb94a4b5dd3edea00e63440b87291c559361bf25a8db1567debff78cf7e9466dc34f14331ca1d426994837df93
45a9d87 to
7a91a62
Compare
…header name conventions 08f756b Replace locale-dependent `std::strerror` with `SysErrorString` (Hennadii Stepanov) d8e4ba4 refactor: Rename `subprocess.hpp` to follow our header name conventions (Hennadii Stepanov) Pull request description: This PR renames the header `*.hpp` --> `*.h` and adjusts the header guard name, which makes it available for processing by linters. Fixed the following linter warning: ``` The locale dependent function strerror(...) appears to be used: src/util/subprocess.h: std::runtime_error( err_msg + ": " + std::strerror(err_code) ) Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. Please avoid using locale-dependent functions if possible. Advice not applicable in this specific case? Add an exception by updating the ignore list in /bitcoin/test/lint/lint-locale-dependence.py ^---- failure generated from lint-locale-dependence.py ``` ACKs for top commit: TheCharlatan: ACK 08f756b Tree-SHA512: 57a2f01c20eb9552481e428a4969bd59e9ada9f784fe1a45cb62aa9c9152c8e950d336854f45af0e2e5dc7c7b2a1fb216c8f832e3d6ccfb457ad71b6e423231e
992c714 common: Don't terminate on null character in UrlDecode (Fabian Jahr) 099fa57 scripted-diff: Modernize name of urlDecode function and param (Fabian Jahr) 8f39aaa refactor: Remove hooking code for urlDecode (Fabian Jahr) 650d43e refactor: Replace libevent use in urlDecode with our own code (Fabian Jahr) 46bc6c2 test: Add unit tests for urlDecode (Fabian Jahr) Pull request description: Fixes bitcoin#29654 (as a side-effect) Removing dependencies is a general goal of the project and the xz backdoor has been an additional wake up call recently. Libevent shows many of the same symptoms, few maintainers and slow releases. While libevent can not be removed completely over night we should start removing it’s usage where it's possible, ideally with the end goal to removing it completely. This is a pretty easy win in that direction. The [`evhttp_uridecode` function from libevent](https://github.com/libevent/libevent/blob/e0a4574ba2cbcdb64bb2b593e72be7f7f4010746/http.c#L3542) we were using in `urlDecode` could be easily emulated in fewer LOC. This also ports the [applicable test vectors over from libevent](https://github.com/libevent/libevent/blob/master/test/regress_http.c#L3430). ACKs for top commit: achow101: ACK 992c714 theStack: Code-review ACK 992c714 maflcko: ACK 992c714 👈 stickies-v: ACK 992c714 Tree-SHA512: 78f76ae7ab3b6710eab2aaac20f55eb0da7803e057eaa6220e865f328666a5399ef1a479702aaf630b2f974ad3aa15e2b6adac9c11bc8c3d4be21e8af1667fea
…subprocess 8b52e7f update comments in cpp-subprocess (check_output references) (Sebastian Falbesoner) 97f1597 remove unused method `Popen::kill` from cpp-subprocess (Sebastian Falbesoner) 908c51f remove commented out code in cpp-subprocess (Sebastian Falbesoner) ff79adb remove unused templates from cpp-subprocess (Sebastian Falbesoner) Pull request description: This PR removes remaining code that is unused within the cpp-subprocess module (templates and commented out code). Happy to add more removals if anyone finds more unused parts. Note that there are some API functions of the `Popen` class that we don't use, e.g. `wait()`, `pid()`, `poll()`, `kill()`, but they sound IMHO common enough to be useful in the future, so not sure how deep we should go there. ACKs for top commit: fjahr: Code review ACK 8b52e7f achow101: ACK 8b52e7f hebasto: ACK 8b52e7f. Tree-SHA512: 14c1cd2216185d941923f06fdc7acbeed66cd87e2691d9a352f7309b3e07fe4877b580f598a2e4106f9c48395ed6de00a0bfb5d3c3af9c4624d1956a0f543e99
b50d127 refactor: Make 64-bit shift explicit (Hennadii Stepanov) Pull request description: This PR fixes MSVC warning [C4334](https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4334) in the fuzzing code. Similar to bitcoin#26252. All `DisableSpecificWarnings` dropped from `fuzz.vcxproj` as all remained are inherited from `common.init.vcxproj`. Required to simplify warning suppression porting to the CMake-based build system. ACKs for top commit: maflcko: utACK b50d127 sipsorcery: utACK b50d127 Tree-SHA512: 18f6082b4234506ad2f9df54e577031b97cdf9f7ef64cad4162f275660716ab73587a97d3af0f778dfd48d2751d8676b5d3381d0aa837fcc60a09704473a9209
bd2de7a refactor, test: Always initialize pointer (Hennadii Stepanov) Pull request description: This change fixes MSVC warning [C4703](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4703). All `DisableSpecificWarnings` dropped from `test_bitcoin.vcxproj` as all remained are inherited from `common.init.vcxproj`. Required to simplify warning suppression porting to the CMake-based build system. ACKs for top commit: maflcko: utACK bd2de7a sipsorcery: utACK bd2de7a. ryanofsky: Code review ACK bd2de7a Tree-SHA512: 006db041d3c3697a77d9df14de86cf7c8a10804b45789df01268b2236cf6452e77dc57e89f5d5a6bc26d4b5cd483f0722d6035649c8a523b57954bb1fc810d0c
fa6d489 refactor: Use type-safe time in txorphanage (MarcoFalke) Pull request description: This allows to remove manual conversions like multiplication by `60`, and uses a type-safe type instead of a raw `int64_t`. ACKs for top commit: epiccurious: utACK fa6d489. dergoegge: Code review ACK fa6d489 brunoerg: utACK fa6d489 Tree-SHA512: c187d0e579b1131afcef8c901f5662c18ab867fa2a99fbb13b67bb1e10b2047128194bfef8329cde0d51e1c35d6227ae292b823968f37ea9422975e46e01846a
a8df81b to
3673fe0
Compare
|
✅ Review complete (commit 9fb5593) |
WalkthroughThis pull request refactors URL decoding functionality and build system dependencies. The changes remove the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~35 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
src/test/fuzz/poolresource.cpp (1)
68-68: Optional: Considersize_t{1}instead of1Ufor consistency.For complete consistency with the other changes in this line, you could replace
- 1Uwith- size_t{1}. This is purely a style preference and doesn't affect correctness, as1Uwill be promoted tosize_tduring the subtraction.✨ Optional consistency fix
- size_t size = m_provider.ConsumeIntegralInRange<size_t>(size_t{1} << size_bits, (size_t{1} << (size_bits + 1)) - 1U) << alignment_bits; + size_t size = m_provider.ConsumeIntegralInRange<size_t>(size_t{1} << size_bits, (size_t{1} << (size_bits + 1)) - size_t{1}) << alignment_bits;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/fuzz/poolresource.cpp` at line 68, Replace the literal unsigned int used in the upper bound with a size_t brace-init for consistency: in the call to m_provider.ConsumeIntegralInRange<size_t> change the upper bound expression from ((size_t{1} << (size_bits + 1)) - 1U) to ((size_t{1} << (size_bits + 1)) - size_t{1}) so both operands are size_t; this edit is in the expression passed to m_provider.ConsumeIntegralInRange<size_t>.src/test/validation_chainstate_tests.cpp (1)
112-119: ReplaceAssert(...)withBOOST_REQUIREfor test-scoped failure handling.In test code,
Assert(...)callsabort()and terminates the entire test process immediately. UsingBOOST_REQUIRE/BOOST_REQUIRE_MESSAGEinstead aborts only the current test case, allowing other test cases in the suite to continue—critical for test-run completeness. This also aligns with the project's requirement that unit tests insrc/test/use Boost::Test.Suggested refactor
- CChainState& background_cs{*Assert([&]() -> CChainState* { + CChainState* background_cs_ptr{[&]() -> CChainState* { for (CChainState* cs : chainman.GetAll()) { if (cs != &chainman.ActiveChainstate()) { return cs; } } return nullptr; - }())}; + }()}; + BOOST_REQUIRE_MESSAGE(background_cs_ptr != nullptr, "Background chainstate not found"); + CChainState& background_cs{*background_cs_ptr};🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/test/validation_chainstate_tests.cpp` around lines 112 - 119, The test uses Assert(...) which aborts the whole process; replace it with Boost checks: iterate over chainman.GetAll() to find the non-active CChainState* (same logic as the lambda), store it in a CChainState* variable, then use BOOST_REQUIRE_MESSAGE(found != nullptr, "background chainstate not found") to fail only this test if null; finally bind CChainState& background_cs to *found (preserving the original variable name background_cs and using chainman.ActiveChainstate() to identify the active one).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/test/fuzz/poolresource.cpp`:
- Line 68: Replace the literal unsigned int used in the upper bound with a
size_t brace-init for consistency: in the call to
m_provider.ConsumeIntegralInRange<size_t> change the upper bound expression from
((size_t{1} << (size_bits + 1)) - 1U) to ((size_t{1} << (size_bits + 1)) -
size_t{1}) so both operands are size_t; this edit is in the expression passed to
m_provider.ConsumeIntegralInRange<size_t>.
In `@src/test/validation_chainstate_tests.cpp`:
- Around line 112-119: The test uses Assert(...) which aborts the whole process;
replace it with Boost checks: iterate over chainman.GetAll() to find the
non-active CChainState* (same logic as the lambda), store it in a CChainState*
variable, then use BOOST_REQUIRE_MESSAGE(found != nullptr, "background
chainstate not found") to fail only this test if null; finally bind CChainState&
background_cs to *found (preserving the original variable name background_cs and
using chainman.ActiveChainstate() to identify the active one).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: bf1c9f39-4bdd-4412-b32b-ce4ffdc697a7
📒 Files selected for processing (21)
configure.acsrc/Makefile.amsrc/Makefile.test.includesrc/bitcoin-cli.cppsrc/bitcoin-wallet.cppsrc/bitcoind.cppsrc/common/run_command.cppsrc/common/url.cppsrc/common/url.hsrc/qt/main.cppsrc/test/common_url_tests.cppsrc/test/fuzz/poolresource.cppsrc/test/fuzz/string.cppsrc/test/system_tests.cppsrc/test/util/setup_common.cppsrc/test/validation_chainstate_tests.cppsrc/txorphanage.cppsrc/txorphanage.hsrc/util/subprocess.hsrc/wallet/rpc/util.cpptest/lint/lint-spelling.py
💤 Files with no reviewable changes (6)
- src/bitcoin-wallet.cpp
- src/qt/main.cpp
- src/test/util/setup_common.cpp
- src/bitcoin-cli.cpp
- src/bitcoind.cpp
- configure.ac
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
I verified the exact patch scope for PR #7257 against the checked-out source at 9fb5593d467374770847be704149ad3cfbdac7f9. The successful agent section (codex-general) reported no findings, and direct inspection of the touched URL decoding, orphanage time-type cleanup, and subprocess header rename did not reveal a concrete correctness, Dash-specific interaction, or build-integration issue within this diff.
Reviewed commit: 9fb5593
bitcoin backport