Skip to content

Commit 7af9a4f

Browse files
committed
Merge branch 'bitcoin' into auxpow
2 parents ec6c6f8 + 75a5c82 commit 7af9a4f

File tree

116 files changed

+1109
-1128
lines changed

Some content is hidden

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

116 files changed

+1109
-1128
lines changed

.github/ci-test-each-commit-exec.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,25 @@ def run(cmd, **kwargs):
1717

1818

1919
def main():
20-
print("Running test-one-commit on ...")
20+
print("Running tests on commit ...")
2121
run(["git", "log", "-1"])
2222

2323
num_procs = int(run(["nproc"], stdout=subprocess.PIPE).stdout)
2424

25-
# Use clang++, because it is a bit faster and uses less memory than g++
2625
run([
2726
"cmake",
2827
"-B",
2928
"build",
3029
"-Werror=dev",
30+
# Use clang++, because it is a bit faster and uses less memory than g++
3131
"-DCMAKE_C_COMPILER=clang",
3232
"-DCMAKE_CXX_COMPILER=clang++",
33+
# Use mold, because it is faster than the default linker
34+
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=mold",
35+
# Use Debug build type for more debug checks, but enable optimizations
36+
"-DAPPEND_CXXFLAGS='-O3 -g2'",
37+
"-DAPPEND_CFLAGS='-O3 -g2'",
38+
"-DCMAKE_BUILD_TYPE=Debug",
3339
"-DWERROR=ON",
3440
"-DWITH_ZMQ=ON",
3541
"-DBUILD_GUI=ON",

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
git config user.name "CI"
7878
- run: |
7979
sudo apt-get update
80-
sudo apt-get install clang ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
80+
sudo apt-get install clang mold ccache build-essential cmake ninja-build pkgconf python3-zmq libevent-dev libboost-dev libsqlite3-dev systemtap-sdt-dev libzmq3-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev -y
8181
- name: Compile and run tests
8282
run: |
8383
# Run tests on commits after the last merge commit and before the PR head commit

ci/test/00_setup_env_native_asan.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export GOAL="install"
2626
export BITCOIN_CONFIG="\
2727
-DWITH_USDT=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON \
2828
-DSANITIZERS=address,float-divide-by-zero,integer,undefined \
29-
-DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \
30-
-DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \
29+
-DCMAKE_C_COMPILER=clang \
30+
-DCMAKE_CXX_COMPILER=clang++ \
3131
-DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \
3232
-DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \
3333
-DAPPEND_CXXFLAGS='-std=c++23' \

ci/test/00_setup_env_native_fuzz.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@ export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the
1919
export BITCOIN_CONFIG="\
2020
-DBUILD_FOR_FUZZING=ON \
2121
-DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \
22-
-DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \
23-
-DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \
22+
-DCMAKE_C_COMPILER=clang \
23+
-DCMAKE_CXX_COMPILER=clang++ \
2424
-DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \
2525
-DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \
2626
"
27-
export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-${APT_LLVM_V}"

ci/test/00_setup_env_native_msan.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
export LC_ALL=C.UTF-8
88

99
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
10+
export APT_LLVM_V="20"
1011
LIBCXX_DIR="/msan/cxx_build/"
1112
export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls"
1213
LIBCXX_FLAGS="-nostdinc++ -nostdlib++ -isystem ${LIBCXX_DIR}include/c++/v1 -L${LIBCXX_DIR}lib -Wl,-rpath,${LIBCXX_DIR}lib -lc++ -lc++abi -lpthread -Wno-unused-command-line-argument"
1314
export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}"
1415

1516
export CONTAINER_NAME="ci_native_msan"
16-
export PACKAGES="ninja-build"
17+
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev ninja-build"
1718
export DEP_OPTS="DEBUG=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
1819
export GOAL="install"
1920
# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered.

ci/test/00_setup_env_native_tsan.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export CONTAINER_NAME=ci_native_tsan
1010
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
1111
export APT_LLVM_V="20"
1212
export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev libc++abi-${APT_LLVM_V}-dev libc++-${APT_LLVM_V}-dev python3-zmq"
13-
export DEP_OPTS="CC=clang-${APT_LLVM_V} CXX='clang++-${APT_LLVM_V} -stdlib=libc++'"
13+
export DEP_OPTS="CC=clang CXX='clang++ -stdlib=libc++'"
1414
export GOAL="install"
1515
export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DSANITIZERS=thread \
1616
-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'"

ci/test/01_base_install.sh

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -44,27 +44,37 @@ elif [ "$CI_OS_NAME" != "macos" ]; then
4444
${CI_RETRY_EXE} bash -c "apt-get install --no-install-recommends --no-upgrade -y $PACKAGES $CI_BASE_PACKAGES"
4545
fi
4646

47+
if [ -n "${APT_LLVM_V}" ]; then
48+
update-alternatives --install /usr/bin/clang++ clang++ "/usr/bin/clang++-${APT_LLVM_V}" 100
49+
update-alternatives --install /usr/bin/clang clang "/usr/bin/clang-${APT_LLVM_V}" 100
50+
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer "/usr/bin/llvm-symbolizer-${APT_LLVM_V}" 100
51+
fi
52+
4753
if [ -n "$PIP_PACKAGES" ]; then
4854
# shellcheck disable=SC2086
4955
${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES
5056
fi
5157

5258
if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
53-
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.0" /msan/llvm-project
54-
55-
cmake -G Ninja -B /msan/clang_build/ \
56-
-DLLVM_ENABLE_PROJECTS="clang" \
57-
-DCMAKE_BUILD_TYPE=Release \
58-
-DLLVM_TARGETS_TO_BUILD=Native \
59-
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
60-
-S /msan/llvm-project/llvm
61-
62-
ninja -C /msan/clang_build/ "$MAKEJOBS"
63-
ninja -C /msan/clang_build/ install-runtimes
64-
65-
update-alternatives --install /usr/bin/clang++ clang++ /msan/clang_build/bin/clang++ 100
66-
update-alternatives --install /usr/bin/clang clang /msan/clang_build/bin/clang 100
67-
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /msan/clang_build/bin/llvm-symbolizer 100
59+
if [ -n "${APT_LLVM_V}" ]; then
60+
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-$( clang --version | sed --silent 's@.*clang version \([0-9.]*\).*@\1@p' )" /msan/llvm-project
61+
else
62+
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.8" /msan/llvm-project
63+
64+
cmake -G Ninja -B /msan/clang_build/ \
65+
-DLLVM_ENABLE_PROJECTS="clang" \
66+
-DCMAKE_BUILD_TYPE=Release \
67+
-DLLVM_TARGETS_TO_BUILD=Native \
68+
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libcxx;libcxxabi;libunwind" \
69+
-S /msan/llvm-project/llvm
70+
71+
ninja -C /msan/clang_build/ "$MAKEJOBS"
72+
ninja -C /msan/clang_build/ install-runtimes
73+
74+
update-alternatives --install /usr/bin/clang++ clang++ /msan/clang_build/bin/clang++ 100
75+
update-alternatives --install /usr/bin/clang clang /msan/clang_build/bin/clang 100
76+
update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /msan/clang_build/bin/llvm-symbolizer 100
77+
fi
6878

6979
cmake -G Ninja -B /msan/cxx_build/ \
7080
-DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \

ci/test/03_test_script.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,11 @@ if [[ "${RUN_TIDY}" == "true" ]]; then
122122
BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
123123
fi
124124

125-
bash -c "cmake -S $BASE_ROOT_DIR -B ${BASE_BUILD_DIR} $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")) && false)"
125+
bash -c "cmake -S $BASE_ROOT_DIR -B ${BASE_BUILD_DIR} $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || (
126+
# shellcheck disable=SC2046
127+
cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")
128+
false
129+
)
126130

