Commit Graph

213 Commits

Author SHA1 Message Date
Woolfgm
cd98caea43 Update ci.yml 2025-12-17 22:41:02 +01:00
MarcoFalke
faa8ee62f5 ci: Pin native tests on cross-builds to same commit 2025-12-16 18:04:42 +01:00
merge-script
d2a199bca7 Merge bitcoin/bitcoin#33909: doc, ci: Make the max number of commits tested explicit
b5a7a685bb ci: Make the max number of commits tested explicit (Hodlinator)

Pull request description:

  Gives less of a false sense of security.

ACKs for top commit:
  maflcko:
    lgtm ACK b5a7a685bb
  rkrux:
    crACK b5a7a685bb
  janb84:
    ACK b5a7a685bb
  glozow:
    lgtm ACK b5a7a685bb

Tree-SHA512: 9f50a86f440d6a551a0c1ff547e61b61b829e98cd0cd2d5ca65966af0b48d40582f698bcb039a7467c4b71166920413c334eac0e9e4f0141c3e02cd68555865b
2025-12-09 07:51:44 -08:00
Hennadii Stepanov
49c6728535 cmake: Set WITH_ZMQ to ON in Windows presets
The "zeromq" feature is already enabled by default in `vcpkg.json`, and
there appears to be no reason to omit this configuration option when
building on Windows.
2025-11-30 13:15:49 +00:00
merge-script
f6acbef108 Merge bitcoin/bitcoin#33764: ci: Add Windows + UCRT jobs for cross-compiling and native testing
2e27bd9c3a ci: Add Windows + UCRT jobs for cross-compiling and native testing (Hennadii Stepanov)
bd130db994 ci: Rename items specific to Windows + MSVCRT (Hennadii Stepanov)

Pull request description:

  This PR is part of the ongoing effort to migrate to the modern UCRT runtime for cross-compiled Windows binaries, including release builds.

  For more details about this migration, see:
  - https://github.com/bitcoin/bitcoin/issues/30210
  - https://github.com/bitcoin/bitcoin/pull/33593

  MSVCRT-related CI jobs should be removed from the CI framework once the migration to UCRT is complete.

ACKs for top commit:
  maflcko:
    review ACK 2e27bd9c3a 🖊
  fanquake:
    ACK 2e27bd9c3a

Tree-SHA512: 222ca5e54646bcce9db6e20191d5891e988274e18b2f30085de6435a3b288a9d0fc414e8f76342e275ae58ee6603f751933d1faa8bdff446edf2695091f8ca4c
2025-11-28 16:42:44 +00:00
Hodlinator
b5a7a685bb ci: Make the max number of commits tested explicit
Gives less of a false sense of security.
2025-11-27 22:33:11 +01:00
will
e07e57368e ci: clear out space on centos job
Clear out space on the centos job be deleteing unnecessary files.

Raised by #33293 which pointed to a solution like b7f04d7822

Only runs when cache provider (runner) is `gha`, and on the CentOS job.
2025-11-26 14:18:18 +00:00
merge-script
b30262dcaa Merge bitcoin/bitcoin#33903: ci: Remove redundant busybox option
fa0fee44a8 ci: Remove redundant busybox option (MarcoFalke)
fa102ec69f doc: Shorten ci name (MarcoFalke)
2222223780 doc: Remove bash -c wrapper (MarcoFalke)

Pull request description:

  The option was fine, but now that there is a dedicated Alpine Linux task, which uses BusyBox, it seems redundant.
  (See: `ci/test/00_setup_env_native_alpine_musl.sh`)

  So remove the `USE_BUSY_BOX` option, along with the `BINS_SCRATCH_DIR` env var.

  Also includes two small ci-doc fixups.

ACKs for top commit:
  fanquake:
    ACK fa0fee44a8

Tree-SHA512: abad7888cbf5833cc322d133187f74653c232c03b8949ad06dd1ea5ace14127871322fe682268ebec7720963615c3f113c7660a2055bf48bbb9ff9a730221d7e
2025-11-25 16:28:09 +00:00
merge-script
68ab2b65bf Merge bitcoin/bitcoin#33919: ci: Run GUI unit tests in cross-Windows task
fa7ea497c3 ci: Run GUI unit tests in cross-Windows task (MarcoFalke)

