Skip to content

backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849#7257

Open
vijaydasmp wants to merge 8 commits intodashpay:developfrom
vijaydasmp:Apr_2026_3
Open

backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849#7257
vijaydasmp wants to merge 8 commits intodashpay:developfrom
vijaydasmp:Apr_2026_3

Conversation

@vijaydasmp
Copy link
Copy Markdown

bitcoin backport

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 26, 2026

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@vijaydasmp vijaydasmp force-pushed the Apr_2026_3 branch 2 times, most recently from e782b6b to 9ec07ba Compare April 1, 2026 15:01
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
@vijaydasmp vijaydasmp force-pushed the Apr_2026_3 branch 2 times, most recently from 45a9d87 to 7a91a62 Compare April 2, 2026 14:16
fanquake and others added 6 commits April 2, 2026 20:15
…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
@vijaydasmp vijaydasmp force-pushed the Apr_2026_3 branch 4 times, most recently from a8df81b to 3673fe0 Compare April 3, 2026 14:10
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849, 29820 backport: Merge bitcoin#30170, 30026, 30017, 29961, 29904, 29910, 29849 Apr 3, 2026
@vijaydasmp vijaydasmp marked this pull request as ready for review April 9, 2026 14:36
@thepastaclaw
Copy link
Copy Markdown

thepastaclaw commented Apr 9, 2026

✅ Review complete (commit 9fb5593)

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Walkthrough

This pull request refactors URL decoding functionality and build system dependencies. The changes remove the USE_LIBEVENT conditional from the build system, consolidating URL decoding into an unconditional library target. The urlDecode function is renamed to UrlDecode with a new signature accepting std::string_view and uses a custom percent-decoder implementation instead of libevent's evhttp_uridecode. The URL_DECODE global function pointer variable is removed from multiple compilation units. The subprocess header is renamed from .hpp to .h, and several functions are removed. Time-related orphan expiration constants are converted from int64_t to strongly-typed duration literals. Minor type safety improvements include explicit size_t casts in bit-shift operations and addition of assertion helpers in tests.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

Possibly related PRs

Suggested reviewers

  • UdjinM6
  • kwvg
  • PastaPastaPasta
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.89% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title references multiple upstream Bitcoin PR numbers (30170, 30026, 30017, 29961, 29904, 29910, 29849) that correspond to the actual changes across URL decoding, subprocess header refactoring, time typing, and other code improvements shown in the changeset.
Description check ✅ Passed The description 'bitcoin backport' is minimal but clearly indicates this is a backport of Bitcoin upstream changes, which aligns with the PR's actual purpose of merging multiple Bitcoin commits.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
src/test/fuzz/poolresource.cpp (1)

68-68: Optional: Consider size_t{1} instead of 1U for consistency.

For complete consistency with the other changes in this line, you could replace - 1U with - size_t{1}. This is purely a style preference and doesn't affect correctness, as 1U will be promoted to size_t during 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: Replace Assert(...) with BOOST_REQUIRE for test-scoped failure handling.

In test code, Assert(...) calls abort() and terminates the entire test process immediately. Using BOOST_REQUIRE/BOOST_REQUIRE_MESSAGE instead 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 in src/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

📥 Commits

Reviewing files that changed from the base of the PR and between 31c8464 and 9fb5593.

📒 Files selected for processing (21)
  • configure.ac
  • src/Makefile.am
  • src/Makefile.test.include
  • src/bitcoin-cli.cpp
  • src/bitcoin-wallet.cpp
  • src/bitcoind.cpp
  • src/common/run_command.cpp
  • src/common/url.cpp
  • src/common/url.h
  • src/qt/main.cpp
  • src/test/common_url_tests.cpp
  • src/test/fuzz/poolresource.cpp
  • src/test/fuzz/string.cpp
  • src/test/system_tests.cpp
  • src/test/util/setup_common.cpp
  • src/test/validation_chainstate_tests.cpp
  • src/txorphanage.cpp
  • src/txorphanage.h
  • src/util/subprocess.h
  • src/wallet/rpc/util.cpp
  • test/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

Copy link
Copy Markdown

@thepastaclaw thepastaclaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants