diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8370afd88f0..6cc7be84688 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -202,7 +202,7 @@ jobs: job-type: [standard, fuzz] include: - job-type: standard - generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DWERROR=ON' + generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DWERROR=ON' job-name: 'Windows native, VS 2022' - job-type: fuzz generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON' @@ -280,7 +280,7 @@ jobs: $exeName = $_.Name # Skip as they currently do not have manifests - if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe" -or $exeName -eq "test_bitcoin-qt.exe" -or $exeName -eq "test_kernel.exe") { + if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe" -or $exeName -eq "test_bitcoin-qt.exe" -or $exeName -eq "test_kernel.exe" -or $exeName -eq "bitcoin-chainstate.exe") { Write-Host "Skipping $exeName (no manifest present)" return } @@ -307,6 +307,7 @@ jobs: BITCOINTX: '${{ github.workspace }}\build\bin\Release\bitcoin-tx.exe' BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe' BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe' + BITCOINCHAINSTATE: '${{ github.workspace }}\build\bin\Release\bitcoin-chainstate.exe' TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }} run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="${RUNNER_TEMP}" --combinedlogslen=99999999 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7c7e0fe718a..aed40610bea 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -407,28 +407,27 @@ if(BUILD_KERNEL_LIB) if (BUILD_KERNEL_TEST) add_subdirectory(test/kernel) endif() -endif() - -if(BUILD_UTIL_CHAINSTATE) - add_executable(bitcoin-chainstate - bitcoin-chainstate.cpp - ) - add_windows_application_manifest(bitcoin-chainstate) - # TODO: The `SKIP_BUILD_RPATH` property setting can be deleted - # in the future after reordering Guix script commands to - # perform binary checks after the installation step. - # Relevant discussions: - # - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 - # - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 - set_target_properties(bitcoin-chainstate PROPERTIES - SKIP_BUILD_RPATH OFF - ) - target_link_libraries(bitcoin-chainstate - PRIVATE - core_interface - bitcoinkernel - ) - install_binary_component(bitcoin-chainstate INTERNAL) + if(BUILD_UTIL_CHAINSTATE) + add_executable(bitcoin-chainstate + bitcoin-chainstate.cpp + ) + add_windows_application_manifest(bitcoin-chainstate) + # TODO: The `SKIP_BUILD_RPATH` property setting can be deleted + # in the future after reordering Guix script commands to + # perform binary checks after the installation step. + # Relevant discussions: + # - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 + # - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 + set_target_properties(bitcoin-chainstate PROPERTIES + SKIP_BUILD_RPATH OFF + ) + target_link_libraries(bitcoin-chainstate + PRIVATE + core_interface + bitcoinkernel + ) + install_binary_component(bitcoin-chainstate INTERNAL) + endif() endif() diff --git a/src/bitcoin-chainstate.cpp b/src/bitcoin-chainstate.cpp index 46e6f06e27f..310ca95c085 100644 --- a/src/bitcoin-chainstate.cpp +++ b/src/bitcoin-chainstate.cpp @@ -1,53 +1,135 @@ -// Copyright (c) 2022 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. -// -// The bitcoin-chainstate executable serves to surface the dependencies required -// by a program wishing to use Bitcoin Core's consensus engine as it is right -// now. -// -// DEVELOPER NOTE: Since this is a "demo-only", experimental, etc. executable, -// it may diverge from Bitcoin Core's coding style. -// -// It is part of the libbitcoinkernel project. - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include