Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions libbitcoinkernel-sys/bitcoin/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ jobs:
file-env: './ci/test/00_setup_env_arm.sh'
provider: 'gha'

- name: 'ASan + LSan + UBSan + integer, no depends, USDT'
- name: 'ASan + LSan + UBSan + integer'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
Expand Down Expand Up @@ -510,7 +510,7 @@ jobs:
timeout-minutes: 240
file-env: './ci/test/00_setup_env_native_fuzz_with_valgrind.sh'

- name: 'previous releases, depends DEBUG'
- name: 'previous releases'
cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md'
fallback-runner: 'ubuntu-24.04'
timeout-minutes: 120
Expand Down
6 changes: 4 additions & 2 deletions libbitcoinkernel-sys/bitcoin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,8 @@ else()
try_append_cxx_flags("-Wself-assign" TARGET warn_interface SKIP_LINK)
try_append_cxx_flags("-Wbidi-chars=any" TARGET warn_interface SKIP_LINK)
try_append_cxx_flags("-Wundef" TARGET warn_interface SKIP_LINK)
try_append_cxx_flags("-Wleading-whitespace=spaces" TARGET warn_interface SKIP_LINK)
try_append_cxx_flags("-Wtrailing-whitespace=any" TARGET warn_interface SKIP_LINK)

# Some compilers (gcc) ignore unknown -Wno-* options, but warn about all
# unknown options if any other warning is produced. Test the -Wfoo case, and
Expand Down Expand Up @@ -493,8 +495,8 @@ try_append_cxx_flags("-fmacro-prefix-map=A=B" TARGET core_interface SKIP_LINK
IF_CHECK_PASSED "-fmacro-prefix-map=${PROJECT_SOURCE_DIR}/src=."
)

