Skip to content

Commit f435ae5

Browse files
Merge #7452: backport: Merge bitcoin#30257, 30264, (partial) 16807, (partial) 23577, 24402, 26252, 30047, 29607, 27905
5ce9c6f Merge bitcoin#27905: validation: add missing insert to m_dirty_blockindex (fanquake) bd6b815 Merge bitcoin#29607: refactor: Reduce memory copying operations in bech32 encoding (Ava Chow) 67d6eed Merge bitcoin#30047: refactor: Model the bech32 charlimit as an Enum (Ava Chow) 0f033fd Merge bitcoin#26252: refactor: Make 64-bit shift explicit (MacroFake) a27cdd3 Merge bitcoin#24402: refactor: Avoid implicit-integer-sign-change in bech32.cpp (fanquake) bd1186e (partial) Merge bitcoin#23577: Follow-ups to Bech32 error detection (W. J. van der Laan) ce6d7cb (partial) Merge bitcoin#16807: Let validateaddress locate error in Bech32 address (W. J. van der Laan) a8a3fa8 Merge bitcoin#30264: test: add coverage for errors for `combinerawtransaction` (merge-script) 8a74523 Merge bitcoin#30257: build: Remove --enable-gprof (merge-script) Pull request description: ## Issue being fixed or feature implemented - Replaces #7296 with a clean, GPG-signed backport stack. - Backports Bitcoin Core build cleanup, RPC test coverage, Bech32 library improvements, and the missing dirty block-index update. - Excludes bitcoin#30006 because its `feature_reindex_readonly.py` change depends on an upstream test-history chain not currently present in Dash; it should be handled separately. ## What was done? - Backported bitcoin#30257 and bitcoin#30264. - Partially backported bitcoin#16807 and bitcoin#23577, limited to: - `src/bech32.cpp` - `src/bech32.h` - `src/test/bech32_tests.cpp` - Intentionally excluded their Bitcoin L1 `key_io` / `validateaddress` integration, related functional tests, and release note. Dash L1 addresses remain Base58; Dash's Platform Bech32m path is separate. - Backported bitcoin#24402 completely, including the Bech32 sign-conversion cleanup and removal of the four now-unnecessary sanitizer suppressions. - Backported the complete applicable bitcoin#26252 change. Its `src/bech32.cpp` change is applied exactly. The `build_msvc/common.init.vcxproj.in` hunk is intentionally inapplicable because Dash removed that obsolete build system in `04fb085f6bddc90e806deefd90c72104763f055a`. - Backported bitcoin#30047 completely, including all `CharLimit`, `CHECKSUM_SIZE`, and `LocateErrors` changes. - Backported bitcoin#29607 completely, including both `hrp.reserve(pos)` additions in `Decode` and `LocateErrors`. - Backported bitcoin#27905 while preserving Dash's ChainLocks-specific `fConflictingChain` path. - Preserved upstream authorship and signed all nine commits with PastaClaw key `218BBA5FAC3745AB`. The remaining older, non-blocking upstream starting-state differences are a copyright-header update and bitcoin#24513's cosmetic `CChainState` rename. Neither causes an omitted hunk, semantic workaround, or behavior difference in this stack. ## How Has This Been Tested? - `git verify-commit` passed for all nine commits. - Compared bitcoin#24402 and bitcoin#26252 against their upstream first-parent merge diffs, file by file. - Confirmed bitcoin#24402 removes only the four intended sanitizer suppressions. - Confirmed bitcoin#26252 applies the exact Bech32 change and does not recreate `build_msvc`. - Confirmed stable patch IDs for bitcoin#30047 and bitcoin#29607 are unchanged. - `git range-diff` confirmed the existing seven patches remain unchanged apart from rewritten IDs and the expected bitcoin#30047 context around bitcoin#24402's formatting change. - `git diff --check` passed. - `make -C src test/test_dash -j15` passed on macOS arm64. - `./src/test/test_dash --run_test=bech32_tests`: 4 test cases passed. - A build configured with `--with-sanitizers=undefined,integer` passed. - The Bech32 test suite passed under the sanitizer build with the project's CI `UBSAN_OPTIONS`. - Separate local Codex backport review passed at `5ce9c6f8da5659c540f8b68cdf8dc317bf7c8934` with no findings. ## Breaking Changes None. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ Top commit has no ACKs. Tree-SHA512: e24f389a19c812766d6c28ead35347808a9b4d4fe3b86527a24ac69ded41310724e5e5ac0e90d1a3a958371060eef8dac1af21bfcbd6c3d517bda23d9f9f07d3
2 parents 36589d4 + 5ce9c6f commit f435ae5

9 files changed

Lines changed: 461 additions & 78 deletions

File tree

‎configure.ac‎

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ AC_ARG_WITH([qrencode],
201201

202202
AC_ARG_ENABLE([hardening],
203203
[AS_HELP_STRING([--disable-hardening],
204-
[do not attempt to harden the resulting executables (default is to harden when possible)])],
204+
[do not attempt to harden the resulting executables (default is to harden)])],
205205
[use_hardening=$enableval],
206-
[use_hardening=auto])
206+
[use_hardening=yes])
207207

