Skip to content

Commit 7990463

Browse files
committed
kernel: Add pure kernel bitcoin-chainstate
Re-write the bitcoin-chainstate utility by only using the kernel C++ API header instead of internal Bitcoin Core code.
1 parent 36ec9a3 commit 7990463

File tree

4 files changed

+193
-256
lines changed

4 files changed

+193
-256
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ jobs:
202202
job-type: [standard, fuzz]
203203
include:
204204
- job-type: standard
205-
generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DWERROR=ON'
205+
generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DWERROR=ON'
206206
job-name: 'Windows native, VS 2022'
207207
- job-type: fuzz
208208
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:
280280
$exeName = $_.Name
281281
282282
# Skip as they currently do not have manifests
283-
if ($exeName -eq "fuzz.exe" -or $exeName -eq "bench_bitcoin.exe" -or $exeName -eq "test_bitcoin-qt.exe" -or $exeName -eq "test_kernel.exe") {
283+
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") {
284284
Write-Host "Skipping $exeName (no manifest present)"
285285
return
286286
}
@@ -307,6 +307,7 @@ jobs:
307307
BITCOINTX: '${{ github.workspace }}\build\bin\Release\bitcoin-tx.exe'
308308
BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe'
309309
BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe'
310+
BITCOINCHAINSTATE: '${{ github.workspace }}\build\bin\Release\bitcoin-chainstate.exe'
310311
TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }}
311312
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}
312313

src/CMakeLists.txt

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -407,28 +407,27 @@ if(BUILD_KERNEL_LIB)
407407
if (BUILD_KERNEL_TEST)
408408
add_subdirectory(test/kernel)
409409
endif()
410-
endif()
411-
412-
if(BUILD_UTIL_CHAINSTATE)
413-
add_executable(bitcoin-chainstate
414-
bitcoin-chainstate.cpp
415-
)
416-
add_windows_application_manifest(bitcoin-chainstate)
417-
# TODO: The `SKIP_BUILD_RPATH` property setting can be deleted
418-
# in the future after reordering Guix script commands to
419-
# perform binary checks after the installation step.
420-
# Relevant discussions:
421-
# - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953
422-
# - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833
423-
set_target_properties(bitcoin-chainstate PROPERTIES
424-
SKIP_BUILD_RPATH OFF
425-
)
426-
target_link_libraries(bitcoin-chainstate
427-
PRIVATE
428-
core_interface
429-
bitcoinkernel
430-
)
431-
install_binary_component(bitcoin-chainstate INTERNAL)
410+
if(BUILD_UTIL_CHAINSTATE)
411+
add_executable(bitcoin-chainstate
412+
bitcoin-chainstate.cpp
413+
)
414+
add_windows_application_manifest(bitcoin-chainstate)
415+
# TODO: The `SKIP_BUILD_RPATH` property setting can be deleted
416+
# in the future after reordering Guix script commands to
417+
# perform binary checks after the installation step.
418+
# Relevant discussions:
419+
# - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953
420+
# - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833
421+
set_target_properties(bitcoin-chainstate PROPERTIES
422+
SKIP_BUILD_RPATH OFF
423+
)
424+
target_link_libraries(bitcoin-chainstate
425+
PRIVATE
426+
core_interface
427+
bitcoinkernel
428+
)
429+
install_binary_component(bitcoin-chainstate INTERNAL)
430+
endif()
432431
endif()
433432

434433

0 commit comments

Comments
 (0)