Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/dash/lint-tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ iwyu_tool.py \
"src/compat" \
"src/dbwrapper.cpp" \
"src/init" \
"src/kernel/mempool_persist.cpp" \
"src/node/chainstate.cpp" \
"src/node/minisketchwrapper.cpp" \
"src/policy/feerate.cpp" \
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ export HOST=x86_64-pc-linux-gnu
export PACKAGES="python3-zmq"
export DEP_OPTS="NO_WALLET=1 CC=gcc-14 CXX=g++-14"
export GOAL="install"
export BITCOIN_CONFIG="--enable-reduce-exports CC=gcc-14 CXX=g++-14 --enable-experimental-util-chainstate"
export BITCOIN_CONFIG="--enable-reduce-exports CC=gcc-14 CXX=g++-14 --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared"
16 changes: 15 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -783,6 +783,12 @@ AC_ARG_WITH([libs],
[build_bitcoin_libs=$withval],
[build_bitcoin_libs=yes])

AC_ARG_WITH([experimental-kernel-lib],
[AS_HELP_STRING([--with-experimental-kernel-lib],
[build experimental dashkernel library (default is to build if we're building libraries and the experimental build-chainstate executable)])],
[build_experimental_kernel_lib=$withval],
[build_experimental_kernel_lib=auto])

AC_ARG_WITH([daemon],
[AS_HELP_STRING([--with-daemon],
[build dashd daemon (default=yes)])],
Expand Down Expand Up @@ -1791,15 +1797,23 @@ AM_CONDITIONAL([BUILD_BITCOIN_UTIL], [test $build_bitcoin_util = "yes"])
AC_MSG_RESULT($build_bitcoin_util)

AC_MSG_CHECKING([whether to build experimental dash-chainstate])
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
if test "$build_experimental_kernel_lib" = "no"; then
AC_MSG_ERROR([experimental dash-chainstate cannot be built without the experimental dashkernel library. Use --with-experimental-kernel-lib]);
Comment on lines +1800 to +1801

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Gate the kernel-lib error on chainstate being enabled

When a user explicitly disables the experimental kernel library with --without-experimental-kernel-lib while leaving --enable-experimental-util-chainstate at its default no, configure still enters this branch and aborts. The dependency error should only be raised when chainstate was requested; otherwise a normal opt-out of the experimental library makes non-chainstate builds fail unnecessarily.

Useful? React with 👍 / 👎.

else
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
fi
Comment on lines +1800 to +1804

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical | ⚡ Quick win

Error fires unconditionally when kernel library is disabled.

Lines 1800-1802 error if build_experimental_kernel_lib = "no" regardless of whether build_bitcoin_chainstate is enabled. This breaks valid configurations where users disable the kernel library but also don't want chainstate (e.g., ./configure --without-experimental-kernel-lib alone).

The error should only fire when chainstate is explicitly enabled and the kernel library is disabled.

🐛 Proposed fix
-if test "$build_experimental_kernel_lib" = "no"; then
-AC_MSG_ERROR([experimental dash-chainstate cannot be built without the experimental dashkernel library. Use --with-experimental-kernel-lib]);
-else
-  AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
-fi
+if test "$build_bitcoin_chainstate" = "yes" && test "$build_experimental_kernel_lib" = "no"; then
+  AC_MSG_ERROR([experimental dash-chainstate cannot be built without the experimental dashkernel library. Use --with-experimental-kernel-lib])
+fi
+AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@configure.ac` around lines 1800 - 1804, The AC_MSG_ERROR currently triggers
whenever build_experimental_kernel_lib = "no" even if chainstate isn't
requested; change the logic so the error is emitted only when both
build_bitcoin_chainstate = "yes" and build_experimental_kernel_lib = "no".
Concretely, replace the top-level if that checks build_experimental_kernel_lib
with a conditional that tests both variables (e.g., if test
"$build_bitcoin_chainstate" = "yes" && test "$build_experimental_kernel_lib" =
"no"; then AC_MSG_ERROR(...); else AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE],
[test $build_bitcoin_chainstate = "yes"]) fi), leaving the AM_CONDITIONAL for
BUILD_BITCOIN_CHAINSTATE unchanged.

AC_MSG_RESULT($build_bitcoin_chainstate)
Comment on lines 1799 to 1805

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 Blocking: --with-experimental-kernel-lib=no aborts configure even when dash-chainstate is not requested

The new guard at configure.ac:1800 fires on build_experimental_kernel_lib = no unconditionally, but build_bitcoin_chainstate defaults to no (line 777) and is also forced to no at line 1460. The result: any invocation of ./configure --with-experimental-kernel-lib=no (or any future path that disables the kernel library) bails out with an error about dash-chainstate, even though dash-chainstate was never requested. The check must be gated on build_bitcoin_chainstate = yes so it only triggers when the user actually asked for dash-chainstate while explicitly disabling the kernel library. As a bonus, the AM_CONDITIONAL must be emitted unconditionally so automake does not see a conditionally-defined conditional.

Suggested change
AC_MSG_CHECKING([whether to build experimental dash-chainstate])
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
if test "$build_experimental_kernel_lib" = "no"; then
AC_MSG_ERROR([experimental dash-chainstate cannot be built without the experimental dashkernel library. Use --with-experimental-kernel-lib]);
else
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
fi
AC_MSG_RESULT($build_bitcoin_chainstate)
AC_MSG_CHECKING([whether to build experimental dash-chainstate])
if test "$build_bitcoin_chainstate" = "yes" && test "$build_experimental_kernel_lib" = "no"; then
AC_MSG_ERROR([experimental dash-chainstate cannot be built without the experimental dashkernel library. Use --with-experimental-kernel-lib])
fi
AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"])
AC_MSG_RESULT($build_bitcoin_chainstate)

source: ['codex']


AC_MSG_CHECKING([whether to build libraries])
AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test $build_bitcoin_libs = "yes"])

if test "$build_bitcoin_libs" = "yes"; then
AC_DEFINE([HAVE_CONSENSUS_LIB], [1], [Define this symbol if the consensus lib has been built])
AC_CONFIG_FILES([libdashconsensus.pc:libdashconsensus.pc.in])
fi

AM_CONDITIONAL([BUILD_BITCOIN_KERNEL_LIB], [test "$build_experimental_kernel_lib" != "no" && ( test "$build_experimental_kernel_lib" = "yes" || test "$build_bitcoin_chainstate" = "yes" )])

AC_MSG_RESULT($build_bitcoin_libs)

AC_LANG_POP
Expand Down
1 change: 1 addition & 0 deletions contrib/devtools/iwyu/bitcoin.core.imp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Nothing for now.
[
{ include: [ "<bits/chrono.h>", private, "<chrono>", public ] },
]
Loading
Loading