Skip to content

Commit 680aa68

Browse files
authored
Merge pull request #2 from stringintech/bitcoin_master
Adapt to latest state of `libbitcoinkernel` in bitcoin/bitcoin master. Last adapt was based on TheCharlatan/bitcoin kernelApi_73.
2 parents 7702fc7 + 3039aef commit 680aa68

File tree

347 files changed

+7026
-2935
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+7026
-2935
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ build-kernel:
99
cmake -B build \
1010
-DBUILD_SHARED_LIBS=ON \
1111
-DBUILD_KERNEL_LIB=ON \
12+
-DBUILD_KERNEL_TEST=OFF \
1213
-DBUILD_TESTS=OFF \
1314
-DBUILD_TX=OFF \
1415
-DBUILD_WALLET_TOOL=OFF \
@@ -40,7 +41,7 @@ deps:
4041
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
4142

4243
update-kernel:
43-
git subtree pull --prefix=depend/bitcoin https://github.com/TheCharlatan/bitcoin.git kernelApi --squash
44+
git subtree pull --prefix=depend/bitcoin https://github.com/bitcoin/bitcoin.git master --squash
4445

4546
help:
4647
@echo "Available targets:"

depend/bitcoin/.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ body:
7878
id: os
7979
attributes:
8080
label: Operating system and version
81-
placeholder: e.g. "MacOS Ventura 13.2" or "Ubuntu 22.04 LTS"
81+
placeholder: e.g. "MacOS 26.0" or "Ubuntu 26.04 LTS"
8282
validations:
8383
required: true
8484
- type: textarea
@@ -90,4 +90,3 @@ body:
9090
e.g. OS/CPU and disk type, network connectivity
9191
validations:
9292
required: false
93-