Pull request description:

  Most users of the cross-compiled releases for Windows will most likely pick the GUI, so running the cross-compiled GUI unit tests on a real Windows seems desirable.

ACKs for top commit:
  fanquake:
    ACK fa7ea497c3 - didn't test.

Tree-SHA512: 6826474295ecf0170e45a644100887d5e53899b4a3eb49635e5cc62c774b512b383bc0b2de15ac854a527da0779b5ab8f52aae9f817c7f2971a0cbfc68c027b7
2025-11-25 12:21:21 +00:00
Hennadii Stepanov
2e27bd9c3a ci: Add Windows + UCRT jobs for cross-compiling and native testing
Co-authored-by: will <will@256k1.dev>
2025-11-24 15:46:45 +00:00
MarcoFalke
fa9537cde1 ci: Use latest Xcode that the minimum macOS version allows 2025-11-24 09:22:59 +01:00
Hennadii Stepanov
bd130db994 ci: Rename items specific to Windows + MSVCRT
This is necessary to prepare for introducing the new Windows + UCRT
script and jobs.
2025-11-21 14:26:59 +00:00
MarcoFalke
fa7ea497c3 ci: Run GUI unit tests in cross-Windows task 2025-11-20 22:34:01 +01:00
MarcoFalke
fa102ec69f doc: Shorten ci name
No other task has in its name whether it is using depends or not, so
remove it here as well.
2025-11-20 20:22:41 +01:00
merge-script
6b2d17b132 Merge bitcoin/bitcoin#33888: ci: Re-enable LINT_CI_SANITY_CHECK_COMMIT_SIG
55555db055 doc: Add missing --platform=linux to docker build command (MarcoFalke)
fa0ce4c148 ci: Re-enable LINT_CI_SANITY_CHECK_COMMIT_SIG (MarcoFalke)
faa0973de2 ci: [refactor] Rename CIRRUS_PR env var to LINT_CI_IS_PR (MarcoFalke)
fa1dacaebe ci: Move lint exec snippet to stand-alone py file (MarcoFalke)

Pull request description:

  The sanity check to check the last few merge commit signatures on the main branch was accidentally and silently disabled while moving from the `cirrus-ci.com` platform to the GHA platform.

  So fix that by re-enabling it.

  Also, contains a few other lint cleanup commits.

ACKs for top commit:
  janb84:
    re ACK 55555db055
  willcl-ark:
    ACK 55555db055

