Skip to content

backport: Merge bitcoin#30257, 30264, 29607 , 30047, 3006, 27905#7296

Open
vijaydasmp wants to merge 6 commits into
dashpay:developfrom
vijaydasmp:May_2026_03
Open

backport: Merge bitcoin#30257, 30264, 29607 , 30047, 3006, 27905#7296
vijaydasmp wants to merge 6 commits into
dashpay:developfrom
vijaydasmp:May_2026_03

Conversation

@vijaydasmp

Copy link
Copy Markdown

No description provided.

@github-actions

github-actions Bot commented Apr 29, 2026

Copy link
Copy Markdown

✅ No Merge Conflicts Detected

This PR currently has no conflicts with other open PRs.

@vijaydasmp vijaydasmp changed the title backport : Merge bitcoin-core/gui#758, 27491 backport :Merge bitcoin#30264, 29607 , 30047, 3006, 27905 May 18, 2026
@vijaydasmp vijaydasmp changed the title backport :Merge bitcoin#30264, 29607 , 30047, 3006, 27905 backport:Merge bitcoin#30264, 29607 , 30047, 3006, 27905 May 18, 2026
@vijaydasmp vijaydasmp changed the title backport:Merge bitcoin#30264, 29607 , 30047, 3006, 27905 backport : Merge bitcoin#30264, 29607 , 30047, 3006, 27905 May 18, 2026
@vijaydasmp vijaydasmp changed the title backport : Merge bitcoin#30264, 29607 , 30047, 3006, 27905 backport: Merge bitcoin#30264, 29607 , 30047, 3006, 27905 May 18, 2026
@vijaydasmp vijaydasmp changed the title backport: Merge bitcoin#30264, 29607 , 30047, 3006, 27905 backport: Merge bitcoin#30257, 30264, 29607 , 30047, 3006, 27905 May 18, 2026
@vijaydasmp vijaydasmp marked this pull request as ready for review June 9, 2026 11:55
fanquake and others added 6 commits June 9, 2026 17:25
fa780e1 build: Remove --enable-gprof (MarcoFalke)

Pull request description:

  It is unclear what benefit this option has, given that:

  * `gprof` requires re-compilation (`perf` and other tools can instead be used on existing executables)
  * `gprof` requires hardening to be disabled
  * `gprof` doesn't work with `clang`
  * `perf` is documented in the dev-notes, and test notes, and embedded into the functional test framework; `gprof` isn't
  * Anyone really wanting to use it could pass the required flags to `./configure`
  * I couldn't find any mention of the use of `gprof` in the discussions in this repo, apart from the initial pull request adding it (cfaac2a)
  * Keeping it means that it needs to be maintained and ported to CMake

  Fix all issues by removing it.

ACKs for top commit:
  TheCharlatan:
    ACK fa780e1
  hebasto:
    ACK fa780e1, I have reviewed the code and it looks OK.
  willcl-ark:
    crACK fa780e1