208208
AC_ARG_ENABLE([reduce-exports],
209209
[AS_HELP_STRING([--enable-reduce-exports],
@@ -307,13 +307,6 @@ AC_ARG_WITH([sanitizers],
307307
[comma separated list of extra sanitizers to build with (default is none enabled)])],
308308
[use_sanitizers=$withval])
309309

310-
dnl Enable gprof profiling
311-
AC_ARG_ENABLE([gprof],
312-
[AS_HELP_STRING([--enable-gprof],
313-
[use gprof profiling compiler flags (default is no)])],
314-
[enable_gprof=$enableval],
315-
[enable_gprof=no])
316-
317310
dnl Turn warnings into errors
318311
AC_ARG_ENABLE([werror],
319312
[AS_HELP_STRING([--enable-werror],
@@ -1058,30 +1051,12 @@ if test "$ac_cv_sys_large_files" != "" &&
10581051
CORE_CPPFLAGS="$CORE_CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files"
10591052
fi
10601053

1061-
if test "$enable_gprof" = "yes"; then
1062-
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense,
1063-
dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force
1064-
dnl -pie by default, in which case it needs to be turned off with -no-pie.
1065-
1066-
if test "$use_hardening" = "yes"; then
1067-
AC_MSG_ERROR([gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof])
1068-
fi
1069-
use_hardening=no
1070-
AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"],
1071-
[AC_MSG_ERROR([gprof profiling requested but not available])], [$CXXFLAG_WERROR])
1072-
1073-
AX_CHECK_LINK_FLAG([-no-pie], [GPROF_LDFLAGS="-no-pie"])
1074-
AX_CHECK_LINK_FLAG([-pg], [GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"],
1075-
[AC_MSG_ERROR([gprof profiling requested but not available])], [$GPROF_LDFLAGS])
1076-
fi
1077-
10781054
if test "$TARGET_OS" != "windows"; then
10791055
dnl All windows code is PIC, forcing it on just adds useless compile warnings
10801056
AX_CHECK_COMPILE_FLAG([-fPIC], [PIC_FLAGS="-fPIC"])
10811057
fi
10821058

10831059
if test "$use_hardening" != "no"; then
1084-
use_hardening=yes
10851060
AX_CHECK_COMPILE_FLAG([-Wstack-protector], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"])
10861061
AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"])
10871062

@@ -2038,8 +2013,6 @@ AC_SUBST(DEBUG_CXXFLAGS)
20382013
AC_SUBST(WARN_CXXFLAGS)
20392014
AC_SUBST(NOWARN_CXXFLAGS)
20402015
AC_SUBST(ERROR_CXXFLAGS)
2041-
AC_SUBST(GPROF_CXXFLAGS)
2042-
AC_SUBST(GPROF_LDFLAGS)
20432016
AC_SUBST(HARDENED_CXXFLAGS)
20442017
AC_SUBST(HARDENED_CPPFLAGS)
20452018
AC_SUBST(HARDENED_LDFLAGS)
@@ -2160,7 +2133,6 @@ echo " debug enabled = $enable_debug"
21602133
echo " stacktraces = $enable_stacktraces"
21612134
echo " crash hooks = $enable_crashhooks"
21622135
echo " miner enabled = $enable_miner"
2163-
echo " gprof enabled = $enable_gprof"
21642136
echo " werror = $enable_werror"
21652137
echo
21662138
echo " target os = $host_os"
@@ -2170,8 +2142,8 @@ echo " CC = $CC"
21702142
echo " CFLAGS = $DEBUG_CFLAGS $PTHREAD_CFLAGS $BACKTRACE_FLAGS $CFLAGS"
21712143
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS"
21722144
echo " CXX = $CXX"
2173-
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $BACKTRACE_FLAGS $CXXFLAGS"
2174-
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $BACKTRACE_LDFLAGS $LDFLAGS"
2145+
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $CORE_CXXFLAGS $BACKTRACE_FLAGS $CXXFLAGS"
2146+
echo " LDFLAGS = $PTHREAD_LIBS $HARDENED_LDFLAGS $CORE_LDFLAGS $BACKTRACE_LDFLAGS $LDFLAGS"
21752147
echo " AR = $AR"
21762148
echo " ARFLAGS = $ARFLAGS"
21772149
echo

‎doc/developer-notes.md‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Developer Notes
1313
- [Development tips and tricks](#development-tips-and-tricks)
1414
- [Compiling for debugging](#compiling-for-debugging)
1515
- [Show sources in debugging](#show-sources-in-debugging)
16-
- [Compiling for gprof profiling](#compiling-for-gprof-profiling)
1716
- [`debug.log`](#debuglog)
1817
- [Devnet, testnet, and regtest modes](#devnet-testnet-and-regtest-modes)
1918
- [DEBUG_LOCKORDER](#debug_lockorder)
@@ -385,10 +384,6 @@ ln -s /path/to/project/root/src src
385384

386385
3. Use `debugedit` to modify debug information in the binary.
387386

388-
### Compiling for gprof profiling
389-
390-
Run configure with the `--enable-gprof` option, then make.
391-
392387
### `debug.log`
393388

394389
If the code is behaving strangely, take a look in the `debug.log` file in the data directory;

‎src/Makefile.am‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ print-%: FORCE
99

1010
DIST_SUBDIRS = secp256k1
1111

12-
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS) $(BACKTRACE_LDFLAGS)
12+
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS) $(BACKTRACE_LDFLAGS)
1313
AM_CFLAGS = $(DEBUG_CFLAGS) $(BACKTRACE_FLAGS)
14-
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(CORE_CXXFLAGS) $(BACKTRACE_FLAGS)
14+
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(CORE_CXXFLAGS) $(BACKTRACE_FLAGS)
1515
AM_OBJCXXFLAGS = $(AM_CXXFLAGS)
1616
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS)
1717
AM_LIBTOOLFLAGS = --preserve-dup-deps

0 commit comments

Comments
 (0)