Tree-SHA512: e623dc88035ee4d1c6a8efa5fad33c35cface87f54e78c7ebfe5d468d28d8d8097150344d276f90f8ed52a89e61609ce95380476ea0151b50f73ad5919233933
2025-11-20 17:29:57 +00:00
merge-script
32368cd3e9 Merge bitcoin/bitcoin#33905: ci: Consistenly only cache on the default branch
fa411f938e ci: Consistenly only cache on the default branch (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/33685

  The general idea for caches is to only save them on pushes to the default branch, because the cache is limited in size and time that the only benefit of the cache can be to speed up pull requests against the default branch.

  Backport pull requests to older branches don't benefit from caches, because usually they will be running into a cache miss anyway. Also, they would cause the cache size to overflow and lead to cache misses down the line.

  So fix it by consistently applying cache saves only on the default branch.

  For reference, the same is already done for the composite action in this repo: 2444488f6a/.github/actions/save-caches/action.yml (L15)

ACKs for top commit:
  hebasto:
    ACK fa411f938e.
  willcl-ark:
    ACK fa411f938e

Tree-SHA512: 59d3de4201b596e5f7eb1915c4bd5ded80bcd4df217f8f5d62d92fa8977a77e2c4c8602b17755b33ff0dfa87f2896e7c1c8f4da8e6a77c111f2a42ec9cf78ffd
2025-11-20 17:17:16 +00:00
Hennadii Stepanov
a07bd8415d Merge bitcoin/bitcoin#33824: ci: Enable experimental kernel stuff in most CI tasks via dev-mode
fae83611b8 ci: [refactor] Use --preset=dev-mode in mac_native task (MarcoFalke)
fadb67b4b4 ci: [refactor] Base nowallet task on --preset=dev-mode (MarcoFalke)
6666980e86 ci: Enable bitcoin-chainstate and test_bitcoin-qt in win64 task (MarcoFalke)
faff7b2312 ci: Enable experimental kernel stuff in i686 task (MarcoFalke)
fa1632eecf ci: Enable experimental kernel stuff in mac-cross tasks (MarcoFalke)
fad10ff7c9 ci: Enable experimental kernel stuff in armhf task (MarcoFalke)
fa9d67c13d ci: Enable experimental kernel stuff in Alpine task (MarcoFalke)
fab3fb8302 ci: Enable experimental kernel stuff in s390x task (MarcoFalke)
fa7da8a646 ci: Enable experimental kernel stuff in valgrind task (MarcoFalke)
fa9c2973d6 ci: Enable experimental kernel stuff in TSan task (MarcoFalke)
fad30d4395 ci: Enable experimental kernel stuff in MSan task (MarcoFalke)

Pull request description:

  Most of the CI tasks have a long list of stuff that they enable. This makes it hard to see what each CI task is actually running.

  Also, most of the CI tasks should probably mimic the `dev-mode` CMake preset and run on as much stuff as possible. Usually, changing the `dev-mode` comes with changing those CI tasks as well in the same commit, which is verbose.

  Fix both issues, by basing most CI tasks on the `dev-mode`. In the future, this makes it easier to change the `dev-mode` in a single place. If CI tasks explicitly disable something, it will be listed explicitly in them.

  As a side-effect this will enable the kernel stuff for some CI task that did not have it enabled, which seems desirable.

ACKs for top commit:
  TheCharlatan:
    Nice, ACK fae83611b8
  janb84:
    ACK fae83611b8
  hebasto:
    ACK fae83611b8, I have reviewed the code and it looks OK.

Tree-SHA512: 58d9d553437b57362e9ec0766bd202482435f263d3f4c6ee7020c5e1e5ba69f8c064630423424f9d754254a66981e670b964a5aee58ef87f30b7d775642255be
2025-11-20 14:19:07 +00:00
MarcoFalke
fa411f938e ci: Consistenly only cache on the default branch 2025-11-18 19:19:04 +01:00
MarcoFalke
fa1dacaebe ci: Move lint exec snippet to stand-alone py file
Moving the python code out of the yaml string makes it easier to lint,
format, and edit.

This can be reviewed with the git options:

--color-moved=dimmed-zebra --color-moved-ws=ignore-all-space
2025-11-17 17:34:27 +01:00
merge-script
c03081fdb4 Merge bitcoin/bitcoin#33776: ci: Lint follow-ups
fae3618fd6 ci: Annotate all check runs with the pull request number (MarcoFalke)
faf05d637d ci: Retry lint image building once after failure (MarcoFalke)
fac4f6de28 ci: Rewrite lint task Bash snippet to Python (MarcoFalke)
fa0d37a579 ci: Rewrite Bash to check inputs to Python (MarcoFalke)

Pull request description:

  This contains a few follow-ups to https://github.com/bitcoin/bitcoin/pull/33744:

  * Rewrite the actions Bash snippet to Python. I've confirmed it still works in https://github.com/maflcko/bitcoin-core-with-ci/actions/runs/19067932430 (scroll down).
  * Add a lint-build retry to avoid issues such as https://github.com/bitcoin/bitcoin/issues/33640 for the lint task as well.
  * Finally, run the `debug_pull_request_number_str` annotation on all checks, to ensure they are present even when GitHub deletes annotations on a re-run. For example, the initial attempt https://github.com/bitcoin/bitcoin/actions/runs/19041534107/attempts/1?pr=33772 has the annotations, and the lint re-run has them removed: https://github.com/bitcoin/bitcoin/actions/runs/19041534107?pr=33772

ACKs for top commit:
  m3dwards:
    ACK fae3618fd6
  willcl-ark:
    ACK fae3618fd6

Tree-SHA512: 6db147ccee622b7a640703f7e916ea662a8e42978f633046f22f8540017196250ef7771b28cd6e502368f1f3fe52b7524de0a3443f25c9659f524b4c9286ad0d
2025-11-17 12:35:17 +00:00
merge-script
6e21558160 Merge bitcoin/bitcoin#33869: refactor: Avoid -W*-whitespace in git archive
fa95353902 ci: Run macos tasks in a git archive, not git checkout (MarcoFalke)
faf99ae379 refactor: Avoid -W*-whitespace in git archive (MarcoFalke)

Pull request description:

  Otherwise, compilation with GCC-15+ will warn about it:

  ```
  src/clientversion.cpp:33:79: error: trailing whitespace [-Werror=trailing-whitespace=]
     33 | //! git will put "#define GIT_COMMIT_ID ..." on the next line inside archives.
  ```

  Follow-up to https://github.com/bitcoin/bitcoin/pull/32482#issuecomment-3522280482

  Can be tested via `git archive --output=/tmp/a.tar HEAD`

ACKs for top commit:
  fanquake:
    ACK fa95353902

Tree-SHA512: 73940ffc0fd83db557275bd5e993a3c47c5397682a1188447c48e077ead597ba0fc3e5ef9da7b746746ff04a26022ce35ac10768888bbd4707f25b799af43e45
2025-11-17 11:36:47 +00:00
MarcoFalke
fa95353902 ci: Run macos tasks in a git archive, not git checkout
This confirms that compiling this way is possible at all.
2025-11-13 15:56:45 +01:00
MarcoFalke
fae3618fd6 ci: Annotate all check runs with the pull request number
On check re-runs the annotations are discarded, so all check runs
require the number to be set.
2025-11-13 12:07:55 +01:00
MarcoFalke
faf05d637d ci: Retry lint image building once after failure
The same was done for the other CI tasks in commit fa6aa9f42f. This may
guard against intermittent network issues to download the base image or
packages ...
2025-11-13 11:40:03 +01:00
Hennadii Stepanov
0dd8d5c237 cmake: Specify Windows plugin path in test_bitcoin-qt property 2025-11-12 19:02:29 +00:00
merge-script
47618446a0 Merge bitcoin/bitcoin#33853: kernel: Allow null arguments for serialized data
a3ac59a431 ci: Enable experimental kernel stuff in ASan task (MarcoFalke)
5b89956eeb kernel: Allow null arguments for serialized data (TheCharlatan)

Pull request description:

  An empty span constructed from an empty vector may have a null data pointer depending on the implementation. Remove the BITCOINKERNEL_ARG_NONNULL requirement for these arguments and instead handle such null arguments in the implementation.

  Also cherry-picked from #33845 to show that CI task passing now.

ACKs for top commit:
  yuvicc:
    Code review ACK a3ac59a431
  maflcko:
    review ACK a3ac59a431 🥈
  laanwj:
    code review ACK a3ac59a431

Tree-SHA512: 629e463796f2f057df5be8e8981a45751c578ed0021be731c1d57fe849a539fe38b0a445914b0fc48f32f0408ad6d566984bd7f3a68797fcfdf1c6889e316a08
2025-11-12 14:16:12 +00:00
MarcoFalke
fac4f6de28 ci: Rewrite lint task Bash snippet to Python
The Bash snippet was shorter, but relying on implicit word splitting
(see the shellcheck SC2086 warning).

For example, the DOCKER_BUILD_CACHE_ARG shlex.split is now done
identical to how ci/test/02_run_container.py does it.

Moreover, the Python will hopefully be easier to modify in the future,
as the dev notes recommend Python over Bash.
2025-11-12 13:40:24 +01:00
MarcoFalke
fae83611b8 ci: [refactor] Use --preset=dev-mode in mac_native task
Also shorten the name, because it is usually truncated anyway in the web
view.

USDT remains disabled explicitly.
2025-11-12 13:09:54 +01:00
MarcoFalke
fadb67b4b4 ci: [refactor] Base nowallet task on --preset=dev-mode
This makes it clearer what pieces are disabled over the full dev-mode.

The wallet remains explicitly disabled.
2025-11-12 13:07:36 +01:00
MarcoFalke
6666980e86 ci: Enable bitcoin-chainstate and test_bitcoin-qt in win64 task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   test_bitcoin-qt ..................... ON

IPC and USDT remain explicitly disabled.
2025-11-12 13:06:53 +01:00
MarcoFalke
faff7b2312 ci: Enable experimental kernel stuff in i686 task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON

IPC remains explicitly disabled.
2025-11-12 10:12:49 +01:00
MarcoFalke
fad10ff7c9 ci: Enable experimental kernel stuff in armhf task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON
2025-11-12 10:12:46 +01:00
MarcoFalke
fa9d67c13d ci: Enable experimental kernel stuff in Alpine task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON
2025-11-12 10:12:21 +01:00
MarcoFalke
fa9c2973d6 ci: Enable experimental kernel stuff in TSan task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON

The GUI remains disabled explicitly.
2025-11-12 10:11:47 +01:00
MarcoFalke
fad30d4395 ci: Enable experimental kernel stuff in MSan task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON

The GUI remains disabled explicitly.
2025-11-12 10:11:43 +01:00
MarcoFalke
faa8be75c9 ci: Enable experimental kernel stuff in G++-12 task (previous releases)
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON

Also, shorten the name, for a less cluttered web view.
2025-11-11 22:44:09 +01:00
MarcoFalke
a3ac59a431 ci: Enable experimental kernel stuff in ASan task
Base the task on --preset=dev-mode to ensure maximal coverage and add
the following:

   bitcoin-chainstate (experimental) ... ON
   libbitcoinkernel (experimental) ..... ON
   kernel-test (experimental) .......... ON
2025-11-11 12:35:18 +01:00
merge-script
4da01123df Merge bitcoin/bitcoin#30595: kernel: Introduce C header API
6c7a34f3b0 kernel: Add Purpose section to header documentation (TheCharlatan)
7e9f00bcc1 kernel: Allowing reducing exports (TheCharlatan)
7990463b10 kernel: Add pure kernel bitcoin-chainstate (TheCharlatan)
36ec9a3ea2 Kernel: Add functions for working with outpoints (TheCharlatan)
5eec7fa96a kernel: Add block hash type and block tree utility functions to C header (TheCharlatan)
f5d5d1213c kernel: Add function to read block undo data from disk to C header (TheCharlatan)
09d0f62638 kernel: Add functions to read block from disk to C header (TheCharlatan)
a263a4caf2 kernel: Add function for copying block data to C header (TheCharlatan)
b30e15f432 kernel: Add functions for the block validation state to C header (TheCharlatan)
aa262da7bc kernel: Add validation interface to C header (TheCharlatan)
d27e27758d kernel: Add interrupt function to C header (TheCharlatan)
1976b13be9 kernel: Add import blocks function to C header (TheCharlatan)
a747ca1f51 kernel: Add chainstate load options for in-memory dbs in C header (TheCharlatan)
070e77732c kernel: Add options for reindexing in C header (TheCharlatan)
ad80abc73d kernel: Add block validation to C header (TheCharlatan)
cb1590b05e kernel: Add chainstate loading when instantiating a ChainstateManager (TheCharlatan)
e2c1bd3d71 kernel: Add chainstate manager option for setting worker threads (TheCharlatan)
65571c36a2 kernel: Add chainstate manager object to C header (TheCharlatan)
c62f657ba3 kernel: Add notifications context option to C header (TheCharlatan)
9e1bac4585 kernel: Add chain params context option to C header (TheCharlatan)
337ea860df kernel: Add kernel library context object (TheCharlatan)
28d679bad9 kernel: Add logging to kernel library C header (TheCharlatan)
2cf136dec4 kernel: Introduce initial kernel C header API (TheCharlatan)

Pull request description:

  This is a first attempt at introducing a C header for the libbitcoinkernel library that may be used by external applications for interfacing with Bitcoin Core's validation logic. It currently is limited to operations on blocks. This is a conscious choice, since it already offers a lot of powerful functionality, but sits just on the cusp of still being reviewable scope-wise while giving some pointers on how the rest of the API could look like.

  The current design was informed by the development of some tools using the C header:

  * A re-implementation (part of this pull request) of [bitcoin-chainstate](https://github.com/bitcoin/bitcoin/blob/master/src/bitcoin-chainstate.cpp).
  * A re-implementation of the python [block linearize](https://github.com/bitcoin/bitcoin/tree/master/contrib/linearize) scripts: https://github.com/TheCharlatan/bitcoin/tree/kernelLinearize
  * A silent payment scanner: https://github.com/josibake/silent-payments-scanner
  * An electrs index builder: https://github.com/josibake/electrs/commits/electrs-kernel-integration
  * A rust bitcoin node: https://github.com/TheCharlatan/kernel-node
  * A reindexer: https://github.com/TheCharlatan/bitcoin/tree/kernelApi_Reindexer

  The library has also been used by other developers already:

  * A historical block analysis tool: https://github.com/ismaelsadeeq/mining-analysis
  * A swiftsync hints generator: https://github.com/theStack/swiftsync-hints-gen
  * Fast script validation in floresta: https://github.com/vinteumorg/Floresta/pull/456
  * A swiftsync node implementation: https://github.com/2140-dev/swiftsync/tree/master/node

  Next to the C++ header also made available in this pull request, bindings for other languages are available here:

  * Rust: https://github.com/TheCharlatan/rust-bitcoinkernel
  * Python: https://github.com/stickies-v/py-bitcoinkernel
  * Go: https://github.com/stringintech/go-bitcoinkernel
  * Java: https://github.com/yuvicc/java-bitcoinkernel

  The rust bindings include unit and fuzz tests for the API.

  The header currently exposes logic for enabling the following functionality:
  * Feature-parity with the now deprecated libbitcoin-consensus
  * Optimized sha256 implementations that were not available to previous users of libbitcoin-consensus thanks to a static kernel context
  * Full support for logging as well as control over categories and severity
  * Feature parity with the existing experimental bitcoin-chainstate
  * Traversing the block index as well as using block index entries for reading block and undo data.
  * Running the chainstate in memory
  * Reindexing (both full and chainstate-only)
  * Interrupting long-running functions

  The pull request introduces a new kernel-only test binary that purely relies on the kernel C header and the C++ standard library. This is intentionally done to show its capabilities without relying on other code inside the project. This may be relaxed to include some of the existing utilities, or even be merged into the existing test suite.

  The complete docs for the API as well as some usage examples are hosted on [thecharlatan.ch/kernel-docs](https://thecharlatan.ch/kernel-docs/index.html). The docs are generated from the following repository (which also holds the examples): [github.com/TheCharlatan/kernel-docs](https://github.com/TheCharlatan/kernel-docs).

  #### How can I review this PR?

  Scrutinize the commit messages, run the tests, write your own little applications using the library, let your favorite code sanitizer loose on it, hook it up to your fuzzing infrastructure, profile the difference between the existing bitcoin-chainstate and the bitcoin-chainstate introduced here, be nitty on the documentation, police the C interface, opine on your own API design philosophy.

  To get a feeling for the API, read through the tests, or one of the examples.

  To configure this PR for making the shared library and the bitcoin-chainstate and test_kernel utilities available:
  ```
  cmake -B build -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON
  ```

  Once compiled the library is part of the build artifacts that can be installed with:
  ```
  cmake --install build
  ```

  #### Why a C header (and not a C++ header)

  * Shipping a shared library with a C++ header is hard, because of name mangling and an unstable ABI.
  * Mature and well-supported tooling for integrating C exists for nearly every popular language.
  * C offers a reasonably stable ABI

  Also see https://github.com/bitcoin/bitcoin/pull/30595#issuecomment-2285719575.

  #### What about versioning?

  The header and library are still experimental and I would expect this to remain so for some time, so best not to worry about versioning yet.

  #### Potential future additions

  In future, the C header could be expanded to support (some of these have been roughly implemented):

  * Handling transactions, block headers, coins cache, utxo set, meta data, and the mempool
  * Adapters for an abstract coins store
  * Adapters for an abstract block store
  * Adapters for an abstract block tree store
  * Allocators and buffers for more efficient memory usage
  * An "[io-less](https://sans-io.readthedocs.io/how-to-sans-io.html)" interface
  * Hooks for an external mempool, or external policy rules

  #### Current drawbacks

  * For external applications to read the block index of an existing Bitcoin Core node, Bitcoin Core needs to shut down first, since leveldb does not support reading across multiple processes. Other than migrating away from leveldb, there does not seem to be a solution for this problem. Such a migration is implemented in #32427.
  * The fatal error handling through the notifications is awkward. This is partly improved through #29642.
  * Handling shared pointers in the interfaces is unfortunate. They make ownership and freeing of the resources fuzzy and poison the interfaces with additional types and complexity. However, they seem to be an artifact of the current code that interfaces with the validation engine. The validation engine itself does not seem to make extensive use of these shared pointers.
  * If multiple instances of the same type of objects are used, there is no mechanism for distinguishing the log messages produced by each of them. A potential solution is #30342.
  * The background leveldb compaction thread may not finish in time leading to a non-clean exit. There seems to be nothing we can do about this, outside of patching leveldb.

ACKs for top commit:
  alexanderwiederin:
    re-ACK 6c7a34f3b0
  stringintech:
    re-ACK 6c7a34f
  laanwj:
    Code review ACK 6c7a34f3b0
  ismaelsadeeq:
    reACK 6c7a34f3b0 👾
  fanquake:
    ACK 6c7a34f3b0 - soon we'll be running bitcoin (kernel)

Tree-SHA512: ffe7d4581facb7017d06da8b685b81f4b5e4840576e878bb6845595021730eab808d8f9780ed0eb0d2b57f2647c85dcb36b6325180caaac469eaf339f7258030
2025-11-04 15:38:42 +00:00
merge-script
5ffa63d681 Merge bitcoin/bitcoin#33626: ci: run native fuzz with MSAN job
1e6e32fa8a ci: run native fuzz with MSAN job (fanquake)
3784d15bcd ci: use LLVM libcxx 21.1.5 (fanquake)

Pull request description:

  I think this job should exist in this repo (not just qa-assets), if the alternative is double-handling changes to the interpreter. #32998 made changes which were then re-changed in #33600, to work around a false positive.

  The unchached runtime of this job with `-lg` is `~32m`, with `-md` it's `~43m`.

  Timeout is set to 150m, as the slow GHA runners were close to hitting a 120m limit.

ACKs for top commit:
  maflcko:
    lgtm ACK 1e6e32fa8a
  dergoegge:
    utACK 1e6e32fa8a

Tree-SHA512: afd4cb0039f4f49ddc23f5553a5bf6d5ceffbc12d91acd6890d5cc40c30b7421b23d04f305983d94c862daa6fc07535b1331d7fa2a8ebfe9f19c20d83d95c692
2025-11-04 13:58:23 +00:00
Hennadii Stepanov
75baff98fc Merge bitcoin/bitcoin#33744: ci: Fix lint runner selection (and docker cache)
7632e0ba31 ci: fix configure docker action inputs (will)
0b3b8a3be1 ci: fix lint docker caching (will)

Pull request description:

  Fixes: #33735

  Correct runner type selection for the lint job.

  This was erroneously left-out during refactor of the runner selection mechanism in #33302 causing the lint job to run on GH hosts (and therefore not be able to acces local cirrus caches).

ACKs for top commit:
  maflcko:
    re-ACK 7632e0ba31 📞
  hebasto:
    ACK 7632e0ba31.

Tree-SHA512: b228a79d13ed80c75fc5e51c4fb93c7fad1cb33c00a659afe65033ce09d95e6ac84e01627f2e58e640ff483d798ac1b9e23f14d31a9c045fd99367059ceef5b4
2025-11-04 11:37:19 +00:00
fanquake
1e6e32fa8a ci: run native fuzz with MSAN job
Set the timout to 150, to give some leeway to the slow GHA runners, that
were close to timing out with a 120m limit.
2025-11-04 09:27:19 +00:00
TheCharlatan
7990463b10 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.
2025-11-04 08:32:13 +01:00
TheCharlatan
2cf136dec4 kernel: Introduce initial kernel C header API
As a first step, implement the equivalent of what was implemented in the
now deprecated libbitcoinconsensus header. Also add a test binary to
exercise the header and library.

Unlike the deprecated libbitcoinconsensus the kernel library can now use
the hardware-accelerated sha256 implementations thanks for its
statically-initialzed context. The functions kept around for
backwards-compatibility in the libbitcoinconsensus header are not ported
over. As a new header, it should not be burdened by previous
implementations. Also add a new error code for handling invalid flag
combinations, which would otherwise cause a crash.

The macros used in the new C header were adapted from the libsecp256k1
header.

To make use of the C header from C++ code, a C++ header is also
introduced for wrapping the C header. This makes it safer and easier to
use from C++ code.

Co-authored-by: stickies-v <stickies-v@protonmail.com>
2025-11-04 08:31:51 +01:00
MarcoFalke
fa9d0f994b ci: gha: Set debug_pull_request_number_str annotation 2025-10-31 12:07:10 +01:00
will
0b3b8a3be1 ci: fix lint docker caching
Fixes: 33735

Correct runner type selection for the lint job.

This was erroneously left-out during refactor of the runner selection
mechanism in #33302 causing the lint job to run on GH hosts (and
therefore not be able to acces local cirrus caches).
2025-10-30 10:38:20 +00:00
fanquake
53b34c80c6 ci: use pycapnp 2.2.1 in mac native job
Drop using the git clone & install.
2025-10-27 12:22:53 +01:00
fanquake
e4b04630bc ci: add Valgrind fuzz 2025-10-22 10:13:14 +02:00
merge-script
40e7d4cd0d Merge bitcoin/bitcoin#33549: ci: Add macOS cross task for arm64-apple-darwin
fad5a7101c ci: Add macOS cross task for arm64 (MarcoFalke)
fa8c750a0a ci: Refactor get_previous_releases step in win-test-cross task (MarcoFalke)

Pull request description:

  Cross compiling to Intel macOS seems fine, but it would be good to cross compile to arm64-apple-darwin as well.

  Further reading:

  * https://en.wikipedia.org/wiki/Mac_transition_to_Apple_silicon#Timeline.
  * It is harder to find native Intel macOS hardware (E.g. GitHub is in the process of dropping it: https://github.blog/changelog/2025-07-11-upcoming-changes-to-macos-hosted-runners-macos-latest-migration-and-xcode-support-policy-updates/#macos-13-is-closing-down)

ACKs for top commit:
  Sjors:
    utACK fad5a7101c
  hodlinator:
    crACK fad5a7101c

Tree-SHA512: ce96ac9f68f594584dc910555bd34590084e3e45ca02a22d4949e88bb569de3bf87ebf6b5c6718ae82d7750a98212b72f6dab80bddfc9652a57180fbdda97f42
2025-10-15 11:20:27 +01:00
merge-script
ea17618c11 Merge bitcoin/bitcoin#33480: ci: Turn CentOS config into Alpine musl config
444409ff2b ci: Reduce Alpine musl task to md runner size (MarcoFalke)
fa6b2e9efe ci: Turn centos config into alpine musl config (MarcoFalke)

Pull request description:

  Fixes https://github.com/bitcoin/bitcoin/issues/33437

  Historically, the centos task was added to add CI coverage for old packages and 32-bit depends builds, but both are now covered by different tasks.

  The CentOS task aligns with Ubuntu/Debian CI tasks in terms of libc usage, but (slightly) differs in package naming and update philosophy. I am not aware of the task ever discovering a centos-related issue, so it seems fine to recycle it into an Alpine Linux task.

  The main difference would be that musl libc is now used. Also, busybox is used in Alpine, so in theory the busybox install could be removed from the arm CI task in the future.

  Packaging considerations: All packages should roughly be the same (gcc remains at version 14, python remains at version 3.12, etc). Also, all packages are from the Alpine main track, coming with 2 years of support. The only exception is the py3-pip package (https://pkgs.alpinelinux.org/packages?name=py3-pip&branch=v3.22&repo=&arch=riscv64) from the community track, however, I don't expect any issues arising from that.

ACKs for top commit:
  janb84:
    reACK 444409ff2b
  willcl-ark:
    ACK 444409ff2b

Tree-SHA512: fd1a1da0fd766591e44a57dbdb84f9b3b47ca92113a429bba139ee5fef54714b8fe509c321e7b3a470c29b4af7d9eab9786e1660b9effb862ecea52824f458aa
2025-10-15 10:56:45 +01:00
Coder
b35341b9ba Update ci.yml 2025-10-09 12:33:01 +02:00