Skip to content

Commit 9e9e55e

Browse files
committed
Merge branch 'auxpow'
2 parents 9759d5c + 2207faa commit 9e9e55e

File tree

101 files changed

+1311
-648
lines changed

Some content is hidden

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

101 files changed

+1311
-648
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ runs:
4848
# Always optimistically --cache‑from in case a cache blob exists
4949
args=(--cache-from "type=gha${url_args:+,${url_args}},scope=${CONTAINER_NAME}")
5050
51-
# If this is a push to the default branch, also add --cache‑to to save the cache
52-
if [[ ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
51+
# Only add --cache-to when using the Cirrus cache provider and pushing to the default branch.
52+
if [[ ${{ inputs.cache-provider }} == 'cirrus' && ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then
5353
args+=(--cache-to "type=gha${url_args:+,${url_args}},mode=max,ignore-error=true,scope=${CONTAINER_NAME}")
5454
fi
5555

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,12 @@ jobs:
500500
timeout-minutes: 240
501501
file-env: './ci/test/00_setup_env_native_fuzz.sh'
502502

503+
- name: 'Valgrind, fuzz'
504+
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
505+
fallback-runner: 'ubuntu-24.04'
506+
timeout-minutes: 240
507+
file-env: './ci/test/00_setup_env_native_fuzz_with_valgrind.sh'
508+
503509
- name: 'previous releases, depends DEBUG'
504510
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
505511
fallback-runner: 'ubuntu-24.04'

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
630630
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
631631
else()
632632
set(CMAKE_SKIP_BUILD_RPATH TRUE)
633-
set(CMAKE_SKIP_INSTALL_RPATH TRUE)
634633
endif()
635634
add_subdirectory(test)
636635
add_subdirectory(doc)

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

ci/test/00_setup_env_native_asan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fi
2020

2121
export CONTAINER_NAME=ci_native_asan
2222
export APT_LLVM_V="21"
23-
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev python3-zmq qt6-base-dev qt6-tools-dev qt6-l10n-tools libevent-dev libboost-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE} libcapnp-dev capnproto python3-pip"
23+
export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev mold python3-zmq qt6-base-dev qt6-tools-dev qt6-l10n-tools libevent-dev libboost-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE} libcapnp-dev capnproto python3-pip"
2424
export PIP_PACKAGES="--break-system-packages pycapnp"
2525
export NO_DEPENDS=1
2626
export GOAL="install"
@@ -32,6 +32,7 @@ export BITCOIN_CONFIG="\
3232
-DCMAKE_CXX_COMPILER=clang++ \
3333
-DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \
3434
-DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \
35+
-DCMAKE_EXE_LINKER_FLAGS='-fuse-ld=mold' \
3536
-DAPPEND_CXXFLAGS='-std=c++23' \
3637
-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \
3738
"

ci/test/00_setup_env_native_fuzz_with_msan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export BITCOIN_CONFIG="\
2525
-DCMAKE_C_FLAGS_DEBUG='' \
2626
-DCMAKE_CXX_FLAGS_DEBUG='' \
2727
-DBUILD_FOR_FUZZING=ON \
28-
-DSANITIZERS=fuzzer,memory \
28+
-DSANITIZERS=memory \
2929
-DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE -U_FORTIFY_SOURCE' \
3030
"
3131
export USE_INSTRUMENTED_LIBCPP="MemoryWithOrigins"

ci/test/02_run_container.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,27 @@ def main():
4545
file.write(f"{k}={v}\n")
4646
run(["cat", env_file])
4747

48+
if not os.getenv("DANGER_RUN_CI_ON_HOST"):
49+
CI_IMAGE_LABEL = "bitcoin-ci-test"
50+
51+
# Use buildx unconditionally
52+
# Using buildx is required to properly load the correct driver, for use with registry caching. Neither build, nor BUILDKIT=1 currently do this properly
53+
cmd_build = ["docker", "buildx", "build"]
54+
cmd_build += [
55+
f"--file={os.environ['BASE_READ_ONLY_DIR']}/ci/test_imagefile",
56+
f"--build-arg=CI_IMAGE_NAME_TAG={os.environ['CI_IMAGE_NAME_TAG']}",
57+
f"--build-arg=FILE_ENV={os.environ['FILE_ENV']}",
58+
f"--build-arg=BASE_ROOT_DIR={os.environ['BASE_ROOT_DIR']}",
59+
f"--platform={os.environ['CI_IMAGE_PLATFORM']}",
60+
f"--label={CI_IMAGE_LABEL}",
61+
f"--tag={os.environ['CONTAINER_NAME']}",
62+
]
63+
cmd_build += shlex.split(os.getenv("DOCKER_BUILD_CACHE_ARG", ""))
64+
cmd_build += [os.environ["BASE_READ_ONLY_DIR"]]
65+
66+
print(f"Building {os.environ['CONTAINER_NAME']} image tag to run in")
67+
run(cmd_build)
68+
4869
run(["./ci/test/02_run_container.sh"]) # run the remainder
4970

5071

ci/test/02_run_container.sh

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,30 +10,6 @@ export CI_IMAGE_LABEL="bitcoin-ci-test"
1010
set -o errexit -o pipefail -o xtrace
1111

1212
if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
13-
# Env vars during the build can not be changed. For example, a modified
14-
# $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an
15-
# approximation to respect $MAKEJOBS somewhat, if cpuset is available.
16-
MAYBE_CPUSET=""
17-
if [ "$HAVE_CGROUP_CPUSET" ]; then
18-
MAYBE_CPUSET="--cpuset-cpus=$( python3 -c "import random;P=$( nproc );M=min(P,int('$MAKEJOBS'.lstrip('-j')));print(','.join(map(str,sorted(random.sample(range(P),M)))))" )"
19-
fi
20-
echo "Creating $CI_IMAGE_NAME_TAG container to run in"
21-
22-
# Use buildx unconditionally
23-
# Using buildx is required to properly load the correct driver, for use with registry caching. Neither build, nor BUILDKIT=1 currently do this properly
24-
# shellcheck disable=SC2086
25-
docker buildx build \
26-
--file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \
27-
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
28-
--build-arg "FILE_ENV=${FILE_ENV}" \
29-
--build-arg "BASE_ROOT_DIR=${BASE_ROOT_DIR}" \
30-
$MAYBE_CPUSET \
31-
--platform="${CI_IMAGE_PLATFORM}" \
32-
--label="${CI_IMAGE_LABEL}" \
33-
--tag="${CONTAINER_NAME}" \
34-
$DOCKER_BUILD_CACHE_ARG \
35-
"${BASE_READ_ONLY_DIR}"
36-
3713
docker volume create "${CONTAINER_NAME}_ccache" || true
3814
docker volume create "${CONTAINER_NAME}_depends" || true
3915
docker volume create "${CONTAINER_NAME}_depends_sources" || true

contrib/devtools/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ BUILDDIR=$PWD/my-build-dir contrib/devtools/gen-manpages.py
137137
headerssync-params.py
138138
=====================
139139

140-
A script to generate optimal parameters for the headerssync module (src/headerssync.cpp). It takes no command-line
140+
A script to generate optimal parameters for the headerssync module (stored in src/kernel/chainparams.cpp). It takes no command-line
141141
options, as all its configuration is set at the top of the file. It runs many times faster inside PyPy. Invocation:
142142

143143
```bash

contrib/devtools/headerssync-params.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
"""Script to find the optimal parameters for the headerssync module through simulation."""
77

8-
from math import log, exp, sqrt
98
from datetime import datetime, timedelta
9+
from math import log, exp, sqrt
1010
import random
1111

1212
# Parameters:
@@ -337,15 +337,15 @@ def analyze(when):
337337
attack_volume = NET_HEADER_SIZE * MINCHAINWORK_HEADERS
338338
# And report them.
339339
print()
340-
print("Optimal configuration:")
341-
print()
342-
print("//! Store one header commitment per HEADER_COMMITMENT_PERIOD blocks.")
343-
print(f"constexpr size_t HEADER_COMMITMENT_PERIOD{{{period}}};")
340+
print(f"Given current min chainwork headers of {MINCHAINWORK_HEADERS}, the optimal parameters for low")
341+
print(f"memory usage on mainchain for release until {TIME:%Y-%m-%d} is:")
344342
print()
345-
print("//! Only feed headers to validation once this many headers on top have been")
346-
print("//! received and validated against commitments.")
347-
print(f"constexpr size_t REDOWNLOAD_BUFFER_SIZE{{{bufsize}}};"
343+
print(f" // Generated by headerssync-params.py on {datetime.today():%Y-%m-%d}.")
344+
print( " m_headers_sync_params = HeadersSyncParams{")
345+
print(f" .commitment_period = {period},")
346+
print(f" .redownload_buffer_size = {bufsize},"
348347
f" // {bufsize}/{period} = ~{bufsize/period:.1f} commitments")
348+
print( " };")
349349
print()
350350
print("Properties:")
351351
print(f"- Per-peer memory for mainchain sync: {mem_mainchain / 8192:.3f} KiB")

0 commit comments

Comments
 (0)