127131
# shellcheck disable=SC2086
128132
cmake --build "${BASE_BUILD_DIR}" "$MAKEJOBS" --target all $GOAL || (

contrib/asmap/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Example usage:
99
python3 asmap-tool.py encode /path/to/input.file /path/to/output.file
1010
python3 asmap-tool.py decode /path/to/input.file /path/to/output.file
1111
python3 asmap-tool.py diff /path/to/first.file /path/to/second.file
12-
python3 asmap-tool.py diff-addrs /path/to/first.file /path/to/second.file addrs.file
12+
python3 asmap-tool.py diff_addrs /path/to/first.file /path/to/second.file addrs.file
1313
```
1414
These commands may take a few minutes to run with `python3`,
1515
depending on the amount of data involved and your machine specs.
@@ -43,7 +43,7 @@ increases output size by outputting strictly non-overlapping network ranges.
4343
### Comparing ASmaps
4444

4545
AS control of IP networks changes frequently, therefore it can be useful to get
46-
the changes between to ASmaps via the `diff` and `diff_addrs` commands.
46+
the changes between two ASmaps via the `diff` and `diff_addrs` commands.
4747

4848
`diff` takes two ASmap files, and returns a file detailing the changes
4949
in the state of a network's AS assignment between the first and the second file.

doc/design/multiprocess.md

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ Guide to the design and architecture of the Bitcoin Core multiprocess feature
44

55
_This document describes the design of the multiprocess feature. For usage information, see the top-level [multiprocess.md](../multiprocess.md) file._
66

7-
## Table of contents
8-
9-
- [Introduction](#introduction)
10-
- [Current Architecture](#current-architecture)
11-
- [Proposed Architecture](#proposed-architecture)
12-
- [Component Overview: Navigating the IPC Framework](#component-overview-navigating-the-ipc-framework)
13-
- [Design Considerations](#design-considerations)
14-
- [Selection of Cap’n Proto](#selection-of-capn-proto)
15-
- [Hiding IPC](#hiding-ipc)
16-
- [Interface Definition Maintenance](#interface-definition-maintenance)
17-
- [Interface Stability](#interface-stability)
18-
- [Security Considerations](#security-considerations)
19-
- [Example Use Cases and Flows](#example-use-cases-and-flows)
20-
- [Retrieving a Block Hash](#retrieving-a-block-hash)
21-
- [Future Enhancements](#future-enhancements)
22-
- [Conclusion](#conclusion)
23-
- [Appendices](#appendices)
24-
- [Glossary of Terms](#glossary-of-terms)
25-
- [References](#references)
26-
- [Acknowledgements](#acknowledgements)
27-
287
## Introduction
298

309
The Bitcoin Core software has historically employed a monolithic architecture. The existing design has integrated functionality like P2P network operations, wallet management, and a GUI into a single executable. While effective, it has limitations in flexibility, security, and scalability. This project introduces changes that transition Bitcoin Core to a more modular architecture. It aims to enhance security, improve usability, and facilitate maintenance and development of the software in the long run.
@@ -136,7 +115,7 @@ The libmultiprocess runtime is designed to place as few constraints as possible
136115

137116
### Interface Definition Maintenance
138117

139-
The choice to maintain interface definitions and C++ type mappings as `.capnp` files in the [`src/ipc/capnp/`](../../src/ipc/capnp/) was mostly done for convenience, and probably something that could be improved in the future.
118+
The choice to maintain interface definitions and C++ type mappings as `.capnp` files in the [`src/ipc/capnp/`](../../src/ipc/capnp/) was mostly done for convenience, and is probably something that could be improved in the future.
140119

141120
In the current design, class names, method names, and parameter names are duplicated between C++ interfaces in [`src/interfaces/`](../../src/interfaces/) and Cap’n Proto files in [`src/ipc/capnp/`](../../src/ipc/capnp/). While this keeps C++ interface headers simple and free of references to IPC, it is a maintenance burden because it means inconsistencies between C++ declarations and Cap’n Proto declarations will result in compile errors. (Static type checking ensures these are not runtime errors.)
142121

0 commit comments

Comments
 (0)