depend/bitcoin/.github/actions/configure-docker/action.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ inputs:
44
cache-provider:
55
description: 'gha or cirrus cache provider'
66
required: true
7-
options:
8-
- gh
9-
- cirrus
107
runs:
118
using: 'composite'
129
steps:
10+
- name: Check inputs
11+
shell: bash
12+
run: |
13+
# We expect only gha or cirrus as inputs to cache-provider
14+
case "${{ inputs.cache-provider }}" in
15+
gha|cirrus)
16+
;;
17+
*)
18+
echo "::warning title=Unknown input to configure docker action::Provided value was ${{ inputs.cache-provider }}"
19+
;;
20+
esac
21+
1322
- name: Set up Docker Buildx
1423
uses: docker/setup-buildx-action@v3
1524
with:
@@ -22,8 +31,12 @@ runs:
2231
uses: actions/github-script@v6
2332
with:
2433
script: |
25-
core.exportVariable('ACTIONS_CACHE_URL', process.env['ACTIONS_CACHE_URL'])
26-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN'])
34+
Object.keys(process.env).forEach(function (key) {
35+
if (key.startsWith('ACTIONS_')) {
36+
core.info(`Exporting ${key}`);
37+
core.exportVariable(key, process.env[key]);
38+
}
39+
});
2740
2841
- name: Construct docker build cache args
2942
shell: bash
@@ -44,8 +57,8 @@ runs:
4457
# Always optimistically --cache‑from in case a cache blob exists
4558
args=(--cache-from "type=gha${url_args:+,${url_args}},scope=${CONTAINER_NAME}")
4659
47-
# If this is a push to the default branch, also add --cache‑to to save the cache
48-
if [[ ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
60+
# Only add --cache-to when using the Cirrus cache provider and pushing to the default branch.
61+
if [[ ${{ inputs.cache-provider }} == 'cirrus' && ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
4962
args+=(--cache-to "type=gha${url_args:+,${url_args}},mode=max,ignore-error=true,scope=${CONTAINER_NAME}")
5063
fi
5164

depend/bitcoin/.github/actions/configure-environment/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ runs:
1717
- name: Set cache hashes
1818
shell: bash
1919
run: |
20-
echo "DEPENDS_HASH=$(git ls-tree HEAD depends "ci/test/$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
20+
echo "DEPENDS_HASH=$(git ls-tree HEAD depends "$FILE_ENV" | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2121
echo "PREVIOUS_RELEASES_HASH=$(git ls-tree HEAD test/get_previous_releases.py | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV
2222
2323
- name: Get container name

depend/bitcoin/.github/workflows/ci.yml

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,14 @@ jobs:
3535
outputs:
3636
provider: ${{ steps.runners.outputs.provider }}
3737
steps:
38+
- name: Annotate with pull request number
39+
# This annotation is machine-readable and can be used to assign a check
40+
# run to its corresponding pull request. Running in one check run is
41+
# sufficient for each check suite.
42+
run: |
43+
if [ "${{ github.event_name }}" = "pull_request" ]; then
44+
echo "::notice title=debug_pull_request_number_str::${{ github.event.number }}"
45+
fi
3846
- id: runners
3947
run: |
4048
if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then
@@ -157,11 +165,6 @@ jobs:
157165
brew install --quiet python@3 || brew link --overwrite python@3
158166
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode capnp
159167
160-
- name: Install Python packages
161-
run: |
162-
git clone -b v2.1.0 https://github.com/capnproto/pycapnp
163-
pip3 install ./pycapnp -C force-bundled-libcapnp=True --break-system-packages
164-
165168
- name: Set Ccache directory
166169
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
167170

@@ -202,7 +205,7 @@ jobs:
202205
job-type: [standard, fuzz]
203206
include:
204207
- job-type: standard
205-
generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_TEST=OFF -DWERROR=ON'
208+
generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DBUILD_KERNEL_LIB=ON -DBUILD_UTIL_CHAINSTATE=ON -DWERROR=ON'
206209
job-name: 'Windows native, VS 2022'
207210
- job-type: fuzz
208211
generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON'
@@ -381,7 +384,7 @@ jobs:
381384
- *CHECKOUT
382385

383386
- name: Download built executables
384-
uses: actions/download-artifact@v4
387+
uses: actions/download-artifact@v5
385388
with:
386389
name: x86_64-w64-mingw32-executables-${{ github.run_id }}
387390

@@ -433,8 +436,7 @@ jobs:
433436
echo "PREVIOUS_RELEASES_DIR=${{ runner.temp }}/previous_releases" >> "$GITHUB_ENV"
434437
435438
- name: Get previous releases
436-
working-directory: test
437-
run: ./get_previous_releases.py --target-dir $PREVIOUS_RELEASES_DIR
439+
run: ./test/get_previous_releases.py --target-dir $PREVIOUS_RELEASES_DIR
438440

439441
- name: Run functional tests
440442
env:
@@ -472,12 +474,18 @@ jobs:
472474
timeout-minutes: 120
473475
file-env: './ci/test/00_setup_env_native_asan.sh'
474476

475-
- name: 'macOS-cross, gui, no tests'
477+
- name: 'macOS-cross to arm64'
476478
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
477479
fallback-runner: 'ubuntu-24.04'
478480
timeout-minutes: 120
479481
file-env: './ci/test/00_setup_env_mac_cross.sh'
480482

483+
- name: 'macOS-cross to x86_64'
484+
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
485+
fallback-runner: 'ubuntu-24.04'
486+
timeout-minutes: 120
487+
file-env: './ci/test/00_setup_env_mac_cross_intel.sh'
488+
481489
- name: 'No wallet, libbitcoinkernel'
482490
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm'
483491
fallback-runner: 'ubuntu-24.04'
@@ -496,17 +504,23 @@ jobs:
496504
timeout-minutes: 240
497505
file-env: './ci/test/00_setup_env_native_fuzz.sh'
498506

507+
- name: 'Valgrind, fuzz'
508+
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
509+
fallback-runner: 'ubuntu-24.04'
510+
timeout-minutes: 240
511+
file-env: './ci/test/00_setup_env_native_fuzz_with_valgrind.sh'
512+
499513
- name: 'previous releases, depends DEBUG'
500514
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
501515
fallback-runner: 'ubuntu-24.04'
502516
timeout-minutes: 120
503517
file-env: './ci/test/00_setup_env_native_previous_releases.sh'
504518

505-
- name: 'CentOS, depends, gui'
506-
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
519+
- name: 'Alpine (musl), depends, gui'
520+
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
507521
fallback-runner: 'ubuntu-24.04'
508522
timeout-minutes: 120
509-
file-env: './ci/test/00_setup_env_native_centos.sh'
523+
file-env: './ci/test/00_setup_env_native_alpine_musl.sh'
510524

511525
- name: 'tidy'
512526
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
@@ -520,6 +534,12 @@ jobs:
520534
timeout-minutes: 120
521535
file-env: './ci/test/00_setup_env_native_tsan.sh'
522536

537+
- name: 'MSan, fuzz'
538+
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
539+
fallback-runner: 'ubuntu-24.04'
540+
timeout-minutes: 150
541+
file-env: './ci/test/00_setup_env_native_fuzz_with_msan.sh'
542+
523543
- name: 'MSan, depends'
524544
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg'
525545
fallback-runner: 'ubuntu-24.04'
@@ -548,7 +568,7 @@ jobs:
548568
run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh
549569

550570
- name: Set mmap_rnd_bits
551-
if: ${{ env.CONTAINER_NAME == 'ci_native_tsan' || env.CONTAINER_NAME == 'ci_native_msan' }}
571+
if: ${{ env.CONTAINER_NAME == 'ci_native_tsan' || env.CONTAINER_NAME == 'ci_native_msan' || env.CONTAINER_NAME == 'ci_native_fuzz_msan' }}
552572
# Prevents crashes due to high ASLR entropy
553573
run: sudo sysctl -w vm.mmap_rnd_bits=28
554574

@@ -561,7 +581,7 @@ jobs:
561581
lint:
562582
name: 'lint'
563583
needs: runners
564-
runs-on: ${{ needs.runners.outputs.use-cirrus-runners == 'true' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xs' || 'ubuntu-24.04' }}
584+
runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xs' || 'ubuntu-24.04' }}
565585
if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }}
566586
timeout-minutes: 20
567587
env:

depend/bitcoin/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
632632
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
633633
else()
634634
set(CMAKE_SKIP_BUILD_RPATH TRUE)
635-
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
636635
endif()
637636
add_subdirectory(test)
638637
add_subdirectory(doc)

depend/bitcoin/ci/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ requires `bash`, `docker`, and `python3` to be installed. To run on different ar
2020
sudo apt install bash docker.io python3 qemu-user-static
2121
```
2222

23+
For some sanitizer builds, the kernel's address-space layout randomization
24+
(ASLR) entropy can cause sanitizer shadow memory mappings to fail. When running
25+
the CI locally you may need to reduce that entropy by running:
26+
27+
```
28+
sudo sysctl -w vm.mmap_rnd_bits=28
29+
```
30+
2331
It is recommended to run the ci system in a clean env. To run the test stage
2432
with a specific configuration,
2533

depend/bitcoin/ci/test/00_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out}
6464
# The folder for previous release binaries.
6565
# This folder exists only on the ci guest, and on the ci host as a volume.
6666
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases}
67-
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake ninja-build}
67+
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3-dev rsync git procps bison e2fsprogs cmake ninja-build}
6868
export GOAL=${GOAL:-install}
6969
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
7070
export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"}

depend/bitcoin/ci/test/00_setup_env_mac_cross.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export LC_ALL=C.UTF-8
99
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
1010

1111
export CONTAINER_NAME=ci_macos_cross
12-
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
13-
export HOST=x86_64-apple-darwin
12+
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/clang (version 19, similar to guix) can cross-compile
13+
export HOST=arm64-apple-darwin
1414
export PACKAGES="clang lld llvm zip"
1515
export XCODE_VERSION=15.0
1616
export XCODE_BUILD_ID=15A240d
1717
export RUN_UNIT_TESTS=false
1818
export RUN_FUNCTIONAL_TESTS=false
1919
export GOAL="deploy"
20-
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DREDUCE_EXPORTS=ON"
20+
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DBUILD_KERNEL_LIB=ON -DREDUCE_EXPORTS=ON"
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2019-present The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
10+
11+
export CONTAINER_NAME=ci_macos_cross_intel
12+
export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/clang (version 19, similar to guix) can cross-compile
13+
export HOST=x86_64-apple-darwin
14+
export PACKAGES="clang lld llvm zip"
15+
export XCODE_VERSION=15.0
16+
export XCODE_BUILD_ID=15A240d
17+
export RUN_UNIT_TESTS=false
18+
export RUN_FUNCTIONAL_TESTS=false
19+
export GOAL="deploy"
20+
export BITCOIN_CONFIG="-DBUILD_GUI=ON -DREDUCE_EXPORTS=ON"

0 commit comments

Comments
 (0)