Tree-SHA512: 0a9ff363ac2bec8b743878a4e3147f18bc16823d00c5007568432c36320bd0199b13b6d0ce828a9a83c2cc434c058afaa64eb2eccfbd93ed85b81ce10c41760c
…nsaction`

ab98e6f test: add coverage for errors for `combinerawtransaction` RPC (brunoerg)

Pull request description:

  This PR adds test coverage for the following errors for the `combinerawtransaction` RPC:

  * Tx decode failed
  * Missing transactions
  * Input not found or already spent

  For reference: https://maflcko.github.io/b-c-cov/total.coverage/src/rpc/rawtransaction.cpp.gcov.html

ACKs for top commit:
  maflcko:
    lgtm ACK ab98e6f
  tdb3:
    ACK ab98e6f

Tree-SHA512: 8a133c25dad2e1b236e0278a88796f60f763e3fd6fbbc080f926bb23f9dcc55599aa242d6e0c4ec15a179d9ded10a1f17ee5b6063719107ea84e6099f10416b2
…ch32 encoding

07f6417 Reduce memory copying operations in bech32 encode (Lőrinc)
d5ece3c Reserve hrp memory in Decode and LocateErrors (Lőrinc)

Pull request description:

  Started optimizing the base conversions in [TryParseHex](bitcoin#29458), [Base58](bitcoin#29473) and [IsSpace](bitcoin#29602) - this is the next step.

  Part of this change was already merged in bitcoin#30047, which made decoding `~26%` faster.

  Here I've reduced the memory reallocations and copying operations in bech32 encode, making it `~15%` faster.

  >  make && ./src/bench/bench_bitcoin --filter='Bech32Encode' --min-time=1000

  Before:
  ```
  |             ns/byte |              byte/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |               19.97 |       50,074,562.72 |    0.1% |      1.06 | `Bech32Encode`
  ```

  After:
  ```
  |             ns/byte |              byte/s |    err% |     total | benchmark
  |--------------------:|--------------------:|--------:|----------:|:----------
  |               17.33 |       57,687,668.20 |    0.1% |      1.10 | `Bech32Encode`
  ```

ACKs for top commit:
  josibake:
    ACK bitcoin@07f6417
  sipa:
    utACK 07f6417
  achow101:
    ACK 07f6417

Tree-SHA512: 511885217d044ad7ef2bdf9203b8e0b94eec8b279bc193bb7e63e29ab868df6d21e9e4c7a24390358e1f9c131447ee42039df72edcf1e2b11e1856eb2b3e10dd
7f3f6c6 refactor: replace hardcoded numbers (Lőrinc)
5676aec refactor: Model the bech32 charlimit as an Enum (josibake)

Pull request description:

  Broken out from bitcoin#28122

  ---

  Bech32(m) was defined with a 90 character limit so that certain guarantees for error detection could be made for segwit addresses (see https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki#checksum-design).

  However, there is nothing about the encoding scheme itself that requires a limit of 90 and in practice bech32(m) is being used without the 90 char limit (e.g. lightning invoices, silent payments). Further, increasing the character limit doesn't do away with error detection, it simply changes the guarantee.

  The primary motivation for this change is for being able to parse BIP352 v0 silent payment addresses (see bitcoin@622c7a9), which require up to 118 characters. In addition to BIP352, modeling the character limit as an enum allows us to easily support new address types that use bech32m and specify their own character limit.

ACKs for top commit:
  paplorinc:
    re-ACK 7f3f6c6
  achow101:
    ACK 7f3f6c6
  theuni:
    utACK 7f3f6c6

Tree-SHA512: 9c793d657448c1f795093b9f7d4d6dfa431598f48d54e1c899a69fb2f43aeb68b40ca2ff08864eefeeb6627d4171877234b5df0056ff2a2b84415bc3558bd280
fd6a7d3 test: use sleepy wait-for-log in reindex readonly (Matthew Zipkin)

Pull request description:

  Also rename the busy wait-for-log method to prevent recurrence. See bitcoin#27039 (comment)

ACKs for top commit:
  maflcko:
    utACK fd6a7d3
  achow101:
    ACK fd6a7d3
  tdb3:
    ACK for fd6a7d3
  rkrux:
    ACK [fd6a7d3](bitcoin@fd6a7d3)

Tree-SHA512: 7ff0574833df1ec843159b35ee88b8bb345a513ac13ed0b72abd1bf330c454a3f9df4d927871b9e3d37bfcc07542b06ef63acef8e822cd18499adae8cbb0cda8
…ndex

e639364 validation: add missing insert to m_dirty_blockindex (Martin Zumsande)

Pull request description:

  When the status of a block index is changed, we must add it to `m_dirty_blockindex` or the change might not get persisted to disk.
  This is missing from one spot in `FindMostWorkChain()`, where `BLOCK_FAILED_CHILD` is set.
  Since we have [code](https://github.com/bitcoin/bitcoin/blob/f0758d8a6696657269d9c057e7aa079ffa9e1c16/src/node/blockstorage.cpp#L284-L287) that later sets missing `BLOCK_FAILED_CHILD` during the next startup, I don't think that this can lead to bad block indexes in practice, but I still think it's worth fixing.

ACKs for top commit:
  TheCharlatan:
    ACK e639364
  stickies-v:
    ACK e639364

Tree-SHA512: a97af9c173e31b90b677a1f95de822e08078d78013de5fa5fe4c3bec06f45d6e1823b7694cdacb887d031329e4b4afc6a2003916e0ae131279dee71f43e1f478
@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e22dfd72-b65d-4f1b-801a-717ef2975a50

📥 Commits

Reviewing files that changed from the base of the PR and between 317917a and 13d8299.

📒 Files selected for processing (9)
  • configure.ac
  • doc/developer-notes.md
  • src/Makefile.am
  • src/bech32.cpp
  • src/bech32.h
  • src/validation.cpp
  • test/functional/feature_init.py
  • test/functional/rpc_rawtransaction.py
  • test/functional/test_framework/test_node.py
💤 Files with no reviewable changes (1)
  • doc/developer-notes.md

Walkthrough

This PR consolidates three independent changes: (1) removes gprof profiling support from the build system and changes hardening default to enabled, (2) refactors the Bech32 checksum implementation with a new optional CharLimit parameter for the Decode function and introduces a helper function to reduce code duplication, and (3) adds block-index dirty tracking during chain validation and renames a test logging method with corresponding test updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • knst
  • thepastaclaw
  • UdjinM6
  • PastaPastaPasta
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 72.73% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided by the author, making it impossible to assess whether any description relates to the changeset. Add a description explaining the purpose and scope of these backported changes, even briefly identifying the key features being merged.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title lists multiple Bitcoin pull request numbers that are being backported, which matches the changeset containing multiple distinct features (hardening/gprof changes, bech32 refactoring, block validation fix, test improvements).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/bech32.cpp

src/bech32.cpp:5:10: error: 'bech32.h' file not found with include; use "quotes" instead
5 | #include <bech32.h>
| ^~~~~~~~~~
| "bech32.h"
src/bech32.cpp:6:10: error: 'util/vector.h' file not found with include; use "quotes" instead
6 | #include <util/vector.h>
| ^~~~~~~~~~~~~~~
| "util/vector.h"
2 errors generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/13d82993811fd561365b6d8ccc3ecd24f0a82fbe-f146300624c06d2e/tmp/clang_command_.tmp.a25c93.txt
++Contents of '/tmp/coderabbit-infer/13d82993811fd561365b6d8ccc3ecd24f0a82fbe-f146300624c06d2e/tmp/clang_command_.tmp.a25c93.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-

... [truncated 1293 characters] ...

lugins/clang/install/lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/f146300624c06d2e/file.o" "-x" "c++"
"src/bech32.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/validation.cpp

src/validation.cpp:7:10: error: 'validation.h' file not found with include; use "quotes" instead
7 | #include <validation.h>
| ^~~~~~~~~~~~~~
| "validation.h"
In file included from src/validation.cpp:7:
src/validation.h:14:10: error: 'arith_uint256.h' file not found with include; use "quotes" instead
14 | #include <arith_uint256.h>
| ^~~~~~~~~~~~~~~~~
| "arith_uint256.h"
src/validation.h:15:10: error: 'attributes.h' file not found with include; use "quotes" instead
15 | #include <attributes.h>
| ^~~~~~~~~~~~~~
| "attributes.h"
src/validation.h:16:10: error: 'chain.h' file not found with include; use "quotes" instead
16 | #include <chain.h>
| ^~~~~~~~~
| "chain.h"
In file included from src/validation.cpp:7:
In file included from src/validation.h:16:
src/chain.h:9:10: error: 'arith_uint256.h' file not found with

... [truncated 2200 characters] ...

ans.CTrans_funct.exec_with_node_creation in file "src/clang/cTrans.ml" (inlined), line 104, characters 20-38
Called from ClangFrontend__CTrans.CTrans_funct.get_clang_stmt_trans in file "src/clang/cTrans.ml" (inlined), line 5395, characters 4-69
Called from ClangFrontend__CTrans.CTrans_funct.get_custom_stmt_trans in file "src/clang/cTrans.ml", line 5401, characters 8-55
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs.exec_trans_instrs_rev in file "src/clang/cTrans.ml" (inlined), line 5365, characters 28-54
Called from ClangFrontend__CTrans.CTrans_funct.exec_trans_instrs in file "src/clang/cTrans.ml" (inlined), line 5389, characters 6-70
Called from ClangFrontend__CTrans.CTrans_funct.instructions_trans in file "src/clang/cTrans.ml", line 5451, characters 25-68
Called from Cl


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.

@thepastaclaw

thepastaclaw commented Jun 10, 2026

Copy link
Copy Markdown

✅ Review complete (commit 13d8299)

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

Six clean Bitcoin Core backports. The final tree at HEAD compiles and is semantically equivalent to upstream for the touched regions; the only in-scope concern is that bitcoin#29607 and bitcoin#30047 were cherry-picked in reverse upstream order, leaving one intermediate merge commit that references CHECKSUM_SIZE before it is defined and breaks bisect.

🟡 1 suggestion(s)

🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `src/bech32.cpp`:
- [SUGGESTION] src/bech32.cpp:189: Cherry-pick order of bitcoin#29607 and bitcoin#30047 is reversed — breaks git bisect
  Upstream merged #30047 (charlimit enum / CHECKSUM_SIZE constexpr) before #29607 (encode-path memcopy reduction), and #29607 explicitly builds on #30047. This PR applies them in the opposite order: 804d22a487 (Merge #29607) lands before 621289fa9a (Merge #30047). At 804d22a487, src/bech32.cpp:189 reads `ret.reserve(hrp.size() + 1 + values.size() + CHECKSUM_SIZE);` but `constexpr size_t CHECKSUM_SIZE = 6;` is not introduced until the next merge. Verified: `git show 804d22a487:src/bech32.cpp` references CHECKSUM_SIZE, while neither 804d22a487~1 nor 804d22a487 itself defines it. That intermediate commit will not compile, which breaks `git bisect` across this range. The final HEAD (13d8299381) is correct because #30047 is applied immediately after, so this is non-blocking — but the merges should be reordered to match upstream and preserve bisectability.

Comment thread src/bech32.cpp
@@ -184,18 +188,18 @@ std::string Encode(Encoding encoding, const std::string& hrp, const data& values
// to return a lowercase Bech32/Bech32m string, but if given an uppercase HRP, the
// result will always be invalid.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Suggestion: Cherry-pick order of bitcoin#29607 and bitcoin#30047 is reversed — breaks git bisect

Upstream merged bitcoin#30047 (charlimit enum / CHECKSUM_SIZE constexpr) before bitcoin#29607 (encode-path memcopy reduction), and bitcoin#29607 explicitly builds on bitcoin#30047. This PR applies them in the opposite order: 804d22a (Merge bitcoin#29607) lands before 621289f (Merge bitcoin#30047). At 804d22a, src/bech32.cpp:189 reads ret.reserve(hrp.size() + 1 + values.size() + CHECKSUM_SIZE); but constexpr size_t CHECKSUM_SIZE = 6; is not introduced until the next merge. Verified: git show 804d22a487:src/bech32.cpp references CHECKSUM_SIZE, while neither 804d22a~1 nor 804d22a itself defines it. That intermediate commit will not compile, which breaks git bisect across this range. The final HEAD (13d8299) is correct because bitcoin#30047 is applied immediately after, so this is non-blocking — but the merges should be reordered to match upstream and preserve bisectability.

source: ['claude', 'codex']

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.

4 participants