# Currently all versions of gcc are subject to a class of bugs, see the
# gccbug_90348 test case (only reproduces on GCC 11 and earlier) and
# GCC versions 13.2 (and earlier) are subject to a class of bugs, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348 and the meta bug
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111843. To work around that, set
# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag).
try_append_cxx_flags("-fstack-reuse=none" TARGET core_interface)
Expand Down
3 changes: 2 additions & 1 deletion libbitcoinkernel-sys/bitcoin/ci/lint/01_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ ${CI_RETRY_EXE} apt-get update
# - curl/xz-utils (to install shellcheck)
# - git (used in many lint scripts)
# - gpg (used by verify-commits)
${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg
# - moreutils (used by scripted-diff)
${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg moreutils

PYTHON_PATH="/python_build"
if [ ! -d "${PYTHON_PATH}/bin" ]; then
Expand Down
5 changes: 1 addition & 4 deletions libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_arm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ export GOAL="install"
export CI_LIMIT_STACK_SIZE=1
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
# This could be removed once the ABI change warning does not show up by default
#
# -Wno-error=dangling-reference helps to work around a GCC 13.1 false-positive,
# fixed in later versions.
export BITCOIN_CONFIG=" \
-DREDUCE_EXPORTS=ON \
-DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=dangling-reference -Wno-error=maybe-uninitialized' \
-DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized' \
"
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export NO_DEPENDS=1
export GOAL="install"
export CI_LIMIT_STACK_SIZE=1
export BITCOIN_CONFIG="\
-DWITH_USDT=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON \
--preset=dev-mode \
-DSANITIZERS=address,float-divide-by-zero,integer,undefined \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++ \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ export LC_ALL=C.UTF-8

export CONTAINER_NAME=ci_native_previous_releases
export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:22.04"
# Use minimum supported python3.10 and gcc-11, see doc/dependencies.md
export PACKAGES="gcc-11 g++-11 python3-zmq"
export DEP_OPTS="CC=gcc-11 CXX=g++-11"
# Use minimum supported python3.10 and gcc-12, see doc/dependencies.md
export PACKAGES="gcc-12 g++-12 python3-zmq"
export DEP_OPTS="CC=gcc-12 CXX=g++-12"
export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash
export GOAL="install"
export CI_LIMIT_STACK_SIZE=1
export DOWNLOAD_PREVIOUS_RELEASES="true"
export BITCOIN_CONFIG="\
-DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON \
--preset=dev-mode \
-DREDUCE_EXPORTS=ON \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_C_FLAGS='-funsigned-char' \
-DCMAKE_C_FLAGS_DEBUG='-g2 -O2' \
Expand Down
4 changes: 1 addition & 3 deletions libbitcoinkernel-sys/bitcoin/ci/test/00_setup_env_win64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export PACKAGES="g++-mingw-w64-x86-64-posix nsis"
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
# -Wno-error=dangling-reference helps to work around a GCC 13.1 false-positive,
# fixed in later versions.
export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_GUI_TESTS=OFF -DBUILD_KERNEL_LIB=ON -DBUILD_KERNEL_TEST=ON \
-DCMAKE_CXX_FLAGS='-Wno-error=dangling-reference -Wno-error=maybe-uninitialized' \
-DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized' \
"
10 changes: 8 additions & 2 deletions libbitcoinkernel-sys/bitcoin/contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,15 @@ esac

# LDFLAGS
case "$HOST" in
*linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++ -Wl,-O2" ;;
*linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -Wl,-O2" ;;
*mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
esac

# EXE FLAGS
case "$HOST" in
*linux*) CMAKE_EXE_LINKER_FLAGS="-DCMAKE_EXE_LINKER_FLAGS=${HOST_LDFLAGS} -static-libstdc++ -static-libgcc" ;;
esac

mkdir -p "$DISTSRC"
(
cd "$DISTSRC"
Expand All @@ -243,7 +248,8 @@ mkdir -p "$DISTSRC"
--toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \
-DWITH_CCACHE=OFF \
-Werror=dev \
${CONFIGFLAGS}
${CONFIGFLAGS} \
"${CMAKE_EXE_LINKER_FLAGS}"

# Build Bitcoin Core
cmake --build build -j "$JOBS" ${V:+--verbose}
Expand Down
10 changes: 5 additions & 5 deletions libbitcoinkernel-sys/bitcoin/contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,10 @@ chain for " target " development."))

(define* (make-bitcoin-cross-toolchain target
#:key
(base-gcc-for-libc linux-base-gcc)
(base-gcc-for-libc (gcc-libgcc-patches linux-base-gcc))
(base-kernel-headers base-linux-kernel-headers)
(base-libc glibc-2.31)
(base-gcc linux-base-gcc))
(base-gcc (gcc-libgcc-patches linux-base-gcc)))
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
desirable for building Bitcoin Core release binaries."
(make-cross-toolchain target
Expand All @@ -111,7 +111,7 @@ desirable for building Bitcoin Core release binaries."
base-libc
base-gcc))

(define (gcc-mingw-patches gcc)
(define (gcc-libgcc-patches gcc)
(package-with-extra-patches gcc
(search-our-patches "gcc-remap-guix-store.patch")))

Expand All @@ -128,10 +128,10 @@ desirable for building Bitcoin Core release binaries."
(let* ((xbinutils (binutils-mingw-patches (cross-binutils target)))
(machine (substring target 0 (string-index target #\-)))
(pthreads-xlibc (winpthreads-patches (make-mingw-w64 machine
#:xgcc (cross-gcc target #:xgcc (gcc-mingw-patches base-gcc))
#:xgcc (cross-gcc target #:xgcc (gcc-libgcc-patches base-gcc))
#:with-winpthreads? #t)))
(pthreads-xgcc (cross-gcc target
#:xgcc (gcc-mingw-patches mingw-w64-base-gcc)
#:xgcc (gcc-libgcc-patches mingw-w64-base-gcc)
#:xbinutils xbinutils
#:libc pthreads-xlibc)))
;; Define a meta-package that propagates the resulting XBINUTILS, XLIBC, and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Without ffile-prefix-map, the debug symbols will contain paths for the
Without -ffile-prefix-map, the debug symbols will contain paths for the
guix store which will include the hashes of each package. However, the
hash for the same package will differ when on different architectures.
In order to be reproducible regardless of the architecture used to build
the package, map all guix store prefixes to something fixed, e.g. /usr.

--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -854,7 +854,7 @@ endif
@@ -857,7 +857,7 @@ endif
# libgcc_eh.a, only LIB2ADDEH matters. If we do, only LIB2ADDEHSTATIC and
# LIB2ADDEHSHARED matter. (Usually all three are identical.)

Expand All @@ -15,6 +15,15 @@ the package, map all guix store prefixes to something fixed, e.g. /usr.

ifeq ($(enable_shared),yes)

@@ -880,7 +880,7 @@ endif
# Build LIBUNWIND. Use -fno-exceptions so that the unwind library does
# not generate calls to __gcc_personality_v0.

-c_flags := -fno-exceptions
+c_flags := -fno-exceptions $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;)

libunwind-objects += $(addsuffix $(objext),$(basename $(notdir $(LIBUNWIND))))

--
2.37.0

8 changes: 0 additions & 8 deletions libbitcoinkernel-sys/bitcoin/contrib/guix/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,25 @@

# Debian 11 (Bullseye) EOL: 2026. https://wiki.debian.org/LTS
#
# - libgcc version 10.2.1 (https://packages.debian.org/bullseye/libgcc-s1)
# - libc version 2.31 (https://packages.debian.org/source/bullseye/glibc)
#
# Ubuntu 20.04 (Focal) EOL: 2030. https://wiki.ubuntu.com/ReleaseTeam
#
# - libgcc version 10.5.0 (https://packages.ubuntu.com/focal/libgcc1)
# - libc version 2.31 (https://packages.ubuntu.com/focal/libc6)
#
# CentOS Stream 9 EOL: 2027. https://www.centos.org/cl-vs-cs/#end-of-life
#
# - libgcc version 12.2.1 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/)
# - libc version 2.34 (https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/)
#
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for more info.

MAX_VERSIONS = {
'GCC': (7,0,0),
'GLIBC': {
lief.ELF.ARCH.X86_64: (2,31),
lief.ELF.ARCH.ARM: (2,31),
lief.ELF.ARCH.AARCH64:(2,31),
lief.ELF.ARCH.PPC64: (2,31),
lief.ELF.ARCH.RISCV: (2,31),
},
'LIBATOMIC': (1,0),
'V': (0,5,0), # xkb (bitcoin-qt only)
}

Expand Down Expand Up @@ -93,11 +87,9 @@
# Allowed NEEDED libraries
ELF_ALLOWED_LIBRARIES = {
# bitcoind and bitcoin-qt
'libgcc_s.so.1', # GCC base support
'libc.so.6', # C library
'libpthread.so.0', # threading
'libm.so.6', # math library
'libatomic.so.1',
'ld-linux-x86-64.so.2', # 64-bit dynamic linker
'ld-linux.so.2', # 32-bit dynamic linker
'ld-linux-aarch64.so.1', # 64-bit ARM dynamic linker
Expand Down
2 changes: 0 additions & 2 deletions libbitcoinkernel-sys/bitcoin/depends/packages/qt.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ $(package)_freebsd_dependencies := $($(package)_linux_dependencies)
$(package)_patches_path := $(qt_details_patches_path)
$(package)_patches := dont_hardcode_pwd.patch
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch
$(package)_patches += qtbase_avoid_native_float16.patch
$(package)_patches += qtbase_avoid_qmain.patch
$(package)_patches += qtbase_platformsupport.patch
$(package)_patches += qtbase_plugins_cocoa.patch
Expand Down Expand Up @@ -257,7 +256,6 @@ endif
define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_native_float16.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase_avoid_qmain.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase_platformsupport.patch && \
patch -p1 -i $($(package)_patch_dir)/qtbase_plugins_cocoa.patch && \
Expand Down

This file was deleted.

6 changes: 5 additions & 1 deletion libbitcoinkernel-sys/bitcoin/doc/build-unix.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ Finally, clang (often less resource hungry) can be used instead of gcc, which is

#### Dependency Build Instructions

Build requirements:
Build requirements for the latest Debian "stable" release, or the latest Ubuntu LTS release:

sudo apt-get install build-essential cmake pkgconf python3

For Debian "oldstable", or earlier Ubuntu LTS releases, you may need to pick a
later compiler version, according to the [dependencies](/doc/dependencies.md)
documentation.

Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies:

sudo apt-get install libevent-dev libboost-dev
Expand Down
2 changes: 1 addition & 1 deletion libbitcoinkernel-sys/bitcoin/doc/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Bitcoin Core requires one of the following compilers.
| Dependency | Minimum required |
| --- | --- |
| [Clang](https://clang.llvm.org) | [17.0](https://github.com/bitcoin/bitcoin/pull/33555) |
| [GCC](https://gcc.gnu.org) | [11.1](https://github.com/bitcoin/bitcoin/pull/29091) |
| [GCC](https://gcc.gnu.org) | [12.1](https://github.com/bitcoin/bitcoin/pull/33842) |

## Required

Expand Down
10 changes: 10 additions & 0 deletions libbitcoinkernel-sys/bitcoin/doc/i2p.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,13 @@ In most cases, the default router settings should work fine.

Please see the "General Guidance for Developers" section in https://geti2p.net/en/docs/api/samv3
if you are developing a downstream application that may be bundling I2P with Bitcoin.

## Privacy recommendations

- Operating a node that listens on multiple networks (e.g. IPv4 and I2P) can help
strengthen the Bitcoin network, as nodes in this configuration (i.e. bridge nodes) increase
the cost and complexity of launching eclipse and partition attacks. However, under certain
conditions, an adversary that can connect to your node on multiple networks may be
able to correlate those identities by observing shared runtime characteristics. It
is not recommended to expose your node over multiple networks if you require
unlinkability across those identities.
4 changes: 4 additions & 0 deletions libbitcoinkernel-sys/bitcoin/doc/release-notes-33842.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Build System
------------

- The minimum supported GCC compiler version has been raised to 12.1 (#33842).
7 changes: 7 additions & 0 deletions libbitcoinkernel-sys/bitcoin/doc/tor.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,10 @@ for normal IPv4/IPv6 communication, use:
Otherwise it is trivial to link them, which may reduce privacy. Onion
services created automatically (as in section 2) always have only one port
open.
- Operating a node that listens on multiple networks (e.g. IPv4 and Tor) can help
strengthen the Bitcoin network, as nodes in this configuration (i.e. bridge nodes) increase
the cost and complexity of launching eclipse and partition attacks. However, under certain
conditions, an adversary that can connect to your node on multiple networks may be
able to correlate those identities by observing shared runtime characteristics. It
is not recommended to expose your node over multiple networks if you require
unlinkability across those identities.
6 changes: 0 additions & 6 deletions libbitcoinkernel-sys/bitcoin/src/chain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
#include <chain.h>
#include <tinyformat.h>
#include <util/check.h>
#include <util/time.h>

std::string CBlockFileInfo::ToString() const
{
return strprintf("CBlockFileInfo(blocks=%u, size=%u, heights=%u...%u, time=%s...%s)", nBlocks, nSize, nHeightFirst, nHeightLast, FormatISO8601Date(nTimeFirst), FormatISO8601Date(nTimeLast));
}

std::string CBlockIndex::ToString() const
{
Expand Down
Loading
Loading