diff --git a/.cirrus.yml b/.cirrus.yml index 263d9d73de..c047bacd88 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,37 +1,57 @@ env: # Global defaults CIRRUS_CLONE_DEPTH: 1 - PACKAGE_MANAGER_INSTALL: "apt-get update && apt-get install -y" + CIRRUS_LOG_TIMESTAMP: true MAKEJOBS: "-j10" TEST_RUNNER_PORT_MIN: "14000" # Must be larger than 12321, which is used for the http cache. See https://cirrus-ci.org/guide/writing-tasks/#http-cache CI_FAILFAST_TEST_LEAVE_DANGLING: "1" # Cirrus CI does not care about dangling processes and setting this variable avoids killing the CI script itself on error - CCACHE_MAXSIZE: "200M" - CCACHE_DIR: "/tmp/ccache_dir" - CCACHE_NOHASHDIR: "1" # Debug info might contain a stale path if the build dir changes, but this is fine +# A self-hosted machine(s) can be used via Cirrus CI. It can be configured with +# multiple users to run tasks in parallel. No sudo permission is required. +# # https://cirrus-ci.org/guide/persistent-workers/ # -# It is possible to select a specific persistent worker by label. Refer to the +# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+. +# +# The following specific types should exist, with the following requirements: +# - small: For an x86_64 machine, with at least 2 vCPUs and 8 GB of memory. +# - medium: For an x86_64 machine, with at least 4 vCPUs and 16 GB of memory. +# - arm64: For an aarch64 machine, with at least 2 vCPUs and 8 GB of memory. +# +# CI jobs for the latter configuration can be run on x86_64 hardware +# by installing qemu-user-static, which works out of the box with +# podman or docker. Background: https://stackoverflow.com/a/72890225/313633 +# +# The above machine types are matched to each task by their label. Refer to the # Cirrus CI docs for more details. # -# Generally, a persistent worker must run Ubuntu 23.04+ or Debian 12+. -# Specifically, -# - apt-get is required due to PACKAGE_MANAGER_INSTALL -# - podman-docker-4.1+ is required due to the use of `podman` when -# RESTART_CI_DOCKER_BEFORE_RUN is set and 4.1+ due to the bugfix in 4.1 +# When a contributor maintains a fork of the repo, any pull request they make +# to their own fork, or to the main repository, will trigger two CI runs: +# one for the branch push and one for the pull request. +# This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable +# in Cirrus repository settings, accessible from +# https://cirrus-ci.com/github/my-organization/my-repository +# +# On machines that are persisted between CI jobs, RESTART_CI_DOCKER_BEFORE_RUN=1 +# ensures that previous containers and artifacts are cleared before each run. +# This requires installing Podman instead of Docker. +# +# Futhermore: +# - podman-docker-4.1+ is required due to the bugfix in 4.1 # (https://github.com/bitcoin/bitcoin/pull/21652#issuecomment-1657098200) -# - The ./ci/ depedencies (with cirrus-cli) should be installed: +# - The ./ci/ dependencies (with cirrus-cli) should be installed. One-liner example +# for a single user setup with sudo permission: # # ``` -# apt update && apt install screen python3 bash podman-docker curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus +# apt update && apt install git screen python3 bash podman-docker uidmap slirp4netns curl -y && curl -L -o cirrus "https://github.com/cirruslabs/cirrus-cli/releases/latest/download/cirrus-linux-$(dpkg --print-architecture)" && mv cirrus /usr/local/bin/cirrus && chmod +x /usr/local/bin/cirrus # ``` # -# - There are no strict requirements on the hardware, because having less CPUs -# runs the same CI script (maybe slower). To avoid rare and intermittent OOM -# due to short memory usage spikes, it is recommended to add (and persist) -# swap: +# - There are no strict requirements on the hardware. Having fewer CPU threads +# than recommended merely causes the CI script to run slower. +# To avoid rare and intermittent OOM due to short memory usage spikes, +# it is recommended to add (and persist) swap: # # ``` -# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | sudo tee -a /etc/fstab ) +# fallocate -l 16G /swapfile_ci && chmod 600 /swapfile_ci && mkswap /swapfile_ci && swapon /swapfile_ci && ( echo '/swapfile_ci none swap sw 0 0' | tee -a /etc/fstab ) # ``` # # - To register the persistent worker, open a `screen` session and run: @@ -39,23 +59,20 @@ env: # Global defaults # ``` # RESTART_CI_DOCKER_BEFORE_RUN=1 screen cirrus worker run --labels type=todo_fill_in_type --token todo_fill_in_token # ``` -# -# The following specific types should exist, with the following requirements: -# - small: For an x86_64 machine, recommended to have 2 CPUs and 8 GB of memory. -# - medium: For an x86_64 machine, recommended to have 4 CPUs and 16 GB of memory. -# - lunar: For a machine running the Linux kernel shipped with Ubuntu Lunar 23.04. The machine is recommended to have 4 CPUs and 16 GB of memory. -# - arm64: For an aarch64 machine, recommended to have 2 CPUs and 8 GB of memory. # https://cirrus-ci.org/guide/tips-and-tricks/#sharing-configuration-between-tasks filter_template: &FILTER_TEMPLATE - skip: $CIRRUS_REPO_FULL_NAME == "bitcoin-core/gui" && $CIRRUS_PR == "" # No need to run on the read-only mirror, unless it is a PR. https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution + # Allow forks to specify SKIP_BRANCH_PUSH=true and skip CI runs when a branch is pushed, + # but still run CI when a PR is created. + # https://cirrus-ci.org/guide/writing-tasks/#conditional-task-execution + skip: $SKIP_BRANCH_PUSH == "true" && $CIRRUS_PR == "" stateful: false # https://cirrus-ci.org/guide/writing-tasks/#stateful-tasks base_template: &BASE_TEMPLATE << : *FILTER_TEMPLATE merge_base_script: - # Unconditionally install git (used in fingerprint_script). - - bash -c "$PACKAGE_MANAGER_INSTALL git" + # Require git (used in fingerprint_script). + - git --version || ( apt-get update && apt-get install -y git ) - if [ "$CIRRUS_PR" = "" ]; then exit 0; fi - git fetch --depth=1 $CIRRUS_REPO_CLONE_URL "pull/${CIRRUS_PR}/merge" - git checkout FETCH_HEAD # Use merged changes to detect silent merge conflicts @@ -79,18 +96,15 @@ task: name: 'lint' << : *BASE_TEMPLATE container: - image: debian:bookworm + dockerfile: ci/lint_imagefile cpu: 1 memory: 1G # For faster CI feedback, immediately schedule the linters << : *CREDITS_TEMPLATE - python_cache: - folder: "/python_build" - fingerprint_script: cat .python-version /etc/os-release unshallow_script: - git fetch --unshallow --no-tags lint_script: - - ./ci/lint_run_all.sh + - ./ci/lint_run.sh task: name: 'tidy' @@ -111,31 +125,22 @@ task: FILE_ENV: "./ci/test/00_setup_env_arm.sh" task: - name: 'Win64, unit tests, no gui tests, no boost::process, no functional tests' - << : *GLOBAL_TASK_TEMPLATE - persistent_worker: - labels: - type: small - env: - FILE_ENV: "./ci/test/00_setup_env_win64.sh" - -task: - name: '32-bit CentOS, dash, gui' + name: 'CentOS, depends, gui' << : *GLOBAL_TASK_TEMPLATE persistent_worker: labels: type: small env: - FILE_ENV: "./ci/test/00_setup_env_i686_centos.sh" + FILE_ENV: "./ci/test/00_setup_env_native_centos.sh" task: - name: 'previous releases, qt5 dev package and depends packages, DEBUG' + name: 'previous releases, depends DEBUG' << : *GLOBAL_TASK_TEMPLATE persistent_worker: labels: type: small env: - FILE_ENV: "./ci/test/00_setup_env_native_qt5.sh" + FILE_ENV: "./ci/test/00_setup_env_native_previous_releases.sh" task: name: 'TSan, depends, gui' @@ -156,25 +161,13 @@ task: env: FILE_ENV: "./ci/test/00_setup_env_native_msan.sh" -task: - name: 'ASan + LSan + UBSan + integer, no depends, USDT' - enable_bpfcc_script: - # In the image build step, no external environment variables are available, - # so any settings will need to be written to the settings env file: - - sed -i "s|\${CIRRUS_CI}|true|g" ./ci/test/00_setup_env_native_asan.sh - << : *GLOBAL_TASK_TEMPLATE - persistent_worker: - labels: - type: lunar # Must use the lunar-specific worker (needed for USDT functional tests) - env: - FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" - task: name: 'fuzzer,address,undefined,integer, no depends' << : *GLOBAL_TASK_TEMPLATE persistent_worker: labels: type: medium + timeout_in: 240m # larger timeout, due to the high CPU demand env: FILE_ENV: "./ci/test/00_setup_env_native_fuzz.sh" @@ -197,10 +190,10 @@ task: FILE_ENV: "./ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh" task: - name: 'macOS-cross 11.0, gui, no tests' + name: 'macOS-cross, gui, no tests' << : *GLOBAL_TASK_TEMPLATE persistent_worker: labels: type: small env: - FILE_ENV: "./ci/test/00_setup_env_mac.sh" + FILE_ENV: "./ci/test/00_setup_env_mac_cross.sh" diff --git a/.editorconfig b/.editorconfig index ae7e92d1c8..c5f3028c50 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,17 +10,17 @@ insert_final_newline = true trim_trailing_whitespace = true # Source code files -[*.{h,cpp,py,sh}] +[*.{h,cpp,rs,py,sh}] indent_size = 4 -# .cirrus.yml, .fuzzbuzz.yml, etc. +# .cirrus.yml, etc. [*.yml] indent_size = 2 -# Makefiles -[{*.am,Makefile.*.include}] +# Makefiles (only relevant for depends build) +[Makefile] indent_style = tab -# Autoconf scripts -[configure.ac] +# CMake files +[{CMakeLists.txt,*.cmake,*.cmake.in}] indent_size = 2 diff --git a/.github/ISSUE_TEMPLATE/good_first_issue.yml b/.github/ISSUE_TEMPLATE/good_first_issue.yml index c40dad9687..2a486b3f2b 100644 --- a/.github/ISSUE_TEMPLATE/good_first_issue.yml +++ b/.github/ISSUE_TEMPLATE/good_first_issue.yml @@ -28,9 +28,11 @@ body: id: useful-skills attributes: label: Useful Skills - description: For example, “`std::thread`”, “Qt5 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”. - validations: - required: false + description: For example, “`std::thread`”, “Qt6 GUI and async GUI design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”. + value: | + * Compiling Bitcoin Core from source + * Running the C++ unit tests and the Python functional tests + * ... - type: textarea attributes: label: Guidance for new contributors diff --git a/.github/ci-test-each-commit-exec.sh b/.github/ci-test-each-commit-exec.sh new file mode 100755 index 0000000000..7704866c44 --- /dev/null +++ b/.github/ci-test-each-commit-exec.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +# +# Copyright (c) The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +set -o errexit -o pipefail -o xtrace + + +echo "Running test-one-commit on $( git log -1 )" + +# Use clang++, because it is a bit faster and uses less memory than g++ +CC=clang CXX=clang++ cmake -B build -DWERROR=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON -DWITH_USDT=ON -DCMAKE_CXX_FLAGS='-Wno-error=unused-member-function' + +cmake --build build -j "$( nproc )" + +ctest --output-on-failure --stop-on-failure --test-dir build -j "$( nproc )" + +./build/test/functional/test_runner.py -j $(( $(nproc) * 2 )) --combinedlogslen=99999999 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e6e8238667..14421fba50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,12 @@ -# Copyright (c) 2023 The Bitcoin Core developers +# Copyright (c) 2023-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. name: CI on: - # See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request. + # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull_request. pull_request: - # See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push. + # See: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#push. push: branches: - '**' @@ -18,109 +18,172 @@ concurrency: cancel-in-progress: true env: - DANGER_RUN_CI_ON_HOST: 1 CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error MAKEJOBS: '-j10' +defaults: + run: + # Enforce fail-fast behavior for all platforms. + # See: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#exit-codes-and-error-action-preference + shell: bash + jobs: - macos-native-x86_64: - name: 'macOS 13 native, x86_64, no depends, sqlite only, gui' - # Use latest image, but hardcode version to avoid silent upgrades (and breaks). + test-each-commit: + name: 'test each commit' + runs-on: ubuntu-24.04 + if: github.event_name == 'pull_request' && github.event.pull_request.commits != 1 + timeout-minutes: 360 # Use maximum time, see https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#jobsjob_idtimeout-minutes. Assuming a worst case time of 1 hour per commit, this leads to a --max-count=6 below. + env: + MAX_COUNT: 6 + steps: + - name: Determine fetch depth + run: echo "FETCH_DEPTH=$((${{ github.event.pull_request.commits }} + 2))" >> "$GITHUB_ENV" + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + fetch-depth: ${{ env.FETCH_DEPTH }} + - name: Determine commit range + run: | + # Checkout HEAD~ and find the test base commit + # Checkout HEAD~ because it would be wasteful to rerun tests on the PR + # head commit that are already run by other jobs. + git checkout HEAD~ + # Figure out test base commit by listing ancestors of HEAD, excluding + # ancestors of the most recent merge commit, limiting the list to the + # newest MAX_COUNT ancestors, ordering it from oldest to newest, and + # taking the first one. + # + # If the branch contains up to MAX_COUNT ancestor commits after the + # most recent merge commit, all of those commits will be tested. If it + # contains more, only the most recent MAX_COUNT commits will be + # tested. + # + # In the command below, the ^@ suffix is used to refer to all parents + # of the merge commit as described in: + # https://git-scm.com/docs/git-rev-parse#_other_rev_parent_shorthand_notations + # and the ^ prefix is used to exclude these parents and all their + # ancestors from the rev-list output as described in: + # https://git-scm.com/docs/git-rev-list + MERGE_BASE=$(git rev-list -n1 --merges HEAD) + EXCLUDE_MERGE_BASE_ANCESTORS= + # MERGE_BASE can be empty due to limited fetch-depth + if test -n "$MERGE_BASE"; then + EXCLUDE_MERGE_BASE_ANCESTORS=^${MERGE_BASE}^@ + fi + echo "TEST_BASE=$(git rev-list -n$((${{ env.MAX_COUNT }} + 1)) --reverse HEAD $EXCLUDE_MERGE_BASE_ANCESTORS | head -1)" >> "$GITHUB_ENV" + - run: | + git fetch origin "${GITHUB_BASE_REF}" + git config user.email "ci@example.com" + git config user.name "CI" + - run: | + sudo apt-get update + 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 + - name: Compile and run tests + run: | + # Run tests on commits after the last merge commit and before the PR head commit + git rebase --exec "git merge --no-commit origin/${GITHUB_BASE_REF} && ./.github/ci-test-each-commit-exec.sh && git reset --hard" ${{ env.TEST_BASE }} + + macos-native-arm64: + name: ${{ matrix.job-name }} + # Use any image to support the xcode-select below, but hardcode version to avoid silent upgrades (and breaks). # See: https://github.com/actions/runner-images#available-images. - runs-on: macos-13 # Use M1 once available https://github.com/github/roadmap/issues/528 + runs-on: macos-14 - # No need to run on the read-only mirror, unless it is a PR. - if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' + # When a contributor maintains a fork of the repo, any pull request they make + # to their own fork, or to the main repository, will trigger two CI runs: + # one for the branch push and one for the pull request. + # This can be avoided by setting SKIP_BRANCH_PUSH=true as a custom env variable + # in Github repository settings. + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} timeout-minutes: 120 + strategy: + fail-fast: false + matrix: + job-type: [standard, fuzz] + include: + - job-type: standard + file-env: './ci/test/00_setup_env_mac_native.sh' + job-name: 'macOS 14 native, arm64, no depends, sqlite only, gui' + - job-type: fuzz + file-env: './ci/test/00_setup_env_mac_native_fuzz.sh' + job-name: 'macOS 14 native, arm64, fuzz' + env: - FILE_ENV: './ci/test/00_setup_env_mac_native.sh' + DANGER_RUN_CI_ON_HOST: 1 BASE_ROOT_DIR: ${{ github.workspace }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Clang version - run: clang --version + run: | + # Use the earliest Xcode supported by the version of macOS denoted in + # doc/release-notes-empty-template.md and providing at least the + # minimum clang version denoted in doc/dependencies.md. + # See: https://developer.apple.com/documentation/xcode-release-notes/xcode-15-release-notes + sudo xcode-select --switch /Applications/Xcode_15.0.app + clang --version - name: Install Homebrew packages - run: brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt + env: + HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 + run: | + # A workaround for "The `brew link` step did not complete successfully" error. + brew install --quiet python@3 || brew link --overwrite python@3 + brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@6 qrencode - name: Set Ccache directory run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV" - name: Restore Ccache cache - uses: actions/cache/restore@v3 + id: ccache-cache + uses: actions/cache/restore@v4 with: path: ${{ env.CCACHE_DIR }} - key: ${{ github.job }}-ccache-${{ github.run_id }} - restore-keys: ${{ github.job }}-ccache- + key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }} + restore-keys: ${{ github.job }}-${{ matrix.job-type }}-ccache- - name: CI script run: ./ci/test_run_all.sh + env: + FILE_ENV: ${{ matrix.file-env }} - name: Save Ccache cache - uses: actions/cache/save@v3 - if: github.event_name != 'pull_request' + uses: actions/cache/save@v4 + if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' with: path: ${{ env.CCACHE_DIR }} # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache - key: ${{ github.job }}-ccache-${{ github.run_id }} + key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }} - win64-native: - name: 'Win64 native, VS 2022' - # Use latest image, but hardcode version to avoid silent upgrades (and breaks). - # See: https://github.com/actions/runner-images#available-images. + windows-native-dll: + name: ${{ matrix.job-name }} runs-on: windows-2022 - # No need to run on the read-only mirror, unless it is a PR. - if: github.repository != 'bitcoin-core/gui' || github.event_name == 'pull_request' + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} env: - CCACHE_MAXSIZE: '200M' - CI_CCACHE_VERSION: '4.7.5' - CI_QT_CONF: '-release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml' - CI_QT_DIR: 'qt-everywhere-src-5.15.5' - CI_QT_URL: 'https://download.qt.io/official_releases/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.zip' PYTHONUTF8: 1 TEST_RUNNER_TIMEOUT_FACTOR: 40 + strategy: + fail-fast: false + matrix: + job-type: [standard, fuzz] + include: + - job-type: standard + generate-options: '-DBUILD_GUI=ON -DWITH_ZMQ=ON -DBUILD_BENCH=ON -DWERROR=ON' + job-name: 'Windows native, VS 2022' + - job-type: fuzz + generate-options: '-DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet" -DBUILD_GUI=OFF -DBUILD_FOR_FUZZING=ON -DWERROR=ON' + job-name: 'Windows native, fuzz, VS 2022' + steps: - name: Checkout - uses: actions/checkout@v3 - - - name: Fix Visual Studio installation - # See: https://github.com/actions/runner-images/issues/7832#issuecomment-1617585694. - run: | - Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\" - $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" - $componentsToRemove= @( - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ARM64.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.x86.x64.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.ATL.ARM64.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM.Spectre" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64" - "Microsoft.VisualStudio.Component.VC.14.35.17.5.MFC.ARM64.Spectre" - ) - [string]$workloadArgs = $componentsToRemove | ForEach-Object {" --remove " + $_} - $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"",$workloadArgs, '--quiet', '--norestart', '--nocache') - # should be run twice - $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden - $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + uses: actions/checkout@v4 - name: Configure Developer Command Prompt for Microsoft Visual C++ # Using microsoft/setup-msbuild is not enough. @@ -128,139 +191,255 @@ jobs: with: arch: x64 - - name: Check MSBuild and Qt + - name: Get tool information + shell: pwsh run: | - msbuild -version | Out-File -FilePath "$env:GITHUB_WORKSPACE\msbuild_version" - Get-Content -Path "$env:GITHUB_WORKSPACE\msbuild_version" - $env:CI_QT_URL | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_url" - $env:CI_QT_CONF | Out-File -FilePath "$env:GITHUB_WORKSPACE\qt_conf" - - - name: Restore static Qt cache - id: static-qt-cache - uses: actions/cache/restore@v3 - with: - path: C:\Qt_static - key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }} + cmake -version | Tee-Object -FilePath "cmake_version" + Write-Output "---" + msbuild -version | Tee-Object -FilePath "msbuild_version" + $env:VCToolsVersion | Tee-Object -FilePath "toolset_version" + py -3 --version + Write-Host "PowerShell version $($PSVersionTable.PSVersion.ToString())" + bash --version - - name: Build static Qt. Download - if: steps.static-qt-cache.outputs.cache-hit != 'true' - shell: cmd + - name: Using vcpkg with MSBuild run: | - curl --location --output C:\qt-src.zip %CI_QT_URL% - choco install --yes --no-progress jom + echo "set(VCPKG_BUILD_TYPE release)" >> "${VCPKG_INSTALLATION_ROOT}/triplets/x64-windows.cmake" + # Workaround for libevent, which requires CMake 3.1 but is incompatible with CMake >= 4.0. + sed -i '1s/^/set(ENV{CMAKE_POLICY_VERSION_MINIMUM} 3.5)\n/' "${VCPKG_INSTALLATION_ROOT}/scripts/ports.cmake" - - name: Build static Qt. Expand source archive - if: steps.static-qt-cache.outputs.cache-hit != 'true' - shell: cmd - run: tar -xf C:\qt-src.zip -C C:\ + - name: vcpkg tools cache + uses: actions/cache@v4 + with: + path: C:/vcpkg/downloads/tools + key: ${{ github.job }}-vcpkg-tools - - name: Build static Qt. Create build directory - if: steps.static-qt-cache.outputs.cache-hit != 'true' - run: | - Rename-Item -Path "C:\$env:CI_QT_DIR" -NewName "C:\qt-src" - New-Item -ItemType Directory -Path "C:\qt-src\build" - - - name: Build static Qt. Configure - if: steps.static-qt-cache.outputs.cache-hit != 'true' - working-directory: C:\qt-src\build - shell: cmd - run: ..\configure %CI_QT_CONF% -prefix C:\Qt_static - - - name: Build static Qt. Build - if: steps.static-qt-cache.outputs.cache-hit != 'true' - working-directory: C:\qt-src\build - shell: cmd - run: jom - - - name: Build static Qt. Install - if: steps.static-qt-cache.outputs.cache-hit != 'true' - working-directory: C:\qt-src\build - shell: cmd - run: jom install - - - name: Save static Qt cache - if: steps.static-qt-cache.outputs.cache-hit != 'true' - uses: actions/cache/save@v3 + - name: Restore vcpkg binary cache + uses: actions/cache/restore@v4 + id: vcpkg-binary-cache with: - path: C:\Qt_static - key: ${{ github.job }}-static-qt-${{ hashFiles('msbuild_version', 'qt_url', 'qt_conf') }} + path: ~/AppData/Local/vcpkg/archives + key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }} - - name: Ccache installation cache - id: ccache-installation-cache - uses: actions/cache@v3 + - name: Generate build system + run: | + cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }} + + - name: Save vcpkg binary cache + uses: actions/cache/save@v4 + if: github.event_name != 'pull_request' && steps.vcpkg-binary-cache.outputs.cache-hit != 'true' && matrix.job-type == 'standard' with: - path: | - C:\ProgramData\chocolatey\lib\ccache - C:\ProgramData\chocolatey\bin\ccache.exe - C:\ccache\cl.exe - key: ${{ github.job }}-ccache-installation-${{ env.CI_CCACHE_VERSION }} + path: ~/AppData/Local/vcpkg/archives + key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('cmake_version', 'msbuild_version', 'toolset_version', 'vcpkg.json') }} - - name: Install Ccache - if: steps.ccache-installation-cache.outputs.cache-hit != 'true' + - name: Build + working-directory: build + run: | + cmake --build . -j $NUMBER_OF_PROCESSORS --config Release + + - name: Get bitcoind manifest + if: matrix.job-type == 'standard' + working-directory: build + run: | + mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -out:bitcoind.manifest + cat bitcoind.manifest + echo + mt.exe -nologo -inputresource:bin/Release/bitcoind.exe -validate_manifest + + - name: Run test suite + if: matrix.job-type == 'standard' + working-directory: build + env: + QT_PLUGIN_PATH: '${{ github.workspace }}\build\vcpkg_installed\x64-windows\Qt6\plugins' run: | - choco install --yes --no-progress ccache --version=$env:CI_CCACHE_VERSION - New-Item -ItemType Directory -Path "C:\ccache" - Copy-Item -Path "$env:ChocolateyInstall\lib\ccache\tools\ccache-$env:CI_CCACHE_VERSION-windows-x86_64\ccache.exe" -Destination "C:\ccache\cl.exe" + ctest --output-on-failure --stop-on-failure -j $NUMBER_OF_PROCESSORS -C Release + + - name: Run functional tests + if: matrix.job-type == 'standard' + working-directory: build + env: + BITCOIND: '${{ github.workspace }}\build\bin\Release\bitcoind.exe' + BITCOINCLI: '${{ github.workspace }}\build\bin\Release\bitcoin-cli.exe' + BITCOINUTIL: '${{ github.workspace }}\build\bin\Release\bitcoin-util.exe' + BITCOINWALLET: '${{ github.workspace }}\build\bin\Release\bitcoin-wallet.exe' + TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }} + run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="${RUNNER_TEMP}" --combinedlogslen=99999999 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} + + - name: Clone corpora + if: matrix.job-type == 'fuzz' + run: | + git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${RUNNER_TEMP}/qa-assets" + cd "${RUNNER_TEMP}/qa-assets" + echo "Using qa-assets repo from commit ..." + git log -1 + + - name: Run fuzz tests + if: matrix.job-type == 'fuzz' + working-directory: build + env: + BITCOINFUZZ: '${{ github.workspace }}\build\bin\Release\fuzz.exe' + run: | + py -3 test/fuzz/test_runner.py --par $NUMBER_OF_PROCESSORS --loglevel DEBUG "${RUNNER_TEMP}/qa-assets/fuzz_corpora" + + windows-cross: + name: 'Linux->Windows cross, no tests' + runs-on: ubuntu-latest + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} + + env: + FILE_ENV: './ci/test/00_setup_env_win64.sh' + DANGER_CI_ON_HOST_FOLDERS: 1 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set CI directories + run: | + echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV" + echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV" + echo "DEPENDS_DIR=${{ runner.temp }}/depends" >> "$GITHUB_ENV" + echo "BASE_BUILD_DIR=${{ runner.temp }}/build" >> "$GITHUB_ENV" + + - name: Depends cache + uses: actions/cache@v4 + with: + path: ${{ env.DEPENDS_DIR }}/built + key: ${{ github.job }}-depends-${{ hashFiles('depends/**', 'ci/test/00_setup_env_win64.sh') }} - name: Restore Ccache cache - uses: actions/cache/restore@v3 + id: ccache-cache + uses: actions/cache/restore@v4 with: - path: ~/AppData/Local/ccache + path: ${{ env.CCACHE_DIR }} key: ${{ github.job }}-ccache-${{ github.run_id }} restore-keys: ${{ github.job }}-ccache- - - name: Using vcpkg with MSBuild - run: | - Set-Location "$env:VCPKG_INSTALLATION_ROOT" - Add-Content -Path "triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)" - vcpkg --vcpkg-root "$env:VCPKG_INSTALLATION_ROOT" integrate install - git rev-parse HEAD | Out-File -FilePath "$env:GITHUB_WORKSPACE\vcpkg_commit" - Get-Content -Path "$env:GITHUB_WORKSPACE\vcpkg_commit" + - name: CI script + run: ./ci/test_run_all.sh - - name: vcpkg tools cache - uses: actions/cache@v3 + - name: Save Ccache cache + uses: actions/cache/save@v4 + if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' with: - path: C:/vcpkg/downloads/tools - key: ${{ github.job }}-vcpkg-tools + path: ${{ env.CCACHE_DIR }} + key: ${{ github.job }}-ccache-${{ github.run_id }} - - name: vcpkg binary cache - uses: actions/cache@v3 + - name: Upload built executables + uses: actions/upload-artifact@v4 with: - path: ~/AppData/Local/vcpkg/archives - key: ${{ github.job }}-vcpkg-binary-${{ hashFiles('vcpkg_commit', 'msbuild_version', 'build_msvc/vcpkg.json') }} + name: x86_64-w64-mingw32-executables-${{ github.run_id }} + path: | + ${{ env.BASE_BUILD_DIR }}/bin/*.exe + ${{ env.BASE_BUILD_DIR }}/src/secp256k1/bin/*.exe + ${{ env.BASE_BUILD_DIR }}/src/univalue/*.exe + ${{ env.BASE_BUILD_DIR }}/test/config.ini - - name: Generate project files - run: py -3 build_msvc\msvc-autogen.py + windows-native-test: + name: 'Windows, test cross-built' + runs-on: windows-2022 + needs: windows-cross - - name: Build - shell: cmd - run: | - ccache --zero-stats - msbuild build_msvc\bitcoin.sln -property:CLToolPath=C:\ccache;CLToolExe=cl.exe;UseMultiToolTask=true;Configuration=Release -maxCpuCount -verbosity:minimal -noLogo + env: + PYTHONUTF8: 1 + TEST_RUNNER_TIMEOUT_FACTOR: 40 - - name: Ccache stats - run: ccache --show-stats + steps: + - name: Checkout + uses: actions/checkout@v4 - - name: Save Ccache cache - uses: actions/cache/save@v3 - if: github.event_name != 'pull_request' + - name: Download built executables + uses: actions/download-artifact@v4 with: - path: ~/AppData/Local/ccache - # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache - key: ${{ github.job }}-ccache-${{ github.run_id }} + name: x86_64-w64-mingw32-executables-${{ github.run_id }} + + - name: Run bitcoind.exe + run: ./bin/bitcoind.exe -version + + - name: Find mt.exe tool + shell: pwsh + run: | + $sdk_dir = (Get-ItemProperty 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows Kits\Installed Roots' -Name KitsRoot10).KitsRoot10 + $sdk_latest = (Get-ChildItem "$sdk_dir\bin" -Directory | Where-Object { $_.Name -match '^\d+\.\d+\.\d+\.\d+$' } | Sort-Object Name -Descending | Select-Object -First 1).Name + "MT_EXE=${sdk_dir}bin\${sdk_latest}\x64\mt.exe" >> $env:GITHUB_ENV + + - name: Get bitcoind manifest + shell: pwsh + run: | + & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -out:bitcoind.manifest + Get-Content bitcoind.manifest + & $env:MT_EXE -nologo -inputresource:bin\bitcoind.exe -validate_manifest - name: Run unit tests - run: src\test_bitcoin.exe -l test_suite + # Can't use ctest here like other jobs as we don't have a CMake build tree. + run: | + ./bin/test_bitcoin.exe -l test_suite + ./src/secp256k1/bin/exhaustive_tests.exe + ./src/secp256k1/bin/noverify_tests.exe + ./src/secp256k1/bin/tests.exe + ./src/univalue/object.exe + ./src/univalue/unitester.exe - name: Run benchmarks - run: src\bench_bitcoin.exe -sanity-check + run: ./bin/bench_bitcoin.exe -sanity-check + + - name: Adjust paths in test/config.ini + shell: pwsh + run: | + (Get-Content "test/config.ini") -replace '(?<=^SRCDIR=).*', '${{ github.workspace }}' -replace '(?<=^BUILDDIR=).*', '${{ github.workspace }}' -replace '(?<=^RPCAUTH=).*', '${{ github.workspace }}/share/rpcauth/rpcauth.py' | Set-Content "test/config.ini" + Get-Content "test/config.ini" - name: Run util tests - run: py -3 test\util\test_runner.py + run: py -3 test/util/test_runner.py - name: Run rpcauth test - run: py -3 test\util\rpcauth-test.py + run: py -3 test/util/rpcauth-test.py - name: Run functional tests - shell: cmd - run: py -3 test\functional\test_runner.py --ci --quiet --tmpdirprefix=%RUNNER_TEMP% --combinedlogslen=99999999 --timeout-factor=%TEST_RUNNER_TIMEOUT_FACTOR% --extended --exclude feature_dbcrash + env: + # TODO: Fix the excluded test and re-enable it. + EXCLUDE: '--exclude wallet_multiwallet.py' + TEST_RUNNER_EXTRA: ${{ github.event_name != 'pull_request' && '--extended' || '' }} + run: py -3 test/functional/test_runner.py --jobs $NUMBER_OF_PROCESSORS --ci --quiet --tmpdirprefix="$RUNNER_TEMP" --combinedlogslen=99999999 --timeout-factor=$TEST_RUNNER_TIMEOUT_FACTOR $EXCLUDE $TEST_RUNNER_EXTRA + + asan-lsan-ubsan-integer-no-depends-usdt: + name: 'ASan + LSan + UBSan + integer, no depends, USDT' + runs-on: ubuntu-24.04 # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools + if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} + timeout-minutes: 120 + env: + FILE_ENV: "./ci/test/00_setup_env_native_asan.sh" + DANGER_CI_ON_HOST_FOLDERS: 1 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set CI directories + run: | + echo "CCACHE_DIR=${{ runner.temp }}/ccache_dir" >> "$GITHUB_ENV" + echo "BASE_ROOT_DIR=${{ runner.temp }}" >> "$GITHUB_ENV" + echo "BASE_BUILD_DIR=${{ runner.temp }}/build-asan" >> "$GITHUB_ENV" + + - name: Restore Ccache cache + id: ccache-cache + uses: actions/cache/restore@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: ${{ github.job }}-ccache-${{ github.run_id }} + restore-keys: ${{ github.job }}-ccache- + + - name: Enable bpfcc script + # In the image build step, no external environment variables are available, + # so any settings will need to be written to the settings env file: + run: sed -i "s|\${INSTALL_BCC_TRACING_TOOLS}|true|g" ./ci/test/00_setup_env_native_asan.sh + + - name: CI script + run: ./ci/test_run_all.sh + + - name: Save Ccache cache + uses: actions/cache/save@v4 + if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true' + with: + path: ${{ env.CCACHE_DIR }} + # https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache + key: ${{ github.job }}-ccache-${{ github.run_id }} diff --git a/.gitignore b/.gitignore index 6ca9d39a16..3b22e358dc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,151 +1,27 @@ -*.tar.gz +# Patterns that are specific to a text editor, IDE, operating system, or user +# environment are not added here. They should be added to your local gitignore +# file instead: +# https://docs.github.com/en/get-started/git-basics/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer -*.exe -*.pdb -src/bitcoin -src/bitcoind -src/bitcoin-cli -src/bitcoin-gui -src/bitcoin-node -src/bitcoin-tx -src/bitcoin-util -src/bitcoin-chainstate -src/bitcoin-wallet -src/test/fuzz/fuzz -src/test/test_bitcoin -src/qt/test/test_bitcoin-qt +# Build subdirectories. +/*build* +!/build-aux +!/build_msvc -# autoreconf -Makefile.in -aclocal.m4 -autom4te.cache/ -build-aux/config.guess -build-aux/config.sub -build-aux/depcomp -build-aux/install-sh -build-aux/ltmain.sh -build-aux/m4/libtool.m4 -build-aux/m4/lt~obsolete.m4 -build-aux/m4/ltoptions.m4 -build-aux/m4/ltsugar.m4 -build-aux/m4/ltversion.m4 -build-aux/missing -build-aux/compile -build-aux/test-driver -config.cache -config.log -config.status -configure -libtool -src/config/bitcoin-config.h -src/config/bitcoin-config.h.in -src/config/stamp-h1 -src/obj -share/setup.nsi -share/qt/Info.plist - -src/qt/*.moc -src/qt/moc_*.cpp -src/qt/forms/ui_*.h - -src/qt/test/moc*.cpp - -src/qt/bitcoin-qt.config -src/qt/bitcoin-qt.creator -src/qt/bitcoin-qt.creator.user -src/qt/bitcoin-qt.files -src/qt/bitcoin-qt.includes - -.deps -.dirstamp -.libs -.*.swp -*~ -*.bak -*.rej -*.orig *.pyc -*.o -*.o-* -*.a -*.pb.cc -*.pb.h -*.dat - -*.log -*.trs -*.dmg - -*.json.h -*.raw.h # Only ignore unexpected patches *.patch !contrib/guix/patches/*.patch !depends/patches/**/*.patch -#libtool object files -*.lo -*.la - -# Compilation and Qt preprocessor part -*.qm -Makefile -!depends/Makefile -src/qt/bitcoin-qt -Bitcoin-Qt.app - -# Qt Creator -Makefile.am.user - -# Unit-tests -Makefile.test -bitcoin-qt_test - -# Resources cpp -qrc_*.cpp - -# Mac specific -.DS_Store -build +/CMakeUserPresets.json # Previous releases -releases - -#lcov -*.gcno -*.gcda -/*.info -test_bitcoin.coverage/ -total.coverage/ -fuzz.coverage/ -coverage_percent.txt -/cov_tool_wrapper.sh -qa-assets/ - -#build tests -linux-coverage-build -linux-build -win32-build -test/config.ini -test/cache/* -test/.mypy_cache/ - -!src/leveldb*/Makefile - -/doc/doxygen/ - -libbitcoinconsensus.pc -contrib/devtools/split-debug.sh - -# Output from running db4 installation -db4/ - -# clang-check -*.plist +/releases -osx_volname -dist/ +# cargo default target dir +target/ /guix-build-* diff --git a/.python-version b/.python-version index e29d80998a..1445aee866 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.8.17 +3.10.14 diff --git a/.tx/config b/.tx/config index ab1fb933d8..b5a9abaae3 100644 --- a/.tx/config +++ b/.tx/config @@ -1,7 +1,7 @@ [main] host = https://www.transifex.com -[o:bitcoin:p:bitcoin:r:qt-translation-025x] +[o:bitcoin:p:bitcoin:r:qt-translation-029x] file_filter = src/qt/locale/bitcoin_.xlf source_file = src/qt/locale/bitcoin_en.xlf source_lang = en diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..c82d9fcae9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,718 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +# Ubuntu 22.04 LTS Jammy Jellyfish, https://wiki.ubuntu.com/Releases, EOSS in June 2027: +# - CMake 3.22.1, https://packages.ubuntu.com/jammy/cmake +# +# Centos Stream 9, https://www.centos.org/cl-vs-cs/#end-of-life, EOL in May 2027: +# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/ +cmake_minimum_required(VERSION 3.22) + +if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) + message(FATAL_ERROR "In-source builds are not allowed.") +endif() + +if(POLICY CMP0171) + # `codegen` is a reserved target name. + # See: https://cmake.org/cmake/help/latest/policy/CMP0171.html + cmake_policy(SET CMP0171 NEW) +endif() + +# When adjusting CMake flag variables, we must not override those explicitly +# set by the user. These are a subset of the CACHE_VARIABLES property. +get_directory_property(precious_variables CACHE_VARIABLES) + +#============================= +# Project / Package metadata +#============================= +set(CLIENT_NAME "Bitcoin Core") +set(CLIENT_VERSION_MAJOR 29) +set(CLIENT_VERSION_MINOR 99) +set(CLIENT_VERSION_BUILD 0) +set(CLIENT_VERSION_RC 0) +set(CLIENT_VERSION_IS_RELEASE "false") +set(COPYRIGHT_YEAR "2025") + +# During the enabling of the CXX and CXXOBJ languages, we modify +# CMake's compiler/linker invocation strings by appending the content +# of the user-defined `APPEND_*` variables, which allows overriding +# any flag. We also ensure that the APPEND_* flags are considered +# during CMake's tests, which use the `try_compile()` command. +# +# CMake's docs state that the `CMAKE_TRY_COMPILE_PLATFORM_VARIABLES` +# variable "is meant to be set by CMake's platform information modules +# for the current toolchain, or by a toolchain file." We do our best +# to set it before the `project()` command. +set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + CMAKE_CXX_COMPILE_OBJECT + CMAKE_OBJCXX_COMPILE_OBJECT + CMAKE_CXX_LINK_EXECUTABLE +) + +project(BitcoinCore + VERSION ${CLIENT_VERSION_MAJOR}.${CLIENT_VERSION_MINOR}.${CLIENT_VERSION_BUILD} + DESCRIPTION "Bitcoin client software" + HOMEPAGE_URL "https://bitcoincore.org/" + LANGUAGES NONE +) + +set(CLIENT_VERSION_STRING ${PROJECT_VERSION}) +if(CLIENT_VERSION_RC GREATER 0) + string(APPEND CLIENT_VERSION_STRING "rc${CLIENT_VERSION_RC}") +endif() + +set(COPYRIGHT_HOLDERS "The %s developers") +set(COPYRIGHT_HOLDERS_FINAL "The ${CLIENT_NAME} developers") +set(CLIENT_BUGREPORT "https://github.com/bitcoin/bitcoin/issues") + +#============================= +# Language setup +#============================= +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE) + # We do not use the install_name_tool when cross-compiling for macOS. + # So disable this tool check in further enable_language() commands. + set(CMAKE_PLATFORM_HAS_INSTALLNAME FALSE) +endif() +enable_language(CXX) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module) +include(ProcessConfigurations) + +# Flatten static lib dependencies. +# Without this, if libfoo.a depends on libbar.a, libfoo's objects can't begin +# to be compiled until libbar.a has been created. +if (NOT DEFINED CMAKE_OPTIMIZE_DEPENDENCIES) + set(CMAKE_OPTIMIZE_DEPENDENCIES TRUE) +endif() + +#============================= +# Configurable options +#============================= +include(CMakeDependentOption) +# When adding a new option, end the with a full stop for consistency. +option(BUILD_BITCOIN_BIN "Build bitcoin executable." ON) +option(BUILD_DAEMON "Build bitcoind executable." ON) +option(BUILD_GUI "Build bitcoin-qt executable." OFF) +option(BUILD_CLI "Build bitcoin-cli executable." ON) + +option(BUILD_TESTS "Build test_bitcoin and other unit test executables." ON) +option(BUILD_TX "Build bitcoin-tx executable." ${BUILD_TESTS}) +option(BUILD_UTIL "Build bitcoin-util executable." ${BUILD_TESTS}) + +option(BUILD_UTIL_CHAINSTATE "Build experimental bitcoin-chainstate executable." OFF) +option(BUILD_KERNEL_LIB "Build experimental bitcoinkernel library." ${BUILD_UTIL_CHAINSTATE}) + +option(ENABLE_WALLET "Enable wallet." ON) +if(ENABLE_WALLET) + if(VCPKG_TARGET_TRIPLET) + # Use of the `unofficial::` namespace is a vcpkg package manager convention. + find_package(unofficial-sqlite3 CONFIG REQUIRED) + else() + find_package(SQLite3 3.7.17 REQUIRED) + endif() +endif() +cmake_dependent_option(BUILD_WALLET_TOOL "Build bitcoin-wallet tool." ${BUILD_TESTS} "ENABLE_WALLET" OFF) + +option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting executables." OFF) +option(WERROR "Treat compiler warnings as errors." OFF) +option(WITH_CCACHE "Attempt to use ccache for compiling." ON) + +option(WITH_ZMQ "Enable ZMQ notifications." OFF) +if(WITH_ZMQ) + find_package(ZeroMQ 4.0.0 MODULE REQUIRED) +endif() + +option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF) +if(WITH_USDT) + find_package(USDT MODULE REQUIRED) +endif() + +option(ENABLE_EXTERNAL_SIGNER "Enable external signer support." ON) + +cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF) +if(WITH_QRENCODE) + find_package(QRencode MODULE REQUIRED) + set(USE_QRCODE TRUE) +endif() + +cmake_dependent_option(WITH_DBUS "Enable DBus support." ON "NOT CMAKE_SYSTEM_NAME MATCHES \"(Windows|Darwin)\" AND BUILD_GUI" OFF) + +option(ENABLE_IPC "Build multiprocess bitcoin-node and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental." OFF) +cmake_dependent_option(WITH_EXTERNAL_LIBMULTIPROCESS "Build with external libmultiprocess library instead of with local git subtree when ENABLE_IPC is enabled. This is not normally recommended, but can be useful for developing libmultiprocess itself." OFF "ENABLE_IPC" OFF) +if(ENABLE_IPC AND WITH_EXTERNAL_LIBMULTIPROCESS) + find_package(Libmultiprocess REQUIRED COMPONENTS Lib) + find_package(LibmultiprocessNative REQUIRED COMPONENTS Bin + NAMES Libmultiprocess + ) +endif() + +cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF) +if(BUILD_GUI) + set(qt_components Core Gui Widgets Quick LinguistTools) + if(ENABLE_WALLET) + list(APPEND qt_components Network) + endif() + if(WITH_DBUS) + list(APPEND qt_components DBus) + set(USE_DBUS TRUE) + endif() + if(BUILD_GUI_TESTS) + list(APPEND qt_components Test) + endif() + find_package(Qt 6.2 MODULE REQUIRED + COMPONENTS ${qt_components} + ) + unset(qt_components) +endif() + +option(BUILD_BENCH "Build bench_bitcoin executable." OFF) +option(BUILD_FUZZ_BINARY "Build fuzz binary." OFF) +option(BUILD_FOR_FUZZING "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF) + +option(INSTALL_MAN "Install man pages." ON) + +set(APPEND_CPPFLAGS "" CACHE STRING "Preprocessor flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.") +set(APPEND_CFLAGS "" CACHE STRING "C compiler flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.") +set(APPEND_CXXFLAGS "" CACHE STRING "(Objective) C++ compiler flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.") +set(APPEND_LDFLAGS "" CACHE STRING "Linker flags that are appended to the command line after all other flags added by the build system. This variable is intended for debugging and special builds.") +# Appending to this low-level rule variables is the only way to +# guarantee that the flags appear at the end of the command line. +string(APPEND CMAKE_CXX_COMPILE_OBJECT " ${APPEND_CPPFLAGS} ${APPEND_CXXFLAGS}") +string(APPEND CMAKE_CXX_CREATE_SHARED_LIBRARY " ${APPEND_LDFLAGS}") +string(APPEND CMAKE_CXX_LINK_EXECUTABLE " ${APPEND_LDFLAGS}") + +set(configure_warnings) + +include(CheckLinkerSupportsPIE) +check_linker_supports_pie(configure_warnings) + +# The core_interface library aims to encapsulate common build flags. +# It is a usage requirement for all targets except for secp256k1, which +# gets its flags by other means. +add_library(core_interface INTERFACE) +add_library(core_interface_relwithdebinfo INTERFACE) +add_library(core_interface_debug INTERFACE) +target_link_libraries(core_interface INTERFACE + $<$:core_interface_relwithdebinfo> + $<$:core_interface_debug> +) + +if(BUILD_FOR_FUZZING) + message(WARNING "BUILD_FOR_FUZZING=ON will disable all other targets and force BUILD_FUZZ_BINARY=ON.") + set(BUILD_BITCOIN_BIN OFF) + set(BUILD_DAEMON OFF) + set(BUILD_CLI OFF) + set(BUILD_TX OFF) + set(BUILD_UTIL OFF) + set(BUILD_UTIL_CHAINSTATE OFF) + set(BUILD_KERNEL_LIB OFF) + set(BUILD_WALLET_TOOL OFF) + set(BUILD_GUI OFF) + set(ENABLE_EXTERNAL_SIGNER OFF) + set(WITH_ZMQ OFF) + set(BUILD_TESTS OFF) + set(BUILD_GUI_TESTS OFF) + set(BUILD_BENCH OFF) + set(BUILD_FUZZ_BINARY ON) + + target_compile_definitions(core_interface INTERFACE + FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION + ) +endif() + +include(TryAppendCXXFlags) +include(TryAppendLinkerFlag) + +# Redefine/adjust per-configuration flags. +target_compile_definitions(core_interface_debug INTERFACE + DEBUG + DEBUG_LOCKORDER + DEBUG_LOCKCONTENTION + RPC_DOC_CHECK + ABORT_ON_FAILED_ASSUME +) + +if(WIN32) + #[=[ + This build system supports two ways to build binaries for Windows. + + 1. Building on Windows using MSVC. + Implementation notes: + - /DWIN32 and /D_WINDOWS definitions are included into the CMAKE_CXX_FLAGS_INIT + and CMAKE_CXX_FLAGS_INIT variables by default. + - A run-time library is selected using the CMAKE_MSVC_RUNTIME_LIBRARY variable. + - MSVC-specific options, for example, /Zc:__cplusplus, are additionally required. + + 2. Cross-compiling using MinGW. + Implementation notes: + - WIN32 and _WINDOWS definitions must be provided explicitly. + - A run-time library must be specified explicitly using _MT definition. + ]=] + + target_compile_definitions(core_interface INTERFACE + _WIN32_WINNT=0x0A00 + _WIN32_IE=0x0A00 + WIN32_LEAN_AND_MEAN + NOMINMAX + ) + + if(MSVC) + if(VCPKG_TARGET_TRIPLET MATCHES "-static") + set(msvc_library_linkage "") + else() + set(msvc_library_linkage "DLL") + endif() + set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>${msvc_library_linkage}") + unset(msvc_library_linkage) + + target_compile_definitions(core_interface INTERFACE + _UNICODE;UNICODE + ) + target_compile_options(core_interface INTERFACE + /utf-8 + /Zc:preprocessor + /Zc:__cplusplus + /sdl + ) + target_link_options(core_interface INTERFACE + # We embed our own manifests. + /MANIFEST:NO + ) + # Improve parallelism in MSBuild. + # See: https://devblogs.microsoft.com/cppblog/improved-parallelism-in-msbuild/. + list(APPEND CMAKE_VS_GLOBALS "UseMultiToolTask=true") + endif() + + if(MINGW) + target_compile_definitions(core_interface INTERFACE + WIN32 + _WINDOWS + _MT + ) + # Avoid the use of aligned vector instructions when building for Windows. + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412. + try_append_cxx_flags("-Wa,-muse-unaligned-vector-move" TARGET core_interface SKIP_LINK) + try_append_linker_flag("-static" TARGET core_interface) + # We support Windows 10+, however it's not possible to set these values accordingly, + # due to a bug in mingw-w64. See https://sourceforge.net/p/mingw-w64/bugs/968/. + # As a best effort, target Windows 8. + try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface) + try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface) + endif() + + # Workaround producing large object files, which cannot be handled by the assembler. + # More likely to happen with no, or lower levels of optimisation. + # See discussion in https://github.com/bitcoin/bitcoin/issues/28109. + if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + try_append_cxx_flags("/bigobj" TARGET core_interface_debug SKIP_LINK) + else() + try_append_cxx_flags("-Wa,-mbig-obj" TARGET core_interface_debug SKIP_LINK) + endif() +endif() + +# Use 64-bit off_t on 32-bit Linux. +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_SIZEOF_VOID_P EQUAL 4) + # Ensure 64-bit offsets are used for filesystem accesses for 32-bit compilation. + target_compile_definitions(core_interface INTERFACE + _FILE_OFFSET_BITS=64 + ) +endif() + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + target_compile_definitions(core_interface INTERFACE OBJC_OLD_DISPATCH_PROTOTYPES=0) + # These flags are specific to ld64, and may cause issues with other linkers. + # For example: GNU ld will interpret -dead_strip as -de and then try and use + # "ad_strip" as the symbol for the entry point. + try_append_linker_flag("-Wl,-dead_strip" TARGET core_interface) + try_append_linker_flag("-Wl,-dead_strip_dylibs" TARGET core_interface) + if(CMAKE_HOST_APPLE) + try_append_linker_flag("-Wl,-headerpad_max_install_names" TARGET core_interface) + endif() +endif() + +set(THREADS_PREFER_PTHREAD_FLAG ON) +find_package(Threads REQUIRED) +target_link_libraries(core_interface INTERFACE + Threads::Threads +) + +# Define sanitize_interface with -fsanitize flags intended to apply to all +# libraries and executables. +add_library(sanitize_interface INTERFACE) +target_link_libraries(core_interface INTERFACE sanitize_interface) +if(SANITIZERS) + # Transform list of sanitizers into -fsanitize flags, replacing "fuzzer" with + # "fuzzer-no-link" in sanitize_interface flags, and moving "fuzzer" to + # fuzzer_interface flags. If -DSANITIZERS=fuzzer is specified, the fuzz test + # binary should be built with -fsanitize=fuzzer (so it can use libFuzzer's + # main function), but libraries should be built with -fsanitize=fuzzer-no-link + # (so they can be linked into other executables that have their own main + # functions). + string(REGEX REPLACE "(^|,)fuzzer($|,)" "\\1fuzzer-no-link\\2" sanitize_opts "${SANITIZERS}") + set(fuzz_flag "") + if(NOT sanitize_opts STREQUAL SANITIZERS) + set(fuzz_flag "-fsanitize=fuzzer") + endif() + + # First check if the compiler accepts flags. If an incompatible pair like + # -fsanitize=address,thread is used here, this check will fail. This will also + # fail if a bad argument is passed, e.g. -fsanitize=undfeined + try_append_cxx_flags("-fsanitize=${sanitize_opts}" TARGET sanitize_interface + RESULT_VAR cxx_supports_sanitizers + SKIP_LINK + ) + if(NOT cxx_supports_sanitizers) + message(FATAL_ERROR "Compiler did not accept requested flags.") + endif() + + # Some compilers (e.g. GCC) require additional libraries like libasan, + # libtsan, libubsan, etc. Make sure linking still works with the sanitize + # flag. This is a separate check so we can give a better error message when + # the sanitize flags are supported by the compiler but the actual sanitizer + # libs are missing. + try_append_linker_flag("-fsanitize=${sanitize_opts}" VAR SANITIZER_LDFLAGS + SOURCE " + #include + #include + extern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } + int main() { return 0; } + " + RESULT_VAR linker_supports_sanitizers + NO_CACHE_IF_FAILED + ) + if(NOT linker_supports_sanitizers) + message(FATAL_ERROR "Linker did not accept requested flags, you are missing required libraries.") + endif() +endif() +target_link_options(sanitize_interface INTERFACE ${SANITIZER_LDFLAGS}) + +# Define fuzzer_interface with flags intended to apply to the fuzz test binary, +# and perform a test compilation to determine correct value of +# FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION. +if(BUILD_FUZZ_BINARY) + include(CheckSourceCompilesWithFlags) + check_cxx_source_compiles_with_flags(" + #include + #include + extern \"C\" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } + // No main() function. + " FUZZ_BINARY_LINKS_WITHOUT_MAIN_FUNCTION + LDFLAGS ${SANITIZER_LDFLAGS} ${fuzz_flag} + LINK_LIBRARIES ${FUZZ_LIBS} + ) + add_library(fuzzer_interface INTERFACE) + target_link_options(fuzzer_interface INTERFACE ${fuzz_flag}) + target_link_libraries(fuzzer_interface INTERFACE ${FUZZ_LIBS}) +endif() + +include(AddBoostIfNeeded) +add_boost_if_needed() + +if(BUILD_DAEMON OR BUILD_GUI OR BUILD_CLI OR BUILD_TESTS OR BUILD_BENCH OR BUILD_FUZZ_BINARY) + find_package(Libevent 2.1.8 MODULE REQUIRED) +endif() + +include(cmake/introspection.cmake) + +include(cmake/ccache.cmake) + +add_library(warn_interface INTERFACE) +target_link_libraries(core_interface INTERFACE warn_interface) +if(MSVC) + try_append_cxx_flags("/W3" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4018" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4146" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4244" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4267" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4715" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("/wd4805" TARGET warn_interface SKIP_LINK) + target_compile_definitions(warn_interface INTERFACE + _CRT_SECURE_NO_WARNINGS + _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING + ) +else() + try_append_cxx_flags("-Wall" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wextra" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wgnu" TARGET warn_interface SKIP_LINK) + # Some compilers will ignore -Wformat-security without -Wformat, so just combine the two here. + try_append_cxx_flags("-Wformat -Wformat-security" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wvla" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wshadow-field" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wthread-safety" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wthread-safety-pointer" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wloop-analysis" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wredundant-decls" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wunused-member-function" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wdate-time" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wconditional-uninitialized" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wduplicated-branches" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wduplicated-cond" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wlogical-op" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Woverloaded-virtual" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wsuggest-override" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wimplicit-fallthrough" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wunreachable-code" TARGET warn_interface SKIP_LINK) + try_append_cxx_flags("-Wdocumentation" TARGET warn_interface SKIP_LINK) + 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) + + # Some compilers (gcc) ignore unknown -Wno-* options, but warn about all + # unknown options if any other warning is produced. Test the -Wfoo case, and + # set the -Wno-foo case if it works. + try_append_cxx_flags("-Wunused-parameter" TARGET warn_interface SKIP_LINK + IF_CHECK_PASSED "-Wno-unused-parameter" + ) +endif() + +configure_file(cmake/script/Coverage.cmake Coverage.cmake USE_SOURCE_PERMISSIONS COPYONLY) +configure_file(cmake/script/CoverageFuzz.cmake CoverageFuzz.cmake USE_SOURCE_PERMISSIONS COPYONLY) +configure_file(cmake/script/CoverageInclude.cmake.in CoverageInclude.cmake USE_SOURCE_PERMISSIONS @ONLY) +configure_file(cmake/script/cov_tool_wrapper.sh.in cov_tool_wrapper.sh.in USE_SOURCE_PERMISSIONS COPYONLY) +configure_file(contrib/filter-lcov.py filter-lcov.py USE_SOURCE_PERMISSIONS COPYONLY) + +# Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review. +try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK) + +# Avoiding the `-ffile-prefix-map` compiler option because it implies +# `-fcoverage-prefix-map` on Clang or `-fprofile-prefix-map` on GCC, +# which can cause issues with coverage builds, particularly when using +# Clang in the OSS-Fuzz environment due to its use of other options +# and a third party script, or with GCC. +try_append_cxx_flags("-fdebug-prefix-map=A=B" TARGET core_interface SKIP_LINK + IF_CHECK_PASSED "-fdebug-prefix-map=${PROJECT_SOURCE_DIR}/src=." +) +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 +# 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) + +if(MSVC) + try_append_linker_flag("/DYNAMICBASE" TARGET core_interface) + try_append_linker_flag("/HIGHENTROPYVA" TARGET core_interface) + try_append_linker_flag("/NXCOMPAT" TARGET core_interface) +else() + + # _FORTIFY_SOURCE requires that there is some level of optimization, + # otherwise it does nothing and just creates a compiler warning. + try_append_cxx_flags("-U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3" + RESULT_VAR cxx_supports_fortify_source + SOURCE "int main() { + # if !defined __OPTIMIZE__ || __OPTIMIZE__ <= 0 + #error + #endif + }" + ) + if(cxx_supports_fortify_source) + target_compile_options(core_interface INTERFACE + -U_FORTIFY_SOURCE + -D_FORTIFY_SOURCE=3 + ) + endif() + unset(cxx_supports_fortify_source) + + try_append_cxx_flags("-Wstack-protector" TARGET core_interface SKIP_LINK) + try_append_cxx_flags("-fstack-protector-all" TARGET core_interface) + try_append_cxx_flags("-fcf-protection=full" TARGET core_interface) + + if(MINGW) + # stack-clash-protection is a no-op for Windows. + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details. + else() + try_append_cxx_flags("-fstack-clash-protection" TARGET core_interface) + endif() + + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + try_append_cxx_flags("-mbranch-protection=bti" TARGET core_interface SKIP_LINK) + else() + try_append_cxx_flags("-mbranch-protection=standard" TARGET core_interface SKIP_LINK) + endif() + endif() + + try_append_linker_flag("-Wl,--enable-reloc-section" TARGET core_interface) + try_append_linker_flag("-Wl,--dynamicbase" TARGET core_interface) + try_append_linker_flag("-Wl,--nxcompat" TARGET core_interface) + try_append_linker_flag("-Wl,--high-entropy-va" TARGET core_interface) + try_append_linker_flag("-Wl,-z,relro" TARGET core_interface) + try_append_linker_flag("-Wl,-z,now" TARGET core_interface) + # TODO: This can be dropped once Bitcoin Core no longer supports + # NetBSD 10.0 or if upstream fix is backported. + # NetBSD's dynamic linker ld.elf_so < 11.0 supports exactly 2 + # `PT_LOAD` segments and binaries linked with `-z separate-code` + # have 4 `PT_LOAD` segments. + # Relevant discussions: + # - https://github.com/bitcoin/bitcoin/pull/28724#issuecomment-2589347934 + # - https://mail-index.netbsd.org/tech-userlevel/2023/01/05/msg013666.html + if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD" AND CMAKE_SYSTEM_VERSION VERSION_LESS 11.0) + try_append_linker_flag("-Wl,-z,noseparate-code" TARGET core_interface) + else() + try_append_linker_flag("-Wl,-z,separate-code" TARGET core_interface) + endif() + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + try_append_linker_flag("-Wl,-fixup_chains" TARGET core_interface) + endif() +endif() + +if(REDUCE_EXPORTS) + set(CMAKE_CXX_VISIBILITY_PRESET hidden) + try_append_linker_flag("-Wl,--exclude-libs,ALL" TARGET core_interface) + try_append_linker_flag("-Wl,-no_exported_symbols" VAR CMAKE_EXE_LINKER_FLAGS) +endif() + +if(WERROR) + if(MSVC) + set(werror_flag "/WX") + else() + set(werror_flag "-Werror") + endif() + try_append_cxx_flags(${werror_flag} TARGET core_interface SKIP_LINK RESULT_VAR compiler_supports_werror) + if(NOT compiler_supports_werror) + message(FATAL_ERROR "WERROR set but ${werror_flag} is not usable.") + endif() + unset(werror_flag) +endif() + +# Prefer Unix-style package components over frameworks on macOS. +# This improves compatibility with Python version managers. +set(Python3_FIND_FRAMEWORK LAST CACHE STRING "") +# Search for generic names before more specialized ones. This +# improves compatibility with Python version managers that use shims. +set(Python3_FIND_UNVERSIONED_NAMES FIRST CACHE STRING "") +mark_as_advanced(Python3_FIND_FRAMEWORK Python3_FIND_UNVERSIONED_NAMES) +find_package(Python3 3.10 COMPONENTS Interpreter) +if(Python3_EXECUTABLE) + set(PYTHON_COMMAND ${Python3_EXECUTABLE}) +else() + list(APPEND configure_warnings + "Minimum required Python not found. Utils and rpcauth tests are disabled." + ) +endif() + +target_compile_definitions(core_interface INTERFACE ${DEPENDS_COMPILE_DEFINITIONS}) +target_compile_definitions(core_interface_relwithdebinfo INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO}) +target_compile_definitions(core_interface_debug INTERFACE ${DEPENDS_COMPILE_DEFINITIONS_DEBUG}) + +# If the {CXX,LD}FLAGS environment variables are defined during building depends +# and configuring this build system, their content might be duplicated. +if(DEFINED ENV{CXXFLAGS}) + deduplicate_flags(CMAKE_CXX_FLAGS) +endif() +if(DEFINED ENV{LDFLAGS}) + deduplicate_flags(CMAKE_EXE_LINKER_FLAGS) +endif() + +if(BUILD_TESTS) + enable_testing() +endif() + +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.29) + # have "make test" depend on "make all" + set(CMAKE_SKIP_TEST_ALL_DEPENDENCY FALSE) +endif() + +# TODO: The `CMAKE_SKIP_BUILD_RPATH` variable setting can be deleted +# in the future after reordering Guix script commands to +# perform binary checks after the installation step. +# Relevant discussions: +# - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 +# - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 +# NetBSD always requires runtime paths to be set for executables. +if(CMAKE_SYSTEM_NAME STREQUAL "NetBSD") + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) +else() + set(CMAKE_SKIP_BUILD_RPATH TRUE) + set(CMAKE_SKIP_INSTALL_RPATH TRUE) +endif() +add_subdirectory(test) +add_subdirectory(doc) + +add_subdirectory(src) + +include(cmake/tests.cmake) + +include(Maintenance) +setup_split_debug_script() +add_maintenance_targets() +add_windows_deploy_target() +add_macos_deploy_target() + +message("\n") +message("Configure summary") +message("=================") +message("Executables:") +message(" bitcoin ............................. ${BUILD_BITCOIN_BIN}") +message(" bitcoind ............................ ${BUILD_DAEMON}") +if(BUILD_DAEMON AND ENABLE_IPC) + set(bitcoin_daemon_status ON) +else() + set(bitcoin_daemon_status OFF) +endif() +message(" bitcoin-node (multiprocess) ......... ${bitcoin_daemon_status}") +message(" bitcoin-qt (GUI) .................... ${BUILD_GUI}") +if(BUILD_GUI AND ENABLE_IPC) + set(bitcoin_gui_status ON) +else() + set(bitcoin_gui_status OFF) +endif() +message(" bitcoin-gui (GUI, multiprocess) ..... ${bitcoin_gui_status}") +message(" bitcoin-cli ......................... ${BUILD_CLI}") +message(" bitcoin-tx .......................... ${BUILD_TX}") +message(" bitcoin-util ........................ ${BUILD_UTIL}") +message(" bitcoin-wallet ...................... ${BUILD_WALLET_TOOL}") +message(" bitcoin-chainstate (experimental) ... ${BUILD_UTIL_CHAINSTATE}") +message(" libbitcoinkernel (experimental) ..... ${BUILD_KERNEL_LIB}") +message("Optional features:") +message(" wallet support ...................... ${ENABLE_WALLET}") +message(" external signer ..................... ${ENABLE_EXTERNAL_SIGNER}") +message(" ZeroMQ .............................. ${WITH_ZMQ}") +if(ENABLE_IPC) + if (WITH_EXTERNAL_LIBMULTIPROCESS) + set(ipc_status "ON (with external libmultiprocess)") + else() + set(ipc_status ON) + endif() +else() + set(ipc_status OFF) +endif() +message(" IPC ................................. ${ipc_status}") +message(" USDT tracing ........................ ${WITH_USDT}") +message(" QR code (GUI) ....................... ${WITH_QRENCODE}") +message(" DBus (GUI) .......................... ${WITH_DBUS}") +message("Tests:") +message(" test_bitcoin ........................ ${BUILD_TESTS}") +message(" test_bitcoin-qt ..................... ${BUILD_GUI_TESTS}") +message(" bench_bitcoin ....................... ${BUILD_BENCH}") +message(" fuzz binary ......................... ${BUILD_FUZZ_BINARY}") +message("") +if(CMAKE_CROSSCOMPILING) + set(cross_status "TRUE, for ${CMAKE_SYSTEM_NAME}, ${CMAKE_SYSTEM_PROCESSOR}") +else() + set(cross_status "FALSE") +endif() +message("Cross compiling ....................... ${cross_status}") +message("C++ compiler .......................... ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}, ${CMAKE_CXX_COMPILER}") +include(FlagsSummary) +flags_summary() +message("Treat compiler warnings as errors ..... ${WERROR}") +message("Use ccache for compiling .............. ${WITH_CCACHE}") +message("\n") +if(configure_warnings) + message(" ******\n") + foreach(warning IN LISTS configure_warnings) + message(WARNING "${warning}") + endforeach() + message(" ******\n") +endif() + +# We want all build properties to be encapsulated properly. +include(WarnAboutGlobalProperties) diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000000..05b055d40b --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,88 @@ +{ + "version": 3, + "cmakeMinimumRequired": {"major": 3, "minor": 21, "patch": 0}, + "configurePresets": [ + { + "name": "vs2022", + "displayName": "Build using 'Visual Studio 17 2022' generator and 'x64-windows' triplet", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows", + "BUILD_GUI": "ON" + } + }, + { + "name": "vs2022-static", + "displayName": "Build using 'Visual Studio 17 2022' generator and 'x64-windows-static' triplet", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "generator": "Visual Studio 17 2022", + "architecture": "x64", + "toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake", + "cacheVariables": { + "VCPKG_TARGET_TRIPLET": "x64-windows-static", + "BUILD_GUI": "ON" + } + }, + { + "name": "libfuzzer", + "displayName": "Build for fuzzing with libfuzzer, and sanitizers enabled", + "binaryDir": "${sourceDir}/build_fuzz", + "cacheVariables": { + "BUILD_FOR_FUZZING": "ON", + "CMAKE_C_COMPILER": "clang", + "CMAKE_C_FLAGS": "-ftrivial-auto-var-init=pattern", + "CMAKE_CXX_COMPILER": "clang++", + "CMAKE_CXX_FLAGS": "-ftrivial-auto-var-init=pattern", + "SANITIZERS": "undefined,address,fuzzer" + } + }, + { + "name": "libfuzzer-nosan", + "displayName": "Build for fuzzing with libfuzzer, and sanitizers disabled", + "binaryDir": "${sourceDir}/build_fuzz_nosan", + "cacheVariables": { + "BUILD_FOR_FUZZING": "ON", + "CMAKE_C_COMPILER": "clang", + "CMAKE_CXX_COMPILER": "clang++", + "SANITIZERS": "fuzzer" + } + }, + { + "name": "dev-mode", + "displayName": "Developer mode, with all features/dependencies enabled", + "binaryDir": "${sourceDir}/build_dev_mode", + "cacheVariables": { + "BUILD_BENCH": "ON", + "BUILD_CLI": "ON", + "BUILD_DAEMON": "ON", + "BUILD_FUZZ_BINARY": "ON", + "BUILD_GUI": "ON", + "BUILD_GUI_TESTS": "ON", + "BUILD_KERNEL_LIB": "ON", + "BUILD_SHARED_LIBS": "ON", + "BUILD_TESTS": "ON", + "BUILD_TX": "ON", + "BUILD_UTIL": "ON", + "BUILD_UTIL_CHAINSTATE": "ON", + "BUILD_WALLET_TOOL": "ON", + "ENABLE_EXTERNAL_SIGNER": "ON", + "ENABLE_WALLET": "ON", + "ENABLE_IPC": "ON", + "WITH_QRENCODE": "ON", + "WITH_USDT": "ON", + "WITH_ZMQ": "ON" + } + } + ] +} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0ae4ff1a92..b0ba03a336 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,8 +36,7 @@ list or changes that are Some of them might no longer be applicable. So if you are interested, but unsure, you might want to leave a comment on the issue first. -You may also participate in the weekly -[Bitcoin Core PR Review Club](https://bitcoincore.reviews/) meeting. +You may also participate in the [Bitcoin Core PR Review Club](https://bitcoincore.reviews/). ### Good First Issue Label @@ -66,9 +65,10 @@ Discussion about codebase improvements happens in GitHub issues and pull requests. The developer -[mailing list](https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev) +[mailing list](https://groups.google.com/g/bitcoindev) should be used to discuss complicated or controversial consensus or P2P protocol changes before working on a patch set. +Archives can be found on [https://gnusha.org/pi/bitcoindev/](https://gnusha.org/pi/bitcoindev/). Contributor Workflow @@ -80,7 +80,7 @@ facilitates social contribution, easy testing and peer review. To contribute a patch, the workflow is as follows: - 1. Fork repository ([only for the first time](https://docs.github.com/en/get-started/quickstart/fork-a-repo)) + 1. Fork repository ([only for the first time](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)) 1. Create topic branch 1. Commit patches @@ -121,7 +121,7 @@ Commit messages should be verbose by default consisting of a short subject line paragraph(s), unless the title alone is self-explanatory (like "Correct typo in init.cpp") in which case a single title line is sufficient. Commit messages should be helpful to people reading your code in the future, so explain the reasoning for -your decisions. Further explanation [here](https://chris.beams.io/posts/git-commit/). +your decisions. Further explanation [here](https://cbea.ms/git-commit/). If a particular commit references another issue, please add the reference. For example: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords @@ -148,11 +148,11 @@ the pull request affects. Valid areas as: - `net` or `p2p` for changes to the peer-to-peer network code - `refactor` for structural changes that do not change behavior - `rpc`, `rest` or `zmq` for changes to the RPC, REST or ZMQ APIs - - `script` for changes to the scripts and tools + - `contrib` or `cli` for changes to the scripts and tools - `test`, `qa` or `ci` for changes to the unit tests, QA tests or CI code - `util` or `lib` for changes to the utils or libraries - `wallet` for changes to the wallet code - - `build` for changes to the GNU Autotools or MSVC builds + - `build` for changes to CMake - `guix` for changes to the GUIX reproducible builds Examples: @@ -182,7 +182,7 @@ for more information on helping with translations. ### Work in Progress Changes and Requests for Comments If a pull request is not to be considered for merging (yet), please -prefix the title with [WIP] or use [Tasks Lists](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists) +prefix the title with [WIP] or use [Tasks Lists](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists) in the body of the pull request to indicate tasks are pending. ### Address Feedback @@ -401,7 +401,7 @@ about: - It may be because your code is too complex for all but a few people, and those people may not have realized your pull request even exists. A great way to find people who are qualified and care about the code you are touching is the - [Git Blame feature](https://docs.github.com/en/github/managing-files-in-a-repository/managing-files-on-github/tracking-changes-in-a-file). Simply + [Git Blame feature](https://docs.github.com/en/repositories/working-with-files/using-files/viewing-and-understanding-files). Simply look up who last modified the code you are changing and see if you can find them and give them a nudge. Don't be incessant about the nudging, though. - Finally, if all else fails, ask on IRC or elsewhere for someone to give your pull request @@ -417,11 +417,8 @@ Backporting Security and bug fixes can be backported from `master` to release branches. -If the backport is non-trivial, it may be appropriate to open an -additional PR to backport the change, but only after the original PR -has been merged. -Otherwise, backports will be done in batches and -the maintainers will use the proper `Needs backport (...)` labels +Maintainers will do backports in batches and +use the proper `Needs backport (...)` labels when needed (the original author does not need to worry about it). A backport should contain the following metadata in the commit body: diff --git a/COPYING b/COPYING index 2f7add71ac..23dc5e905b 100644 --- a/COPYING +++ b/COPYING @@ -1,7 +1,7 @@ The MIT License (MIT) -Copyright (c) 2009-2023 The Bitcoin Core developers -Copyright (c) 2009-2023 Bitcoin Developers +Copyright (c) 2009-2025 The Bitcoin Core developers +Copyright (c) 2009-2025 Bitcoin Developers Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/INSTALL.md b/INSTALL.md index 4cead03036..013a099c95 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1 +1 @@ -See [doc/build-\*.md](/doc) \ No newline at end of file +See [doc/build-\*.md](/doc) diff --git a/Makefile.am b/Makefile.am deleted file mode 100644 index 8b61763ae4..0000000000 --- a/Makefile.am +++ /dev/null @@ -1,352 +0,0 @@ -# Copyright (c) 2013-2020 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# Pattern rule to print variables, e.g. make print-top_srcdir -print-%: FORCE - @echo '$*'='$($*)' - -ACLOCAL_AMFLAGS = -I build-aux/m4 -SUBDIRS = src -if ENABLE_MAN -SUBDIRS += doc/man -endif -.PHONY: deploy FORCE -.INTERMEDIATE: $(COVERAGE_INFO) - -export PYTHONPATH - -if BUILD_BITCOIN_LIBS -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libbitcoinconsensus.pc -endif - -BITCOIND_BIN=$(top_builddir)/src/$(BITCOIN_DAEMON_NAME)$(EXEEXT) -BITCOIN_QT_BIN=$(top_builddir)/src/qt/$(BITCOIN_GUI_NAME)$(EXEEXT) -BITCOIN_TEST_BIN=$(top_builddir)/src/test/$(BITCOIN_TEST_NAME)$(EXEEXT) -BITCOIN_CLI_BIN=$(top_builddir)/src/$(BITCOIN_CLI_NAME)$(EXEEXT) -BITCOIN_TX_BIN=$(top_builddir)/src/$(BITCOIN_TX_NAME)$(EXEEXT) -BITCOIN_UTIL_BIN=$(top_builddir)/src/$(BITCOIN_UTIL_NAME)$(EXEEXT) -BITCOIN_WALLET_BIN=$(top_builddir)/src/$(BITCOIN_WALLET_TOOL_NAME)$(EXEEXT) -BITCOIN_NODE_BIN=$(top_builddir)/src/$(BITCOIN_MP_NODE_NAME)$(EXEEXT) -BITCOIN_GUI_BIN=$(top_builddir)/src/$(BITCOIN_MP_GUI_NAME)$(EXEEXT) -BITCOIN_WIN_INSTALLER=$(PACKAGE)-$(PACKAGE_VERSION)-win64-setup$(EXEEXT) - -empty := -space := $(empty) $(empty) - -OSX_APP=Bitcoin-Qt.app -OSX_VOLNAME = $(subst $(space),-,$(PACKAGE_NAME)) -OSX_DMG = $(OSX_VOLNAME).dmg -OSX_DEPLOY_SCRIPT=$(top_srcdir)/contrib/macdeploy/macdeployqtplus -OSX_INSTALLER_ICONS=$(top_srcdir)/src/qt/res/icons/bitcoin.icns -OSX_PLIST=$(top_builddir)/share/qt/Info.plist #not installed - -DIST_CONTRIB = \ - $(top_srcdir)/test/sanitizer_suppressions/lsan \ - $(top_srcdir)/test/sanitizer_suppressions/tsan \ - $(top_srcdir)/test/sanitizer_suppressions/ubsan \ - $(top_srcdir)/contrib/linearize/linearize-data.py \ - $(top_srcdir)/contrib/linearize/linearize-hashes.py \ - $(top_srcdir)/contrib/signet/miner - -DIST_SHARE = \ - $(top_srcdir)/share/genbuild.sh \ - $(top_srcdir)/share/rpcauth - -BIN_CHECKS=$(top_srcdir)/contrib/devtools/symbol-check.py \ - $(top_srcdir)/contrib/devtools/security-check.py \ - $(top_srcdir)/contrib/devtools/utils.py - -WINDOWS_PACKAGING = $(top_srcdir)/share/pixmaps/bitcoin.ico \ - $(top_srcdir)/share/pixmaps/nsis-header.bmp \ - $(top_srcdir)/share/pixmaps/nsis-wizard.bmp \ - $(top_srcdir)/doc/README_windows.txt - -OSX_PACKAGING = $(OSX_DEPLOY_SCRIPT) $(OSX_INSTALLER_ICONS) \ - $(top_srcdir)/contrib/macdeploy/detached-sig-create.sh - -COVERAGE_INFO = $(COV_TOOL_WRAPPER) baseline.info \ - test_bitcoin_filtered.info total_coverage.info \ - baseline_filtered.info functional_test.info functional_test_filtered.info \ - test_bitcoin_coverage.info test_bitcoin.info fuzz.info fuzz_filtered.info fuzz_coverage.info - -dist-hook: - -$(GIT) archive --format=tar HEAD -- src/clientversion.cpp | $(AMTAR) -C $(top_distdir) -xf - - -if TARGET_WINDOWS -$(BITCOIN_WIN_INSTALLER): all-recursive - $(MKDIR_P) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIND_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TEST_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_CLI_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_TX_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_WALLET_BIN) $(top_builddir)/release - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_UTIL_BIN) $(top_builddir)/release - @test -f $(MAKENSIS) && echo 'OutFile "$@"' | cat $(top_builddir)/share/setup.nsi - | $(MAKENSIS) -V2 - || \ - echo error: could not build $@ - @echo built $@ - -deploy: $(BITCOIN_WIN_INSTALLER) -endif - -if TARGET_DARWIN -$(OSX_APP)/Contents/PkgInfo: - $(MKDIR_P) $(@D) - @echo "APPL????" > $@ - -$(OSX_APP)/Contents/Resources/empty.lproj: - $(MKDIR_P) $(@D) - @touch $@ - -$(OSX_APP)/Contents/Info.plist: $(OSX_PLIST) - $(MKDIR_P) $(@D) - $(INSTALL_DATA) $< $@ - -$(OSX_APP)/Contents/Resources/bitcoin.icns: $(OSX_INSTALLER_ICONS) - $(MKDIR_P) $(@D) - $(INSTALL_DATA) $< $@ - -$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: all-recursive - $(MKDIR_P) $(@D) - STRIPPROG="$(STRIP)" $(INSTALL_STRIP_PROGRAM) $(BITCOIN_QT_BIN) $@ - -$(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings: - $(MKDIR_P) $(@D) - echo '{ CFBundleDisplayName = "$(PACKAGE_NAME)"; CFBundleName = "$(PACKAGE_NAME)"; }' > $@ - -OSX_APP_BUILT=$(OSX_APP)/Contents/PkgInfo $(OSX_APP)/Contents/Resources/empty.lproj \ - $(OSX_APP)/Contents/Resources/bitcoin.icns $(OSX_APP)/Contents/Info.plist \ - $(OSX_APP)/Contents/MacOS/Bitcoin-Qt $(OSX_APP)/Contents/Resources/Base.lproj/InfoPlist.strings - -osx_volname: - echo $(OSX_VOLNAME) >$@ - -if BUILD_DARWIN -$(OSX_DMG): $(OSX_APP_BUILT) $(OSX_PACKAGING) - $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) -dmg - -deploydir: $(OSX_DMG) -else !BUILD_DARWIN -APP_DIST_DIR=$(top_builddir)/dist - -$(OSX_DMG): deploydir - $(XORRISOFS) -D -l -V "$(OSX_VOLNAME)" -no-pad -r -dir-mode 0755 -o $@ $(APP_DIST_DIR) -- $(if $(SOURCE_DATE_EPOCH),-volume_date all_file_dates =$(SOURCE_DATE_EPOCH)) - -$(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt: $(OSX_APP_BUILT) $(OSX_PACKAGING) - INSTALL_NAME_TOOL=$(INSTALL_NAME_TOOL) OTOOL=$(OTOOL) STRIP=$(STRIP) $(PYTHON) $(OSX_DEPLOY_SCRIPT) $(OSX_APP) $(OSX_VOLNAME) -translations-dir=$(QT_TRANSLATION_DIR) - -deploydir: $(APP_DIST_DIR)/$(OSX_APP)/Contents/MacOS/Bitcoin-Qt -endif !BUILD_DARWIN - -deploy: $(OSX_DMG) -endif - -$(BITCOIN_QT_BIN): FORCE - $(MAKE) -C src qt/$(@F) - -$(BITCOIND_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_CLI_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_TX_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_UTIL_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_WALLET_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_NODE_BIN): FORCE - $(MAKE) -C src $(@F) - -$(BITCOIN_GUI_BIN): FORCE - $(MAKE) -C src $(@F) - -if USE_LCOV -LCOV_FILTER_PATTERN = \ - -p "/usr/local/" \ - -p "/usr/include/" \ - -p "/usr/lib/" \ - -p "/usr/lib64/" \ - -p "src/leveldb/" \ - -p "src/crc32c/" \ - -p "src/bench/" \ - -p "src/crypto/ctaes" \ - -p "src/minisketch" \ - -p "src/secp256k1" \ - -p "depends" - -DIR_FUZZ_SEED_CORPUS ?= qa-assets/fuzz_seed_corpus - -$(COV_TOOL_WRAPPER): - @echo 'exec $(COV_TOOL) "$$@"' > $(COV_TOOL_WRAPPER) - @chmod +x $(COV_TOOL_WRAPPER) - -baseline.info: $(COV_TOOL_WRAPPER) - $(LCOV) -c -i -d $(abs_builddir)/src -o $@ - -baseline_filtered.info: baseline.info - $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ - $(LCOV) -a $@ $(LCOV_OPTS) -o $@ - -fuzz.info: baseline_filtered.info - @TIMEOUT=15 test/fuzz/test_runner.py $(DIR_FUZZ_SEED_CORPUS) -l DEBUG - $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t fuzz-tests -o $@ - $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src - -fuzz_filtered.info: fuzz.info - $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ - $(LCOV) -a $@ $(LCOV_OPTS) -o $@ - -test_bitcoin.info: baseline_filtered.info - $(MAKE) -C src/ check - $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src -t test_bitcoin -o $@ - $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src - -test_bitcoin_filtered.info: test_bitcoin.info - $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ - $(LCOV) -a $@ $(LCOV_OPTS) -o $@ - -functional_test.info: test_bitcoin_filtered.info - @TIMEOUT=15 test/functional/test_runner.py $(EXTENDED_FUNCTIONAL_TESTS) - $(LCOV) -c $(LCOV_OPTS) -d $(abs_builddir)/src --t functional-tests -o $@ - $(LCOV) -z $(LCOV_OPTS) -d $(abs_builddir)/src - -functional_test_filtered.info: functional_test.info - $(abs_builddir)/contrib/filter-lcov.py $(LCOV_FILTER_PATTERN) $< $@ - $(LCOV) -a $@ $(LCOV_OPTS) -o $@ - -fuzz_coverage.info: fuzz_filtered.info - $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a fuzz_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt - -test_bitcoin_coverage.info: baseline_filtered.info test_bitcoin_filtered.info - $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -o $@ - -total_coverage.info: test_bitcoin_filtered.info functional_test_filtered.info - $(LCOV) -a $(LCOV_OPTS) baseline_filtered.info -a test_bitcoin_filtered.info -a functional_test_filtered.info -o $@ | $(GREP) "\%" | $(AWK) '{ print substr($$3,2,50) "/" $$5 }' > coverage_percent.txt - -fuzz.coverage/.dirstamp: fuzz_coverage.info - $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D) - @touch $@ - -test_bitcoin.coverage/.dirstamp: test_bitcoin_coverage.info - $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D) - @touch $@ - -total.coverage/.dirstamp: total_coverage.info - $(GENHTML) -s $(LCOV_OPTS) $< -o $(@D) - @touch $@ - -cov_fuzz: fuzz.coverage/.dirstamp - -cov: test_bitcoin.coverage/.dirstamp total.coverage/.dirstamp - -endif - -dist_noinst_SCRIPTS = autogen.sh - -EXTRA_DIST = $(DIST_SHARE) $(DIST_CONTRIB) $(WINDOWS_PACKAGING) $(OSX_PACKAGING) $(BIN_CHECKS) - -EXTRA_DIST += \ - test/functional \ - test/fuzz - -EXTRA_DIST += \ - test/util/test_runner.py \ - test/util/data/bitcoin-util-test.json \ - test/util/data/blanktxv1.hex \ - test/util/data/blanktxv1.json \ - test/util/data/blanktxv2.hex \ - test/util/data/blanktxv2.json \ - test/util/data/tt-delin1-out.hex \ - test/util/data/tt-delin1-out.json \ - test/util/data/tt-delout1-out.hex \ - test/util/data/tt-delout1-out.json \ - test/util/data/tt-locktime317000-out.hex \ - test/util/data/tt-locktime317000-out.json \ - test/util/data/tx394b54bb.hex \ - test/util/data/txcreate1.hex \ - test/util/data/txcreate1.json \ - test/util/data/txcreate2.hex \ - test/util/data/txcreate2.json \ - test/util/data/txcreatedata1.hex \ - test/util/data/txcreatedata1.json \ - test/util/data/txcreatedata2.hex \ - test/util/data/txcreatedata2.json \ - test/util/data/txcreatedata_seq0.hex \ - test/util/data/txcreatedata_seq0.json \ - test/util/data/txcreatedata_seq1.hex \ - test/util/data/txcreatedata_seq1.json \ - test/util/data/txcreatemultisig1.hex \ - test/util/data/txcreatemultisig1.json \ - test/util/data/txcreatemultisig2.hex \ - test/util/data/txcreatemultisig2.json \ - test/util/data/txcreatemultisig3.hex \ - test/util/data/txcreatemultisig3.json \ - test/util/data/txcreatemultisig4.hex \ - test/util/data/txcreatemultisig4.json \ - test/util/data/txcreatemultisig5.json \ - test/util/data/txcreateoutpubkey1.hex \ - test/util/data/txcreateoutpubkey1.json \ - test/util/data/txcreateoutpubkey2.hex \ - test/util/data/txcreateoutpubkey2.json \ - test/util/data/txcreateoutpubkey3.hex \ - test/util/data/txcreateoutpubkey3.json \ - test/util/data/txcreatescript1.hex \ - test/util/data/txcreatescript1.json \ - test/util/data/txcreatescript2.hex \ - test/util/data/txcreatescript2.json \ - test/util/data/txcreatescript3.hex \ - test/util/data/txcreatescript3.json \ - test/util/data/txcreatescript4.hex \ - test/util/data/txcreatescript4.json \ - test/util/data/txcreatescript5.hex \ - test/util/data/txcreatescript6.hex \ - test/util/data/txcreatesignsegwit1.hex \ - test/util/data/txcreatesignv1.hex \ - test/util/data/txcreatesignv1.json \ - test/util/data/txcreatesignv2.hex \ - test/util/rpcauth-test.py - -CLEANFILES = $(OSX_DMG) $(BITCOIN_WIN_INSTALLER) - -DISTCHECK_CONFIGURE_FLAGS = --enable-man - -doc/doxygen/.stamp: doc/Doxyfile FORCE - $(MKDIR_P) $(@D) - $(DOXYGEN) $^ - $(AM_V_at) touch $@ - -if HAVE_DOXYGEN -docs: doc/doxygen/.stamp -else -docs: - @echo "error: doxygen not found" -endif - -clean-docs: - rm -rf doc/doxygen - -clean-local: clean-docs - rm -rf coverage_percent.txt test_bitcoin.coverage/ total.coverage/ fuzz.coverage/ test/tmp/ cache/ $(OSX_APP) - rm -rf test/functional/__pycache__ test/functional/test_framework/__pycache__ test/cache share/rpcauth/__pycache__ - rm -rf osx_volname dist/ - -test-security-check: -if TARGET_DARWIN - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_MACHO - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_MACHO -endif -if TARGET_WINDOWS - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_PE - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_PE -endif -if TARGET_LINUX - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-security-check.py TestSecurityChecks.test_ELF - $(AM_V_at) CC='$(CC)' CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(PYTHON) $(top_srcdir)/contrib/devtools/test-symbol-check.py TestSymbolChecks.test_ELF -endif diff --git a/README.md b/README.md index 2eab2315eb..6628e0a5c9 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ License ------- Bitcoin Core is released under the terms of the MIT license. See [COPYING](COPYING) for more -information or see https://opensource.org/licenses/MIT. +information or see https://opensource.org/license/MIT. Development Process ------------------- @@ -48,12 +48,13 @@ lots of money. Developers are strongly encouraged to write [unit tests](src/test/README.md) for new code, and to submit new unit tests for old code. Unit tests can be compiled and run -(assuming they weren't disabled in configure) with: `make check`. Further details on running +(assuming they weren't disabled during the generation of the build system) with: `ctest`. Further details on running and extending unit tests can be found in [/src/test/README.md](/src/test/README.md). There are also [regression and integration tests](/test), written in Python. -These tests can be run (if the [test dependencies](/test) are installed) with: `test/functional/test_runner.py` +These tests can be run (if the [test dependencies](/test) are installed) with: `build/test/functional/test_runner.py` +(assuming `build` is your build directory). The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically. diff --git a/SECURITY.md b/SECURITY.md index c0660e7042..fd4c61d176 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -15,6 +15,6 @@ The following keys may be used to communicate sensitive information to developer |------|-------------| | Pieter Wuille | 133E AC17 9436 F14A 5CF1 B794 860F EB80 4E66 9320 | | Michael Ford | E777 299F C265 DD04 7930 70EB 944D 35F9 AC3D B76A | -| Andrew Chow | 1528 1230 0785 C964 44D3 334D 1756 5732 E08E 5E41 | +| Ava Chow | 1528 1230 0785 C964 44D3 334D 1756 5732 E08E 5E41 | You can import a key by running the following command with that individual’s fingerprint: `gpg --keyserver hkps://keys.openpgp.org --recv-keys ""` Ensure that you put quotes around fingerprints containing spaces. diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 69c892ffa0..0000000000 --- a/autogen.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# Copyright (c) 2013-2019 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C -set -e -srcdir="$(dirname "$0")" -cd "$srcdir" -if [ -z "${LIBTOOLIZE}" ] && GLIBTOOLIZE="$(command -v glibtoolize)"; then - LIBTOOLIZE="${GLIBTOOLIZE}" - export LIBTOOLIZE -fi -command -v autoreconf >/dev/null || \ - (echo "configuration failed, please install autoconf first" && exit 1) -autoreconf --install --force --warnings=all - -if expr "'$(build-aux/config.guess --timestamp)" \< "'$(depends/config.guess --timestamp)" > /dev/null; then - chmod ug+w build-aux/config.guess - chmod ug+w src/secp256k1/build-aux/config.guess - cp depends/config.guess build-aux - cp depends/config.guess src/secp256k1/build-aux -fi -if expr "'$(build-aux/config.sub --timestamp)" \< "'$(depends/config.sub --timestamp)" > /dev/null; then - chmod ug+w build-aux/config.sub - chmod ug+w src/secp256k1/build-aux/config.sub - cp depends/config.sub build-aux - cp depends/config.sub src/secp256k1/build-aux -fi diff --git a/build-aux/m4/ax_boost_base.m4 b/build-aux/m4/ax_boost_base.m4 deleted file mode 100644 index f6620882a2..0000000000 --- a/build-aux/m4/ax_boost_base.m4 +++ /dev/null @@ -1,256 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_boost_base.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) -# -# DESCRIPTION -# -# Test for the Boost C++ headers of a particular version (or newer) -# -# If no path to the installed boost library is given the macro searchs -# under /usr, /usr/local, /opt, /opt/local and /opt/homebrew and evaluates -# the $BOOST_ROOT environment variable. Further documentation is available -# at . -# -# This macro calls: -# -# AC_SUBST(BOOST_CPPFLAGS) -# -# And sets: -# -# HAVE_BOOST -# -# Note that this macro has been modified compared to upstream. -# -# LICENSE -# -# Copyright (c) 2008 Thomas Porschberg -# Copyright (c) 2009 Peter Adolphs -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 51 - -# example boost program (need to pass version) -m4_define([_AX_BOOST_BASE_PROGRAM], - [AC_LANG_PROGRAM([[ -#include -]],[[ -(void) ((void)sizeof(char[1 - 2*!!((BOOST_VERSION) < ($1))])); -]])]) - -AC_DEFUN([AX_BOOST_BASE], -[ -AC_ARG_WITH([boost], - [AS_HELP_STRING([--with-boost@<:@=ARG@:>@], - [use Boost library from a standard location (ARG=yes), - from the specified location (ARG=), - or disable it (ARG=no) - @<:@ARG=yes@:>@ ])], - [ - AS_CASE([$withval], - [no],[want_boost="no";_AX_BOOST_BASE_boost_path=""], - [yes],[want_boost="yes";_AX_BOOST_BASE_boost_path=""], - [want_boost="yes";_AX_BOOST_BASE_boost_path="$withval"]) - ], - [want_boost="yes"]) - -BOOST_CPPFLAGS="" -AS_IF([test "x$want_boost" = "xyes"], - [_AX_BOOST_BASE_RUNDETECT([$1],[$2],[$3])]) -AC_SUBST(BOOST_CPPFLAGS) -]) - - -# convert a version string in $2 to numeric and affect to polymorphic var $1 -AC_DEFUN([_AX_BOOST_BASE_TONUMERICVERSION],[ - AS_IF([test "x$2" = "x"],[_AX_BOOST_BASE_TONUMERICVERSION_req="1.20.0"],[_AX_BOOST_BASE_TONUMERICVERSION_req="$2"]) - _AX_BOOST_BASE_TONUMERICVERSION_req_shorten=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\.[[0-9]]*\)'` - _AX_BOOST_BASE_TONUMERICVERSION_req_major=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '\([[0-9]]*\)'` - AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_major" = "x"], - [AC_MSG_ERROR([You should at least specify libboost major version])]) - _AX_BOOST_BASE_TONUMERICVERSION_req_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.\([[0-9]]*\)'` - AS_IF([test "x$_AX_BOOST_BASE_TONUMERICVERSION_req_minor" = "x"], - [_AX_BOOST_BASE_TONUMERICVERSION_req_minor="0"]) - _AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'` - AS_IF([test "X$_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor" = "X"], - [_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor="0"]) - _AX_BOOST_BASE_TONUMERICVERSION_RET=`expr $_AX_BOOST_BASE_TONUMERICVERSION_req_major \* 100000 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_minor \* 100 \+ $_AX_BOOST_BASE_TONUMERICVERSION_req_sub_minor` - AS_VAR_SET($1,$_AX_BOOST_BASE_TONUMERICVERSION_RET) -]) - -dnl Run the detection of boost should be run only if $want_boost -AC_DEFUN([_AX_BOOST_BASE_RUNDETECT],[ - _AX_BOOST_BASE_TONUMERICVERSION(WANT_BOOST_VERSION,[$1]) - succeeded=no - - - AC_REQUIRE([AC_CANONICAL_HOST]) - dnl On 64-bit systems check for system libraries in both lib64 and lib. - dnl The former is specified by FHS, but e.g. Debian does not adhere to - dnl this (as it rises problems for generic multi-arch support). - dnl The last entry in the list is chosen by default when no libraries - dnl are found, e.g. when only header-only libraries are installed! - AS_CASE([${host_cpu}], - [x86_64],[libsubdirs="lib64 libx32 lib lib64"], - [mips*64*],[libsubdirs="lib64 lib32 lib lib64"], - [ppc64|powerpc64|s390x|sparc64|aarch64|ppc64le|powerpc64le|riscv64|e2k],[libsubdirs="lib64 lib lib64"], - [libsubdirs="lib"] - ) - - dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give - dnl them priority over the other paths since, if libs are found there, they - dnl are almost assuredly the ones desired. - AS_CASE([${host_cpu}], - [i?86],[multiarch_libsubdir="lib/i386-${host_os}"], - [armv7l],[multiarch_libsubdir="lib/arm-${host_os}"], - [multiarch_libsubdir="lib/${host_cpu}-${host_os}"] - ) - - dnl first we check the system location for boost libraries - dnl this location is chosen if boost libraries are installed with the --layout=system option - dnl or if you install boost with RPM - AS_IF([test "x$_AX_BOOST_BASE_boost_path" != "x"],[ - AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) includes in "$_AX_BOOST_BASE_boost_path/include"]) - AS_IF([test -d "$_AX_BOOST_BASE_boost_path/include" && test -r "$_AX_BOOST_BASE_boost_path/include"],[ - AC_MSG_RESULT([yes]) - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include" - for _AX_BOOST_BASE_boost_path_tmp in $multiarch_libsubdir $libsubdirs; do - AC_MSG_CHECKING([for boostlib >= $1 ($WANT_BOOST_VERSION) lib path in "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp"]) - AS_IF([test -d "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" && test -r "$_AX_BOOST_BASE_boost_path/$_AX_BOOST_BASE_boost_path_tmp" ],[ - AC_MSG_RESULT([yes]) - break; - ], - [AC_MSG_RESULT([no])]) - done],[ - AC_MSG_RESULT([no])]) - ],[ - if test X"$cross_compiling" = Xyes; then - search_libsubdirs=$multiarch_libsubdir - else - search_libsubdirs="$multiarch_libsubdir $libsubdirs" - fi - for _AX_BOOST_BASE_boost_path_tmp in /usr /usr/local /opt /opt/local /opt/homebrew ; do - if test -d "$_AX_BOOST_BASE_boost_path_tmp/include/boost" && test -r "$_AX_BOOST_BASE_boost_path_tmp/include/boost" ; then - for libsubdir in $search_libsubdirs ; do - if ls "$_AX_BOOST_BASE_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path_tmp/include" - break; - fi - done - ]) - - AC_MSG_CHECKING([for Boost headers >= $1 ($WANT_BOOST_VERSION)]) - CPPFLAGS_SAVED="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - AC_REQUIRE([AC_PROG_CXX]) - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - - - - dnl if we found no boost with system layout we search for boost libraries - dnl built and installed without the --layout=system option or for a staged(not installed) version - if test "x$succeeded" != "xyes" ; then - CPPFLAGS="$CPPFLAGS_SAVED" - BOOST_CPPFLAGS= - - _version=0 - if test -n "$_AX_BOOST_BASE_boost_path" ; then - if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path"; then - for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "x$V_CHECK" = "x1" ; then - _version=$_version_tmp - fi - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path/include/boost-$VERSION_UNDERSCORE" - done - dnl if nothing found search for layout used in Windows distributions - if test -z "$BOOST_CPPFLAGS"; then - if test -d "$_AX_BOOST_BASE_boost_path/boost" && test -r "$_AX_BOOST_BASE_boost_path/boost"; then - BOOST_CPPFLAGS="-I$_AX_BOOST_BASE_boost_path" - fi - fi - fi - else - if test "x$cross_compiling" != "xyes" ; then - for _AX_BOOST_BASE_boost_path in /usr /usr/local /opt /opt/local /opt/homebrew ; do - if test -d "$_AX_BOOST_BASE_boost_path" && test -r "$_AX_BOOST_BASE_boost_path" ; then - for i in `ls -d $_AX_BOOST_BASE_boost_path/include/boost-* 2>/dev/null`; do - _version_tmp=`echo $i | sed "s#$_AX_BOOST_BASE_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'` - V_CHECK=`expr $_version_tmp \> $_version` - if test "x$V_CHECK" = "x1" ; then - _version=$_version_tmp - best_path=$_AX_BOOST_BASE_boost_path - fi - done - fi - done - - VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'` - BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE" - fi - - if test -n "$BOOST_ROOT" ; then - for libsubdir in $libsubdirs ; do - if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi - done - if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then - version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'` - stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'` - stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'` - V_CHECK=`expr $stage_version_shorten \>\= $_version` - if test "x$V_CHECK" = "x1" ; then - AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT) - BOOST_CPPFLAGS="-I$BOOST_ROOT" - fi - fi - fi - fi - - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - export CPPFLAGS - - AC_LANG_PUSH(C++) - AC_COMPILE_IFELSE([_AX_BOOST_BASE_PROGRAM($WANT_BOOST_VERSION)],[ - AC_MSG_RESULT(yes) - succeeded=yes - found_system=yes - ],[ - ]) - AC_LANG_POP([C++]) - fi - - if test "x$succeeded" != "xyes" ; then - if test "x$_version" = "x0" ; then - AC_MSG_NOTICE([[We could not detect the boost libraries (version $1 or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in . See http://randspringer.de/boost for more documentation.]]) - else - AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).]) - fi - # execute ACTION-IF-NOT-FOUND (if present): - ifelse([$3], , :, [$3]) - else - AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available]) - # execute ACTION-IF-FOUND (if present): - ifelse([$2], , :, [$2]) - fi - - CPPFLAGS="$CPPFLAGS_SAVED" -]) diff --git a/build-aux/m4/ax_check_compile_flag.m4 b/build-aux/m4/ax_check_compile_flag.m4 deleted file mode 100644 index bd753b34d7..0000000000 --- a/build-aux/m4/ax_check_compile_flag.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's compiler -# or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the current language's default -# flags (e.g. CFLAGS) when the check is done. The check is thus made with -# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to -# force the compiler to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_COMPILE_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_COMPILE_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ - ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" - AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_COMPILE_FLAGS diff --git a/build-aux/m4/ax_check_link_flag.m4 b/build-aux/m4/ax_check_link_flag.m4 deleted file mode 100644 index 03a30ce4c7..0000000000 --- a/build-aux/m4/ax_check_link_flag.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_link_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_LINK_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the linker or gives an error. -# (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the linker's default flags -# when the check is done. The check is thus made with the flags: "LDFLAGS -# EXTRA-FLAGS FLAG". This can for example be used to force the linker to -# issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_LINK_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{PREPROC,COMPILE}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_LINK_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_ldflags_$4_$1])dnl -AC_CACHE_CHECK([whether the linker accepts $1], CACHEVAR, [ - ax_check_save_flags=$LDFLAGS - LDFLAGS="$LDFLAGS $4 $1" - AC_LINK_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - LDFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_LINK_FLAGS diff --git a/build-aux/m4/ax_check_preproc_flag.m4 b/build-aux/m4/ax_check_preproc_flag.m4 deleted file mode 100644 index e43560fbd3..0000000000 --- a/build-aux/m4/ax_check_preproc_flag.m4 +++ /dev/null @@ -1,53 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_check_preproc_flag.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CHECK_PREPROC_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) -# -# DESCRIPTION -# -# Check whether the given FLAG works with the current language's -# preprocessor or gives an error. (Warnings, however, are ignored) -# -# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on -# success/failure. -# -# If EXTRA-FLAGS is defined, it is added to the preprocessor's default -# flags when the check is done. The check is thus made with the flags: -# "CPPFLAGS EXTRA-FLAGS FLAG". This can for example be used to force the -# preprocessor to issue an error when a bad flag is given. -# -# INPUT gives an alternative input source to AC_PREPROC_IFELSE. -# -# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this -# macro in sync with AX_CHECK_{COMPILE,LINK}_FLAG. -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# Copyright (c) 2011 Maarten Bosmans -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 6 - -AC_DEFUN([AX_CHECK_PREPROC_FLAG], -[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF -AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]cppflags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG preprocessor accepts $1], CACHEVAR, [ - ax_check_save_flags=$CPPFLAGS - CPPFLAGS="$CPPFLAGS $4 $1" - AC_PREPROC_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], - [AS_VAR_SET(CACHEVAR,[yes])], - [AS_VAR_SET(CACHEVAR,[no])]) - CPPFLAGS=$ax_check_save_flags]) -AS_VAR_IF(CACHEVAR,yes, - [m4_default([$2], :)], - [m4_default([$3], :)]) -AS_VAR_POPDEF([CACHEVAR])dnl -])dnl AX_CHECK_PREPROC_FLAGS diff --git a/build-aux/m4/ax_cxx_compile_stdcxx.m4 b/build-aux/m4/ax_cxx_compile_stdcxx.m4 deleted file mode 100644 index 51a35054d0..0000000000 --- a/build-aux/m4/ax_cxx_compile_stdcxx.m4 +++ /dev/null @@ -1,1005 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) -# -# DESCRIPTION -# -# Check for baseline language coverage in the compiler for the specified -# version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for -# the respective C++ standard version. -# -# The second argument, if specified, indicates whether you insist on an -# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. -# -std=c++11). If neither is specified, you get whatever works, with -# preference for no added switch, and then for an extended mode. -# -# The third argument, if specified 'mandatory' or if left unspecified, -# indicates that baseline support for the specified C++ standard is -# required and that the macro should error out if no mode with that -# support is found. If specified 'optional', then configuration proceeds -# regardless, after defining HAVE_CXX${VERSION} if and only if a -# supporting mode is found. -# -# LICENSE -# -# Copyright (c) 2008 Benjamin Kosnik -# Copyright (c) 2012 Zack Weinberg -# Copyright (c) 2013 Roy Stogner -# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov -# Copyright (c) 2015 Paul Norman -# Copyright (c) 2015 Moritz Klammler -# Copyright (c) 2016, 2018 Krzesimir Nowak -# Copyright (c) 2019 Enji Cooper -# Copyright (c) 2020 Jason Merrill -# Copyright (c) 2021 Jörn Heusipp -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 14 - -dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro -dnl (serial version number 13). - -AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl - m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], - [$1], [14], [ax_cxx_compile_alternatives="14 1y"], - [$1], [17], [ax_cxx_compile_alternatives="17 1z"], - [$1], [20], [ax_cxx_compile_alternatives="20"], - [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$2], [], [], - [$2], [ext], [], - [$2], [noext], [], - [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl - m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], - [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], - [$3], [optional], [ax_cxx_compile_cxx$1_required=false], - [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) - AC_LANG_PUSH([C++])dnl - ac_success=no - - m4_if([$2], [], [dnl - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [ax_cv_cxx_compile_cxx$1=yes], - [ax_cv_cxx_compile_cxx$1=no])]) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi]) - - m4_if([$2], [noext], [], [dnl - if test x$ac_success = xno; then - for alternative in ${ax_cxx_compile_alternatives}; do - switch="-std=gnu++${alternative}" - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - fi]) - - m4_if([$2], [ext], [], [dnl - if test x$ac_success = xno; then - dnl HP's aCC needs +std=c++11 according to: - dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf - dnl Cray's crayCC needs "-h std=c++11" - for alternative in ${ax_cxx_compile_alternatives}; do - for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do - cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - [ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], - [eval $cachevar=yes], - [eval $cachevar=no]) - CXX="$ac_save_CXX"]) - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - if test -n "$CXXCPP" ; then - CXXCPP="$CXXCPP $switch" - fi - ac_success=yes - break - fi - done - if test x$ac_success = xyes; then - break - fi - done - fi]) - AC_LANG_POP([C++]) - if test x$ax_cxx_compile_cxx$1_required = xtrue; then - if test x$ac_success = xno; then - AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) - fi - fi - if test x$ac_success = xno; then - HAVE_CXX$1=0 - AC_MSG_NOTICE([No compiler with C++$1 support was found]) - else - HAVE_CXX$1=1 - AC_DEFINE(HAVE_CXX$1,1, - [define if the compiler supports basic C++$1 syntax]) - fi - AC_SUBST(HAVE_CXX$1) -]) - - -dnl Test body for checking C++11 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 -) - -dnl Test body for checking C++14 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 -) - -dnl Test body for checking C++17 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 -) - -dnl Test body for checking C++20 support - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_20], - _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 - _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 -) - - -dnl Tests for new features in C++11 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ - -// If the compiler admits that it is not ready for C++11, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201103L - -#error "This is not a C++11 compiler" - -#else - -namespace cxx11 -{ - - namespace test_static_assert - { - - template - struct check - { - static_assert(sizeof(int) <= sizeof(T), "not big enough"); - }; - - } - - namespace test_final_override - { - - struct Base - { - virtual ~Base() {} - virtual void f() {} - }; - - struct Derived : public Base - { - virtual ~Derived() override {} - virtual void f() override {} - }; - - } - - namespace test_double_right_angle_brackets - { - - template < typename T > - struct check {}; - - typedef check single_type; - typedef check> double_type; - typedef check>> triple_type; - typedef check>>> quadruple_type; - - } - - namespace test_decltype - { - - int - f() - { - int a = 1; - decltype(a) b = 2; - return a + b; - } - - } - - namespace test_type_deduction - { - - template < typename T1, typename T2 > - struct is_same - { - static const bool value = false; - }; - - template < typename T > - struct is_same - { - static const bool value = true; - }; - - template < typename T1, typename T2 > - auto - add(T1 a1, T2 a2) -> decltype(a1 + a2) - { - return a1 + a2; - } - - int - test(const int c, volatile int v) - { - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == false, ""); - auto ac = c; - auto av = v; - auto sumi = ac + av + 'x'; - auto sumf = ac + av + 1.0; - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == true, ""); - static_assert(is_same::value == false, ""); - static_assert(is_same::value == true, ""); - return (sumf > 0.0) ? sumi : add(c, v); - } - - } - - namespace test_noexcept - { - - int f() { return 0; } - int g() noexcept { return 0; } - - static_assert(noexcept(f()) == false, ""); - static_assert(noexcept(g()) == true, ""); - - } - - namespace test_constexpr - { - - template < typename CharT > - unsigned long constexpr - strlen_c_r(const CharT *const s, const unsigned long acc) noexcept - { - return *s ? strlen_c_r(s + 1, acc + 1) : acc; - } - - template < typename CharT > - unsigned long constexpr - strlen_c(const CharT *const s) noexcept - { - return strlen_c_r(s, 0UL); - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("1") == 1UL, ""); - static_assert(strlen_c("example") == 7UL, ""); - static_assert(strlen_c("another\0example") == 7UL, ""); - - } - - namespace test_rvalue_references - { - - template < int N > - struct answer - { - static constexpr int value = N; - }; - - answer<1> f(int&) { return answer<1>(); } - answer<2> f(const int&) { return answer<2>(); } - answer<3> f(int&&) { return answer<3>(); } - - void - test() - { - int i = 0; - const int c = 0; - static_assert(decltype(f(i))::value == 1, ""); - static_assert(decltype(f(c))::value == 2, ""); - static_assert(decltype(f(0))::value == 3, ""); - } - - } - - namespace test_uniform_initialization - { - - struct test - { - static const int zero {}; - static const int one {1}; - }; - - static_assert(test::zero == 0, ""); - static_assert(test::one == 1, ""); - - } - - namespace test_lambdas - { - - void - test1() - { - auto lambda1 = [](){}; - auto lambda2 = lambda1; - lambda1(); - lambda2(); - } - - int - test2() - { - auto a = [](int i, int j){ return i + j; }(1, 2); - auto b = []() -> int { return '0'; }(); - auto c = [=](){ return a + b; }(); - auto d = [&](){ return c; }(); - auto e = [a, &b](int x) mutable { - const auto identity = [](int y){ return y; }; - for (auto i = 0; i < a; ++i) - a += b--; - return x + identity(a + b); - }(0); - return a + b + c + d + e; - } - - int - test3() - { - const auto nullary = [](){ return 0; }; - const auto unary = [](int x){ return x; }; - using nullary_t = decltype(nullary); - using unary_t = decltype(unary); - const auto higher1st = [](nullary_t f){ return f(); }; - const auto higher2nd = [unary](nullary_t f1){ - return [unary, f1](unary_t f2){ return f2(unary(f1())); }; - }; - return higher1st(nullary) + higher2nd(nullary)(unary); - } - - } - - namespace test_variadic_templates - { - - template - struct sum; - - template - struct sum - { - static constexpr auto value = N0 + sum::value; - }; - - template <> - struct sum<> - { - static constexpr auto value = 0; - }; - - static_assert(sum<>::value == 0, ""); - static_assert(sum<1>::value == 1, ""); - static_assert(sum<23>::value == 23, ""); - static_assert(sum<1, 2>::value == 3, ""); - static_assert(sum<5, 5, 11>::value == 21, ""); - static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); - - } - - // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae - // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function - // because of this. - namespace test_template_alias_sfinae - { - - struct foo {}; - - template - using member = typename T::member_type; - - template - void func(...) {} - - template - void func(member*) {} - - void test(); - - void test() { func(0); } - - } - -} // namespace cxx11 - -#endif // __cplusplus >= 201103L - -]]) - - -dnl Tests for new features in C++14 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ - -// If the compiler admits that it is not ready for C++14, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201402L - -#error "This is not a C++14 compiler" - -#else - -namespace cxx14 -{ - - namespace test_polymorphic_lambdas - { - - int - test() - { - const auto lambda = [](auto&&... args){ - const auto istiny = [](auto x){ - return (sizeof(x) == 1UL) ? 1 : 0; - }; - const int aretiny[] = { istiny(args)... }; - return aretiny[0]; - }; - return lambda(1, 1L, 1.0f, '1'); - } - - } - - namespace test_binary_literals - { - - constexpr auto ivii = 0b0000000000101010; - static_assert(ivii == 42, "wrong value"); - - } - - namespace test_generalized_constexpr - { - - template < typename CharT > - constexpr unsigned long - strlen_c(const CharT *const s) noexcept - { - auto length = 0UL; - for (auto p = s; *p; ++p) - ++length; - return length; - } - - static_assert(strlen_c("") == 0UL, ""); - static_assert(strlen_c("x") == 1UL, ""); - static_assert(strlen_c("test") == 4UL, ""); - static_assert(strlen_c("another\0test") == 7UL, ""); - - } - - namespace test_lambda_init_capture - { - - int - test() - { - auto x = 0; - const auto lambda1 = [a = x](int b){ return a + b; }; - const auto lambda2 = [a = lambda1(x)](){ return a; }; - return lambda2(); - } - - } - - namespace test_digit_separators - { - - constexpr auto ten_million = 100'000'000; - static_assert(ten_million == 100000000, ""); - - } - - namespace test_return_type_deduction - { - - auto f(int& x) { return x; } - decltype(auto) g(int& x) { return x; } - - template < typename T1, typename T2 > - struct is_same - { - static constexpr auto value = false; - }; - - template < typename T > - struct is_same - { - static constexpr auto value = true; - }; - - int - test() - { - auto x = 0; - static_assert(is_same::value, ""); - static_assert(is_same::value, ""); - return x; - } - - } - -} // namespace cxx14 - -#endif // __cplusplus >= 201402L - -]]) - - -dnl Tests for new features in C++17 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ - -// If the compiler admits that it is not ready for C++17, why torture it? -// Hopefully, this will speed up the test. - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 201703L - -#error "This is not a C++17 compiler" - -#else - -#include -#include -#include - -namespace cxx17 -{ - - namespace test_constexpr_lambdas - { - - constexpr int foo = [](){return 42;}(); - - } - - namespace test::nested_namespace::definitions - { - - } - - namespace test_fold_expression - { - - template - int multiply(Args... args) - { - return (args * ... * 1); - } - - template - bool all(Args... args) - { - return (args && ...); - } - - } - - namespace test_extended_static_assert - { - - static_assert (true); - - } - - namespace test_auto_brace_init_list - { - - auto foo = {5}; - auto bar {5}; - - static_assert(std::is_same, decltype(foo)>::value); - static_assert(std::is_same::value); - } - - namespace test_typename_in_template_template_parameter - { - - template typename X> struct D; - - } - - namespace test_fallthrough_nodiscard_maybe_unused_attributes - { - - int f1() - { - return 42; - } - - [[nodiscard]] int f2() - { - [[maybe_unused]] auto unused = f1(); - - switch (f1()) - { - case 17: - f1(); - [[fallthrough]]; - case 42: - f1(); - } - return f1(); - } - - } - - namespace test_extended_aggregate_initialization - { - - struct base1 - { - int b1, b2 = 42; - }; - - struct base2 - { - base2() { - b3 = 42; - } - int b3; - }; - - struct derived : base1, base2 - { - int d; - }; - - derived d1 {{1, 2}, {}, 4}; // full initialization - derived d2 {{}, {}, 4}; // value-initialized bases - - } - - namespace test_general_range_based_for_loop - { - - struct iter - { - int i; - - int& operator* () - { - return i; - } - - const int& operator* () const - { - return i; - } - - iter& operator++() - { - ++i; - return *this; - } - }; - - struct sentinel - { - int i; - }; - - bool operator== (const iter& i, const sentinel& s) - { - return i.i == s.i; - } - - bool operator!= (const iter& i, const sentinel& s) - { - return !(i == s); - } - - struct range - { - iter begin() const - { - return {0}; - } - - sentinel end() const - { - return {5}; - } - }; - - void f() - { - range r {}; - - for (auto i : r) - { - [[maybe_unused]] auto v = i; - } - } - - } - - namespace test_lambda_capture_asterisk_this_by_value - { - - struct t - { - int i; - int foo() - { - return [*this]() - { - return i; - }(); - } - }; - - } - - namespace test_enum_class_construction - { - - enum class byte : unsigned char - {}; - - byte foo {42}; - - } - - namespace test_constexpr_if - { - - template - int f () - { - if constexpr(cond) - { - return 13; - } - else - { - return 42; - } - } - - } - - namespace test_selection_statement_with_initializer - { - - int f() - { - return 13; - } - - int f2() - { - if (auto i = f(); i > 0) - { - return 3; - } - - switch (auto i = f(); i + 4) - { - case 17: - return 2; - - default: - return 1; - } - } - - } - - namespace test_template_argument_deduction_for_class_templates - { - - template - struct pair - { - pair (T1 p1, T2 p2) - : m1 {p1}, - m2 {p2} - {} - - T1 m1; - T2 m2; - }; - - void f() - { - [[maybe_unused]] auto p = pair{13, 42u}; - } - - } - - namespace test_non_type_auto_template_parameters - { - - template - struct B - {}; - - B<5> b1; - B<'a'> b2; - - } - - namespace test_structured_bindings - { - - int arr[2] = { 1, 2 }; - std::pair pr = { 1, 2 }; - - auto f1() -> int(&)[2] - { - return arr; - } - - auto f2() -> std::pair& - { - return pr; - } - - struct S - { - int x1 : 2; - volatile double y1; - }; - - S f3() - { - return {}; - } - - auto [ x1, y1 ] = f1(); - auto& [ xr1, yr1 ] = f1(); - auto [ x2, y2 ] = f2(); - auto& [ xr2, yr2 ] = f2(); - const auto [ x3, y3 ] = f3(); - - } - - namespace test_exception_spec_type_system - { - - struct Good {}; - struct Bad {}; - - void g1() noexcept; - void g2(); - - template - Bad - f(T*, T*); - - template - Good - f(T1*, T2*); - - static_assert (std::is_same_v); - - } - - namespace test_inline_variables - { - - template void f(T) - {} - - template inline T g(T) - { - return T{}; - } - - template<> inline void f<>(int) - {} - - template<> int g<>(int) - { - return 5; - } - - } - -} // namespace cxx17 - -#endif // __cplusplus < 201703L - -]]) - - -dnl Tests for new features in C++20 - -m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_20], [[ - -#ifndef __cplusplus - -#error "This is not a C++ compiler" - -#elif __cplusplus < 202002L - -#error "This is not a C++20 compiler" - -#else - -#include - -namespace cxx20 -{ - -// As C++20 supports feature test macros in the standard, there is no -// immediate need to actually test for feature availability on the -// Autoconf side. - -} // namespace cxx20 - -#endif // __cplusplus < 202002L - -]]) diff --git a/build-aux/m4/ax_pthread.m4 b/build-aux/m4/ax_pthread.m4 deleted file mode 100644 index 9f35d13914..0000000000 --- a/build-aux/m4/ax_pthread.m4 +++ /dev/null @@ -1,522 +0,0 @@ -# =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is -# needed for multi-threaded programs (defaults to the value of CC -# respectively CXX otherwise). (This is necessary on e.g. AIX to use the -# special cc_r/CC_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also to link with them as well. For example, you might link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threaded programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# CXX="$PTHREAD_CXX" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to -# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# Also HAVE_PTHREAD_PRIO_INHERIT is defined if pthread is found and the -# PTHREAD_PRIO_INHERIT symbol is defined when compiling with -# PTHREAD_CFLAGS. -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# Updated for Autoconf 2.68 by Daniel Richard G. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# Copyright (c) 2011 Daniel Richard G. -# Copyright (c) 2019 Marc Stevens -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -#serial 31 - -AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) -AC_DEFUN([AX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_CC]) -AC_REQUIRE([AC_PROG_SED]) -AC_LANG_PUSH([C]) -ax_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on Tru64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then - ax_pthread_save_CC="$CC" - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) - AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"]) - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_join])], [ax_pthread_ok=yes]) - AC_MSG_RESULT([$ax_pthread_ok]) - if test "x$ax_pthread_ok" = "xno"; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - CC="$ax_pthread_save_CC" - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items with a "," contain both -# C compiler flags (before ",") and linker flags (after ","). Other items -# starting with a "-" are C compiler flags, and remaining items are -# library names, except for "none" which indicates that we try without -# any flags at all, and "pthread-config" which is a program returning -# the flags for the Pth emulation library. - -ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads), Tru64 -# (Note: HP C rejects this with "bad form for `-t' option") -# -pthreads: Solaris/gcc (Note: HP C also rejects) -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads and -# -D_REENTRANT too), HP C (must be checked before -lpthread, which -# is present but should not be used directly; and before -mthreads, -# because the compiler interprets this as "-mt" + "-hreads") -# -mthreads: Mingw32/gcc, Lynx/gcc -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case $host_os in - - freebsd*) - - # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) - # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) - - ax_pthread_flags="-kthread lthread $ax_pthread_flags" - ;; - - hpux*) - - # From the cc(1) man page: "[-mt] Sets various -D flags to enable - # multi-threading and also sets -lpthread." - - ax_pthread_flags="-mt -pthread pthread $ax_pthread_flags" - ;; - - openedition*) - - # IBM z/OS requires a feature-test macro to be defined in order to - # enable POSIX threads at all, so give the user a hint if this is - # not set. (We don't define these ourselves, as they can affect - # other portions of the system API in unpredictable ways.) - - AC_EGREP_CPP([AX_PTHREAD_ZOS_MISSING], - [ -# if !defined(_OPEN_THREADS) && !defined(_UNIX03_THREADS) - AX_PTHREAD_ZOS_MISSING -# endif - ], - [AC_MSG_WARN([IBM z/OS requires -D_OPEN_THREADS or -D_UNIX03_THREADS to enable pthreads support.])]) - ;; - - solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (N.B.: The stubs are missing - # pthread_cleanup_push, or rather a function called by this macro, - # so we could check for that, but who knows whether they'll stub - # that too in a future libc.) So we'll check first for the - # standard Solaris way of linking pthreads (-mt -lpthread). - - ax_pthread_flags="-mt,-lpthread pthread $ax_pthread_flags" - ;; -esac - -# Are we compiling with Clang? - -AC_CACHE_CHECK([whether $CC is Clang], - [ax_cv_PTHREAD_CLANG], - [ax_cv_PTHREAD_CLANG=no - # Note that Autoconf sets GCC=yes for Clang as well as GCC - if test "x$GCC" = "xyes"; then - AC_EGREP_CPP([AX_PTHREAD_CC_IS_CLANG], - [/* Note: Clang 2.7 lacks __clang_[a-z]+__ */ -# if defined(__clang__) && defined(__llvm__) - AX_PTHREAD_CC_IS_CLANG -# endif - ], - [ax_cv_PTHREAD_CLANG=yes]) - fi - ]) -ax_pthread_clang="$ax_cv_PTHREAD_CLANG" - - -# GCC generally uses -pthread, or -pthreads on some platforms (e.g. SPARC) - -# Note that for GCC and Clang -pthread generally implies -lpthread, -# except when -nostdlib is passed. -# This is problematic using libtool to build C++ shared libraries with pthread: -# [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460 -# [2] https://bugzilla.redhat.com/show_bug.cgi?id=661333 -# [3] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=468555 -# To solve this, first try -pthread together with -lpthread for GCC - -AS_IF([test "x$GCC" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread -pthreads $ax_pthread_flags"]) - -# Clang takes -pthread (never supported any other flag), but we'll try with -lpthread first - -AS_IF([test "x$ax_pthread_clang" = "xyes"], - [ax_pthread_flags="-pthread,-lpthread -pthread"]) - - -# The presence of a feature test macro requesting re-entrant function -# definitions is, on some systems, a strong hint that pthreads support is -# correctly enabled - -case $host_os in - darwin* | hpux* | linux* | osf* | solaris*) - ax_pthread_check_macro="_REENTRANT" - ;; - - aix*) - ax_pthread_check_macro="_THREAD_SAFE" - ;; - - *) - ax_pthread_check_macro="--" - ;; -esac -AS_IF([test "x$ax_pthread_check_macro" = "x--"], - [ax_pthread_check_cond=0], - [ax_pthread_check_cond="!defined($ax_pthread_check_macro)"]) - - -if test "x$ax_pthread_ok" = "xno"; then -for ax_pthread_try_flag in $ax_pthread_flags; do - - case $ax_pthread_try_flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - *,*) - PTHREAD_CFLAGS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\1/"` - PTHREAD_LIBS=`echo $ax_pthread_try_flag | sed "s/^\(.*\),\(.*\)$/\2/"` - AC_MSG_CHECKING([whether pthreads work with "$PTHREAD_CFLAGS" and "$PTHREAD_LIBS"]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $ax_pthread_try_flag]) - PTHREAD_CFLAGS="$ax_pthread_try_flag" - ;; - - pthread-config) - AC_CHECK_PROG([ax_pthread_config], [pthread-config], [yes], [no]) - AS_IF([test "x$ax_pthread_config" = "xno"], [continue]) - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$ax_pthread_try_flag]) - PTHREAD_LIBS="-l$ax_pthread_try_flag" - ;; - esac - - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include -# if $ax_pthread_check_cond -# error "$ax_pthread_check_macro must be defined" -# endif - static void *some_global = NULL; - static void routine(void *a) - { - /* To avoid any unused-parameter or - unused-but-set-parameter warning. */ - some_global = a; - } - static void *start_routine(void *a) { return a; }], - [pthread_t th; pthread_attr_t attr; - pthread_create(&th, 0, start_routine, 0); - pthread_join(th, 0); - pthread_attr_init(&attr); - pthread_cleanup_push(routine, 0); - pthread_cleanup_pop(0) /* ; */])], - [ax_pthread_ok=yes], - []) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - AC_MSG_RESULT([$ax_pthread_ok]) - AS_IF([test "x$ax_pthread_ok" = "xyes"], [break]) - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - - -# Clang needs special handling, because older versions handle the -pthread -# option in a rather... idiosyncratic way - -if test "x$ax_pthread_clang" = "xyes"; then - - # Clang takes -pthread; it has never supported any other flag - - # (Note 1: This will need to be revisited if a system that Clang - # supports has POSIX threads in a separate library. This tends not - # to be the way of modern systems, but it's conceivable.) - - # (Note 2: On some systems, notably Darwin, -pthread is not needed - # to get POSIX threads support; the API is always present and - # active. We could reasonably leave PTHREAD_CFLAGS empty. But - # -pthread does define _REENTRANT, and while the Darwin headers - # ignore this macro, third-party headers might not.) - - # However, older versions of Clang make a point of warning the user - # that, in an invocation where only linking and no compilation is - # taking place, the -pthread option has no effect ("argument unused - # during compilation"). They expect -pthread to be passed in only - # when source code is being compiled. - # - # Problem is, this is at odds with the way Automake and most other - # C build frameworks function, which is that the same flags used in - # compilation (CFLAGS) are also used in linking. Many systems - # supported by AX_PTHREAD require exactly this for POSIX threads - # support, and in fact it is often not straightforward to specify a - # flag that is used only in the compilation phase and not in - # linking. Such a scenario is extremely rare in practice. - # - # Even though use of the -pthread flag in linking would only print - # a warning, this can be a nuisance for well-run software projects - # that build with -Werror. So if the active version of Clang has - # this misfeature, we search for an option to squash it. - - AC_CACHE_CHECK([whether Clang needs flag to prevent "argument unused" warning when linking with -pthread], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG], - [ax_cv_PTHREAD_CLANG_NO_WARN_FLAG=unknown - # Create an alternate version of $ac_link that compiles and - # links in two steps (.c -> .o, .o -> exe) instead of one - # (.c -> exe), because the warning occurs only in the second - # step - ax_pthread_save_ac_link="$ac_link" - ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' - ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` - ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" - ax_pthread_save_CFLAGS="$CFLAGS" - for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do - AS_IF([test "x$ax_pthread_try" = "xunknown"], [break]) - CFLAGS="-Werror -Wunknown-warning-option $ax_pthread_try -pthread $ax_pthread_save_CFLAGS" - ac_link="$ax_pthread_save_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [ac_link="$ax_pthread_2step_ac_link" - AC_LINK_IFELSE([AC_LANG_SOURCE([[int main(void){return 0;}]])], - [break]) - ]) - done - ac_link="$ax_pthread_save_ac_link" - CFLAGS="$ax_pthread_save_CFLAGS" - AS_IF([test "x$ax_pthread_try" = "x"], [ax_pthread_try=no]) - ax_cv_PTHREAD_CLANG_NO_WARN_FLAG="$ax_pthread_try" - ]) - - case "$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG" in - no | unknown) ;; - *) PTHREAD_CFLAGS="$ax_cv_PTHREAD_CLANG_NO_WARN_FLAG $PTHREAD_CFLAGS" ;; - esac - -fi # $ax_pthread_clang = yes - - - -# Various other checks: -if test "x$ax_pthread_ok" = "xyes"; then - ax_pthread_save_CFLAGS="$CFLAGS" - ax_pthread_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_CACHE_CHECK([for joinable pthread attribute], - [ax_cv_PTHREAD_JOINABLE_ATTR], - [ax_cv_PTHREAD_JOINABLE_ATTR=unknown - for ax_pthread_attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], - [int attr = $ax_pthread_attr; return attr /* ; */])], - [ax_cv_PTHREAD_JOINABLE_ATTR=$ax_pthread_attr; break], - []) - done - ]) - AS_IF([test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xunknown" && \ - test "x$ax_cv_PTHREAD_JOINABLE_ATTR" != "xPTHREAD_CREATE_JOINABLE" && \ - test "x$ax_pthread_joinable_attr_defined" != "xyes"], - [AC_DEFINE_UNQUOTED([PTHREAD_CREATE_JOINABLE], - [$ax_cv_PTHREAD_JOINABLE_ATTR], - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - ax_pthread_joinable_attr_defined=yes - ]) - - AC_CACHE_CHECK([whether more special flags are required for pthreads], - [ax_cv_PTHREAD_SPECIAL_FLAGS], - [ax_cv_PTHREAD_SPECIAL_FLAGS=no - case $host_os in - solaris*) - ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" - ;; - esac - ]) - AS_IF([test "x$ax_cv_PTHREAD_SPECIAL_FLAGS" != "xno" && \ - test "x$ax_pthread_special_flags_added" != "xyes"], - [PTHREAD_CFLAGS="$ax_cv_PTHREAD_SPECIAL_FLAGS $PTHREAD_CFLAGS" - ax_pthread_special_flags_added=yes]) - - AC_CACHE_CHECK([for PTHREAD_PRIO_INHERIT], - [ax_cv_PTHREAD_PRIO_INHERIT], - [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int i = PTHREAD_PRIO_INHERIT; - return i;]])], - [ax_cv_PTHREAD_PRIO_INHERIT=yes], - [ax_cv_PTHREAD_PRIO_INHERIT=no]) - ]) - AS_IF([test "x$ax_cv_PTHREAD_PRIO_INHERIT" = "xyes" && \ - test "x$ax_pthread_prio_inherit_defined" != "xyes"], - [AC_DEFINE([HAVE_PTHREAD_PRIO_INHERIT], [1], [Have PTHREAD_PRIO_INHERIT.]) - ax_pthread_prio_inherit_defined=yes - ]) - - CFLAGS="$ax_pthread_save_CFLAGS" - LIBS="$ax_pthread_save_LIBS" - - # More AIX lossage: compile with *_r variant - if test "x$GCC" != "xyes"; then - case $host_os in - aix*) - AS_CASE(["x/$CC"], - [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], - [#handle absolute path differently from PATH based program lookup - AS_CASE(["x$CC"], - [x/*], - [ - AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) - AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])]) - ], - [ - AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC]) - AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])]) - ] - ) - ]) - ;; - esac - fi -fi - -test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" -test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX" - -AC_SUBST([PTHREAD_LIBS]) -AC_SUBST([PTHREAD_CFLAGS]) -AC_SUBST([PTHREAD_CC]) -AC_SUBST([PTHREAD_CXX]) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test "x$ax_pthread_ok" = "xyes"; then - ifelse([$1],,[AC_DEFINE([HAVE_PTHREAD],[1],[Define if you have POSIX threads libraries and header files.])],[$1]) - : -else - ax_pthread_ok=no - $2 -fi -AC_LANG_POP -])dnl AX_PTHREAD diff --git a/build-aux/m4/bitcoin_find_bdb48.m4 b/build-aux/m4/bitcoin_find_bdb48.m4 deleted file mode 100644 index 3ef7fab5b5..0000000000 --- a/build-aux/m4/bitcoin_find_bdb48.m4 +++ /dev/null @@ -1,97 +0,0 @@ -dnl Copyright (c) 2013-2015 The Bitcoin Core developers -dnl Distributed under the MIT software license, see the accompanying -dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. - -AC_DEFUN([BITCOIN_FIND_BDB48],[ - AC_ARG_VAR([BDB_CFLAGS], [C compiler flags for BerkeleyDB, bypasses autodetection]) - AC_ARG_VAR([BDB_LIBS], [Linker flags for BerkeleyDB, bypasses autodetection]) - - if test "$use_bdb" = "no"; then - use_bdb=no - elif test "$BDB_CFLAGS" = ""; then - AC_MSG_CHECKING([for Berkeley DB C++ headers]) - BDB_CPPFLAGS= - bdbpath=X - bdb48path=X - bdbdirlist= - for _vn in 4.8 48 4 5 5.3 ''; do - for _pfx in b lib ''; do - bdbdirlist="$bdbdirlist ${_pfx}db${_vn}" - done - done - for searchpath in $bdbdirlist ''; do - test -n "${searchpath}" && searchpath="${searchpath}/" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <${searchpath}db_cxx.h> - ]],[[ - #if !((DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR >= 8) || DB_VERSION_MAJOR > 4) - #error "failed to find bdb 4.8+" - #endif - ]])],[ - if test "$bdbpath" = "X"; then - bdbpath="${searchpath}" - fi - ],[ - continue - ]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include <${searchpath}db_cxx.h> - ]],[[ - #if !(DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR == 8) - #error "failed to find bdb 4.8" - #endif - ]])],[ - bdb48path="${searchpath}" - break - ],[]) - done - if test "$bdbpath" = "X"; then - use_bdb=no - AC_MSG_RESULT([no]) - AC_MSG_WARN([libdb_cxx headers missing]) - AC_MSG_WARN(AC_PACKAGE_NAME[ requires this library for BDB (legacy) wallet support]) - AC_MSG_WARN([Passing --without-bdb will suppress this warning]) - elif test "$bdb48path" = "X"; then - BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdbpath}],db_cxx) - AC_ARG_WITH([incompatible-bdb],[AS_HELP_STRING([--with-incompatible-bdb], [allow using a bdb version other than 4.8])],[ - AC_MSG_WARN([Found Berkeley DB other than 4.8]) - AC_MSG_WARN([BDB (legacy) wallets opened by this build will not be portable!]) - use_bdb=yes - ],[ - AC_MSG_WARN([Found Berkeley DB other than 4.8]) - AC_MSG_WARN([BDB (legacy) wallets opened by this build would not be portable!]) - AC_MSG_WARN([If this is intended, pass --with-incompatible-bdb]) - AC_MSG_WARN([Passing --without-bdb will suppress this warning]) - use_bdb=no - ]) - else - BITCOIN_SUBDIR_TO_INCLUDE(BDB_CPPFLAGS,[${bdb48path}],db_cxx) - bdbpath="${bdb48path}" - use_bdb=yes - fi - else - BDB_CPPFLAGS=${BDB_CFLAGS} - fi - AC_SUBST(BDB_CPPFLAGS) - - if test "$use_bdb" = "no"; then - use_bdb=no - elif test "$BDB_LIBS" = ""; then - # TODO: Ideally this could find the library version and make sure it matches the headers being used - for searchlib in db_cxx-4.8 db_cxx db4_cxx; do - AC_CHECK_LIB([$searchlib],[main],[ - BDB_LIBS="-l${searchlib}" - break - ]) - done - if test "$BDB_LIBS" = ""; then - AC_MSG_WARN([libdb_cxx headers missing]) - AC_MSG_WARN(AC_PACKAGE_NAME[ requires this library for BDB (legacy) wallet support]) - AC_MSG_WARN([Passing --without-bdb will suppress this warning]) - fi - fi - if test "$use_bdb" != "no"; then - AC_DEFINE([USE_BDB], [1], [Define if BDB support should be compiled in]) - use_bdb=yes - fi -]) diff --git a/build-aux/m4/bitcoin_qt.m4 b/build-aux/m4/bitcoin_qt.m4 deleted file mode 100644 index a716cd9a27..0000000000 --- a/build-aux/m4/bitcoin_qt.m4 +++ /dev/null @@ -1,397 +0,0 @@ -dnl Copyright (c) 2013-2016 The Bitcoin Core developers -dnl Distributed under the MIT software license, see the accompanying -dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. - -dnl Helper for cases where a qt dependency is not met. -dnl Output: If qt version is auto, set bitcoin_enable_qt to false. Else, exit. -AC_DEFUN([BITCOIN_QT_FAIL],[ - if test "$bitcoin_qt_want_version" = "auto" && test "$bitcoin_qt_force" != "yes"; then - if test "$bitcoin_enable_qt" != "no"; then - AC_MSG_WARN([$1; bitcoin-qt frontend will not be built]) - fi - bitcoin_enable_qt=no - bitcoin_enable_qt_test=no - else - AC_MSG_ERROR([$1]) - fi -]) - -AC_DEFUN([BITCOIN_QT_CHECK],[ - if test "$bitcoin_enable_qt" != "no" && test "$bitcoin_qt_want_version" != "no"; then - true - $1 - else - true - $2 - fi -]) - -dnl BITCOIN_QT_PATH_PROGS([FOO], [foo foo2], [/path/to/search/first], [continue if missing]) -dnl Helper for finding the path of programs needed for Qt. -dnl Inputs: $1: Variable to be set -dnl Inputs: $2: List of programs to search for -dnl Inputs: $3: Look for $2 here before $PATH -dnl Inputs: $4: If "yes", don't fail if $2 is not found. -dnl Output: $1 is set to the path of $2 if found. $2 are searched in order. -AC_DEFUN([BITCOIN_QT_PATH_PROGS],[ - BITCOIN_QT_CHECK([ - if test "$3" != ""; then - AC_PATH_PROGS([$1], [$2], [], [$3]) - else - AC_PATH_PROGS([$1], [$2]) - fi - if test "$$1" = "" && test "$4" != "yes"; then - BITCOIN_QT_FAIL([$1 not found]) - fi - ]) -]) - -dnl Initialize qt input. -dnl This must be called before any other BITCOIN_QT* macros to ensure that -dnl input variables are set correctly. -dnl CAUTION: Do not use this inside of a conditional. -AC_DEFUN([BITCOIN_QT_INIT],[ - dnl enable qt support - AC_ARG_WITH([gui], - [AS_HELP_STRING([--with-gui@<:@=no|qt5|auto@:>@], - [build bitcoin-qt GUI (default=auto)])], - [ - bitcoin_qt_want_version=$withval - if test "$bitcoin_qt_want_version" = "yes"; then - bitcoin_qt_force=yes - bitcoin_qt_want_version=auto - fi - ], - [bitcoin_qt_want_version=auto]) - - AS_IF([test "$with_gui" = "qt5_debug"], - [AS_CASE([$host], - [*darwin*], [qt_lib_suffix=_debug], - [qt_lib_suffix= ]); bitcoin_qt_want_version=qt5], - [qt_lib_suffix= ]) - - AS_CASE([$host], [*android*], [qt_lib_suffix=_$ANDROID_ARCH]) - - AC_ARG_WITH([qt-incdir],[AS_HELP_STRING([--with-qt-incdir=INC_DIR],[specify qt include path (overridden by pkgconfig)])], [qt_include_path=$withval], []) - AC_ARG_WITH([qt-libdir],[AS_HELP_STRING([--with-qt-libdir=LIB_DIR],[specify qt lib path (overridden by pkgconfig)])], [qt_lib_path=$withval], []) - AC_ARG_WITH([qt-plugindir],[AS_HELP_STRING([--with-qt-plugindir=PLUGIN_DIR],[specify qt plugin path (overridden by pkgconfig)])], [qt_plugin_path=$withval], []) - AC_ARG_WITH([qt-translationdir],[AS_HELP_STRING([--with-qt-translationdir=PLUGIN_DIR],[specify qt translation path (overridden by pkgconfig)])], [qt_translation_path=$withval], []) - AC_ARG_WITH([qt-bindir],[AS_HELP_STRING([--with-qt-bindir=BIN_DIR],[specify qt bin path])], [qt_bin_path=$withval], []) - - AC_ARG_WITH([qtdbus], - [AS_HELP_STRING([--with-qtdbus], - [enable DBus support (default is yes if qt is enabled and QtDBus is found, except on Android)])], - [use_dbus=$withval], - [use_dbus=auto]) - - dnl Android doesn't support D-Bus and certainly doesn't use it for notifications - case $host in - *android*) - if test "$use_dbus" != "yes"; then - use_dbus=no - fi - ;; - esac - - AC_SUBST(QT_TRANSLATION_DIR,$qt_translation_path) -]) - -dnl Find Qt libraries and includes. -dnl -dnl BITCOIN_QT_CONFIGURE([MINIMUM-VERSION]) -dnl -dnl Outputs: See _BITCOIN_QT_FIND_LIBS -dnl Outputs: Sets variables for all qt-related tools. -dnl Outputs: bitcoin_enable_qt, bitcoin_enable_qt_dbus, bitcoin_enable_qt_test -AC_DEFUN([BITCOIN_QT_CONFIGURE],[ - qt_version=">= $1" - qt_lib_prefix="Qt5" - BITCOIN_QT_CHECK([_BITCOIN_QT_FIND_LIBS]) - - dnl This is ugly and complicated. Yuck. Works as follows: - dnl We check a header to find out whether Qt is built statically. - dnl When Qt is built statically, some plugins must be linked into - dnl the final binary as well. _BITCOIN_QT_CHECK_STATIC_PLUGIN does - dnl a quick link-check and appends the results to QT_LIBS. - BITCOIN_QT_CHECK([ - TEMP_CPPFLAGS=$CPPFLAGS - TEMP_CXXFLAGS=$CXXFLAGS - CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS" - CXXFLAGS="$PIC_FLAGS $CORE_CXXFLAGS $CXXFLAGS" - _BITCOIN_QT_IS_STATIC - if test "$bitcoin_cv_static_qt" = "yes"; then - _BITCOIN_QT_CHECK_STATIC_LIBS - - if test "$qt_plugin_path" != ""; then - if test -d "$qt_plugin_path/platforms"; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms" - fi - if test -d "$qt_plugin_path/styles"; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/styles" - fi - if test -d "$qt_plugin_path/accessible"; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/accessible" - fi - if test -d "$qt_plugin_path/platforms/android"; then - QT_LIBS="$QT_LIBS -L$qt_plugin_path/platforms/android -lqtfreetype -lEGL" - fi - fi - - AC_DEFINE([QT_STATICPLUGIN], [1], [Define this symbol if qt plugins are static]) - if test "$TARGET_OS" != "android"; then - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMinimalIntegrationPlugin], [-lqminimal]) - AC_DEFINE([QT_QPA_PLATFORM_MINIMAL], [1], [Define this symbol if the minimal qt platform exists]) - fi - if test "$TARGET_OS" = "windows"; then - dnl Linking against wtsapi32 is required. See #17749 and - dnl https://bugreports.qt.io/browse/QTBUG-27097. - AX_CHECK_LINK_FLAG([-lwtsapi32], [QT_LIBS="$QT_LIBS -lwtsapi32"], [AC_MSG_ERROR([could not link against -lwtsapi32])]) - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsIntegrationPlugin], [-lqwindows]) - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QWindowsVistaStylePlugin], [-lqwindowsvistastyle]) - AC_DEFINE([QT_QPA_PLATFORM_WINDOWS], [1], [Define this symbol if the qt platform is windows]) - elif test "$TARGET_OS" = "linux"; then - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QXcbIntegrationPlugin], [-lqxcb]) - AC_DEFINE([QT_QPA_PLATFORM_XCB], [1], [Define this symbol if the qt platform is xcb]) - elif test "$TARGET_OS" = "darwin"; then - AX_CHECK_LINK_FLAG([-framework Carbon], [QT_LIBS="$QT_LIBS -framework Carbon"], [AC_MSG_ERROR(could not link against Carbon framework)]) - AX_CHECK_LINK_FLAG([-framework IOSurface], [QT_LIBS="$QT_LIBS -framework IOSurface"], [AC_MSG_ERROR(could not link against IOSurface framework)]) - AX_CHECK_LINK_FLAG([-framework Metal], [QT_LIBS="$QT_LIBS -framework Metal"], [AC_MSG_ERROR(could not link against Metal framework)]) - AX_CHECK_LINK_FLAG([-framework QuartzCore], [QT_LIBS="$QT_LIBS -framework QuartzCore"], [AC_MSG_ERROR(could not link against QuartzCore framework)]) - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QCocoaIntegrationPlugin], [-lqcocoa]) - _BITCOIN_QT_CHECK_STATIC_PLUGIN([QMacStylePlugin], [-lqmacstyle]) - AC_DEFINE([QT_QPA_PLATFORM_COCOA], [1], [Define this symbol if the qt platform is cocoa]) - elif test "$TARGET_OS" = "android"; then - QT_LIBS="-Wl,--export-dynamic,--undefined=JNI_OnLoad -lplugins_platforms_qtforandroid${qt_lib_suffix} -ljnigraphics -landroid -lqtfreetype${qt_lib_suffix} $QT_LIBS" - AC_DEFINE([QT_QPA_PLATFORM_ANDROID], [1], [Define this symbol if the qt platform is android]) - fi - fi - CPPFLAGS=$TEMP_CPPFLAGS - CXXFLAGS=$TEMP_CXXFLAGS - ]) - - if test "$qt_bin_path" = ""; then - qt_bin_path="`$PKG_CONFIG --variable=host_bins ${qt_lib_prefix}Core 2>/dev/null`" - fi - - if test "$use_hardening" != "no"; then - BITCOIN_QT_CHECK([ - AC_MSG_CHECKING([whether -fPIE can be used with this Qt config]) - TEMP_CPPFLAGS=$CPPFLAGS - TEMP_CXXFLAGS=$CXXFLAGS - CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS" - CXXFLAGS="$PIE_FLAGS $CORE_CXXFLAGS $CXXFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if defined(QT_REDUCE_RELOCATIONS) - choke - #endif - ]])], - [ AC_MSG_RESULT([yes]); QT_PIE_FLAGS=$PIE_FLAGS ], - [ AC_MSG_RESULT([no]); QT_PIE_FLAGS=$PIC_FLAGS] - ) - CPPFLAGS=$TEMP_CPPFLAGS - CXXFLAGS=$TEMP_CXXFLAGS - ]) - else - BITCOIN_QT_CHECK([ - AC_MSG_CHECKING([whether -fPIC is needed with this Qt config]) - TEMP_CPPFLAGS=$CPPFLAGS - CPPFLAGS="$QT_INCLUDES $CORE_CPPFLAGS $CPPFLAGS" - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if defined(QT_REDUCE_RELOCATIONS) - choke - #endif - ]])], - [ AC_MSG_RESULT([no])], - [ AC_MSG_RESULT([yes]); QT_PIE_FLAGS=$PIC_FLAGS] - ) - CPPFLAGS=$TEMP_CPPFLAGS - ]) - fi - - BITCOIN_QT_PATH_PROGS([MOC], [moc-qt5 moc5 moc], $qt_bin_path) - BITCOIN_QT_PATH_PROGS([UIC], [uic-qt5 uic5 uic], $qt_bin_path) - BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt5 rcc5 rcc], $qt_bin_path) - BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt5 lrelease5 lrelease], $qt_bin_path) - BITCOIN_QT_PATH_PROGS([LUPDATE], [lupdate-qt5 lupdate5 lupdate],$qt_bin_path, yes) - BITCOIN_QT_PATH_PROGS([LCONVERT], [lconvert-qt5 lconvert5 lconvert], $qt_bin_path, yes) - - MOC_DEFS='-DHAVE_CONFIG_H -I$(srcdir)' - case $host in - *darwin*) - BITCOIN_QT_CHECK([ - MOC_DEFS="${MOC_DEFS} -DQ_OS_MAC" - base_frameworks="-framework Foundation -framework AppKit" - AX_CHECK_LINK_FLAG([$base_frameworks], [QT_LIBS="$QT_LIBS $base_frameworks"], [AC_MSG_ERROR(could not find base frameworks)]) - ]) - ;; - *mingw*) - BITCOIN_QT_CHECK([ - AX_CHECK_LINK_FLAG([-mwindows], [QT_LDFLAGS="$QT_LDFLAGS -mwindows"], [AC_MSG_WARN([-mwindows linker support not detected])]) - ]) - esac - - - dnl enable qt support - AC_MSG_CHECKING([whether to build ]AC_PACKAGE_NAME[ GUI]) - BITCOIN_QT_CHECK([ - bitcoin_enable_qt=yes - bitcoin_enable_qt_test=yes - if test "$have_qt_test" = "no"; then - bitcoin_enable_qt_test=no - fi - bitcoin_enable_qt_dbus=no - if test "$use_dbus" != "no" && test "$have_qt_dbus" = "yes"; then - bitcoin_enable_qt_dbus=yes - fi - if test "$use_dbus" = "yes" && test "$have_qt_dbus" = "no"; then - AC_MSG_ERROR([libQtDBus not found. Install libQtDBus or remove --with-qtdbus.]) - fi - if test "$LUPDATE" = ""; then - AC_MSG_WARN([lupdate tool is required to update Qt translations.]) - fi - if test "$LCONVERT" = ""; then - AC_MSG_WARN([lconvert tool is required to update Qt translations.]) - fi - ],[ - bitcoin_enable_qt=no - ]) - if test $bitcoin_enable_qt = "yes"; then - AC_MSG_RESULT([$bitcoin_enable_qt ($qt_lib_prefix)]) - else - AC_MSG_RESULT([$bitcoin_enable_qt]) - fi - - AC_SUBST(QT_PIE_FLAGS) - AC_SUBST(QT_INCLUDES) - AC_SUBST(QT_LIBS) - AC_SUBST(QT_LDFLAGS) - AC_SUBST(QT_DBUS_INCLUDES) - AC_SUBST(QT_TEST_INCLUDES) - AC_SUBST(QT_SELECT, qt5) - AC_SUBST(MOC_DEFS) -]) - -dnl All macros below are internal and should _not_ be used from configure.ac. - -dnl Internal. Check if the linked version of Qt was built statically. -dnl -dnl _BITCOIN_QT_IS_STATIC -dnl --------------------- -dnl -dnl Requires: INCLUDES and LIBS must be populated as necessary. -dnl Output: bitcoin_cv_static_qt=yes|no -AC_DEFUN([_BITCOIN_QT_IS_STATIC],[ - AC_CACHE_CHECK(for static Qt, bitcoin_cv_static_qt,[ - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #ifndef QT_VERSION - # include - #endif - ]], - [[ - #if !defined(QT_STATIC) - choke - #endif - ]])], - [bitcoin_cv_static_qt=yes], - [bitcoin_cv_static_qt=no]) - ]) -]) - -dnl Internal. Check if the link-requirements for a static plugin are met. -dnl -dnl _BITCOIN_QT_CHECK_STATIC_PLUGIN(PLUGIN, LIBRARIES) -dnl -------------------------------------------------- -dnl -dnl Requires: INCLUDES and LIBS must be populated as necessary. -dnl Inputs: $1: A static plugin name. -dnl Inputs: $2: The libraries that resolve $1. -dnl Output: QT_LIBS is prepended or configure exits. -AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_PLUGIN], [ - AC_MSG_CHECKING([for $1 ($2)]) - CHECK_STATIC_PLUGINS_TEMP_LIBS="$LIBS" - LIBS="$2${qt_lib_suffix} $QT_LIBS $LIBS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #include - Q_IMPORT_PLUGIN($1) - ]])], - [AC_MSG_RESULT([yes]); QT_LIBS="$2${qt_lib_suffix} $QT_LIBS"], - [AC_MSG_RESULT([no]); BITCOIN_QT_FAIL([$1 not found.])]) - LIBS="$CHECK_STATIC_PLUGINS_TEMP_LIBS" -]) - -dnl Internal. Check Qt static libs with PKG_CHECK_MODULES. -dnl -dnl _BITCOIN_QT_CHECK_STATIC_LIBS -dnl ----------------------------- -dnl -dnl Outputs: QT_LIBS is prepended. -AC_DEFUN([_BITCOIN_QT_CHECK_STATIC_LIBS], [ - PKG_CHECK_MODULES([QT_ACCESSIBILITY], [${qt_lib_prefix}AccessibilitySupport${qt_lib_suffix}], [QT_LIBS="$QT_ACCESSIBILITY_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_DEVICEDISCOVERY], [${qt_lib_prefix}DeviceDiscoverySupport${qt_lib_suffix}], [QT_LIBS="$QT_DEVICEDISCOVERY_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_EDID], [${qt_lib_prefix}EdidSupport${qt_lib_suffix}], [QT_LIBS="$QT_EDID_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_EVENTDISPATCHER], [${qt_lib_prefix}EventDispatcherSupport${qt_lib_suffix}], [QT_LIBS="$QT_EVENTDISPATCHER_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_FB], [${qt_lib_prefix}FbSupport${qt_lib_suffix}], [QT_LIBS="$QT_FB_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_FONTDATABASE], [${qt_lib_prefix}FontDatabaseSupport${qt_lib_suffix}], [QT_LIBS="$QT_FONTDATABASE_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_THEME], [${qt_lib_prefix}ThemeSupport${qt_lib_suffix}], [QT_LIBS="$QT_THEME_LIBS $QT_LIBS"]) - if test "$TARGET_OS" = "linux"; then - PKG_CHECK_MODULES([QT_INPUT], [${qt_lib_prefix}InputSupport], [QT_LIBS="$QT_INPUT_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_XCBQPA], [${qt_lib_prefix}XcbQpa], [QT_LIBS="$QT_XCBQPA_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_XKBCOMMON], [${qt_lib_prefix}XkbCommonSupport], [QT_LIBS="$QT_XKBCOMMON_LIBS $QT_LIBS"]) - elif test "$TARGET_OS" = "darwin"; then - PKG_CHECK_MODULES([QT_CLIPBOARD], [${qt_lib_prefix}ClipboardSupport${qt_lib_suffix}], [QT_LIBS="$QT_CLIPBOARD_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_GRAPHICS], [${qt_lib_prefix}GraphicsSupport${qt_lib_suffix}], [QT_LIBS="$QT_GRAPHICS_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) - elif test "$TARGET_OS" = "windows"; then - PKG_CHECK_MODULES([QT_WINDOWSUIAUTOMATION], [${qt_lib_prefix}WindowsUIAutomationSupport${qt_lib_suffix}], [QT_LIBS="$QT_WINDOWSUIAUTOMATION_LIBS $QT_LIBS"]) - elif test "$TARGET_OS" = "android"; then - PKG_CHECK_MODULES([QT_EGL], [${qt_lib_prefix}EglSupport${qt_lib_suffix}], [QT_LIBS="$QT_EGL_LIBS $QT_LIBS"]) - PKG_CHECK_MODULES([QT_SERVICE], [${qt_lib_prefix}ServiceSupport${qt_lib_suffix}], [QT_LIBS="$QT_SERVICE_LIBS $QT_LIBS"]) - fi -]) - -dnl Internal. Find Qt libraries using pkg-config. -dnl -dnl _BITCOIN_QT_FIND_LIBS -dnl --------------------- -dnl -dnl Outputs: All necessary QT_* variables are set. -dnl Outputs: have_qt_test and have_qt_dbus are set (if applicable) to yes|no. -AC_DEFUN([_BITCOIN_QT_FIND_LIBS],[ - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT_CORE], [${qt_lib_prefix}Core${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_CORE_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_CORE_LIBS $QT_LIBS"], - [BITCOIN_QT_FAIL([${qt_lib_prefix}Core${qt_lib_suffix} $qt_version not found])]) - ]) - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT_GUI], [${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_GUI_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_GUI_LIBS $QT_LIBS"], - [BITCOIN_QT_FAIL([${qt_lib_prefix}Gui${qt_lib_suffix} $qt_version not found])]) - ]) - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT_WIDGETS], [${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_WIDGETS_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_WIDGETS_LIBS $QT_LIBS"], - [BITCOIN_QT_FAIL([${qt_lib_prefix}Widgets${qt_lib_suffix} $qt_version not found])]) - ]) - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT_NETWORK], [${qt_lib_prefix}Network${qt_lib_suffix} $qt_version], [QT_INCLUDES="$QT_NETWORK_CFLAGS $QT_INCLUDES" QT_LIBS="$QT_NETWORK_LIBS $QT_LIBS"], - [BITCOIN_QT_FAIL([${qt_lib_prefix}Network${qt_lib_suffix} $qt_version not found])]) - ]) - - BITCOIN_QT_CHECK([ - PKG_CHECK_MODULES([QT_TEST], [${qt_lib_prefix}Test${qt_lib_suffix} $qt_version], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no]) - if test "$use_dbus" != "no"; then - PKG_CHECK_MODULES([QT_DBUS], [${qt_lib_prefix}DBus $qt_version], [QT_DBUS_INCLUDES="$QT_DBUS_CFLAGS"; have_qt_dbus=yes], [have_qt_dbus=no]) - fi - ]) -]) diff --git a/build-aux/m4/bitcoin_runtime_lib.m4 b/build-aux/m4/bitcoin_runtime_lib.m4 deleted file mode 100644 index 1a6922deca..0000000000 --- a/build-aux/m4/bitcoin_runtime_lib.m4 +++ /dev/null @@ -1,42 +0,0 @@ -# On some platforms clang builtin implementations -# require compiler-rt as a runtime library to use. -# -# See: -# - https://bugs.llvm.org/show_bug.cgi?id=28629 - -m4_define([_CHECK_RUNTIME_testbody], [[ - bool f(long long x, long long y, long long* p) - { - return __builtin_mul_overflow(x, y, p); - } - int main() { return 0; } -]]) - -AC_DEFUN([CHECK_RUNTIME_LIB], [ - - AC_LANG_PUSH([C++]) - - AC_MSG_CHECKING([for __builtin_mul_overflow]) - AC_LINK_IFELSE( - [AC_LANG_SOURCE([_CHECK_RUNTIME_testbody])], - [ - AC_MSG_RESULT([yes]) - AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [Define if you have a working __builtin_mul_overflow]) - ], - [ - ax_check_save_flags="$LDFLAGS" - LDFLAGS="$LDFLAGS --rtlib=compiler-rt -lgcc_s" - AC_LINK_IFELSE( - [AC_LANG_SOURCE([_CHECK_RUNTIME_testbody])], - [ - AC_MSG_RESULT([yes, with additional linker flags]) - RUNTIME_LDFLAGS="--rtlib=compiler-rt -lgcc_s" - AC_DEFINE([HAVE_BUILTIN_MUL_OVERFLOW], [1], [Define if you have a working __builtin_mul_overflow]) - ], - [AC_MSG_RESULT([no])]) - LDFLAGS="$ax_check_save_flags" - ]) - - AC_LANG_POP - AC_SUBST([RUNTIME_LDFLAGS]) -]) diff --git a/build-aux/m4/bitcoin_subdir_to_include.m4 b/build-aux/m4/bitcoin_subdir_to_include.m4 deleted file mode 100644 index 736270afea..0000000000 --- a/build-aux/m4/bitcoin_subdir_to_include.m4 +++ /dev/null @@ -1,18 +0,0 @@ -dnl Copyright (c) 2013-2014 The Bitcoin Core developers -dnl Distributed under the MIT software license, see the accompanying -dnl file COPYING or http://www.opensource.org/licenses/mit-license.php. - -dnl BITCOIN_SUBDIR_TO_INCLUDE([CPPFLAGS-VARIABLE-NAME],[SUBDIRECTORY-NAME],[HEADER-FILE]) -dnl SUBDIRECTORY-NAME must end with a path separator -AC_DEFUN([BITCOIN_SUBDIR_TO_INCLUDE],[ - if test "$2" = ""; then - AC_MSG_RESULT([default]) - else - echo "#include <$2$3.h>" >conftest.cpp - newinclpath=`${CXXCPP} ${CPPFLAGS} -M conftest.cpp 2>/dev/null | [ tr -d '\\n\\r\\\\' | sed -e 's/^.*[[:space:]:]\(\/[^[:space:]]*\)]$3[\.h[[:space:]].*$/\1/' -e t -e d`] - AC_MSG_RESULT([${newinclpath}]) - if test "${newinclpath}" != ""; then - eval "$1=\"\$$1\"' -I${newinclpath}'" - fi - fi -]) diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4 deleted file mode 100644 index 602b57fe43..0000000000 --- a/build-aux/m4/l_atomic.m4 +++ /dev/null @@ -1,58 +0,0 @@ -dnl Copyright (c) 2015 Tim Kosse -dnl Copying and distribution of this file, with or without modification, are -dnl permitted in any medium without royalty provided the copyright notice -dnl and this notice are preserved. This file is offered as-is, without any -dnl warranty. - -# Some versions of gcc/libstdc++ require linking with -latomic if -# using the C++ atomic library. -# -# Sourced from http://bugs.debian.org/797228 - -m4_define([_CHECK_ATOMIC_testbody], [[ - #include - #include - #include - - using namespace std::chrono_literals; - - int main() { - std::atomic lock{true}; - lock.exchange(false); - - std::atomic t{0s}; - t.store(2s); - - std::atomic a{}; - - int64_t v = 5; - int64_t r = a.fetch_add(v); - return static_cast(r); - } -]]) - -AC_DEFUN([CHECK_ATOMIC], [ - - AC_LANG_PUSH(C++) - TEMP_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS" - - AC_MSG_CHECKING([whether std::atomic can be used without link library]) - - AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - LIBS="$LIBS -latomic" - AC_MSG_CHECKING([whether std::atomic needs -latomic]) - AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - AC_MSG_FAILURE([cannot figure out how to use std::atomic]) - ]) - ]) - - CXXFLAGS="$TEMP_CXXFLAGS" - AC_LANG_POP -]) diff --git a/build-aux/m4/l_socket.m4 b/build-aux/m4/l_socket.m4 deleted file mode 100644 index 38923a98fc..0000000000 --- a/build-aux/m4/l_socket.m4 +++ /dev/null @@ -1,36 +0,0 @@ -# Illumos/SmartOS requires linking with -lsocket if -# using getifaddrs & freeifaddrs - -m4_define([_CHECK_SOCKET_testbody], [[ - #include - #include - - int main() { - struct ifaddrs *ifaddr; - getifaddrs(&ifaddr); - freeifaddrs(ifaddr); - } -]]) - -AC_DEFUN([CHECK_SOCKET], [ - - AC_LANG_PUSH(C++) - - AC_MSG_CHECKING([whether ifaddrs funcs can be used without link library]) - - AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_SOCKET_testbody])],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - LIBS="$LIBS -lsocket" - AC_MSG_CHECKING([whether getifaddrs needs -lsocket]) - AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_SOCKET_testbody])],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - AC_MSG_FAILURE([cannot figure out how to use getifaddrs]) - ]) - ]) - - AC_LANG_POP -]) diff --git a/build_msvc/.gitignore b/build_msvc/.gitignore deleted file mode 100644 index b2eb9313a0..0000000000 --- a/build_msvc/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# Build directories -Debug/* -Release/* -.vs -packages/* -*/Obj -*/Debug -*/Release -*/x64 -*.vcxproj.user - -# .vcxproj files that are auto-generated by the msvc-autogen.py script. -libbitcoin_cli/libbitcoin_cli.vcxproj -libbitcoin_common/libbitcoin_common.vcxproj -libbitcoin_crypto/libbitcoin_crypto.vcxproj -libbitcoin_node/libbitcoin_node.vcxproj -libbitcoin_util/libbitcoin_util.vcxproj -libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj -libbitcoin_wallet/libbitcoin_wallet.vcxproj -libbitcoin_zmq/libbitcoin_zmq.vcxproj -bench_bitcoin/bench_bitcoin.vcxproj -libtest_util/libtest_util.vcxproj - -/bitcoin_config.h -/common.init.vcxproj - -*/Win32 -libbitcoin_qt/QtGeneratedFiles/* -test_bitcoin-qt/QtGeneratedFiles/* -vcpkg_installed \ No newline at end of file diff --git a/build_msvc/README.md b/build_msvc/README.md deleted file mode 100644 index ba6171fee7..0000000000 --- a/build_msvc/README.md +++ /dev/null @@ -1,90 +0,0 @@ -Building Bitcoin Core with Visual Studio -======================================== - -Introduction ---------------------- -Visual Studio 2022 is minimum required to build Bitcoin Core. - -Solution and project files to build with `msbuild` or Visual Studio can be found in the `build_msvc` directory. - -To build Bitcoin Core from the command-line, it is sufficient to only install the [Visual Studio Build Tools](https://visualstudio.microsoft.com/downloads/) component. - -The "Desktop development with C++" workload must be installed as well. - -Building with Visual Studio is an alternative to the Linux based [cross-compiler build](../doc/build-windows.md). - - -Prerequisites ---------------------- -To build [dependencies](../doc/dependencies.md) (except for [Qt](#qt)), -the default approach is to use the [vcpkg](https://vcpkg.io) package manager from Microsoft: - -1. [Install](https://vcpkg.io/en/getting-started.html) vcpkg. - -2. By default, vcpkg makes both `release` and `debug` builds for each package. -To save build time and disk space, one could skip `debug` builds (example uses PowerShell): -```powershell - -Add-Content -Path "vcpkg\triplets\x64-windows-static.cmake" -Value "set(VCPKG_BUILD_TYPE release)" -``` - -Qt ---------------------- -To build Bitcoin Core with the GUI, a static build of Qt is required. - -1. Download a single ZIP archive of Qt source code from https://download.qt.io/official_releases/qt/ (e.g., [`qt-everywhere-opensource-src-5.15.5.zip`](https://download.qt.io/official_releases/qt/5.15/5.15.5/single/qt-everywhere-opensource-src-5.15.5.zip)), and expand it into a dedicated folder. The following instructions assume that this folder is `C:\dev\qt-source`. - -2. Open "x64 Native Tools Command Prompt for VS 2022", and input the following commands: -```cmd -cd C:\dev\qt-source -mkdir build -cd build -..\configure -release -silent -opensource -confirm-license -opengl desktop -static -static-runtime -mp -qt-zlib -qt-pcre -qt-libpng -nomake examples -nomake tests -nomake tools -no-angle -no-dbus -no-gif -no-gtk -no-ico -no-icu -no-libjpeg -no-libudev -no-sql-sqlite -no-sql-odbc -no-sqlite -no-vulkan -skip qt3d -skip qtactiveqt -skip qtandroidextras -skip qtcharts -skip qtconnectivity -skip qtdatavis3d -skip qtdeclarative -skip doc -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtlottie -skip qtmacextras -skip qtmultimedia -skip qtnetworkauth -skip qtpurchasing -skip qtquick3d -skip qtquickcontrols -skip qtquickcontrols2 -skip qtquicktimeline -skip qtremoteobjects -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebglplugin -skip qtwebsockets -skip qtwebview -skip qtx11extras -skip qtxmlpatterns -no-openssl -no-feature-bearermanagement -no-feature-printdialog -no-feature-printer -no-feature-printpreviewdialog -no-feature-printpreviewwidget -no-feature-sql -no-feature-sqlmodel -no-feature-textbrowser -no-feature-textmarkdownwriter -no-feature-textodfwriter -no-feature-xml -prefix C:\Qt_static -nmake -nmake install -``` - -One could speed up building with [`jom`](https://wiki.qt.io/Jom), a replacement for `nmake` which makes use of all CPU cores. - -To build Bitcoin Core without Qt, unload or disable the `bitcoin-qt`, `libbitcoin_qt` and `test_bitcoin-qt` projects. - - -Building ---------------------- -1. Use Python to generate `*.vcxproj` for the Visual Studio 2022 toolchain from Makefile: - -```cmd -python build_msvc\msvc-autogen.py -``` - -2. An optional step is to adjust the settings in the `build_msvc` directory and the `common.init.vcxproj` file. This project file contains settings that are common to all projects such as the runtime library version and target Windows SDK version. The Qt directories can also be set. To specify a non-default path to a static Qt package directory, use the `QTBASEDIR` environment variable. - -3. To build from the command-line with the Visual Studio toolchain use: - -```cmd -msbuild build_msvc\bitcoin.sln -property:Configuration=Release -maxCpuCount -verbosity:minimal -``` - -Alternatively, open the `build_msvc/bitcoin.sln` file in Visual Studio. - -Security ---------------------- -[Base address randomization](https://learn.microsoft.com/en-us/cpp/build/reference/dynamicbase-use-address-space-layout-randomization) is used to make Bitcoin Core more secure. When building Bitcoin using the `build_msvc` process base address randomization can be disabled by editing `common.init.vcproj` to change `RandomizedBaseAddress` from `true` to `false` and then rebuilding the project. - -To check if `bitcoind` has `RandomizedBaseAddress` enabled or disabled run - -``` -.\dumpbin.exe /headers src/bitcoind.exe -``` - -If is it enabled then in the output `Dynamic base` will be listed in the `DLL characteristics` under `OPTIONAL HEADER VALUES` as shown below - -``` - 8160 DLL characteristics - High Entropy Virtual Addresses - Dynamic base - NX compatible - Terminal Server Aware -``` - -This may not disable all stack randomization as versions of windows employ additional stack randomization protections. These protections must be turned off in the OS configuration. diff --git a/build_msvc/bench_bitcoin/bench_bitcoin.vcxproj.in b/build_msvc/bench_bitcoin/bench_bitcoin.vcxproj.in deleted file mode 100644 index a5702a83ba..0000000000 --- a/build_msvc/bench_bitcoin/bench_bitcoin.vcxproj.in +++ /dev/null @@ -1,62 +0,0 @@ - - - - - {1125654E-E1B2-4431-8B5C-62EA9A2FEECB} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - -@SOURCE_FILES@ - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {460fee33-1fe1-483f-b3bf-931ff8e969a5} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {792d487f-f14c-49fc-a9de-3fc150f31c3f} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - {18430fef-6b61-4c53-b396-718e02850f1b} - - - {1e065f03-3566-47d0-8fa9-daa72b084e7d} - - - - - There was an error executing the raw bench header generation task. - - - - - - - - - - - \ No newline at end of file diff --git a/build_msvc/bitcoin-cli/bitcoin-cli.vcxproj b/build_msvc/bitcoin-cli/bitcoin-cli.vcxproj deleted file mode 100644 index 738884fb41..0000000000 --- a/build_msvc/bitcoin-cli/bitcoin-cli.vcxproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - - {0B2D7431-F876-4A58-87BF-F748338CD3BF} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - - {0667528c-d734-4009-adf9-c0d6c4a5a5a6} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - - - - diff --git a/build_msvc/bitcoin-qt/bitcoin-qt.vcxproj b/build_msvc/bitcoin-qt/bitcoin-qt.vcxproj deleted file mode 100644 index 20cdb7bb6e..0000000000 --- a/build_msvc/bitcoin-qt/bitcoin-qt.vcxproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - - - {7E99172D-7FF2-4CB6-B736-AC9B76ED412A} - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {0667528c-d734-4009-adf9-c0d6c4a5a5a6} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {2b4abff8-d1fd-4845-88c9-1f3c0a6512bf} - - - {460fee33-1fe1-483f-b3bf-931ff8e969a5} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {792d487f-f14c-49fc-a9de-3fc150f31c3f} - - - {18430fef-6b61-4c53-b396-718e02850f1b} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - - - - $(QtIncludes);%(AdditionalIncludeDirectories) - - - Windows - $(QtReleaseLibraries);%(AdditionalDependencies) - /ignore:4206 /LTCG:OFF - - - ..\..\src; - HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions) - - - - - - $(QtIncludes);%(AdditionalIncludeDirectories) - - - $(QtDebugLibraries);%(AdditionalDependencies) - /ignore:4206 - - - ..\..\src; - HAVE_CONFIG_H;_UNICODE;UNICODE;%(PreprocessorDefinitions) - - - - - - diff --git a/build_msvc/bitcoin-tx/bitcoin-tx.vcxproj b/build_msvc/bitcoin-tx/bitcoin-tx.vcxproj deleted file mode 100644 index 52585b98f9..0000000000 --- a/build_msvc/bitcoin-tx/bitcoin-tx.vcxproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - - {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - - - - diff --git a/build_msvc/bitcoin-util/bitcoin-util.vcxproj b/build_msvc/bitcoin-util/bitcoin-util.vcxproj deleted file mode 100644 index 4ea27fe439..0000000000 --- a/build_msvc/bitcoin-util/bitcoin-util.vcxproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - - {57A04EC9-542A-4E40-83D0-AC3BE1F36805} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - - - - diff --git a/build_msvc/bitcoin-wallet/bitcoin-wallet.vcxproj b/build_msvc/bitcoin-wallet/bitcoin-wallet.vcxproj deleted file mode 100644 index 56d88d6a44..0000000000 --- a/build_msvc/bitcoin-wallet/bitcoin-wallet.vcxproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - - {84DE8790-EDE3-4483-81AC-C32F15E861F4} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - $(IntDir)init_bitcoin-wallet.obj - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {f91ac55e-6f5e-4c58-9ac5-b40db7deef93} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - - - - diff --git a/build_msvc/bitcoin.sln b/build_msvc/bitcoin.sln deleted file mode 100644 index 0931bf5dfe..0000000000 --- a/build_msvc/bitcoin.sln +++ /dev/null @@ -1,162 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.28803.452 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_consensus", "libbitcoin_consensus\libbitcoin_consensus.vcxproj", "{2B384FA8-9EE1-4544-93CB-0D733C25E8CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoind", "bitcoind\bitcoind.vcxproj", "{D4513DDF-6013-44DC-ADCC-12EAF6D1F038}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_util", "libbitcoin_util\libbitcoin_util.vcxproj", "{B53A5535-EE9D-4C6F-9A26-F79EE3BC3754}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_common", "libbitcoin_common\libbitcoin_common.vcxproj", "{7C87E378-DF58-482E-AA2F-1BC129BC19CE}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_crypto", "libbitcoin_crypto\libbitcoin_crypto.vcxproj", "{6190199C-6CF4-4DAD-BFBD-93FA72A760C1}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_node", "libbitcoin_node\libbitcoin_node.vcxproj", "{460FEE33-1FE1-483F-B3BF-931FF8E969A5}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libunivalue", "libunivalue\libunivalue.vcxproj", "{5724BA7D-A09A-4BA8-800B-C4C1561B3D69}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_wallet", "libbitcoin_wallet\libbitcoin_wallet.vcxproj", "{93B86837-B543-48A5-A89B-7C87ABB77DF2}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_zmq", "libbitcoin_zmq\libbitcoin_zmq.vcxproj", "{792D487F-F14C-49FC-A9DE-3FC150F31C3F}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bitcoin", "test_bitcoin\test_bitcoin.vcxproj", "{A56B73DB-D46D-4882-8374-1FE3FFA08F07}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_cli", "libbitcoin_cli\libbitcoin_cli.vcxproj", "{0667528C-D734-4009-ADF9-C0D6C4A5A5A6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-cli", "bitcoin-cli\bitcoin-cli.vcxproj", "{0B2D7431-F876-4A58-87BF-F748338CD3BF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bench_bitcoin", "bench_bitcoin\bench_bitcoin.vcxproj", "{1125654E-E1B2-4431-8B5C-62EA9A2FEECB}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-tx", "bitcoin-tx\bitcoin-tx.vcxproj", "{D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-util", "bitcoin-util\bitcoin-util.vcxproj", "{57A04EC9-542A-4E40-83D0-AC3BE1F36805}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-wallet", "bitcoin-wallet\bitcoin-wallet.vcxproj", "{84DE8790-EDE3-4483-81AC-C32F15E861F4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_wallet_tool", "libbitcoin_wallet_tool\libbitcoin_wallet_tool.vcxproj", "{F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsecp256k1", "libsecp256k1\libsecp256k1.vcxproj", "{BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libleveldb", "libleveldb\libleveldb.vcxproj", "{18430FEF-6B61-4C53-B396-718E02850F1B}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libbitcoin_qt", "libbitcoin_qt\libbitcoin_qt.vcxproj", "{2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bitcoin-qt", "bitcoin-qt\bitcoin-qt.vcxproj", "{7E99172D-7FF2-4CB6-B736-AC9B76ED412A}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libtest_util", "libtest_util\libtest_util.vcxproj", "{868474FD-35F6-4400-8EED-30A33E7521D4}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test_bitcoin-qt", "test_bitcoin-qt\test_bitcoin-qt.vcxproj", "{51201D5E-D939-4854-AE9D-008F03FF518E}" -EndProject -Project("{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}") = "libminisketch", "libminisketch\libminisketch.vcxproj", "{542007E3-BE0D-4B0D-A6B0-AA8813E2558D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2B384FA8-9EE1-4544-93CB-0D733C25E8CE}.Debug|x64.ActiveCfg = Debug|x64 - {2B384FA8-9EE1-4544-93CB-0D733C25E8CE}.Debug|x64.Build.0 = Debug|x64 - {2B384FA8-9EE1-4544-93CB-0D733C25E8CE}.Release|x64.ActiveCfg = Release|x64 - {2B384FA8-9EE1-4544-93CB-0D733C25E8CE}.Release|x64.Build.0 = Release|x64 - {D4513DDF-6013-44DC-ADCC-12EAF6D1F038}.Debug|x64.ActiveCfg = Debug|x64 - {D4513DDF-6013-44DC-ADCC-12EAF6D1F038}.Debug|x64.Build.0 = Debug|x64 - {D4513DDF-6013-44DC-ADCC-12EAF6D1F038}.Release|x64.ActiveCfg = Release|x64 - {D4513DDF-6013-44DC-ADCC-12EAF6D1F038}.Release|x64.Build.0 = Release|x64 - {B53A5535-EE9D-4C6F-9A26-F79EE3BC3754}.Debug|x64.ActiveCfg = Debug|x64 - {B53A5535-EE9D-4C6F-9A26-F79EE3BC3754}.Debug|x64.Build.0 = Debug|x64 - {B53A5535-EE9D-4C6F-9A26-F79EE3BC3754}.Release|x64.ActiveCfg = Release|x64 - {B53A5535-EE9D-4C6F-9A26-F79EE3BC3754}.Release|x64.Build.0 = Release|x64 - {7C87E378-DF58-482E-AA2F-1BC129BC19CE}.Debug|x64.ActiveCfg = Debug|x64 - {7C87E378-DF58-482E-AA2F-1BC129BC19CE}.Debug|x64.Build.0 = Debug|x64 - {7C87E378-DF58-482E-AA2F-1BC129BC19CE}.Release|x64.ActiveCfg = Release|x64 - {7C87E378-DF58-482E-AA2F-1BC129BC19CE}.Release|x64.Build.0 = Release|x64 - {6190199C-6CF4-4DAD-BFBD-93FA72A760C1}.Debug|x64.ActiveCfg = Debug|x64 - {6190199C-6CF4-4DAD-BFBD-93FA72A760C1}.Debug|x64.Build.0 = Debug|x64 - {6190199C-6CF4-4DAD-BFBD-93FA72A760C1}.Release|x64.ActiveCfg = Release|x64 - {6190199C-6CF4-4DAD-BFBD-93FA72A760C1}.Release|x64.Build.0 = Release|x64 - {460FEE33-1FE1-483F-B3BF-931FF8E969A5}.Debug|x64.ActiveCfg = Debug|x64 - {460FEE33-1FE1-483F-B3BF-931FF8E969A5}.Debug|x64.Build.0 = Debug|x64 - {460FEE33-1FE1-483F-B3BF-931FF8E969A5}.Release|x64.ActiveCfg = Release|x64 - {460FEE33-1FE1-483F-B3BF-931FF8E969A5}.Release|x64.Build.0 = Release|x64 - {5724BA7D-A09A-4BA8-800B-C4C1561B3D69}.Debug|x64.ActiveCfg = Debug|x64 - {5724BA7D-A09A-4BA8-800B-C4C1561B3D69}.Debug|x64.Build.0 = Debug|x64 - {5724BA7D-A09A-4BA8-800B-C4C1561B3D69}.Release|x64.ActiveCfg = Release|x64 - {5724BA7D-A09A-4BA8-800B-C4C1561B3D69}.Release|x64.Build.0 = Release|x64 - {93B86837-B543-48A5-A89B-7C87ABB77DF2}.Debug|x64.ActiveCfg = Debug|x64 - {93B86837-B543-48A5-A89B-7C87ABB77DF2}.Debug|x64.Build.0 = Debug|x64 - {93B86837-B543-48A5-A89B-7C87ABB77DF2}.Release|x64.ActiveCfg = Release|x64 - {93B86837-B543-48A5-A89B-7C87ABB77DF2}.Release|x64.Build.0 = Release|x64 - {792D487F-F14C-49FC-A9DE-3FC150F31C3F}.Debug|x64.ActiveCfg = Debug|x64 - {792D487F-F14C-49FC-A9DE-3FC150F31C3F}.Debug|x64.Build.0 = Debug|x64 - {792D487F-F14C-49FC-A9DE-3FC150F31C3F}.Release|x64.ActiveCfg = Release|x64 - {792D487F-F14C-49FC-A9DE-3FC150F31C3F}.Release|x64.Build.0 = Release|x64 - {A56B73DB-D46D-4882-8374-1FE3FFA08F07}.Debug|x64.ActiveCfg = Debug|x64 - {A56B73DB-D46D-4882-8374-1FE3FFA08F07}.Debug|x64.Build.0 = Debug|x64 - {A56B73DB-D46D-4882-8374-1FE3FFA08F07}.Release|x64.ActiveCfg = Release|x64 - {A56B73DB-D46D-4882-8374-1FE3FFA08F07}.Release|x64.Build.0 = Release|x64 - {0667528C-D734-4009-ADF9-C0D6C4A5A5A6}.Debug|x64.ActiveCfg = Debug|x64 - {0667528C-D734-4009-ADF9-C0D6C4A5A5A6}.Debug|x64.Build.0 = Debug|x64 - {0667528C-D734-4009-ADF9-C0D6C4A5A5A6}.Release|x64.ActiveCfg = Release|x64 - {0667528C-D734-4009-ADF9-C0D6C4A5A5A6}.Release|x64.Build.0 = Release|x64 - {0B2D7431-F876-4A58-87BF-F748338CD3BF}.Debug|x64.ActiveCfg = Debug|x64 - {0B2D7431-F876-4A58-87BF-F748338CD3BF}.Debug|x64.Build.0 = Debug|x64 - {0B2D7431-F876-4A58-87BF-F748338CD3BF}.Release|x64.ActiveCfg = Release|x64 - {0B2D7431-F876-4A58-87BF-F748338CD3BF}.Release|x64.Build.0 = Release|x64 - {1125654E-E1B2-4431-8B5C-62EA9A2FEECB}.Debug|x64.ActiveCfg = Debug|x64 - {1125654E-E1B2-4431-8B5C-62EA9A2FEECB}.Debug|x64.Build.0 = Debug|x64 - {1125654E-E1B2-4431-8B5C-62EA9A2FEECB}.Release|x64.ActiveCfg = Release|x64 - {1125654E-E1B2-4431-8B5C-62EA9A2FEECB}.Release|x64.Build.0 = Release|x64 - {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Debug|x64.ActiveCfg = Debug|x64 - {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Debug|x64.Build.0 = Debug|x64 - {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Release|x64.ActiveCfg = Release|x64 - {D3022AF6-AD33-4CE3-B358-87CB6A1B29CF}.Release|x64.Build.0 = Release|x64 - {57A04EC9-542A-4E40-83D0-AC3BE1F36805}.Debug|x64.ActiveCfg = Debug|x64 - {57A04EC9-542A-4E40-83D0-AC3BE1F36805}.Debug|x64.Build.0 = Debug|x64 - {57A04EC9-542A-4E40-83D0-AC3BE1F36805}.Release|x64.ActiveCfg = Release|x64 - {57A04EC9-542A-4E40-83D0-AC3BE1F36805}.Release|x64.Build.0 = Release|x64 - {84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x64.ActiveCfg = Debug|x64 - {84DE8790-EDE3-4483-81AC-C32F15E861F4}.Debug|x64.Build.0 = Debug|x64 - {84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x64.ActiveCfg = Release|x64 - {84DE8790-EDE3-4483-81AC-C32F15E861F4}.Release|x64.Build.0 = Release|x64 - {F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x64.ActiveCfg = Debug|x64 - {F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Debug|x64.Build.0 = Debug|x64 - {F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x64.ActiveCfg = Release|x64 - {F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93}.Release|x64.Build.0 = Release|x64 - {BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6}.Debug|x64.ActiveCfg = Debug|x64 - {BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6}.Debug|x64.Build.0 = Debug|x64 - {BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6}.Release|x64.ActiveCfg = Release|x64 - {BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6}.Release|x64.Build.0 = Release|x64 - {18430FEF-6B61-4C53-B396-718E02850F1B}.Debug|x64.ActiveCfg = Debug|x64 - {18430FEF-6B61-4C53-B396-718E02850F1B}.Debug|x64.Build.0 = Debug|x64 - {18430FEF-6B61-4C53-B396-718E02850F1B}.Release|x64.ActiveCfg = Release|x64 - {18430FEF-6B61-4C53-B396-718E02850F1B}.Release|x64.Build.0 = Release|x64 - {2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF}.Debug|x64.ActiveCfg = Debug|x64 - {2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF}.Debug|x64.Build.0 = Debug|x64 - {2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF}.Release|x64.ActiveCfg = Release|x64 - {2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF}.Release|x64.Build.0 = Release|x64 - {7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Debug|x64.ActiveCfg = Debug|x64 - {7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Debug|x64.Build.0 = Debug|x64 - {7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Release|x64.ActiveCfg = Release|x64 - {7E99172D-7FF2-4CB6-B736-AC9B76ED412A}.Release|x64.Build.0 = Release|x64 - {868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x64.ActiveCfg = Debug|x64 - {868474FD-35F6-4400-8EED-30A33E7521D4}.Debug|x64.Build.0 = Debug|x64 - {868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x64.ActiveCfg = Release|x64 - {868474FD-35F6-4400-8EED-30A33E7521D4}.Release|x64.Build.0 = Release|x64 - {51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x64.ActiveCfg = Debug|x64 - {51201D5E-D939-4854-AE9D-008F03FF518E}.Debug|x64.Build.0 = Debug|x64 - {51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x64.ActiveCfg = Release|x64 - {51201D5E-D939-4854-AE9D-008F03FF518E}.Release|x64.Build.0 = Release|x64 - {542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Debug|x64.ActiveCfg = Debug|x64 - {542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Debug|x64.Build.0 = Debug|x64 - {542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Release|x64.ActiveCfg = Release|x64 - {542007E3-BE0D-4B0D-A6B0-AA8813E2558D}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {58AAB032-7274-49BD-845E-5EF4DBB69B70} - EndGlobalSection -EndGlobal diff --git a/build_msvc/bitcoin_config.h.in b/build_msvc/bitcoin_config.h.in deleted file mode 100644 index 1716647486..0000000000 --- a/build_msvc/bitcoin_config.h.in +++ /dev/null @@ -1,152 +0,0 @@ -// Copyright (c) 2018-2020 The Bitcoin Core developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#ifndef BITCOIN_BITCOIN_CONFIG_H -#define BITCOIN_BITCOIN_CONFIG_H - -/* Version Build */ -#define CLIENT_VERSION_BUILD $ - -/* Version is release */ -#define CLIENT_VERSION_IS_RELEASE $ - -/* Major version */ -#define CLIENT_VERSION_MAJOR $ - -/* Minor version */ -#define CLIENT_VERSION_MINOR $ - -/* Copyright holder(s) before %s replacement */ -#define COPYRIGHT_HOLDERS "The %s developers" - -/* Copyright holder(s) */ -#define COPYRIGHT_HOLDERS_FINAL "The Bitcoin Core developers" - -/* Replacement for %s in copyright holders string */ -#define COPYRIGHT_HOLDERS_SUBSTITUTION "Bitcoin Core" - -/* Copyright year */ -#define COPYRIGHT_YEAR $ - -/* Define to 1 to enable wallet functions */ -#define ENABLE_WALLET 1 - -/* Define to 1 to enable BDB wallet */ -#define USE_BDB 1 - -/* Define to 1 to enable SQLite wallet */ -#define USE_SQLITE 1 - -/* Define this symbol to enable ZMQ functions */ -#define ENABLE_ZMQ 1 - -/* define if external signer support is enabled (requires Boost::Process) */ -#define ENABLE_EXTERNAL_SIGNER /**/ - -/* Define to 1 if you have the declaration of `be16toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE16TOH 0 - -/* Define to 1 if you have the declaration of `be32toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE32TOH 0 - -/* Define to 1 if you have the declaration of `be64toh', and to 0 if you - don't. */ -#define HAVE_DECL_BE64TOH 0 - -/* Define to 1 if you have the declaration of `bswap_16', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_16 0 - -/* Define to 1 if you have the declaration of `bswap_32', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_32 0 - -/* Define to 1 if you have the declaration of `bswap_64', and to 0 if you - don't. */ -#define HAVE_DECL_BSWAP_64 0 - -/* Define to 1 if you have the declaration of `fork', and to 0 if you don't. - */ -#define HAVE_DECL_FORK 0 - -/* Define to 1 if you have the declaration of `htobe16', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE16 0 - -/* Define to 1 if you have the declaration of `htobe32', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE32 0 - -/* Define to 1 if you have the declaration of `htobe64', and to 0 if you - don't. */ -#define HAVE_DECL_HTOBE64 0 - -/* Define to 1 if you have the declaration of `htole16', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE16 0 - -/* Define to 1 if you have the declaration of `htole32', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE32 0 - -/* Define to 1 if you have the declaration of `htole64', and to 0 if you - don't. */ -#define HAVE_DECL_HTOLE64 0 - -/* Define to 1 if you have the declaration of `le16toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE16TOH 0 - -/* Define to 1 if you have the declaration of `le32toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE32TOH 0 - -/* Define to 1 if you have the declaration of `le64toh', and to 0 if you - don't. */ -#define HAVE_DECL_LE64TOH 0 - -/* Define to 1 if you have the declaration of `setsid', and to 0 if you don't. - */ -#define HAVE_DECL_SETSID 0 - -/* Define if the dllexport attribute is supported. */ -#define HAVE_DLLEXPORT_ATTRIBUTE 1 - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "https://github.com/bitcoin/bitcoin/issues" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "Bitcoin Core" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING $ - -/* Define to the home page for this package. */ -#define PACKAGE_URL "https://bitcoincore.org/" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION $ - -/* Define this symbol if the minimal qt platform exists */ -#define QT_QPA_PLATFORM_MINIMAL 1 - -/* Define this symbol if the qt platform is windows */ -#define QT_QPA_PLATFORM_WINDOWS 1 - -/* Define this symbol if qt plugins are static */ -#define QT_STATICPLUGIN 1 - -/* Windows Universal Platform constraints */ -#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) -/* Either a desktop application without API restrictions, or and older system - before these macros were defined. */ - -/* ::wsystem is available */ -#define HAVE_SYSTEM 1 - -#endif // !WINAPI_FAMILY || WINAPI_FAMILY_DESKTOP_APP - -#endif //BITCOIN_BITCOIN_CONFIG_H diff --git a/build_msvc/bitcoind/bitcoind.vcxproj b/build_msvc/bitcoind/bitcoind.vcxproj deleted file mode 100644 index bb61865e14..0000000000 --- a/build_msvc/bitcoind/bitcoind.vcxproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - - {D4513DDF-6013-44DC-ADCC-12EAF6D1F038} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - $(IntDir)init_bitcoind.obj - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {460fee33-1fe1-483f-b3bf-931ff8e969a5} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {792d487f-f14c-49fc-a9de-3fc150f31c3f} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - {18430fef-6b61-4c53-b396-718e02850f1b} - - - - - - - ..\..\test\config.ini.in - ..\..\test\config.ini - - - - - - - - - - - - - - - - - - - - diff --git a/build_msvc/common.init.vcxproj.in b/build_msvc/common.init.vcxproj.in deleted file mode 100644 index 9cce546268..0000000000 --- a/build_msvc/common.init.vcxproj.in +++ /dev/null @@ -1,106 +0,0 @@ - - - - - - 16.0 - true - - - - true - true - true - true - true - $(Configuration) - x64-windows-static - - - - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) - $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion) - - $(WindowsTargetPlatformVersion_10).0 - $(WindowsTargetPlatformVersion_10) - - - - - Release - x64 - - - Debug - x64 - - - - - false - false - @TOOLSET@ - Unicode - No - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - $(Platform)\$(Configuration)\$(ProjectName)\ - - - - true - true - @TOOLSET@ - Unicode - $(SolutionDir)$(Platform)\$(Configuration)\$(ProjectName)\ - $(Platform)\$(Configuration)\$(ProjectName)\ - - - - - Disabled - false - true - true - true - MultiThreaded - None - - - false - false - /LTCG:OFF - - - - - - Disabled - false - _DEBUG;%(PreprocessorDefinitions) - true - MultiThreadedDebug - /bigobj %(AdditionalOptions) - - - - - - Level3 - NotUsing - /utf-8 /Zc:__cplusplus /std:c++20 %(AdditionalOptions) - 4018;4244;4267;4715;4805 - true - _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;SECP256K1_STATIC;ZMQ_STATIC;NOMINMAX;WIN32;HAVE_CONFIG_H;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CONSOLE;_WIN32_WINNT=0x0601;_WIN32_IE=0x0501;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions) - ..\..\src;..\..\src\minisketch\include;..\..\src\univalue\include;..\..\src\secp256k1\include;..\..\src\leveldb\include;..\..\src\leveldb\helpers\memenv;%(AdditionalIncludeDirectories) - - - Console - Iphlpapi.lib;ws2_32.lib;Shlwapi.lib;kernel32.lib;user32.lib;gdi32.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies) - true - - - /ignore:4221 - - - - diff --git a/build_msvc/common.qt.init.vcxproj b/build_msvc/common.qt.init.vcxproj deleted file mode 100644 index cc8063e545..0000000000 --- a/build_msvc/common.qt.init.vcxproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - C:\Qt_static - $(QtBaseDir)\plugins - $(QtBaseDir)\lib - $(QtBaseDir)\include - $(QtIncludeDir);$(QtIncludeDir)\QtNetwork;$(QtIncludeDir)\QtCore;$(QtIncludeDir)\QtWidgets;$(QtIncludeDir)\QtGui; - .\QtGeneratedFiles\qt - $(QtBaseDir)\bin - $(QtPluginsLibraryDir)\platforms\qminimal.lib;$(QtPluginsLibraryDir)\platforms\qwindows.lib;$(QtPluginsLibraryDir)\styles\qwindowsvistastyle.lib;$(QtLibraryDir)\Qt5WindowsUIAutomationSupport.lib;$(QtLibraryDir)\qtfreetype.lib;$(QtLibraryDir)\qtharfbuzz.lib;$(QtLibraryDir)\qtlibpng.lib;$(QtLibraryDir)\qtpcre2.lib;$(QtLibraryDir)\Qt5AccessibilitySupport.lib;$(QtLibraryDir)\Qt5Core.lib;$(QtLibraryDir)\Qt5Concurrent.lib;$(QtLibraryDir)\Qt5EventDispatcherSupport.lib;$(QtLibraryDir)\Qt5FontDatabaseSupport.lib;$(QtLibraryDir)\Qt5Gui.lib;$(QtLibraryDir)\Qt5Network.lib;$(QtLibraryDir)\Qt5PlatformCompositorSupport.lib;$(QtLibraryDir)\Qt5ThemeSupport.lib;$(QtLibraryDir)\Qt5Widgets.lib;$(QtLibraryDir)\Qt5WinExtras.lib;$(QtLibraryDir)\qtmain.lib;Wtsapi32.lib;userenv.lib;netapi32.lib;imm32.lib;Dwmapi.lib;version.lib;winmm.lib;UxTheme.lib - $(QtPluginsLibraryDir)\platforms\qwindowsd.lib;$(QtPluginsLibraryDir)\platforms\qminimald.lib;$(QtPluginsLibraryDir)\styles\qwindowsvistastyled.lib;$(QtLibraryDir)\*d.lib;Wtsapi32.lib;crypt32.lib;userenv.lib;netapi32.lib;imm32.lib;Dwmapi.lib;version.lib;winmm.lib;UxTheme.lib - - - diff --git a/build_msvc/common.vcxproj b/build_msvc/common.vcxproj deleted file mode 100644 index 270c75e8a7..0000000000 --- a/build_msvc/common.vcxproj +++ /dev/null @@ -1,12 +0,0 @@ - - -$(BuildDependsOn);CopyBuildArtifacts - - - - - - - - - diff --git a/build_msvc/libbitcoin_cli/libbitcoin_cli.vcxproj.in b/build_msvc/libbitcoin_cli/libbitcoin_cli.vcxproj.in deleted file mode 100644 index 620df72a2f..0000000000 --- a/build_msvc/libbitcoin_cli/libbitcoin_cli.vcxproj.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {0667528C-D734-4009-ADF9-C0D6C4A5A5A6} - - - StaticLibrary - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_common/libbitcoin_common.vcxproj.in b/build_msvc/libbitcoin_common/libbitcoin_common.vcxproj.in deleted file mode 100644 index 482e4333f7..0000000000 --- a/build_msvc/libbitcoin_common/libbitcoin_common.vcxproj.in +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {7C87E378-DF58-482E-AA2F-1BC129BC19CE} - - - StaticLibrary - - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_consensus/libbitcoin_consensus.vcxproj b/build_msvc/libbitcoin_consensus/libbitcoin_consensus.vcxproj deleted file mode 100644 index 95fdcdb79b..0000000000 --- a/build_msvc/libbitcoin_consensus/libbitcoin_consensus.vcxproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - - {2B384FA8-9EE1-4544-93CB-0D733C25E8CE} - - - StaticLibrary - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build_msvc/libbitcoin_crypto/libbitcoin_crypto.vcxproj.in b/build_msvc/libbitcoin_crypto/libbitcoin_crypto.vcxproj.in deleted file mode 100644 index 32cb75bf87..0000000000 --- a/build_msvc/libbitcoin_crypto/libbitcoin_crypto.vcxproj.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {6190199C-6CF4-4DAD-BFBD-93FA72A760C1} - - - StaticLibrary - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_node/libbitcoin_node.vcxproj.in b/build_msvc/libbitcoin_node/libbitcoin_node.vcxproj.in deleted file mode 100644 index 58e90dbaeb..0000000000 --- a/build_msvc/libbitcoin_node/libbitcoin_node.vcxproj.in +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {460FEE33-1FE1-483F-B3BF-931FF8E969A5} - - - StaticLibrary - - -@SOURCE_FILES@ - - $(IntDir)wallet_init.obj - - - - - - \ No newline at end of file diff --git a/build_msvc/libbitcoin_qt/libbitcoin_qt.vcxproj b/build_msvc/libbitcoin_qt/libbitcoin_qt.vcxproj deleted file mode 100644 index 9f9dc9d5fa..0000000000 --- a/build_msvc/libbitcoin_qt/libbitcoin_qt.vcxproj +++ /dev/null @@ -1,224 +0,0 @@ - - - - - - {2B4ABFF8-D1FD-4845-88C9-1F3C0A6512BF} - StaticLibrary - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _AMD64_;%(PreprocessorDefinitions) - $(QtIncludes);$(GeneratedFilesOutDir)\..;%(AdditionalIncludeDirectories) - - - - - - _AMD64_;%(PreprocessorDefinitions) - $(QtIncludes);$(GeneratedFilesOutDir)\..;%(AdditionalIncludeDirectories) - - - - - - - - - - - - - - - - - There was an error executing the libbitcoin_qt moc code include generation task. - - - - - - - - - - There was an error executing the libbitcoin_qt moc header generation task. - - - - - - - - - - There was an error executing the libbitcoin_qt forms header generation task. - - - - - - - - - There was an error executing the libbitcoin_qt translation file generation task. - - - - - - - - There was an error executing the libbitcoin_qt resource code generation task. - - - - - - - - - - - - - - - moccode; - mocheader; - forms; - translation; - resource; - $(BuildDependsOn); - - - - - qtclean; - $(CleanDependsOn); - - - - diff --git a/build_msvc/libbitcoin_util/libbitcoin_util.vcxproj.in b/build_msvc/libbitcoin_util/libbitcoin_util.vcxproj.in deleted file mode 100644 index adf4fa0354..0000000000 --- a/build_msvc/libbitcoin_util/libbitcoin_util.vcxproj.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {B53A5535-EE9D-4C6F-9A26-F79EE3BC3754} - - - StaticLibrary - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_wallet/libbitcoin_wallet.vcxproj.in b/build_msvc/libbitcoin_wallet/libbitcoin_wallet.vcxproj.in deleted file mode 100644 index 613d5c7199..0000000000 --- a/build_msvc/libbitcoin_wallet/libbitcoin_wallet.vcxproj.in +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {93B86837-B543-48A5-A89B-7C87ABB77DF2} - - - StaticLibrary - - - - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj.in b/build_msvc/libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj.in deleted file mode 100644 index 1a6b7b6b92..0000000000 --- a/build_msvc/libbitcoin_wallet_tool/libbitcoin_wallet_tool.vcxproj.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {F91AC55E-6F5E-4C58-9AC5-B40DB7DEEF93} - - - StaticLibrary - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libbitcoin_zmq/libbitcoin_zmq.vcxproj.in b/build_msvc/libbitcoin_zmq/libbitcoin_zmq.vcxproj.in deleted file mode 100644 index e86eea81e6..0000000000 --- a/build_msvc/libbitcoin_zmq/libbitcoin_zmq.vcxproj.in +++ /dev/null @@ -1,16 +0,0 @@ - - - - - {792D487F-F14C-49FC-A9DE-3FC150F31C3F} - - - StaticLibrary - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libleveldb/libleveldb.vcxproj b/build_msvc/libleveldb/libleveldb.vcxproj deleted file mode 100644 index 2914eb2cfb..0000000000 --- a/build_msvc/libleveldb/libleveldb.vcxproj +++ /dev/null @@ -1,61 +0,0 @@ - - - - - {18430FEF-6B61-4C53-B396-718E02850F1B} - - - StaticLibrary - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - HAVE_CRC32C=0;HAVE_SNAPPY=0;LEVELDB_IS_BIG_ENDIAN=0;_UNICODE;UNICODE;_CRT_NONSTDC_NO_DEPRECATE;LEVELDB_PLATFORM_WINDOWS;%(PreprocessorDefinitions) - 4244;4267 - ..\..\src\leveldb;..\..\src\leveldb\include;%(AdditionalIncludeDirectories) - - - - - - diff --git a/build_msvc/libminisketch/libminisketch.vcxproj b/build_msvc/libminisketch/libminisketch.vcxproj deleted file mode 100644 index b34593fe5c..0000000000 --- a/build_msvc/libminisketch/libminisketch.vcxproj +++ /dev/null @@ -1,38 +0,0 @@ - - - - - {542007E3-BE0D-4B0D-A6B0-AA8813E2558D} - - - StaticLibrary - - - - - - - - - - - - - - - - - - - - - - - 4060;4065;4146;4244;4267;4554 - HAVE_CLMUL;DISABLE_DEFAULT_FIELDS;ENABLE_FIELD_32;%(PreprocessorDefinitions) - - - - - - diff --git a/build_msvc/libsecp256k1/libsecp256k1.vcxproj b/build_msvc/libsecp256k1/libsecp256k1.vcxproj deleted file mode 100644 index 777515aa3a..0000000000 --- a/build_msvc/libsecp256k1/libsecp256k1.vcxproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - - {BB493552-3B8C-4A8C-BF69-A6E7A51D2EA6} - - - StaticLibrary - - - - - - - - - ENABLE_MODULE_RECOVERY;ENABLE_MODULE_EXTRAKEYS;ENABLE_MODULE_SCHNORRSIG;ENABLE_MODULE_ELLSWIFT;%(PreprocessorDefinitions) - USE_ASM_X86_64;%(UndefinePreprocessorDefinitions) - ..\..\src\secp256k1;%(AdditionalIncludeDirectories) - 4146;4244;4267;4334 - - - - - - diff --git a/build_msvc/libtest_util/libtest_util.vcxproj.in b/build_msvc/libtest_util/libtest_util.vcxproj.in deleted file mode 100644 index 64cfa82dcc..0000000000 --- a/build_msvc/libtest_util/libtest_util.vcxproj.in +++ /dev/null @@ -1,17 +0,0 @@ - - - - - {868474FD-35F6-4400-8EED-30A33E7521D4} - - - StaticLibrary - - - -@SOURCE_FILES@ - - - - - diff --git a/build_msvc/libunivalue/libunivalue.vcxproj b/build_msvc/libunivalue/libunivalue.vcxproj deleted file mode 100644 index 0f13a57241..0000000000 --- a/build_msvc/libunivalue/libunivalue.vcxproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - - {5724BA7D-A09A-4BA8-800B-C4C1561B3D69} - - - StaticLibrary - - - - - - - - - - - diff --git a/build_msvc/msbuild/tasks/hexdump.targets b/build_msvc/msbuild/tasks/hexdump.targets deleted file mode 100644 index 12868a9874..0000000000 --- a/build_msvc/msbuild/tasks/hexdump.targets +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - outFileInfo.LastWriteTime) - { - using (Stream inStm = File.OpenRead(RawFilePath)) - { - using (StreamWriter sw = new StreamWriter(HeaderFilePath)) - { - sw.WriteLine(SourceHeader); - int count = 0; - int rawChar = inStm.ReadByte(); - while(rawChar != -1) - { - sw.Write("0x{0:x2}, ", rawChar); - count++; - if(count % 8 == 0) - { - sw.WriteLine(); - } - rawChar = inStm.ReadByte(); - } - sw.WriteLine(SourceFooter); - } - } - } -} -]]> - - - - \ No newline at end of file diff --git a/build_msvc/msbuild/tasks/replaceinfile.targets b/build_msvc/msbuild/tasks/replaceinfile.targets deleted file mode 100644 index 2ccb8b30e0..0000000000 --- a/build_msvc/msbuild/tasks/replaceinfile.targets +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/build_msvc/msvc-autogen.py b/build_msvc/msvc-autogen.py deleted file mode 100755 index 9484f0cb89..0000000000 --- a/build_msvc/msvc-autogen.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2016-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -import os -import re -import argparse -from shutil import copyfile - -SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'src')) -DEFAULT_PLATFORM_TOOLSET = R'v143' - -libs = [ - 'libbitcoin_cli', - 'libbitcoin_common', - 'libbitcoin_crypto', - 'libbitcoin_node', - 'libbitcoin_util', - 'libbitcoin_wallet_tool', - 'libbitcoin_wallet', - 'libbitcoin_zmq', - 'bench_bitcoin', - 'libtest_util', -] - -ignore_list = [ -] - -lib_sources = {} - - -def parse_makefile(makefile): - with open(makefile, 'r', encoding='utf-8') as file: - current_lib = '' - for line in file.read().splitlines(): - if current_lib: - source = line.split()[0] - if source.endswith('.cpp') and not source.startswith('$') and source not in ignore_list: - source_filename = source.replace('/', '\\') - object_filename = source.replace('/', '_')[:-4] + ".obj" - lib_sources[current_lib].append((source_filename, object_filename)) - if not line.endswith('\\'): - current_lib = '' - continue - for lib in libs: - _lib = lib.replace('-', '_') - if re.search(_lib + '.*_SOURCES \\= \\\\', line): - current_lib = lib - lib_sources[current_lib] = [] - break - -def parse_config_into_btc_config(): - def find_between( s, first, last ): - try: - start = s.index( first ) + len( first ) - end = s.index( last, start ) - return s[start:end] - except ValueError: - return "" - - config_info = [] - with open(os.path.join(SOURCE_DIR,'../configure.ac'), encoding="utf8") as f: - for line in f: - if line.startswith("define"): - config_info.append(find_between(line, "(_", ")")) - - config_info = [c for c in config_info if not c.startswith("COPYRIGHT_HOLDERS")] - - config_dict = dict(item.split(", ") for item in config_info) - config_dict["PACKAGE_VERSION"] = f"\"{config_dict['CLIENT_VERSION_MAJOR']}.{config_dict['CLIENT_VERSION_MINOR']}.{config_dict['CLIENT_VERSION_BUILD']}\"" - version = config_dict["PACKAGE_VERSION"].strip('"') - config_dict["PACKAGE_STRING"] = f"\"Bitcoin Core {version}\"" - - with open(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h.in'), "r", encoding="utf8") as template_file: - template = template_file.readlines() - - for index, line in enumerate(template): - header = "" - if line.startswith("#define"): - header = line.split(" ")[1] - if header in config_dict: - template[index] = line.replace("$", f"{config_dict[header]}") - - with open(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h'), "w", encoding="utf8") as btc_config: - btc_config.writelines(template) - -def set_properties(vcxproj_filename, placeholder, content): - with open(vcxproj_filename + '.in', 'r', encoding='utf-8') as vcxproj_in_file: - with open(vcxproj_filename, 'w', encoding='utf-8') as vcxproj_file: - vcxproj_file.write(vcxproj_in_file.read().replace(placeholder, content)) - -def main(): - parser = argparse.ArgumentParser(description='Bitcoin-core msbuild configuration initialiser.') - parser.add_argument('-toolset', nargs='?', default=DEFAULT_PLATFORM_TOOLSET, - help='Optionally sets the msbuild platform toolset, e.g. v143 for Visual Studio 2022.' - ' default is %s.'%DEFAULT_PLATFORM_TOOLSET) - args = parser.parse_args() - set_properties(os.path.join(SOURCE_DIR, '../build_msvc/common.init.vcxproj'), '@TOOLSET@', args.toolset) - - for makefile_name in os.listdir(SOURCE_DIR): - if 'Makefile' in makefile_name: - parse_makefile(os.path.join(SOURCE_DIR, makefile_name)) - for key, value in lib_sources.items(): - vcxproj_filename = os.path.abspath(os.path.join(os.path.dirname(__file__), key, key + '.vcxproj')) - content = '' - for source_filename, object_filename in value: - content += ' \n' - content += ' $(IntDir)' + object_filename + '\n' - content += ' \n' - set_properties(vcxproj_filename, '@SOURCE_FILES@\n', content) - parse_config_into_btc_config() - copyfile(os.path.join(SOURCE_DIR,'../build_msvc/bitcoin_config.h'), os.path.join(SOURCE_DIR, 'config/bitcoin-config.h')) - -if __name__ == '__main__': - main() diff --git a/build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj b/build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj deleted file mode 100644 index 3776317fc7..0000000000 --- a/build_msvc/test_bitcoin-qt/test_bitcoin-qt.vcxproj +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - {51201D5E-D939-4854-AE9D-008F03FF518E} - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - $(IntDir)wallet_test_util.obj - - - - - - - - - $(IntDir)qt_test_util.obj - - - - - - - - - - - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {0667528c-d734-4009-adf9-c0d6c4a5a5a6} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {2b4abff8-d1fd-4845-88c9-1f3c0a6512bf} - - - {460fee33-1fe1-483f-b3bf-931ff8e969a5} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {792d487f-f14c-49fc-a9de-3fc150f31c3f} - - - {1e065f03-3566-47d0-8fa9-daa72b084e7d} - - - {18430fef-6b61-4c53-b396-718e02850f1b} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - - - - - - - ..\libbitcoin_qt\$(GeneratedFilesOutDir)\..\;$(QtIncludeDir)\QtTest;$(QtIncludes);%(AdditionalIncludeDirectories) - - - $(QtLibraryDir)\Qt5Test.lib;$(QtReleaseLibraries);%(AdditionalDependencies) - /ignore:4206 /LTCG:OFF - - - - - - ..\libbitcoin_qt\$(GeneratedFilesOutDir)\..\;$(QtIncludeDir)\QtTest;$(QtIncludes);%(AdditionalIncludeDirectories) - - - $(QtDebugLibraries);%(AdditionalDependencies) - /ignore:4206 - - - - - - - - - - - - - There was an error executing the test_bitcoin-qt moc code generation task. - - - - - - - - - - - - - moccode; - $(BuildDependsOn); - - - - - QtTestCleanGeneratedFiles; - $(CleanDependsOn); - - - diff --git a/build_msvc/test_bitcoin/test_bitcoin.vcxproj b/build_msvc/test_bitcoin/test_bitcoin.vcxproj deleted file mode 100644 index de836bc01d..0000000000 --- a/build_msvc/test_bitcoin/test_bitcoin.vcxproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - - {A56B73DB-D46D-4882-8374-1FE3FFA08F07} - - - Application - $(SolutionDir)$(Platform)\$(Configuration)\ - - - - - - - - - - - - - - {542007e3-be0d-4b0d-a6b0-aa8813e2558d} - - - {2b384fa8-9ee1-4544-93cb-0d733c25e8ce} - - - {0667528c-d734-4009-adf9-c0d6c4a5a5a6} - - - {7c87e378-df58-482e-aa2f-1bc129bc19ce} - - - {6190199c-6cf4-4dad-bfbd-93fa72a760c1} - - - {460fee33-1fe1-483f-b3bf-931ff8e969a5} - - - {b53a5535-ee9d-4c6f-9a26-f79ee3bc3754} - - - {93b86837-b543-48a5-a89b-7c87abb77df2} - - - {792d487f-f14c-49fc-a9de-3fc150f31c3f} - - - {1e065f03-3566-47d0-8fa9-daa72b084e7d} - - - {5724ba7d-a09a-4ba8-800b-c4c1561b3d69} - - - {bb493552-3b8c-4a8c-bf69-a6e7a51d2ea6} - - - {18430fef-6b61-4c53-b396-718e02850f1b} - - - - - There was an error executing the JSON test header generation task. - - - - - - - - - - - - - diff --git a/build_msvc/vcpkg.json b/build_msvc/vcpkg.json deleted file mode 100644 index 3557269be0..0000000000 --- a/build_msvc/vcpkg.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "bitcoin-core", - "version-string": "1", - "dependencies": [ - "berkeleydb", - "boost-multi-index", - "boost-process", - "boost-signals2", - "boost-test", - "sqlite3", - { - "name": "libevent", - "features": ["thread"] - }, - "zeromq" - ], - "builtin-baseline": "f14984af3738e69f197bf0e647a8dca12de92996", - "overrides": [ - { - "name": "libevent", - "version": "2.1.12#7" - } - ] -} diff --git a/ci/README.md b/ci/README.md index f89af329dd..377aae7fa0 100644 --- a/ci/README.md +++ b/ci/README.md @@ -9,15 +9,15 @@ If the repository is not a fresh git clone, you might have to clean files from p The ci needs to perform various sysadmin tasks such as installing packages or writing to the user's home directory. While it should be fine to run -the ci system locally on you development box, the ci scripts can generally be assumed to have received less review and +the ci system locally on your development box, the ci scripts can generally be assumed to have received less review and testing compared to other parts of the codebase. If you want to keep the work tree clean, you might want to run the ci system in a virtual machine with a Linux operating system of your choice. To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage -requires `bash`, `docker`, and `python3` to be installed. To install all requirements on Ubuntu, run +requires `bash`, `docker`, and `python3` to be installed. To run on different architectures than the host `qemu` is also required. To install all requirements on Ubuntu, run ``` -sudo apt install bash docker.io python3 +sudo apt install bash docker.io python3 qemu-user-static ``` It is recommended to run the ci system in a clean env. To run the test stage @@ -52,5 +52,5 @@ in order. ### Cache In order to avoid rebuilding all dependencies for each build, the binaries are -cached and re-used when possible. Changes in the dependency-generator will +cached and reused when possible. Changes in the dependency-generator will trigger cache-invalidation and rebuilds as necessary. diff --git a/ci/lint/04_install.sh b/ci/lint/04_install.sh index 8113500fb2..f2d390bd1b 100755 --- a/ci/lint/04_install.sh +++ b/ci/lint/04_install.sh @@ -1,24 +1,27 @@ #!/usr/bin/env bash # -# Copyright (c) 2018-2022 The Bitcoin Core developers +# Copyright (c) 2018-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C -export PATH=$PWD/ci/retry:$PATH +export CI_RETRY_EXE="/ci_retry --" + +pushd "/" ${CI_RETRY_EXE} apt-get update # Lint dependencies: +# - cargo (used to run the lint tests) # - curl/xz-utils (to install shellcheck) # - git (used in many lint scripts) # - gpg (used by verify-commits) -${CI_RETRY_EXE} apt-get install -y curl xz-utils git gpg +${CI_RETRY_EXE} apt-get install -y cargo curl xz-utils git gpg PYTHON_PATH="/python_build" if [ ! -d "${PYTHON_PATH}/bin" ]; then ( - git clone https://github.com/pyenv/pyenv.git + ${CI_RETRY_EXE} git clone --depth=1 https://github.com/pyenv/pyenv.git cd pyenv/plugins/python-build || exit 1 ./install.sh ) @@ -27,21 +30,28 @@ if [ ! -d "${PYTHON_PATH}/bin" ]; then libbz2-dev libreadline-dev libsqlite3-dev curl llvm \ libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev \ clang - env CC=clang python-build "$(cat "./.python-version")" "${PYTHON_PATH}" + env CC=clang python-build "$(cat "/.python-version")" "${PYTHON_PATH}" fi export PATH="${PYTHON_PATH}/bin:${PATH}" command -v python3 python3 --version ${CI_RETRY_EXE} pip3 install \ - codespell==2.2.5 \ - flake8==6.1.0 \ + codespell==2.4.1 \ lief==0.13.2 \ mypy==1.4.1 \ pyzmq==25.1.0 \ + ruff==0.5.5 \ vulture==2.6 SHELLCHECK_VERSION=v0.8.0 curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | \ tar --xz -xf - --directory /tmp/ mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/ + +MLC_VERSION=v0.19.0 +MLC_BIN=mlc-x86_64-linux +curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc" +chmod +x /usr/bin/mlc + +popd || exit diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index ccde12a033..6d637c2a43 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2018-2022 The Bitcoin Core developers +# Copyright (c) 2018-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -8,30 +8,15 @@ export LC_ALL=C set -ex -if [ -n "$LOCAL_BRANCH" ]; then - # To faithfully recreate CI linting locally, specify all commits on the current - # branch. - COMMIT_RANGE="$(git merge-base HEAD master)..HEAD" -elif [ -n "$CIRRUS_PR" ]; then - COMMIT_RANGE="HEAD~..HEAD" - echo - git log --no-merges --oneline "$COMMIT_RANGE" - echo - test/lint/commit-script-check.sh "$COMMIT_RANGE" -else - COMMIT_RANGE="SKIP_EMPTY_NOT_A_PR" +if [ -n "$CIRRUS_PR" ]; then + export COMMIT_RANGE="HEAD~..HEAD" + if [ "$(git rev-list -1 HEAD)" != "$(git rev-list -1 --merges HEAD)" ]; then + echo "Error: The top commit must be a merge commit, usually the remote 'pull/${PR_NUMBER}/merge' branch." + false + fi fi -export COMMIT_RANGE -# This only checks that the trees are pure subtrees, it is not doing a full -# check with -r to not have to fetch all the remotes. -test/lint/git-subtree-check.sh src/crypto/ctaes -test/lint/git-subtree-check.sh src/secp256k1 -test/lint/git-subtree-check.sh src/minisketch -test/lint/git-subtree-check.sh src/leveldb -test/lint/git-subtree-check.sh src/crc32c -test/lint/check-doc.py -test/lint/all-lint.py +RUST_BACKTRACE=1 cargo run --manifest-path "./test/lint/test_runner/Cargo.toml" if [ "$CIRRUS_REPO_FULL_NAME" = "bitcoin/bitcoin" ] && [ "$CIRRUS_PR" = "" ] ; then # Sanity check only the last few commits to get notified of missing sigs, diff --git a/ci/lint/container-entrypoint.sh b/ci/lint/container-entrypoint.sh index e94a75e22c..84e60be291 100755 --- a/ci/lint/container-entrypoint.sh +++ b/ci/lint/container-entrypoint.sh @@ -13,7 +13,7 @@ git config --global --add safe.directory /bitcoin export PATH="/python_build/bin:${PATH}" if [ -z "$1" ]; then - LOCAL_BRANCH=1 bash -ic "./ci/lint/06_script.sh" + bash -ic "./ci/lint/06_script.sh" else exec "$@" fi diff --git a/ci/lint_imagefile b/ci/lint_imagefile index 4136a9bfde..9da3747e08 100644 --- a/ci/lint_imagefile +++ b/ci/lint_imagefile @@ -4,11 +4,12 @@ # See test/lint/README.md for usage. -FROM debian:bookworm +FROM mirror.gcr.io/ubuntu:24.04 ENV DEBIAN_FRONTEND=noninteractive ENV LC_ALL=C.UTF-8 +COPY ./ci/retry/retry /ci_retry COPY ./.python-version /.python-version COPY ./ci/lint/container-entrypoint.sh /entrypoint.sh COPY ./ci/lint/04_install.sh /install.sh diff --git a/ci/lint_run.sh b/ci/lint_run.sh new file mode 100755 index 0000000000..6327c3c456 --- /dev/null +++ b/ci/lint_run.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +# +# Copyright (c) The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 +set -o errexit -o pipefail -o xtrace + +# Only used in .cirrus.yml. Refer to test/lint/README.md on how to run locally. +export PATH="/python_build/bin:${PATH}" +./ci/lint/06_script.sh diff --git a/ci/lint_run_all.sh b/ci/lint_run_all.sh index b56ee0d303..ab3f4392dc 100755 --- a/ci/lint_run_all.sh +++ b/ci/lint_run_all.sh @@ -1,12 +1,18 @@ #!/usr/bin/env bash # -# Copyright (c) 2019-2020 The Bitcoin Core developers +# Copyright (c) 2019-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C.UTF-8 -set -o errexit; source ./ci/test/00_setup_env.sh +# Only used in .cirrus.yml for stale re-runs of old pull request tasks. This +# file can be removed in September 2025. + +cp "./ci/retry/retry" "/ci_retry" +cp "./.python-version" "/.python-version" +mkdir --parents "/test/lint" +cp --recursive "./test/lint/test_runner" "/test/lint/" set -o errexit; source ./ci/lint/04_install.sh set -o errexit ./ci/lint/06_script.sh diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 62318000db..cf8fbb006f 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2019-2022 The Bitcoin Core developers +# Copyright (c) 2019-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -46,7 +46,6 @@ export RUN_TIDY=${RUN_TIDY:-false} # This is needed because some ci machines have slow CPU or disk, so sanitizers # might be slow or a reindex might be waiting on disk IO. export TEST_RUNNER_TIMEOUT_FACTOR=${TEST_RUNNER_TIMEOUT_FACTOR:-40} -export TEST_RUNNER_ENV=${TEST_RUNNER_ENV:-} export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false} # Randomize test order. @@ -54,20 +53,21 @@ export RUN_FUZZ_TESTS=${RUN_FUZZ_TESTS:-false} export BOOST_TEST_RANDOM=${BOOST_TEST_RANDOM:-1} # See man 7 debconf export DEBIAN_FRONTEND=noninteractive -export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-100M} +export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-500M} export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp} export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1} # The cache dir. # This folder exists only on the ci guest, and on the ci host as a volume. -export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache} +export CCACHE_DIR="${CCACHE_DIR:-$BASE_SCRATCH_DIR/ccache}" # Folder where the build result is put (bin and lib). export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out} -# Folder where the build is done (dist and out-of-tree build). -export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build} # The folder for previous release binaries. # This folder exists only on the ci guest, and on the ci host as a volume. export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/prev_releases} -export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps bison} +export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential pkgconf curl ca-certificates ccache python3 rsync git procps bison e2fsprogs cmake ninja-build} export GOAL=${GOAL:-install} export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets} export CI_RETRY_EXE=${CI_RETRY_EXE:-"retry --"} + +# The --platform argument used with `docker build` and `docker run`. +export CI_IMAGE_PLATFORM=${CI_IMAGE_PLATFORM:-"linux"} # Force linux, but use native arch by default diff --git a/ci/test/00_setup_env_android.sh b/ci/test/00_setup_env_android.sh deleted file mode 100755 index 97a6bd7318..0000000000 --- a/ci/test/00_setup_env_android.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -export HOST=aarch64-linux-android -export PACKAGES="unzip openjdk-8-jdk gradle" -export CONTAINER_NAME=ci_android -export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04" - -export RUN_UNIT_TESTS=false -export RUN_FUNCTIONAL_TESTS=false - -export ANDROID_API_LEVEL=28 -export ANDROID_BUILD_TOOLS_VERSION=28.0.3 -export ANDROID_NDK_VERSION=23.2.8568313 -export ANDROID_TOOLS_URL=https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip -export ANDROID_HOME="${DEPENDS_DIR}/SDKs/android" -export ANDROID_NDK_HOME="${ANDROID_HOME}/ndk/${ANDROID_NDK_VERSION}" -export DEP_OPTS="ANDROID_SDK=${ANDROID_HOME} ANDROID_NDK=${ANDROID_NDK_HOME} ANDROID_API_LEVEL=${ANDROID_API_LEVEL} ANDROID_TOOLCHAIN_BIN=${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/" - -export BITCOIN_CONFIG="--disable-tests --enable-gui-tests --disable-bench --disable-fuzz-binary --without-utils --without-libs --without-daemon" diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh index 65d37f01d9..45dabb8f38 100755 --- a/ci/test/00_setup_env_arm.sh +++ b/ci/test/00_setup_env_arm.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2019-2021 The Bitcoin Core developers +# Copyright (c) 2019-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -10,11 +10,12 @@ export HOST=arm-linux-gnueabihf export DPKG_ADD_ARCH="armhf" export PACKAGES="python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf" export CONTAINER_NAME=ci_arm_linux -export CI_IMAGE_NAME_TAG="docker.io/arm64v8/debian:bookworm" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" # Check that https://packages.ubuntu.com/noble/g++-arm-linux-gnueabihf (version 13.x, similar to guix) can cross-compile +export CI_IMAGE_PLATFORM="linux/arm64" export USE_BUSY_BOX=true export RUN_UNIT_TESTS=true export RUN_FUNCTIONAL_TESTS=false export GOAL="install" # -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 -export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS=-Wno-psabi" +export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DCMAKE_CXX_FLAGS='-Wno-psabi -Wno-error=maybe-uninitialized'" diff --git a/ci/test/00_setup_env_i686_centos.sh b/ci/test/00_setup_env_i686_centos.sh deleted file mode 100755 index a8bc0d0ca0..0000000000 --- a/ci/test/00_setup_env_i686_centos.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2020-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -export HOST=i686-pc-linux-gnu -export CONTAINER_NAME=ci_i686_centos -export CI_IMAGE_NAME_TAG="quay.io/centos/amd64:stream9" -export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python3 python3-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison util-linux" -export PIP_PACKAGES="pyzmq" -export GOAL="install" -export NO_WERROR=1 # Suppress error: #warning _FORTIFY_SOURCE > 2 is treated like 2 on this platform [-Werror=cpp] -export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports" -export CONFIG_SHELL="/bin/dash" diff --git a/ci/test/00_setup_env_i686_multiprocess.sh b/ci/test/00_setup_env_i686_multiprocess.sh index b11a387660..3144cf22fc 100755 --- a/ci/test/00_setup_env_i686_multiprocess.sh +++ b/ci/test/00_setup_env_i686_multiprocess.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2020-2022 The Bitcoin Core developers +# Copyright (c) 2020-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -8,10 +8,16 @@ export LC_ALL=C.UTF-8 export HOST=i686-pc-linux-gnu export CONTAINER_NAME=ci_i686_multiprocess -export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:20.04" -export PACKAGES="cmake llvm clang g++-multilib" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_PLATFORM="linux/amd64" +export PACKAGES="llvm clang g++-multilib" export DEP_OPTS="DEBUG=1 MULTIPROCESS=1" export GOAL="install" -export BITCOIN_CONFIG="--enable-debug CC='clang -m32' CXX='clang++ -m32' \ -LDFLAGS='--rtlib=compiler-rt -lgcc_s' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE'" -export TEST_RUNNER_ENV="BITCOIND=bitcoin-node" +export TEST_RUNNER_EXTRA="--v2transport" +export BITCOIN_CONFIG="\ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_COMPILER='clang;-m32' \ + -DCMAKE_CXX_COMPILER='clang++;-m32' \ + -DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' \ +" +export BITCOIN_CMD="bitcoin -m" # Used in functional tests diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac_cross.sh similarity index 55% rename from ci/test/00_setup_env_mac.sh rename to ci/test/00_setup_env_mac_cross.sh index 85d30b758f..a0d9082f4b 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac_cross.sh @@ -9,15 +9,12 @@ export LC_ALL=C.UTF-8 export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks} export CONTAINER_NAME=ci_macos_cross -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export HOST=x86_64-apple-darwin -export PACKAGES="cmake libz-dev python3-setuptools xorriso" -export XCODE_VERSION=12.2 -export XCODE_BUILD_ID=12B45b +export PACKAGES="clang lld llvm zip" +export XCODE_VERSION=15.0 +export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" - -# False-positive warning is fixed with clang 17, remove this when that version -# can be used. -export BITCOIN_CONFIG="--with-gui --enable-reduce-exports LDFLAGS=-Wno-error=unused-command-line-argument" +export BITCOIN_CONFIG="-DBUILD_GUI=ON -DREDUCE_EXPORTS=ON" diff --git a/ci/test/00_setup_env_mac_native.sh b/ci/test/00_setup_env_mac_native.sh index c9f65bf397..1b4bee1566 100755 --- a/ci/test/00_setup_env_mac_native.sh +++ b/ci/test/00_setup_env_mac_native.sh @@ -6,13 +6,12 @@ export LC_ALL=C.UTF-8 -export HOST=x86_64-apple-darwin -export PIP_PACKAGES="zmq" -export GOAL="install" -export BITCOIN_CONFIG="--with-gui --with-miniupnpc --with-natpmp --enable-reduce-exports" +# Homebrew's python@3.12 is marked as externally managed (PEP 668). +# Therefore, `--break-system-packages` is needed. +export PIP_PACKAGES="--break-system-packages zmq" +export GOAL="install deploy" +export CMAKE_GENERATOR="Ninja" +export BITCOIN_CONFIG="-DBUILD_GUI=ON -DWITH_ZMQ=ON -DREDUCE_EXPORTS=ON" export CI_OS_NAME="macos" export NO_DEPENDS=1 export OSX_SDK="" -export CCACHE_MAXSIZE=400M -export RUN_FUZZ_TESTS=true -export FUZZ_TESTS_CONFIG="--exclude banman" # https://github.com/bitcoin/bitcoin/issues/27924 diff --git a/ci/test/00_setup_env_mac_native_fuzz.sh b/ci/test/00_setup_env_mac_native_fuzz.sh new file mode 100755 index 0000000000..cacf2423ac --- /dev/null +++ b/ci/test/00_setup_env_mac_native_fuzz.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# +# Copyright (c) The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +export CMAKE_GENERATOR="Ninja" +export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON" +export CI_OS_NAME="macos" +export NO_DEPENDS=1 +export OSX_SDK="" +export RUN_UNIT_TESTS=false +export RUN_FUNCTIONAL_TESTS=false +export RUN_FUZZ_TESTS=true +export GOAL="all" diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index b03fea4af9..b2650ada0c 100755 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -6,8 +6,11 @@ export LC_ALL=C.UTF-8 -# Only install BCC tracing packages in Cirrus CI. -if [[ "${CIRRUS_CI}" == "true" ]]; then +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" + +# Only install BCC tracing packages in CI. Container has to match the host for BCC to work. +if [[ "${INSTALL_BCC_TRACING_TOOLS}" == "true" ]]; then + # Required for USDT functional tests to run BPFCC_PACKAGE="bpfcc-tools linux-headers-$(uname --kernel-release)" export CI_CONTAINER_CAP="--privileged -v /sys/kernel:/sys/kernel:rw" else @@ -16,10 +19,17 @@ else fi export CONTAINER_NAME=ci_native_asan -export PACKAGES="systemtap-sdt-dev clang-16 llvm-16 libclang-rt-16-dev python3-zmq qtbase5-dev qttools5-dev-tools libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libqrencode-dev libsqlite3-dev ${BPFCC_PACKAGE}" -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version). +export APT_LLVM_V="20" +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}" export NO_DEPENDS=1 export GOAL="install" -export BITCOIN_CONFIG="--enable-c++20 --enable-usdt --enable-zmq --with-incompatible-bdb --with-gui=qt5 \ -CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \ ---with-sanitizers=address,float-divide-by-zero,integer,undefined CC=clang-16 CXX=clang++-16" +export BITCOIN_CONFIG="\ + -DWITH_USDT=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON \ + -DSANITIZERS=address,float-divide-by-zero,integer,undefined \ + -DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \ + -DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \ + -DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \ + -DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \ + -DAPPEND_CXXFLAGS='-std=c++23' \ + -DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER' \ +" diff --git a/ci/test/00_setup_env_native_centos.sh b/ci/test/00_setup_env_native_centos.sh new file mode 100755 index 0000000000..25b9923dc7 --- /dev/null +++ b/ci/test/00_setup_env_native_centos.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2020-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +export CONTAINER_NAME=ci_native_centos +export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream10" +export CI_BASE_PACKAGES="gcc-c++ glibc-devel libstdc++-devel ccache make ninja-build git python3 python3-pip which patch xz procps-ng ksh rsync coreutils bison e2fsprogs cmake" +export PIP_PACKAGES="pyzmq" +export GOAL="install" +export BITCOIN_CONFIG="\ + -DWITH_ZMQ=ON \ + -DBUILD_GUI=ON \ + -DREDUCE_EXPORTS=ON \ + -DAPPEND_CPPFLAGS='-D_GLIBCXX_ASSERTIONS' \ + -DCMAKE_BUILD_TYPE=Debug \ +" diff --git a/ci/test/00_setup_env_native_fuzz.sh b/ci/test/00_setup_env_native_fuzz.sh index b932e69c95..c5220211fc 100755 --- a/ci/test/00_setup_env_native_fuzz.sh +++ b/ci/test/00_setup_env_native_fuzz.sh @@ -6,15 +6,22 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version). +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_fuzz -export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev libevent-dev libboost-dev libsqlite3-dev" +export APT_LLVM_V="20" +export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev libevent-dev libboost-dev libsqlite3-dev" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true -export GOAL="install" +export GOAL="all" export CI_CONTAINER_CAP="--cap-add SYS_PTRACE" # If run with (ASan + LSan), the container needs access to ptrace (https://github.com/google/sanitizers/issues/764) -export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,address,undefined,float-divide-by-zero,integer \ -CC='clang-16 -ftrivial-auto-var-init=pattern' CXX='clang++-16 -ftrivial-auto-var-init=pattern'" -export CCACHE_MAXSIZE=200M +export BITCOIN_CONFIG="\ + -DBUILD_FOR_FUZZING=ON \ + -DSANITIZERS=fuzzer,address,undefined,float-divide-by-zero,integer \ + -DCMAKE_C_COMPILER=clang-${APT_LLVM_V} \ + -DCMAKE_CXX_COMPILER=clang++-${APT_LLVM_V} \ + -DCMAKE_C_FLAGS='-ftrivial-auto-var-init=pattern' \ + -DCMAKE_CXX_FLAGS='-ftrivial-auto-var-init=pattern' \ +" +export LLVM_SYMBOLIZER_PATH="/usr/bin/llvm-symbolizer-${APT_LLVM_V}" diff --git a/ci/test/00_setup_env_native_fuzz_with_msan.sh b/ci/test/00_setup_env_native_fuzz_with_msan.sh index 6055e0ad19..fe107a74ba 100755 --- a/ci/test/00_setup_env_native_fuzz_with_msan.sh +++ b/ci/test/00_setup_env_native_fuzz_with_msan.sh @@ -6,20 +6,27 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" LIBCXX_DIR="/msan/cxx_build/" export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls" 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" export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}" export CONTAINER_NAME="ci_native_fuzz_msan" -export PACKAGES="cmake ninja-build" -# BDB generates false-positives and will be removed in future -export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" -export GOAL="install" -export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer,memory --disable-hardening --with-asm=no CFLAGS='${MSAN_FLAGS}' CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" +export PACKAGES="ninja-build" +export DEP_OPTS="DEBUG=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" +export GOAL="all" +# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered. +# _FORTIFY_SOURCE is not compatible with MSAN. +export BITCOIN_CONFIG="\ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS_DEBUG='' \ + -DCMAKE_CXX_FLAGS_DEBUG='' \ + -DBUILD_FOR_FUZZING=ON \ + -DSANITIZERS=fuzzer,memory \ + -DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE -U_FORTIFY_SOURCE' \ +" export USE_MEMORY_SANITIZER="true" export RUN_UNIT_TESTS="false" export RUN_FUNCTIONAL_TESTS="false" export RUN_FUZZ_TESTS=true -export CCACHE_MAXSIZE=250M diff --git a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh index 1f60c46803..b2f3545b37 100755 --- a/ci/test/00_setup_env_native_fuzz_with_valgrind.sh +++ b/ci/test/00_setup_env_native_fuzz_with_valgrind.sh @@ -6,15 +6,16 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/debian:bookworm" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_fuzz_valgrind -export PACKAGES="clang llvm libclang-rt-dev libevent-dev libboost-dev libsqlite3-dev valgrind" +export PACKAGES="libevent-dev libboost-dev libsqlite3-dev valgrind" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=true export FUZZ_TESTS_CONFIG="--valgrind" -export GOAL="install" -# Temporarily pin dwarf 4, until using Valgrind 3.20 or later -export BITCOIN_CONFIG="--enable-fuzz --with-sanitizers=fuzzer CC='clang -gdwarf-4' CXX='clang++ -gdwarf-4'" -export CCACHE_MAXSIZE=200M +export GOAL="all" +export BITCOIN_CONFIG="\ + -DBUILD_FOR_FUZZING=ON \ + -DCMAKE_CXX_FLAGS='-Wno-error=array-bounds' \ +" diff --git a/ci/test/00_setup_env_native_msan.sh b/ci/test/00_setup_env_native_msan.sh index d73a7db0e6..756c3d3027 100755 --- a/ci/test/00_setup_env_native_msan.sh +++ b/ci/test/00_setup_env_native_msan.sh @@ -6,18 +6,23 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:22.04" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" LIBCXX_DIR="/msan/cxx_build/" export MSAN_FLAGS="-fsanitize=memory -fsanitize-memory-track-origins=2 -fno-omit-frame-pointer -g -O1 -fno-optimize-sibling-calls" 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" export MSAN_AND_LIBCXX_FLAGS="${MSAN_FLAGS} ${LIBCXX_FLAGS}" export CONTAINER_NAME="ci_native_msan" -export PACKAGES="cmake ninja-build" -# BDB generates false-positives and will be removed in future -export DEP_OPTS="NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" +export PACKAGES="ninja-build" +export DEP_OPTS="DEBUG=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" export GOAL="install" -export BITCOIN_CONFIG="--with-sanitizers=memory --disable-hardening --with-asm=no CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'" +# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered. +# _FORTIFY_SOURCE is not compatible with MSAN. +export BITCOIN_CONFIG="\ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS_DEBUG='' \ + -DCMAKE_CXX_FLAGS_DEBUG='' \ + -DSANITIZERS=memory \ + -DAPPEND_CPPFLAGS='-U_FORTIFY_SOURCE' \ +" export USE_MEMORY_SANITIZER="true" -export RUN_FUNCTIONAL_TESTS="false" -export CCACHE_MAXSIZE=250M diff --git a/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh b/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh index 454a4b8dff..74bc891aaf 100755 --- a/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh +++ b/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh @@ -7,9 +7,9 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:20.04" -# Use minimum supported python3.8 and clang-10, see doc/dependencies.md -export PACKAGES="python3-zmq clang-10 llvm-10 libc++abi-10-dev libc++-10-dev" -export DEP_OPTS="NO_WALLET=1 CC=clang-10 CXX='clang++-10 -stdlib=libc++'" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:bookworm" +# Use minimum supported python3.10 (or best-effort 3.11) and clang-16, see doc/dependencies.md +export PACKAGES="python3-zmq clang-16 llvm-16 libc++abi-16-dev libc++-16-dev" +export DEP_OPTS="NO_WALLET=1 CC=clang-16 CXX='clang++-16 -stdlib=libc++'" export GOAL="install" -export BITCOIN_CONFIG="--enable-reduce-exports --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared" +export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_UTIL_CHAINSTATE=ON -DBUILD_KERNEL_LIB=ON -DBUILD_SHARED_LIBS=ON" diff --git a/ci/test/00_setup_env_native_previous_releases.sh b/ci/test/00_setup_env_native_previous_releases.sh new file mode 100755 index 0000000000..2a26c4c578 --- /dev/null +++ b/ci/test/00_setup_env_native_previous_releases.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2019-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +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" +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 RUN_UNIT_TESTS_SEQUENTIAL="true" +export RUN_UNIT_TESTS="false" +export GOAL="install" +export DOWNLOAD_PREVIOUS_RELEASES="true" +export BITCOIN_CONFIG="\ + -DWITH_ZMQ=ON -DBUILD_GUI=ON -DREDUCE_EXPORTS=ON \ + -DCMAKE_BUILD_TYPE=Debug \ + -DCMAKE_C_FLAGS='-funsigned-char' \ + -DCMAKE_C_FLAGS_DEBUG='-g2 -O2' \ + -DCMAKE_CXX_FLAGS='-funsigned-char' \ + -DCMAKE_CXX_FLAGS_DEBUG='-g2 -O2' \ + -DAPPEND_CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' \ +" diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh deleted file mode 100755 index 0fad95e2cb..0000000000 --- a/ci/test/00_setup_env_native_qt5.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-present The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -export CONTAINER_NAME=ci_native_qt5 -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:20.04" -# Use minimum supported python3.8 and gcc-9, see doc/dependencies.md -export PACKAGES="gcc-9 g++-9 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" -export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9" -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 RUN_UNIT_TESTS_SEQUENTIAL="true" -export RUN_UNIT_TESTS="false" -export GOAL="install" -export NO_WERROR=1 # -Werror=maybe-uninitialized -export DOWNLOAD_PREVIOUS_RELEASES="true" -export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports --enable-debug \ -CFLAGS=\"-g0 -O2 -funsigned-char\" CPPFLAGS='-DBOOST_MULTI_INDEX_ENABLE_SAFE_MODE' CXXFLAGS=\"-g0 -O2 -funsigned-char\"" diff --git a/ci/test/00_setup_env_native_tidy.sh b/ci/test/00_setup_env_native_tidy.sh index f8f0587886..d67616c1c6 100755 --- a/ci/test/00_setup_env_native_tidy.sh +++ b/ci/test/00_setup_env_native_tidy.sh @@ -6,14 +6,22 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version). +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_tidy -export PACKAGES="clang-16 libclang-16-dev llvm-16-dev libomp-16-dev clang-tidy-16 jq bear cmake libevent-dev libboost-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev systemtap-sdt-dev libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libqrencode-dev libsqlite3-dev libdb++-dev" +export TIDY_LLVM_V="20" +export APT_LLVM_V="${TIDY_LLVM_V}" +export PACKAGES="clang-${TIDY_LLVM_V} libclang-${TIDY_LLVM_V}-dev llvm-${TIDY_LLVM_V}-dev libomp-${TIDY_LLVM_V}-dev clang-tidy-${TIDY_LLVM_V} jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev qt6-base-dev qt6-tools-dev qt6-l10n-tools libqrencode-dev libsqlite3-dev" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export RUN_FUZZ_TESTS=false +export RUN_CHECK_DEPS=true export RUN_TIDY=true export GOAL="install" -export BITCOIN_CONFIG="CC=clang-16 CXX=clang++-16 --with-incompatible-bdb --disable-hardening CFLAGS='-O0 -g0' CXXFLAGS='-O0 -g0 -I/usr/lib/llvm-16/lib/clang/16/include'" -export CCACHE_MAXSIZE=200M +export BITCOIN_CONFIG="\ + -DWITH_ZMQ=ON -DBUILD_GUI=ON -DBUILD_BENCH=ON -DWITH_USDT=ON \ + -DCMAKE_C_COMPILER=clang-${TIDY_LLVM_V} \ + -DCMAKE_CXX_COMPILER=clang++-${TIDY_LLVM_V} \ + -DCMAKE_C_FLAGS_RELWITHDEBINFO='-O0 -g0' \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO='-O0 -g0' \ +" diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index 52198ec2b1..b341adfec5 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -7,8 +7,10 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_tsan -export CI_IMAGE_NAME_TAG="docker.io/ubuntu:23.04" # Version 23.04 will reach EOL in Jan 2024, and can be replaced by "ubuntu:24.04" (or anything else that ships the wanted clang version). -export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev libc++abi-16-dev libc++-16-dev python3-zmq" -export DEP_OPTS="CC=clang-16 CXX='clang++-16 -stdlib=libc++'" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export APT_LLVM_V="20" +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" +export DEP_OPTS="CC=clang-${APT_LLVM_V} CXX='clang++-${APT_LLVM_V} -stdlib=libc++'" export GOAL="install" -export BITCOIN_CONFIG="--enable-zmq CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION' CXXFLAGS='-g' --with-sanitizers=thread" +export BITCOIN_CONFIG="-DWITH_ZMQ=ON -DSANITIZERS=thread \ +-DAPPEND_CPPFLAGS='-DARENA_DEBUG -DDEBUG_LOCKORDER -DDEBUG_LOCKCONTENTION -D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES'" diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh index daa1a0cdb3..e0213dbe65 100755 --- a/ci/test/00_setup_env_native_valgrind.sh +++ b/ci/test/00_setup_env_native_valgrind.sh @@ -6,12 +6,15 @@ export LC_ALL=C.UTF-8 -export CI_IMAGE_NAME_TAG="docker.io/debian:bookworm" +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_valgrind -export PACKAGES="valgrind clang llvm libclang-rt-dev python3-zmq libevent-dev libboost-dev libdb5.3++-dev libminiupnpc-dev libnatpmp-dev libzmq3-dev libsqlite3-dev" +export PACKAGES="valgrind python3-zmq libevent-dev libboost-dev libzmq3-dev libsqlite3-dev" export USE_VALGRIND=1 export NO_DEPENDS=1 -export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 +# bind tests excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 +export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra" export GOAL="install" -# Temporarily pin dwarf 4, until using Valgrind 3.20 or later -export BITCOIN_CONFIG="--enable-zmq --with-incompatible-bdb --with-gui=no CC='clang -gdwarf-4' CXX='clang++ -gdwarf-4'" # TODO enable GUI +# TODO enable GUI +export BITCOIN_CONFIG="\ + -DWITH_ZMQ=ON -DBUILD_GUI=OFF \ +" diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index a7516d6b4e..b84d99076e 100755 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2019-2022 The Bitcoin Core developers +# Copyright (c) 2019-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -9,9 +9,9 @@ export LC_ALL=C.UTF-8 export HOST=s390x-linux-gnu export PACKAGES="python3-zmq" export CONTAINER_NAME=ci_s390x -export CI_IMAGE_NAME_TAG="docker.io/s390x/debian:bookworm" -export TEST_RUNNER_ENV="LC_ALL=C" -export TEST_RUNNER_EXTRA="--exclude feature_init,rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" +export CI_IMAGE_PLATFORM="linux/s390x" +export TEST_RUNNER_EXTRA="--exclude rpc_bind,feature_bind_extra" # Excluded for now, see https://github.com/bitcoin/bitcoin/issues/17765#issuecomment-602068547 export RUN_FUNCTIONAL_TESTS=true export GOAL="install" -export BITCOIN_CONFIG="--enable-reduce-exports" +export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON" diff --git a/ci/test/00_setup_env_win64.sh b/ci/test/00_setup_env_win64.sh index ebd4487c52..13e794bd6d 100755 --- a/ci/test/00_setup_env_win64.sh +++ b/ci/test/00_setup_env_win64.sh @@ -7,13 +7,12 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_win64 -export CI_IMAGE_NAME_TAG="docker.io/amd64/ubuntu:22.04" # Check that Jammy can cross-compile to win64 +export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" # Check that https://packages.ubuntu.com/noble/g++-mingw-w64-x86-64-posix (version 13.x, similar to guix) can cross-compile +export CI_IMAGE_PLATFORM="linux/amd64" export HOST=x86_64-w64-mingw32 -export DPKG_ADD_ARCH="i386" -export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file" +export PACKAGES="g++-mingw-w64-x86-64-posix nsis" +export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="deploy" -# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when -# cross-compiling for Windows. https://sourceforge.net/p/mingw-w64/bugs/306/ -# https://github.com/mingw-w64/mingw-w64/commit/1690994f515910a31b9fb7c7bd3a52d4ba987abe -export BITCOIN_CONFIG="--enable-reduce-exports --enable-external-signer --disable-gui-tests CXXFLAGS=-Wno-return-type" +export BITCOIN_CONFIG="-DREDUCE_EXPORTS=ON -DBUILD_GUI_TESTS=OFF \ +-DCMAKE_CXX_FLAGS='-Wno-error=maybe-uninitialized'" diff --git a/ci/test/01_base_install.sh b/ci/test/01_base_install.sh index d8faae8340..d61aaca3f0 100755 --- a/ci/test/01_base_install.sh +++ b/ci/test/01_base_install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2018-2022 The Bitcoin Core developers +# Copyright (c) 2018-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -15,13 +15,27 @@ if [ "$(git config --global ${CFG_DONE})" == "true" ]; then exit 0 fi +MAKEJOBS="-j$( nproc )" # Use nproc, because MAKEJOBS is the default in docker image builds. + if [ -n "$DPKG_ADD_ARCH" ]; then dpkg --add-architecture "$DPKG_ADD_ARCH" fi +if [ -n "${APT_LLVM_V}" ]; then + ${CI_RETRY_EXE} apt-get update + ${CI_RETRY_EXE} apt-get install curl -y + curl "https://apt.llvm.org/llvm-snapshot.gpg.key" | tee "/etc/apt/trusted.gpg.d/apt.llvm.org.asc" + ( + # shellcheck disable=SC2034 + source /etc/os-release + echo "deb http://apt.llvm.org/${VERSION_CODENAME}/ llvm-toolchain-${VERSION_CODENAME}-${APT_LLVM_V} main" > "/etc/apt/sources.list.d/llvm-toolchain-${VERSION_CODENAME}-${APT_LLVM_V}.list" + ) +fi + if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then bash -c "dnf -y install epel-release" - bash -c "dnf -y --allowerasing install $CI_BASE_PACKAGES $PACKAGES" + # The ninja-build package is available in the CRB repository. + bash -c "dnf -y --allowerasing --enablerepo crb install $CI_BASE_PACKAGES $PACKAGES" elif [ "$CI_OS_NAME" != "macos" ]; then if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list @@ -31,18 +45,12 @@ elif [ "$CI_OS_NAME" != "macos" ]; then fi if [ -n "$PIP_PACKAGES" ]; then - if [ "$CI_OS_NAME" == "macos" ]; then - sudo -H pip3 install --upgrade pip - # shellcheck disable=SC2086 - IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES - else - # shellcheck disable=SC2086 - ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES - fi + # shellcheck disable=SC2086 + ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES fi if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then - git clone --depth=1 https://github.com/llvm/llvm-project -b llvmorg-16.0.6 /msan/llvm-project + ${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.0" /msan/llvm-project cmake -G Ninja -B /msan/clang_build/ \ -DLLVM_ENABLE_PROJECTS="clang" \ @@ -59,23 +67,28 @@ if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then update-alternatives --install /usr/bin/llvm-symbolizer llvm-symbolizer /msan/clang_build/bin/llvm-symbolizer 100 cmake -G Ninja -B /msan/cxx_build/ \ - -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi' \ + -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \ -DCMAKE_BUILD_TYPE=Release \ -DLLVM_USE_SANITIZER=MemoryWithOrigins \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ -DLLVM_TARGETS_TO_BUILD=Native \ -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF \ - -DLIBCXX_ENABLE_DEBUG_MODE=ON \ - -DLIBCXX_ENABLE_ASSERTIONS=ON \ + -DLIBCXXABI_USE_LLVM_UNWINDER=OFF \ + -DLIBCXX_ABI_DEFINES="_LIBCPP_ABI_BOUNDED_ITERATORS;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STD_ARRAY;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_STRING;_LIBCPP_ABI_BOUNDED_ITERATORS_IN_VECTOR;_LIBCPP_ABI_BOUNDED_UNIQUE_PTR" \ + -DLIBCXX_HARDENING_MODE=debug \ -S /msan/llvm-project/runtimes ninja -C /msan/cxx_build/ "$MAKEJOBS" + + # Clear no longer needed source folder + du -sh /msan/llvm-project + rm -rf /msan/llvm-project fi if [[ "${RUN_TIDY}" == "true" ]]; then - git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_16 /include-what-you-use - cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-16 -S /include-what-you-use + ${CI_RETRY_EXE} git clone --depth=1 https://github.com/include-what-you-use/include-what-you-use -b clang_"${TIDY_LLVM_V}" /include-what-you-use + cmake -B /iwyu-build/ -G 'Unix Makefiles' -DCMAKE_PREFIX_PATH=/usr/lib/llvm-"${TIDY_LLVM_V}" -S /include-what-you-use make -C /iwyu-build/ install "$MAKEJOBS" fi @@ -92,14 +105,4 @@ if [ -n "$XCODE_VERSION" ] && [ ! -d "${DEPENDS_DIR}/SDKs/${OSX_SDK_BASENAME}" ] tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" fi -if [ -n "$ANDROID_HOME" ] && [ ! -d "$ANDROID_HOME" ]; then - ANDROID_TOOLS_PATH=${DEPENDS_DIR}/sdk-sources/android-tools.zip - if [ ! -f "$ANDROID_TOOLS_PATH" ]; then - ${CI_RETRY_EXE} curl --location --fail "${ANDROID_TOOLS_URL}" -o "$ANDROID_TOOLS_PATH" - fi - mkdir -p "$ANDROID_HOME" - unzip -o "$ANDROID_TOOLS_PATH" -d "$ANDROID_HOME" - yes | "${ANDROID_HOME}"/cmdline-tools/bin/sdkmanager --sdk_root="${ANDROID_HOME}" --install "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" "platform-tools" "platforms;android-${ANDROID_API_LEVEL}" "ndk;${ANDROID_NDK_VERSION}" -fi - git config --global ${CFG_DONE} "true" diff --git a/ci/test/02_run_container.sh b/ci/test/02_run_container.sh new file mode 100755 index 0000000000..9616018e31 --- /dev/null +++ b/ci/test/02_run_container.sh @@ -0,0 +1,170 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 +export CI_IMAGE_LABEL="bitcoin-ci-test" + +set -o errexit -o pipefail -o xtrace + +if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then + # Export all env vars to avoid missing some. + # Though, exclude those with newlines to avoid parsing problems. + python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee "/tmp/env-$USER-$CONTAINER_NAME" + + # Env vars during the build can not be changed. For example, a modified + # $MAKEJOBS is ignored in the build process. Use --cpuset-cpus as an + # approximation to respect $MAKEJOBS somewhat, if cpuset is available. + MAYBE_CPUSET="" + if [ "$HAVE_CGROUP_CPUSET" ]; then + 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)))))" )" + fi + echo "Creating $CI_IMAGE_NAME_TAG container to run in" + + DOCKER_BUILD_CACHE_ARG="" + DOCKER_BUILD_CACHE_TEMPDIR="" + DOCKER_BUILD_CACHE_OLD_DIR="" + DOCKER_BUILD_CACHE_NEW_DIR="" + # If set, use an `docker build` cache directory on the CI host + # to cache docker image layers for the CI container image. + # This cache can be multiple GB in size. Prefixed with DANGER + # as setting it removes (old cache) files from the host. + if [ "$DANGER_DOCKER_BUILD_CACHE_HOST_DIR" ]; then + # Directory where the current cache for this run could be. If not existing + # or empty, "docker build" will warn, but treat it as cache-miss and continue. + DOCKER_BUILD_CACHE_OLD_DIR="${DANGER_DOCKER_BUILD_CACHE_HOST_DIR}/${CONTAINER_NAME}" + # Temporary directory for a newly created cache. We can't write the new + # cache into OLD_DIR directly, as old cache layers would not be removed. + # The NEW_DIR contents are moved to OLD_DIR after OLD_DIR has been cleared. + # This happens after `docker build`. If a task fails or is aborted, the + # DOCKER_BUILD_CACHE_TEMPDIR might be retained on the host. If the host isn't + # ephemeral, it has to take care of cleaning old TEMPDIR's up. + DOCKER_BUILD_CACHE_TEMPDIR="$(mktemp --directory ci-docker-build-cache-XXXXXXXXXX)" + DOCKER_BUILD_CACHE_NEW_DIR="${DOCKER_BUILD_CACHE_TEMPDIR}/${CONTAINER_NAME}" + DOCKER_BUILD_CACHE_ARG="--cache-from type=local,src=${DOCKER_BUILD_CACHE_OLD_DIR} --cache-to type=local,dest=${DOCKER_BUILD_CACHE_NEW_DIR},mode=max" + fi + + # shellcheck disable=SC2086 + DOCKER_BUILDKIT=1 docker build \ + --file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \ + --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ + --build-arg "FILE_ENV=${FILE_ENV}" \ + $MAYBE_CPUSET \ + --platform="${CI_IMAGE_PLATFORM}" \ + --label="${CI_IMAGE_LABEL}" \ + --tag="${CONTAINER_NAME}" \ + $DOCKER_BUILD_CACHE_ARG \ + "${BASE_READ_ONLY_DIR}" + + if [ "$DANGER_DOCKER_BUILD_CACHE_HOST_DIR" ]; then + if [ -e "${DOCKER_BUILD_CACHE_NEW_DIR}/index.json" ]; then + echo "Removing the existing docker build cache in ${DOCKER_BUILD_CACHE_OLD_DIR}" + rm -rf "${DOCKER_BUILD_CACHE_OLD_DIR}" + echo "Moving the contents of ${DOCKER_BUILD_CACHE_NEW_DIR} to ${DOCKER_BUILD_CACHE_OLD_DIR}" + mv "${DOCKER_BUILD_CACHE_NEW_DIR}" "${DOCKER_BUILD_CACHE_OLD_DIR}" + fi + fi + + docker volume create "${CONTAINER_NAME}_ccache" || true + docker volume create "${CONTAINER_NAME}_depends" || true + docker volume create "${CONTAINER_NAME}_depends_sources" || true + docker volume create "${CONTAINER_NAME}_previous_releases" || true + + CI_CCACHE_MOUNT="type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR" + CI_DEPENDS_MOUNT="type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR/built" + CI_DEPENDS_SOURCES_MOUNT="type=volume,src=${CONTAINER_NAME}_depends_sources,dst=$DEPENDS_DIR/sources" + CI_PREVIOUS_RELEASES_MOUNT="type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" + CI_BUILD_MOUNT="" + + if [ "$DANGER_CI_ON_HOST_FOLDERS" ]; then + # ensure the directories exist + mkdir -p "${CCACHE_DIR}" + mkdir -p "${DEPENDS_DIR}/built" + mkdir -p "${DEPENDS_DIR}/sources" + mkdir -p "${PREVIOUS_RELEASES_DIR}" + mkdir -p "${BASE_BUILD_DIR}" # Unset by default, must be defined externally + + CI_CCACHE_MOUNT="type=bind,src=${CCACHE_DIR},dst=$CCACHE_DIR" + CI_DEPENDS_MOUNT="type=bind,src=${DEPENDS_DIR}/built,dst=$DEPENDS_DIR/built" + CI_DEPENDS_SOURCES_MOUNT="type=bind,src=${DEPENDS_DIR}/sources,dst=$DEPENDS_DIR/sources" + CI_PREVIOUS_RELEASES_MOUNT="type=bind,src=${PREVIOUS_RELEASES_DIR},dst=$PREVIOUS_RELEASES_DIR" + CI_BUILD_MOUNT="--mount type=bind,src=${BASE_BUILD_DIR},dst=${BASE_BUILD_DIR}" + fi + + if [ "$DANGER_CI_ON_HOST_CCACHE_FOLDER" ]; then + if [ ! -d "${CCACHE_DIR}" ]; then + echo "Error: Directory '${CCACHE_DIR}' must be created in advance." + exit 1 + fi + CI_CCACHE_MOUNT="type=bind,src=${CCACHE_DIR},dst=${CCACHE_DIR}" + fi + + docker network create --ipv6 --subnet 1111:1111::/112 ci-ip6net || true + + if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then + echo "Restart docker before run to stop and clear all containers started with --rm" + podman container rm --force --all # Similar to "systemctl restart docker" + + # Still prune everything in case the filtered pruning doesn't work, or if labels were not set + # on a previous run. Belt and suspenders approach, should be fine to remove in the future. + # Prune images used by --external containers (e.g. build containers) when + # using podman. + echo "Prune all dangling images" + podman image prune --force --external + fi + echo "Prune all dangling $CI_IMAGE_LABEL images" + # When detecting podman-docker, `--external` should be added. + docker image prune --force --filter "label=$CI_IMAGE_LABEL" + + # Append $USER to /tmp/env to support multi-user systems and $CONTAINER_NAME + # to allow support starting multiple runs simultaneously by the same user. + # shellcheck disable=SC2086 + CI_CONTAINER_ID=$(docker run --cap-add LINUX_IMMUTABLE $CI_CONTAINER_CAP --rm --interactive --detach --tty \ + --mount "type=bind,src=$BASE_READ_ONLY_DIR,dst=$BASE_READ_ONLY_DIR,readonly" \ + --mount "${CI_CCACHE_MOUNT}" \ + --mount "${CI_DEPENDS_MOUNT}" \ + --mount "${CI_DEPENDS_SOURCES_MOUNT}" \ + --mount "${CI_PREVIOUS_RELEASES_MOUNT}" \ + ${CI_BUILD_MOUNT} \ + --env-file /tmp/env-$USER-$CONTAINER_NAME \ + --name "$CONTAINER_NAME" \ + --network ci-ip6net \ + --platform="${CI_IMAGE_PLATFORM}" \ + "$CONTAINER_NAME") + export CI_CONTAINER_ID + export CI_EXEC_CMD_PREFIX="docker exec ${CI_CONTAINER_ID}" +else + echo "Running on host system without docker wrapper" + echo "Create missing folders" + mkdir -p "${CCACHE_DIR}" + mkdir -p "${PREVIOUS_RELEASES_DIR}" +fi + +if [ "$CI_OS_NAME" == "macos" ]; then + IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" + export IN_GETOPT_BIN +fi + +CI_EXEC () { + $CI_EXEC_CMD_PREFIX bash -c "export PATH=\"/path_with space:${BINS_SCRATCH_DIR}:${BASE_ROOT_DIR}/ci/retry:\$PATH\" && cd \"${BASE_ROOT_DIR}\" && $*" +} +export -f CI_EXEC + +# Normalize all folders to BASE_ROOT_DIR +CI_EXEC rsync --archive --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/" +CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh" + +# Fixes permission issues when there is a container UID/GID mismatch with the owner +# of the git source code directory. +CI_EXEC git config --global --add safe.directory \"*\" + +CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}" + +CI_EXEC "${BASE_ROOT_DIR}/ci/test/03_test_script.sh" + +if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then + echo "Stop and remove CI container by ID" + docker container kill "${CI_CONTAINER_ID}" +fi diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh new file mode 100755 index 0000000000..3394c50b8b --- /dev/null +++ b/ci/test/03_test_script.sh @@ -0,0 +1,189 @@ +#!/usr/bin/env bash +# +# Copyright (c) 2018-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +export LC_ALL=C.UTF-8 + +set -ex + +export ASAN_OPTIONS="detect_leaks=1:detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1" +export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan" +export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1:second_deadlock_stack=1" +export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" + +echo "Number of available processing units: $(nproc)" +if [ "$CI_OS_NAME" == "macos" ]; then + top -l 1 -s 0 | awk ' /PhysMem/ {print}' +else + free -m -h + echo "System info: $(uname --kernel-name --kernel-release)" + lscpu +fi +echo "Free disk space:" +df -h + +# What host to compile for. See also ./depends/README.md +# Tests that need cross-compilation export the appropriate HOST. +# Tests that run natively guess the host +export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")} + +echo "=== BEGIN env ===" +env +echo "=== END env ===" + +( + # compact->outputs[i].file_size is uninitialized memory, so reading it is UB. + # The statistic bytes_written is only used for logging, which is disabled in + # CI, so as a temporary minimal fix to work around UB and CI failures, leave + # bytes_written unmodified. + # See https://github.com/bitcoin/bitcoin/pull/28359#issuecomment-1698694748 + # Tee patch to stdout to make it clear CI is testing modified code. + tee >(patch -p1) <<'EOF' +--- a/src/leveldb/db/db_impl.cc ++++ b/src/leveldb/db/db_impl.cc +@@ -1028,9 +1028,6 @@ Status DBImpl::DoCompactionWork(CompactionState* compact) { + stats.bytes_read += compact->compaction->input(which, i)->file_size; + } + } +- for (size_t i = 0; i < compact->outputs.size(); i++) { +- stats.bytes_written += compact->outputs[i].file_size; +- } + + mutex_.Lock(); + stats_[compact->compaction->level() + 1].Add(stats); +EOF +) + +if [ "$RUN_FUZZ_TESTS" = "true" ]; then + export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_corpora/ + if [ ! -d "$DIR_FUZZ_IN" ]; then + ${CI_RETRY_EXE} git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${DIR_QA_ASSETS}" + fi + ( + cd "${DIR_QA_ASSETS}" + echo "Using qa-assets repo from commit ..." + git log -1 + ) +elif [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then + export DIR_UNIT_TEST_DATA=${DIR_QA_ASSETS}/unit_test_data/ + if [ ! -d "$DIR_UNIT_TEST_DATA" ]; then + mkdir -p "$DIR_UNIT_TEST_DATA" + ${CI_RETRY_EXE} curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o "${DIR_UNIT_TEST_DATA}/script_assets_test.json" + fi +fi + +if [ "$USE_BUSY_BOX" = "true" ]; then + echo "Setup to use BusyBox utils" + # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version) + # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed) + for util in $(busybox --list | grep -v "^ar$" | grep -v "^tar$" ); do ln -s "$(command -v busybox)" "${BINS_SCRATCH_DIR}/$util"; done + # Print BusyBox version + patch --help +fi + +# Make sure default datadir does not exist and is never read by creating a dummy file +if [ "$CI_OS_NAME" == "macos" ]; then + echo > "${HOME}/Library/Application Support/Bitcoin" +else + echo > "${HOME}/.bitcoin" +fi + +if [ -z "$NO_DEPENDS" ]; then + if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then + SHELL_OPTS="CONFIG_SHELL=/bin/ksh" # Temporarily use ksh instead of dash, until https://bugzilla.redhat.com/show_bug.cgi?id=2335416 is fixed. + else + SHELL_OPTS="CONFIG_SHELL=" + fi + bash -c "$SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS LOG=1" +fi +if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then + test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" +fi + +BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON" +if [ -z "$NO_DEPENDS" ]; then + BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DCMAKE_TOOLCHAIN_FILE=$DEPENDS_DIR/$HOST/toolchain.cmake" +fi +if [ -z "$NO_WERROR" ]; then + BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DWERROR=ON" +fi + +ccache --zero-stats +PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats" + +# Folder where the build is done. +BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-$HOST} +mkdir -p "${BASE_BUILD_DIR}" +cd "${BASE_BUILD_DIR}" + +BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_INSTALL_PREFIX=$BASE_OUTDIR" + +if [[ "${RUN_TIDY}" == "true" ]]; then + BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_EXPORT_COMPILE_COMMANDS=ON" +fi + +bash -c "cmake -S $BASE_ROOT_DIR $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG || ( (cat $(cmake -P "${BASE_ROOT_DIR}/ci/test/GetCMakeLogFiles.cmake")) && false)" + +bash -c "cmake --build . $MAKEJOBS --target all $GOAL" || ( echo "Build failure. Verbose build follows." && cmake --build . --target all "$GOAL" --verbose ; false ) + +bash -c "${PRINT_CCACHE_STATISTICS}" +du -sh "${DEPENDS_DIR}"/*/ +du -sh "${PREVIOUS_RELEASES_DIR}" + +if [ -n "$USE_VALGRIND" ]; then + "${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh" +fi + +if [ "$RUN_CHECK_DEPS" = "true" ]; then + "${BASE_ROOT_DIR}/contrib/devtools/check-deps.sh" . +fi + +if [ "$RUN_UNIT_TESTS" = "true" ]; then + DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" CTEST_OUTPUT_ON_FAILURE=ON ctest --stop-on-failure "${MAKEJOBS}" --timeout $(( TEST_RUNNER_TIMEOUT_FACTOR * 60 )) +fi + +if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then + DIR_UNIT_TEST_DATA="${DIR_UNIT_TEST_DATA}" LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" "${BASE_OUTDIR}"/bin/test_bitcoin --catch_system_errors=no -l test_suite +fi + +if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then + # parses TEST_RUNNER_EXTRA as an array which allows for multiple arguments such as TEST_RUNNER_EXTRA='--exclude "rpc_bind.py --ipv6"' + eval "TEST_RUNNER_EXTRA=($TEST_RUNNER_EXTRA)" + LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/functional/test_runner.py --ci "${MAKEJOBS}" --tmpdirprefix "${BASE_SCRATCH_DIR}"/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor="${TEST_RUNNER_TIMEOUT_FACTOR}" "${TEST_RUNNER_EXTRA[@]}" --quiet --failfast +fi + +if [ "${RUN_TIDY}" = "true" ]; then + cmake -B /tidy-build -DLLVM_DIR=/usr/lib/llvm-"${TIDY_LLVM_V}"/cmake -DCMAKE_BUILD_TYPE=Release -S "${BASE_ROOT_DIR}"/contrib/devtools/bitcoin-tidy + cmake --build /tidy-build "$MAKEJOBS" + cmake --build /tidy-build --target bitcoin-tidy-tests "$MAKEJOBS" + + set -eo pipefail + # Filter out: + # * qt qrc and moc generated files + jq 'map(select(.file | test("src/qt/.*_autogen/.*\\.cpp$") | not))' "${BASE_BUILD_DIR}/compile_commands.json" > tmp.json + mv tmp.json "${BASE_BUILD_DIR}/compile_commands.json" + + cd "${BASE_BUILD_DIR}/src/" + if ! ( run-clang-tidy-"${TIDY_LLVM_V}" -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" | tee tmp.tidy-out.txt ); then + grep -C5 "error: " tmp.tidy-out.txt + echo "^^^ ⚠️ Failure generated from clang-tidy" + false + fi + + cd "${BASE_ROOT_DIR}" + python3 "/include-what-you-use/iwyu_tool.py" \ + -p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \ + -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \ + -Xiwyu --max_line_length=160 \ + 2>&1 | tee /tmp/iwyu_ci.out + cd "${BASE_ROOT_DIR}/src" + python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out + git --no-pager diff +fi + +if [ "$RUN_FUZZ_TESTS" = "true" ]; then + # shellcheck disable=SC2086 + LD_LIBRARY_PATH="${DEPENDS_DIR}/${HOST}/lib" test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} "${MAKEJOBS}" -l DEBUG "${DIR_FUZZ_IN}" --empty_min_time=60 +fi diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh deleted file mode 100755 index 6183c6e21f..0000000000 --- a/ci/test/04_install.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then - # Export all env vars to avoid missing some. - # Though, exclude those with newlines to avoid parsing problems. - python3 -c 'import os; [print(f"{key}={value}") for key, value in os.environ.items() if "\n" not in value and "HOME" != key and "PATH" != key and "USER" != key]' | tee /tmp/env - # System-dependent env vars must be kept as is. So read them from the container. - docker run --rm "${CI_IMAGE_NAME_TAG}" bash -c "env | grep --extended-regexp '^(HOME|PATH|USER)='" | tee --append /tmp/env - echo "Creating $CI_IMAGE_NAME_TAG container to run in" - DOCKER_BUILDKIT=1 docker build \ - --file "${BASE_READ_ONLY_DIR}/ci/test_imagefile" \ - --build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \ - --build-arg "FILE_ENV=${FILE_ENV}" \ - --tag="${CONTAINER_NAME}" \ - "${BASE_READ_ONLY_DIR}" - docker volume create "${CONTAINER_NAME}_ccache" || true - docker volume create "${CONTAINER_NAME}_depends" || true - docker volume create "${CONTAINER_NAME}_previous_releases" || true - - if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then - echo "Restart docker before run to stop and clear all containers started with --rm" - podman container stop --all # Similar to "systemctl restart docker" - echo "Prune all dangling images" - docker image prune --force - fi - - # shellcheck disable=SC2086 - CI_CONTAINER_ID=$(docker run $CI_CONTAINER_CAP --rm --interactive --detach --tty \ - --mount type=bind,src=$BASE_READ_ONLY_DIR,dst=/ro_base,readonly \ - --mount "type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR" \ - --mount "type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR" \ - --mount "type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" \ - --env-file /tmp/env \ - --name $CONTAINER_NAME \ - $CONTAINER_NAME) - export CI_CONTAINER_ID - export CI_EXEC_CMD_PREFIX="docker exec ${CI_CONTAINER_ID}" -else - echo "Running on host system without docker wrapper" - echo "Create missing folders" - mkdir -p "${CCACHE_DIR}" - mkdir -p "${PREVIOUS_RELEASES_DIR}" -fi - -CI_EXEC () { - $CI_EXEC_CMD_PREFIX bash -c "export PATH=${BINS_SCRATCH_DIR}:${BASE_ROOT_DIR}/ci/retry:\$PATH && cd \"${BASE_ROOT_DIR}\" && $*" -} -export -f CI_EXEC - -# Normalize all folders to BASE_ROOT_DIR -CI_EXEC rsync --archive --stats --human-readable "${BASE_READ_ONLY_DIR}/" "${BASE_ROOT_DIR}" || echo "Nothing to copy from ${BASE_READ_ONLY_DIR}/" -CI_EXEC "${BASE_ROOT_DIR}/ci/test/01_base_install.sh" -CI_EXEC rsync --archive --stats --human-readable /ro_base/ "${BASE_ROOT_DIR}" || echo "Nothing to copy from ro_base" -# Fixes permission issues when there is a container UID/GID mismatch with the owner -# of the git source code directory. -CI_EXEC git config --global --add safe.directory \"*\" - -CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}" diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh deleted file mode 100755 index a3d982486e..0000000000 --- a/ci/test/06_script_b.sh +++ /dev/null @@ -1,180 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -set -ex - -export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1" -export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/lsan" -export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1:log_path=${BASE_SCRATCH_DIR}/sanitizer-output/tsan" -export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" - -if [ "$CI_OS_NAME" == "macos" ]; then - top -l 1 -s 0 | awk ' /PhysMem/ {print}' - echo "Number of CPUs: $(sysctl -n hw.logicalcpu)" -else - free -m -h - echo "Number of CPUs (nproc): $(nproc)" - lscpu -fi -echo "Free disk space:" -df -h - -# What host to compile for. See also ./depends/README.md -# Tests that need cross-compilation export the appropriate HOST. -# Tests that run natively guess the host -export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")} - -if [ "$RUN_FUZZ_TESTS" = "true" ]; then - export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/ - if [ ! -d "$DIR_FUZZ_IN" ]; then - git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${DIR_QA_ASSETS}" - fi - ( - cd "${DIR_QA_ASSETS}" - echo "Using qa-assets repo from commit ..." - git log -1 - ) -elif [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then - export DIR_UNIT_TEST_DATA=${DIR_QA_ASSETS}/unit_test_data/ - if [ ! -d "$DIR_UNIT_TEST_DATA" ]; then - mkdir -p "$DIR_UNIT_TEST_DATA" - ${CI_RETRY_EXE} curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o "${DIR_UNIT_TEST_DATA}/script_assets_test.json" - fi -fi - -mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/" - -if [ "$USE_BUSY_BOX" = "true" ]; then - echo "Setup to use BusyBox utils" - # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version) - # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed) - for util in $(busybox --list | grep -v "^ar$" | grep -v "^tar$" ); do ln -s "$(command -v busybox)" "${BINS_SCRATCH_DIR}/$util"; done - # Print BusyBox version - patch --help -fi - -# Make sure default datadir does not exist and is never read by creating a dummy file -if [ "$CI_OS_NAME" == "macos" ]; then - echo > "${HOME}/Library/Application Support/Bitcoin" -else - echo > "${HOME}/.bitcoin" -fi - -if [ -z "$NO_DEPENDS" ]; then - if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then - SHELL_OPTS="CONFIG_SHELL=/bin/dash" - else - SHELL_OPTS="CONFIG_SHELL=" - fi - bash -c "$SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS LOG=1" -fi -if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then - test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" -fi - -BITCOIN_CONFIG_ALL="--disable-dependency-tracking" -if [ -z "$NO_DEPENDS" ]; then - BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} CONFIG_SITE=$DEPENDS_DIR/$HOST/share/config.site" -fi -if [ -z "$NO_WERROR" ]; then - BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-werror" -fi - -ccache --zero-stats -PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats" - -if [ -n "$ANDROID_TOOLS_URL" ]; then - make distclean || true - ./autogen.sh - bash -c "./configure $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false) - make "${MAKEJOBS}" && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk - bash -c "${PRINT_CCACHE_STATISTICS}" - exit 0 -fi - -BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR" - -if [ -n "$CONFIG_SHELL" ]; then - "$CONFIG_SHELL" -c "./autogen.sh" -else - ./autogen.sh -fi - -mkdir -p "${BASE_BUILD_DIR}" -cd "${BASE_BUILD_DIR}" - -bash -c "${BASE_ROOT_DIR}/configure --cache-file=config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false) - -make distdir VERSION="$HOST" - -cd "${BASE_BUILD_DIR}/bitcoin-$HOST" - -bash -c "./configure --cache-file=../config.cache $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false) - -if [[ "${RUN_TIDY}" == "true" ]]; then - MAYBE_BEAR="bear --config src/.bear-tidy-config" - MAYBE_TOKEN="--" -fi - -bash -c "${MAYBE_BEAR} ${MAYBE_TOKEN} make $MAKEJOBS $GOAL" || ( echo "Build failure. Verbose build follows." && make "$GOAL" V=1 ; false ) - -bash -c "${PRINT_CCACHE_STATISTICS}" -du -sh "${DEPENDS_DIR}"/*/ -du -sh "${PREVIOUS_RELEASES_DIR}" - -if [[ $HOST = *-mingw32 ]]; then - # Generate all binaries, so that they can be wrapped - make "$MAKEJOBS" -C src/secp256k1 VERBOSE=1 - make "$MAKEJOBS" -C src minisketch/test.exe VERBOSE=1 - "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh" -fi - -if [ -n "$USE_VALGRIND" ]; then - "${BASE_ROOT_DIR}/ci/test/wrap-valgrind.sh" -fi - -if [ "$RUN_UNIT_TESTS" = "true" ]; then - bash -c "${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib make $MAKEJOBS check VERBOSE=1" -fi - -if [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then - bash -c "${TEST_RUNNER_ENV} DIR_UNIT_TEST_DATA=${DIR_UNIT_TEST_DATA} LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib ${BASE_OUTDIR}/bin/test_bitcoin --catch_system_errors=no -l test_suite" -fi - -if [ "$RUN_FUNCTIONAL_TESTS" = "true" ]; then - bash -c "LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib ${TEST_RUNNER_ENV} test/functional/test_runner.py --ci $MAKEJOBS --tmpdirprefix ${BASE_SCRATCH_DIR}/test_runner/ --ansi --combinedlogslen=99999999 --timeout-factor=${TEST_RUNNER_TIMEOUT_FACTOR} ${TEST_RUNNER_EXTRA} --quiet --failfast" -fi - -if [ "${RUN_TIDY}" = "true" ]; then - cmake -B /tidy-build -DLLVM_DIR=/usr/lib/llvm-16/cmake -DCMAKE_BUILD_TYPE=Release -S "${BASE_ROOT_DIR}"/contrib/devtools/bitcoin-tidy - cmake --build /tidy-build "$MAKEJOBS" - cmake --build /tidy-build --target bitcoin-tidy-tests "$MAKEJOBS" - - set -eo pipefail - cd "${BASE_BUILD_DIR}/bitcoin-$HOST/src/" - ( run-clang-tidy-16 -quiet -load="/tidy-build/libbitcoin-tidy.so" "${MAKEJOBS}" ) | grep -C5 "error" - # Filter out files by regex here, because regex may not be - # accepted in src/.bear-tidy-config - # Filter out: - # * qt qrc and moc generated files - jq 'map(select(.file | test("src/qt/qrc_.*\\.cpp$|/moc_.*\\.cpp$") | not))' ../compile_commands.json > tmp.json - mv tmp.json ../compile_commands.json - cd "${BASE_BUILD_DIR}/bitcoin-$HOST/" - python3 "/include-what-you-use/iwyu_tool.py" \ - -p . "${MAKEJOBS}" \ - -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp" \ - -Xiwyu --max_line_length=160 \ - 2>&1 | tee /tmp/iwyu_ci.out - cd "${BASE_ROOT_DIR}/src" - python3 "/include-what-you-use/fix_includes.py" --nosafe_headers < /tmp/iwyu_ci.out - git --no-pager diff -fi - -if [ "$RUN_FUZZ_TESTS" = "true" ]; then - bash -c "LD_LIBRARY_PATH=${DEPENDS_DIR}/${HOST}/lib test/fuzz/test_runner.py ${FUZZ_TESTS_CONFIG} $MAKEJOBS -l DEBUG ${DIR_FUZZ_IN} --empty_min_time=60" -fi diff --git a/ci/test/GetCMakeLogFiles.cmake b/ci/test/GetCMakeLogFiles.cmake new file mode 100644 index 0000000000..80f71dcf63 --- /dev/null +++ b/ci/test/GetCMakeLogFiles.cmake @@ -0,0 +1,11 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.26) + set(log_files "CMakeFiles/CMakeConfigureLog.yaml") +else() + set(log_files "CMakeFiles/CMakeOutput.log CMakeFiles/CMakeError.log") +endif() + +execute_process(COMMAND ${CMAKE_COMMAND} -E echo ${log_files}) diff --git a/ci/test/wrap-valgrind.sh b/ci/test/wrap-valgrind.sh index 2775483184..e351cf2483 100755 --- a/ci/test/wrap-valgrind.sh +++ b/ci/test/wrap-valgrind.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash # -# Copyright (c) 2018-2021 The Bitcoin Core developers +# Copyright (c) 2018-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. @@ -12,7 +12,7 @@ for b_name in "${BASE_OUTDIR}/bin"/*; do echo "Wrap $b ..." mv "$b" "${b}_orig" echo '#!/usr/bin/env bash' > "$b" - echo "valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b" + echo "exec valgrind --gen-suppressions=all --quiet --error-exitcode=1 --suppressions=${BASE_ROOT_DIR}/contrib/valgrind.supp \"${b}_orig\" \"\$@\"" >> "$b" chmod +x "$b" done done diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh deleted file mode 100755 index 90e53887bc..0000000000 --- a/ci/test/wrap-wine.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2020-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{test_json,unitester,object}}.exe; do - # shellcheck disable=SC2044 - for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename "$b_name")"); do - if (file "$b" | grep "Windows"); then - echo "Wrap $b ..." - mv "$b" "${b}_orig" - echo '#!/usr/bin/env bash' > "$b" - echo "( wine \"${b}_orig\" \"\$@\" ) || ( sleep 1 && wine \"${b}_orig\" \"\$@\" )" >> "$b" - chmod +x "$b" - fi - done -done diff --git a/ci/test_run_all.sh b/ci/test_run_all.sh index 2284a2903b..3afc47b23e 100755 --- a/ci/test_run_all.sh +++ b/ci/test_run_all.sh @@ -1,17 +1,11 @@ #!/usr/bin/env bash # -# Copyright (c) 2019-2020 The Bitcoin Core developers +# Copyright (c) 2019-present The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C.UTF-8 set -o errexit; source ./ci/test/00_setup_env.sh -set -o errexit; source ./ci/test/04_install.sh set -o errexit -CI_EXEC "${BASE_ROOT_DIR}/ci/test/06_script_b.sh" - -if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then - echo "Stop and remove CI container by ID" - docker container kill "${CI_CONTAINER_ID}" -fi +"./ci/test/02_run_container.sh" diff --git a/cmake/bitcoin-build-config.h.in b/cmake/bitcoin-build-config.h.in new file mode 100644 index 0000000000..bf3ddcd7ff --- /dev/null +++ b/cmake/bitcoin-build-config.h.in @@ -0,0 +1,115 @@ +// Copyright (c) 2023-present The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://opensource.org/license/mit/. + +#ifndef BITCOIN_CONFIG_H +#define BITCOIN_CONFIG_H + +/* Version Build */ +#define CLIENT_VERSION_BUILD @CLIENT_VERSION_BUILD@ + +/* Version is release */ +#define CLIENT_VERSION_IS_RELEASE @CLIENT_VERSION_IS_RELEASE@ + +/* Major version */ +#define CLIENT_VERSION_MAJOR @CLIENT_VERSION_MAJOR@ + +/* Minor version */ +#define CLIENT_VERSION_MINOR @CLIENT_VERSION_MINOR@ + +/* Copyright holder(s) before %s replacement */ +#define COPYRIGHT_HOLDERS "@COPYRIGHT_HOLDERS@" + +/* Copyright holder(s) */ +#define COPYRIGHT_HOLDERS_FINAL "@COPYRIGHT_HOLDERS_FINAL@" + +/* Replacement for %s in copyright holders string */ +#define COPYRIGHT_HOLDERS_SUBSTITUTION "@CLIENT_NAME@" + +/* Copyright year */ +#define COPYRIGHT_YEAR @COPYRIGHT_YEAR@ + +/* Define if external signer support is enabled */ +#cmakedefine ENABLE_EXTERNAL_SIGNER 1 + +/* Define to 1 to enable tracepoints for Userspace, Statically Defined Tracing + */ +#cmakedefine ENABLE_TRACING 1 + +/* Define to 1 to enable wallet functions. */ +#cmakedefine ENABLE_WALLET 1 + +/* Define to 1 if you have the declaration of `fork', and to 0 if you don't. + */ +#cmakedefine01 HAVE_DECL_FORK + +/* Define to 1 if '*ifaddrs' are available. */ +#cmakedefine HAVE_IFADDRS 1 + +/* Define to 1 if you have the declaration of `pipe2', and to 0 if you don't. + */ +#cmakedefine01 HAVE_DECL_PIPE2 + +/* Define to 1 if you have the declaration of `setsid', and to 0 if you don't. + */ +#cmakedefine01 HAVE_DECL_SETSID + +/* Define to 1 if fdatasync is available. */ +#cmakedefine HAVE_FDATASYNC 1 + +/* Define this symbol if the BSD getentropy system call is available with + sys/random.h */ +#cmakedefine HAVE_GETENTROPY_RAND 1 + +/* Define this symbol if the Linux getrandom function call is available */ +#cmakedefine HAVE_GETRANDOM 1 + +/* Define this symbol if you have malloc_info */ +#cmakedefine HAVE_MALLOC_INFO 1 + +/* Define this symbol if you have mallopt with M_ARENA_MAX */ +#cmakedefine HAVE_MALLOPT_ARENA_MAX 1 + +/* Define to 1 if O_CLOEXEC flag is available. */ +#cmakedefine01 HAVE_O_CLOEXEC + +/* Define this symbol if you have posix_fallocate */ +#cmakedefine HAVE_POSIX_FALLOCATE 1 + +/* Define this symbol if platform supports unix domain sockets */ +#cmakedefine HAVE_SOCKADDR_UN 1 + +/* Define this symbol to build code that uses getauxval */ +#cmakedefine HAVE_STRONG_GETAUXVAL 1 + +/* Define this symbol if the BSD sysctl() is available */ +#cmakedefine HAVE_SYSCTL 1 + +/* Define this symbol if the BSD sysctl(KERN_ARND) is available */ +#cmakedefine HAVE_SYSCTL_ARND 1 + +/* Define to 1 if std::system or ::wsystem is available. */ +#cmakedefine HAVE_SYSTEM 1 + +/* Define to the address where bug reports for this package should be sent. */ +#define CLIENT_BUGREPORT "@CLIENT_BUGREPORT@" + +/* Define to the full name of this package. */ +#define CLIENT_NAME "@CLIENT_NAME@" + +/* Define to the home page for this package. */ +#define CLIENT_URL "@PROJECT_HOMEPAGE_URL@" + +/* Define to the version of this package. */ +#define CLIENT_VERSION_STRING "@CLIENT_VERSION_STRING@" + +/* Define to 1 if strerror_r returns char *. */ +#cmakedefine STRERROR_R_CHAR_P 1 + +/* Define if dbus support should be compiled in */ +#cmakedefine USE_DBUS 1 + +/* Define if QR support should be compiled in */ +#cmakedefine USE_QRCODE 1 + +#endif //BITCOIN_CONFIG_H diff --git a/cmake/ccache.cmake b/cmake/ccache.cmake new file mode 100644 index 0000000000..0bfd3a41f6 --- /dev/null +++ b/cmake/ccache.cmake @@ -0,0 +1,30 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +if(NOT MSVC) + find_program(CCACHE_EXECUTABLE ccache) + if(CCACHE_EXECUTABLE) + execute_process( + COMMAND readlink -f ${CMAKE_CXX_COMPILER} + OUTPUT_VARIABLE compiler_resolved_link + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(CCACHE_EXECUTABLE STREQUAL compiler_resolved_link AND NOT WITH_CCACHE) + list(APPEND configure_warnings + "Disabling ccache was attempted using -DWITH_CCACHE=${WITH_CCACHE}, but ccache masquerades as the compiler." + ) + set(WITH_CCACHE ON) + elseif(WITH_CCACHE) + list(APPEND CMAKE_C_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE}) + list(APPEND CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_EXECUTABLE}) + endif() + else() + set(WITH_CCACHE OFF) + endif() +else() + set(WITH_CCACHE OFF) +endif() + +mark_as_advanced(CCACHE_EXECUTABLE) diff --git a/cmake/crc32c.cmake b/cmake/crc32c.cmake new file mode 100644 index 0000000000..25f046bb43 --- /dev/null +++ b/cmake/crc32c.cmake @@ -0,0 +1,115 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +# This file is part of the transition from Autotools to CMake. Once CMake +# support has been merged we should switch to using the upstream CMake +# buildsystem. + +include(CheckCXXSourceCompiles) +include(CheckSourceCompilesWithFlags) + +# Check for __builtin_prefetch support in the compiler. +check_cxx_source_compiles(" + int main() { + char data = 0; + const char* address = &data; + __builtin_prefetch(address, 0, 0); + return 0; + } + " HAVE_BUILTIN_PREFETCH +) + +# Check for _mm_prefetch support in the compiler. +check_cxx_source_compiles(" + #if defined(_MSC_VER) + #include + #else + #include + #endif + + int main() { + char data = 0; + const char* address = &data; + _mm_prefetch(address, _MM_HINT_NTA); + return 0; + } + " HAVE_MM_PREFETCH +) + +# Check for SSE4.2 support in the compiler. +if(MSVC) + set(SSE42_CXXFLAGS /arch:AVX) +else() + set(SSE42_CXXFLAGS -msse4.2) +endif() +check_cxx_source_compiles_with_flags(" + #include + #if defined(_MSC_VER) + #include + #elif defined(__GNUC__) && defined(__SSE4_2__) + #include + #endif + + int main() { + uint64_t l = 0; + l = _mm_crc32_u8(l, 0); + l = _mm_crc32_u32(l, 0); + l = _mm_crc32_u64(l, 0); + return l; + } + " HAVE_SSE42 + CXXFLAGS ${SSE42_CXXFLAGS} +) + +# Check for ARMv8 w/ CRC and CRYPTO extensions support in the compiler. +set(ARM64_CRC_CXXFLAGS -march=armv8-a+crc+crypto) +check_cxx_source_compiles_with_flags(" + #include + #include + + int main() { + #ifdef __aarch64__ + __crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0); + vmull_p64(0, 0); + #else + #error crc32c library does not support hardware acceleration on 32-bit ARM + #endif + return 0; + } + " HAVE_ARM64_CRC32C + CXXFLAGS ${ARM64_CRC_CXXFLAGS} +) + +add_library(crc32c STATIC EXCLUDE_FROM_ALL + ${PROJECT_SOURCE_DIR}/src/crc32c/src/crc32c.cc + ${PROJECT_SOURCE_DIR}/src/crc32c/src/crc32c_portable.cc +) +target_compile_definitions(crc32c PRIVATE + HAVE_BUILTIN_PREFETCH=$ + HAVE_MM_PREFETCH=$ + HAVE_STRONG_GETAUXVAL=$ + BYTE_ORDER_BIG_ENDIAN=$ + HAVE_SSE42=$ + HAVE_ARM64_CRC32C=$ +) +target_include_directories(crc32c + PUBLIC + $ +) +target_link_libraries(crc32c PRIVATE core_interface) +set_target_properties(crc32c PROPERTIES EXPORT_COMPILE_COMMANDS OFF) + +if(HAVE_SSE42) + set(_crc32_src ${PROJECT_SOURCE_DIR}/src/crc32c/src/crc32c_sse42.cc) + target_sources(crc32c PRIVATE ${_crc32_src}) + set_property(SOURCE ${_crc32_src} PROPERTY COMPILE_OPTIONS ${SSE42_CXXFLAGS}) +endif() + +if(HAVE_ARM64_CRC32C) + set(_crc32_src ${PROJECT_SOURCE_DIR}/src/crc32c/src/crc32c_arm64.cc) + target_sources(crc32c PRIVATE ${_crc32_src}) + set_property(SOURCE ${_crc32_src} PROPERTY COMPILE_OPTIONS ${ARM64_CRC_CXXFLAGS}) +endif() + +unset(_crc32_src) diff --git a/cmake/introspection.cmake b/cmake/introspection.cmake new file mode 100644 index 0000000000..d225763397 --- /dev/null +++ b/cmake/introspection.cmake @@ -0,0 +1,213 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include(CheckCXXSourceCompiles) +include(CheckCXXSymbolExists) + +check_cxx_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC) +check_cxx_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC) +check_cxx_symbol_exists(fork "unistd.h" HAVE_DECL_FORK) +check_cxx_symbol_exists(pipe2 "unistd.h" HAVE_DECL_PIPE2) +check_cxx_symbol_exists(setsid "unistd.h" HAVE_DECL_SETSID) + +if(NOT WIN32) + include(TestAppendRequiredLibraries) + test_append_socket_library(core_interface) +endif() + +include(TestAppendRequiredLibraries) +test_append_atomic_library(core_interface) + +# Even though ::system is part of the standard library, we still check +# for it, to support building targets that don't have it, such as iOS. +check_cxx_symbol_exists(std::system "cstdlib" HAVE_STD_SYSTEM) +check_cxx_symbol_exists(::_wsystem "stdlib.h" HAVE__WSYSTEM) +if(HAVE_STD_SYSTEM OR HAVE__WSYSTEM) + set(HAVE_SYSTEM 1) +endif() + +check_cxx_source_compiles(" + #include + + int main() + { + char buf[100]; + char* p{strerror_r(0, buf, sizeof buf)}; + (void)p; + } + " STRERROR_R_CHAR_P +) + +# Check for malloc_info (for memory statistics information in getmemoryinfo). +check_cxx_symbol_exists(malloc_info "malloc.h" HAVE_MALLOC_INFO) + +# Check for mallopt(M_ARENA_MAX) (to set glibc arenas). +check_cxx_source_compiles(" + #include + + int main() + { + mallopt(M_ARENA_MAX, 1); + } + " HAVE_MALLOPT_ARENA_MAX +) + +# Check for posix_fallocate(). +check_cxx_source_compiles(" + #include + + int main() + { + return posix_fallocate(0, 0, 0); + } + " HAVE_POSIX_FALLOCATE +) + +# Check for strong getauxval() support in the system headers. +check_cxx_source_compiles(" + #include + + int main() + { + getauxval(AT_HWCAP); + } + " HAVE_STRONG_GETAUXVAL +) + +# Check for UNIX sockets. +check_cxx_source_compiles(" + #include + #include + + int main() + { + struct sockaddr_un addr; + addr.sun_family = AF_UNIX; + } + " HAVE_SOCKADDR_UN +) + +# Check for different ways of gathering OS randomness: +# - Linux getrandom() +check_cxx_source_compiles(" + #include + + int main() + { + getrandom(nullptr, 32, 0); + } + " HAVE_GETRANDOM +) + +# - BSD getentropy() +check_cxx_source_compiles(" + #include + + int main() + { + getentropy(nullptr, 32); + } + " HAVE_GETENTROPY_RAND +) + + +# - BSD sysctl() +check_cxx_source_compiles(" + #include + #include + + #ifdef __linux__ + #error Don't use sysctl on Linux, it's deprecated even when it works + #endif + + int main() + { + sysctl(nullptr, 2, nullptr, nullptr, nullptr, 0); + } + " HAVE_SYSCTL +) + +# - BSD sysctl(KERN_ARND) +check_cxx_source_compiles(" + #include + #include + + #ifdef __linux__ + #error Don't use sysctl on Linux, it's deprecated even when it works + #endif + + int main() + { + static int name[2] = {CTL_KERN, KERN_ARND}; + sysctl(name, 2, nullptr, nullptr, nullptr, 0); + } + " HAVE_SYSCTL_ARND +) + +if(NOT MSVC) + include(CheckSourceCompilesWithFlags) + + # Check for SSE4.1 intrinsics. + set(SSE41_CXXFLAGS -msse4.1) + check_cxx_source_compiles_with_flags(" + #include + + int main() + { + __m128i a = _mm_set1_epi32(0); + __m128i b = _mm_set1_epi32(1); + __m128i r = _mm_blend_epi16(a, b, 0xFF); + return _mm_extract_epi32(r, 3); + } + " HAVE_SSE41 + CXXFLAGS ${SSE41_CXXFLAGS} + ) + + # Check for AVX2 intrinsics. + set(AVX2_CXXFLAGS -mavx -mavx2) + check_cxx_source_compiles_with_flags(" + #include + + int main() + { + __m256i l = _mm256_set1_epi32(0); + return _mm256_extract_epi32(l, 7); + } + " HAVE_AVX2 + CXXFLAGS ${AVX2_CXXFLAGS} + ) + + # Check for x86 SHA-NI intrinsics. + set(X86_SHANI_CXXFLAGS -msse4 -msha) + check_cxx_source_compiles_with_flags(" + #include + + int main() + { + __m128i i = _mm_set1_epi32(0); + __m128i j = _mm_set1_epi32(1); + __m128i k = _mm_set1_epi32(2); + return _mm_extract_epi32(_mm_sha256rnds2_epu32(i, j, k), 0); + } + " HAVE_X86_SHANI + CXXFLAGS ${X86_SHANI_CXXFLAGS} + ) + + # Check for ARMv8 SHA-NI intrinsics. + set(ARM_SHANI_CXXFLAGS -march=armv8-a+crypto) + check_cxx_source_compiles_with_flags(" + #include + + int main() + { + uint32x4_t a, b, c; + vsha256h2q_u32(a, b, c); + vsha256hq_u32(a, b, c); + vsha256su0q_u32(a, b); + vsha256su1q_u32(a, b, c); + } + " HAVE_ARM_SHANI + CXXFLAGS ${ARM_SHANI_CXXFLAGS} + ) +endif() diff --git a/cmake/leveldb.cmake b/cmake/leveldb.cmake new file mode 100644 index 0000000000..572b2bed77 --- /dev/null +++ b/cmake/leveldb.cmake @@ -0,0 +1,103 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +# This file is part of the transition from Autotools to CMake. Once CMake +# support has been merged we should switch to using the upstream CMake +# buildsystem. + +include(CheckCXXSymbolExists) +check_cxx_symbol_exists(F_FULLFSYNC "fcntl.h" HAVE_FULLFSYNC) + +add_library(leveldb STATIC EXCLUDE_FROM_ALL + ${PROJECT_SOURCE_DIR}/src/leveldb/db/builder.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/c.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/db_impl.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/db_iter.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/dbformat.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/dumpfile.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/filename.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/log_reader.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/log_writer.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/memtable.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/repair.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/table_cache.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/version_edit.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/version_set.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/db/write_batch.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/block.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/block_builder.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/filter_block.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/format.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/iterator.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/merger.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/table.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/table_builder.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/table/two_level_iterator.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/arena.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/bloom.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/cache.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/coding.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/comparator.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/crc32c.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/env.cc + $<$>:${PROJECT_SOURCE_DIR}/src/leveldb/util/env_posix.cc> + $<$:${PROJECT_SOURCE_DIR}/src/leveldb/util/env_windows.cc> + ${PROJECT_SOURCE_DIR}/src/leveldb/util/filter_policy.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/hash.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/histogram.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/logging.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/options.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/util/status.cc + ${PROJECT_SOURCE_DIR}/src/leveldb/helpers/memenv/memenv.cc +) + +target_compile_definitions(leveldb + PRIVATE + HAVE_SNAPPY=0 + HAVE_CRC32C=1 + HAVE_FDATASYNC=$ + HAVE_FULLFSYNC=$ + HAVE_O_CLOEXEC=$ + FALLTHROUGH_INTENDED=[[fallthrough]] + $<$>:LEVELDB_PLATFORM_POSIX> + $<$:LEVELDB_PLATFORM_WINDOWS> + $<$:_UNICODE;UNICODE> +) +if(MINGW) + target_compile_definitions(leveldb + PRIVATE + __USE_MINGW_ANSI_STDIO=1 + ) +endif() + +target_include_directories(leveldb + PRIVATE + $ + PUBLIC + $ +) + +add_library(nowarn_leveldb_interface INTERFACE) +if(MSVC) + target_compile_options(nowarn_leveldb_interface INTERFACE + /wd4722 + ) + target_compile_definitions(nowarn_leveldb_interface INTERFACE + _CRT_NONSTDC_NO_WARNINGS + ) +else() + try_append_cxx_flags("-Wconditional-uninitialized" TARGET nowarn_leveldb_interface SKIP_LINK + IF_CHECK_PASSED "-Wno-conditional-uninitialized" + ) +endif() + +target_link_libraries(leveldb PRIVATE + core_interface + nowarn_leveldb_interface + crc32c +) + +set_target_properties(leveldb PROPERTIES + EXPORT_COMPILE_COMMANDS OFF +) diff --git a/cmake/libmultiprocess.cmake b/cmake/libmultiprocess.cmake new file mode 100644 index 0000000000..5db8f4e9e5 --- /dev/null +++ b/cmake/libmultiprocess.cmake @@ -0,0 +1,38 @@ +# Copyright (c) 2025 The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +function(add_libmultiprocess subdir) + # Set BUILD_TESTING to match BUILD_TESTS. BUILD_TESTING is a standard cmake + # option that controls whether enable_testing() is called, but in the bitcoin + # build a BUILD_TESTS option is used instead. + set(BUILD_TESTING "${BUILD_TESTS}") + add_subdirectory(${subdir} EXCLUDE_FROM_ALL) + # Apply core_interface compile options to libmultiprocess runtime library. + target_link_libraries(multiprocess PUBLIC $) + target_link_libraries(mputil PUBLIC $) + target_link_libraries(mpgen PUBLIC $) + # Mark capproto options as advanced to hide by default from cmake UI + mark_as_advanced(CapnProto_DIR) + mark_as_advanced(CapnProto_capnpc_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_capnp_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_capnp-json_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_capnp-rpc_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_capnp-websocket_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj-async_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj-gzip_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj-http_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj-test_IMPORTED_LOCATION) + mark_as_advanced(CapnProto_kj-tls_IMPORTED_LOCATION) + if(BUILD_TESTS) + # Add tests to "all" target so ctest can run them + set_target_properties(mptests PROPERTIES EXCLUDE_FROM_ALL OFF) + endif() + # Exclude examples from compilation database, because the examples are not + # built by default, and they contain generated c++ code. Without this + # exclusion, tools like clang-tidy and IWYU that make use of compilation + # database would complain that the generated c++ source files do not exist. An + # alternate fix could build "mpexamples" by default like "mptests" above. + set_target_properties(mpcalculator mpprinter mpexample PROPERTIES EXPORT_COMPILE_COMMANDS OFF) +endfunction() diff --git a/cmake/minisketch.cmake b/cmake/minisketch.cmake new file mode 100644 index 0000000000..5f57d25e6c --- /dev/null +++ b/cmake/minisketch.cmake @@ -0,0 +1,89 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include(CheckSourceCompilesWithFlags) + +# Check for clmul instructions support. +if(MSVC) + set(CLMUL_CXXFLAGS "") +else() + set(CLMUL_CXXFLAGS -mpclmul) +endif() +check_cxx_source_compiles_with_flags(" + #include + #include + + int main() + { + __m128i a = _mm_cvtsi64_si128((uint64_t)7); + __m128i b = _mm_clmulepi64_si128(a, a, 37); + __m128i c = _mm_srli_epi64(b, 41); + __m128i d = _mm_xor_si128(b, c); + uint64_t e = _mm_cvtsi128_si64(d); + return e == 0; + } + " HAVE_CLMUL + CXXFLAGS ${CLMUL_CXXFLAGS} +) + +add_library(minisketch_common INTERFACE) +if(MSVC) + target_compile_options(minisketch_common INTERFACE + /wd4060 + /wd4065 + /wd4146 + /wd4244 + /wd4267 + ) +endif() + +add_library(minisketch STATIC EXCLUDE_FROM_ALL + ${PROJECT_SOURCE_DIR}/src/minisketch/src/minisketch.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_1byte.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_2bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_3bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_4bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_5bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_6bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_7bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/generic_8bytes.cpp +) + +target_compile_definitions(minisketch + PRIVATE + DISABLE_DEFAULT_FIELDS + ENABLE_FIELD_32 +) + +target_include_directories(minisketch + PUBLIC + $ +) + +target_link_libraries(minisketch + PRIVATE + core_interface + minisketch_common +) + +set_target_properties(minisketch PROPERTIES + EXPORT_COMPILE_COMMANDS OFF +) + +if(HAVE_CLMUL) + set(_minisketch_clmul_src + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_1byte.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_2bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_3bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_4bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_5bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_6bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_7bytes.cpp + ${PROJECT_SOURCE_DIR}/src/minisketch/src/fields/clmul_8bytes.cpp + ) + target_sources(minisketch PRIVATE ${_minisketch_clmul_src}) + set_property(SOURCE ${_minisketch_clmul_src} PROPERTY COMPILE_OPTIONS ${CLMUL_CXXFLAGS}) + target_compile_definitions(minisketch PRIVATE HAVE_CLMUL) + unset(_minisketch_clmul_src) +endif() diff --git a/cmake/module/AddBoostIfNeeded.cmake b/cmake/module/AddBoostIfNeeded.cmake new file mode 100644 index 0000000000..ecd0d6f2ab --- /dev/null +++ b/cmake/module/AddBoostIfNeeded.cmake @@ -0,0 +1,78 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +function(add_boost_if_needed) + #[=[ + TODO: Not all targets, which will be added in the future, require + Boost. Therefore, a proper check will be appropriate here. + + Implementation notes: + Although only Boost headers are used to build Bitcoin Core, + we still leverage a standard CMake's approach to handle + dependencies, i.e., the Boost::headers "library". + A command target_link_libraries(target PRIVATE Boost::headers) + will propagate Boost::headers usage requirements to the target. + For Boost::headers such usage requirements is an include + directory and other added INTERFACE properties. + ]=] + + # We cannot rely on find_package(Boost ...) to work properly without + # Boost_NO_BOOST_CMAKE set until we require a more recent Boost because + # upstream did not ship proper CMake files until 1.82.0. + # Until then, we rely on CMake's FindBoost module. + # See: https://cmake.org/cmake/help/latest/policy/CMP0167.html + if(POLICY CMP0167) + cmake_policy(SET CMP0167 OLD) + endif() + set(Boost_NO_BOOST_CMAKE ON) + find_package(Boost 1.73.0 REQUIRED) + mark_as_advanced(Boost_INCLUDE_DIR) + set_target_properties(Boost::headers PROPERTIES IMPORTED_GLOBAL TRUE) + target_compile_definitions(Boost::headers INTERFACE + # We don't use multi_index serialization. + BOOST_MULTI_INDEX_DISABLE_SERIALIZATION + ) + if(DEFINED VCPKG_TARGET_TRIPLET) + # Workaround for https://github.com/microsoft/vcpkg/issues/36955. + target_compile_definitions(Boost::headers INTERFACE + BOOST_NO_USER_CONFIG + ) + endif() + + # Prevent use of std::unary_function, which was removed in C++17, + # and will generate warnings with newer compilers for Boost + # older than 1.80. + # See: https://github.com/boostorg/config/pull/430. + set(CMAKE_REQUIRED_DEFINITIONS -DBOOST_NO_CXX98_FUNCTION_BASE) + set(CMAKE_REQUIRED_INCLUDES ${Boost_INCLUDE_DIR}) + include(CMakePushCheckState) + cmake_push_check_state() + include(TryAppendCXXFlags) + set(CMAKE_REQUIRED_FLAGS ${working_compiler_werror_flag}) + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + check_cxx_source_compiles(" + #include + " NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE + ) + cmake_pop_check_state() + if(NO_DIAGNOSTICS_BOOST_NO_CXX98_FUNCTION_BASE) + target_compile_definitions(Boost::headers INTERFACE + BOOST_NO_CXX98_FUNCTION_BASE + ) + else() + set(CMAKE_REQUIRED_DEFINITIONS) + endif() + + # Some package managers, such as vcpkg, vendor Boost.Test separately + # from the rest of the headers, so we have to check for it individually. + if(BUILD_TESTS AND DEFINED VCPKG_TARGET_TRIPLET) + list(APPEND CMAKE_REQUIRED_DEFINITIONS -DBOOST_TEST_NO_MAIN) + include(CheckIncludeFileCXX) + check_include_file_cxx(boost/test/included/unit_test.hpp HAVE_BOOST_INCLUDED_UNIT_TEST_H) + if(NOT HAVE_BOOST_INCLUDED_UNIT_TEST_H) + message(FATAL_ERROR "Building test_bitcoin executable requested but boost/test/included/unit_test.hpp header not available.") + endif() + endif() + +endfunction() diff --git a/cmake/module/AddWindowsResources.cmake b/cmake/module/AddWindowsResources.cmake new file mode 100644 index 0000000000..84c1ba8565 --- /dev/null +++ b/cmake/module/AddWindowsResources.cmake @@ -0,0 +1,24 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +function(add_windows_resources target rc_file) + if(WIN32) + target_sources(${target} PRIVATE ${rc_file}) + endif() +endfunction() + +# Add a fusion manifest to Windows executables. +# See: https://learn.microsoft.com/en-us/windows/win32/sbscs/application-manifests +function(add_windows_application_manifest target) + if(WIN32) + configure_file(${PROJECT_SOURCE_DIR}/cmake/windows-app.manifest.in ${target}.manifest USE_SOURCE_PERMISSIONS) + file(CONFIGURE + OUTPUT ${target}-manifest.rc + CONTENT "1 /* CREATEPROCESS_MANIFEST_RESOURCE_ID */ 24 /* RT_MANIFEST */ \"${target}.manifest\"" + ) + add_windows_resources(${target} ${CMAKE_CURRENT_BINARY_DIR}/${target}-manifest.rc) + endif() +endfunction() diff --git a/cmake/module/CheckLinkerSupportsPIE.cmake b/cmake/module/CheckLinkerSupportsPIE.cmake new file mode 100644 index 0000000000..f3897e56a9 --- /dev/null +++ b/cmake/module/CheckLinkerSupportsPIE.cmake @@ -0,0 +1,27 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +function(check_linker_supports_pie warnings) + # Workaround for a bug in the check_pie_supported() function. + # See: + # - https://gitlab.kitware.com/cmake/cmake/-/issues/26463 + # - https://gitlab.kitware.com/cmake/cmake/-/merge_requests/10034 + if(CMAKE_VERSION VERSION_LESS 3.32) + # CMAKE_CXX_COMPILE_OPTIONS_PIE is a list, whereas CMAKE_REQUIRED_FLAGS + # must be a string. Therefore, a proper conversion is required. + list(JOIN CMAKE_CXX_COMPILE_OPTIONS_PIE " " CMAKE_REQUIRED_FLAGS) + endif() + + include(CheckPIESupported) + check_pie_supported(OUTPUT_VARIABLE output LANGUAGES CXX) + if(CMAKE_CXX_LINK_PIE_SUPPORTED) + set(CMAKE_POSITION_INDEPENDENT_CODE ON PARENT_SCOPE) + elseif(NOT WIN32) + # The warning is superfluous for Windows. + message(WARNING "PIE is not supported at link time. See the configure log for details.") + set(${warnings} ${${warnings}} "Position independent code disabled." PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/module/CheckSourceCompilesWithFlags.cmake b/cmake/module/CheckSourceCompilesWithFlags.cmake new file mode 100644 index 0000000000..02bd7265bf --- /dev/null +++ b/cmake/module/CheckSourceCompilesWithFlags.cmake @@ -0,0 +1,34 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +#[=[ +Check once if C++ source code can be compiled. + +Options: + + CXXFLAGS - A list of additional flags to pass to the compiler. + + LDFLAGS - A list of additional flags to pass to the linker. + + LINK_LIBRARIES - A list of libraries to add to the link command. + +For historical reasons, among the CMake `CMAKE_REQUIRED_*` variables that influence +`check_cxx_source_compiles()`, only `CMAKE_REQUIRED_FLAGS` is a string rather than +a list. Additionally, `target_compile_options()` also expects a list of options. + +The `check_cxx_source_compiles_with_flags()` function handles this case and accepts +`CXXFLAGS` as a list, simplifying the code at the caller site. + +#]=] +function(check_cxx_source_compiles_with_flags source result_var) + cmake_parse_arguments(PARSE_ARGV 2 _ "" "" "CXXFLAGS;LDFLAGS;LINK_LIBRARIES") + list(JOIN __CXXFLAGS " " CMAKE_REQUIRED_FLAGS) + set(CMAKE_REQUIRED_LINK_OPTIONS ${__LDFLAGS}) + set(CMAKE_REQUIRED_LIBRARIES ${__LINK_LIBRARIES}) + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("${source}" ${result_var}) + set(${result_var} ${${result_var}} PARENT_SCOPE) +endfunction() diff --git a/cmake/module/FindLibevent.cmake b/cmake/module/FindLibevent.cmake new file mode 100644 index 0000000000..c006b43d60 --- /dev/null +++ b/cmake/module/FindLibevent.cmake @@ -0,0 +1,86 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +#[=======================================================================[ +FindLibevent +------------ + +Finds the Libevent headers and libraries. + +This is a wrapper around find_package()/pkg_check_modules() commands that: + - facilitates searching in various build environments + - prints a standard log message + +#]=======================================================================] + +# Check whether evhttp_connection_get_peer expects const char**. +# See https://github.com/libevent/libevent/commit/a18301a2bb160ff7c3ffaf5b7653c39ffe27b385 +function(check_evhttp_connection_get_peer target) + include(CMakePushCheckState) + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_LIBRARIES ${target}) + include(CheckCXXSourceCompiles) + check_cxx_source_compiles(" + #include + #include + + int main() + { + evhttp_connection* conn = (evhttp_connection*)1; + const char* host; + uint16_t port; + evhttp_connection_get_peer(conn, &host, &port); + } + " HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR + ) + cmake_pop_check_state() + target_compile_definitions(${target} INTERFACE + $<$:HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR> + ) +endfunction() + +set(_libevent_components core extra) +if(NOT WIN32) + list(APPEND _libevent_components pthreads) +endif() + +find_package(Libevent ${Libevent_FIND_VERSION} QUIET + NO_MODULE +) + +include(FindPackageHandleStandardArgs) +if(Libevent_FOUND) + find_package(Libevent ${Libevent_FIND_VERSION} QUIET + REQUIRED COMPONENTS ${_libevent_components} + NO_MODULE + ) + find_package_handle_standard_args(Libevent + REQUIRED_VARS Libevent_DIR + VERSION_VAR Libevent_VERSION + ) + check_evhttp_connection_get_peer(libevent::extra) +else() + find_package(PkgConfig REQUIRED) + foreach(component IN LISTS _libevent_components) + pkg_check_modules(libevent_${component} + REQUIRED QUIET + IMPORTED_TARGET GLOBAL + libevent_${component}>=${Libevent_FIND_VERSION} + ) + if(TARGET PkgConfig::libevent_${component} AND NOT TARGET libevent::${component}) + add_library(libevent::${component} ALIAS PkgConfig::libevent_${component}) + endif() + endforeach() + find_package_handle_standard_args(Libevent + REQUIRED_VARS libevent_core_LIBRARY_DIRS + VERSION_VAR libevent_core_VERSION + ) + check_evhttp_connection_get_peer(PkgConfig::libevent_extra) +endif() + +unset(_libevent_components) + +mark_as_advanced(Libevent_DIR) +mark_as_advanced(_event_h) +mark_as_advanced(_event_lib) diff --git a/cmake/module/FindQRencode.cmake b/cmake/module/FindQRencode.cmake new file mode 100644 index 0000000000..39e3b8b679 --- /dev/null +++ b/cmake/module/FindQRencode.cmake @@ -0,0 +1,71 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +#[=======================================================================[ +FindQRencode +------------ + +Finds the QRencode header and library. + +This is a wrapper around find_package()/pkg_check_modules() commands that: + - facilitates searching in various build environments + - prints a standard log message + +#]=======================================================================] + +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(PC_QRencode QUIET libqrencode) +endif() + +find_path(QRencode_INCLUDE_DIR + NAMES qrencode.h + PATHS ${PC_QRencode_INCLUDE_DIRS} +) + +find_library(QRencode_LIBRARY_RELEASE + NAMES qrencode + PATHS ${PC_QRencode_LIBRARY_DIRS} +) +find_library(QRencode_LIBRARY_DEBUG + NAMES qrencoded qrencode + PATHS ${PC_QRencode_LIBRARY_DIRS} +) +include(SelectLibraryConfigurations) +select_library_configurations(QRencode) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(QRencode + REQUIRED_VARS QRencode_LIBRARY QRencode_INCLUDE_DIR + VERSION_VAR PC_QRencode_VERSION +) + +if(QRencode_FOUND) + if(NOT TARGET QRencode::QRencode) + add_library(QRencode::QRencode UNKNOWN IMPORTED) + endif() + if(QRencode_LIBRARY_RELEASE) + set_property(TARGET QRencode::QRencode APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE + ) + set_target_properties(QRencode::QRencode PROPERTIES + IMPORTED_LOCATION_RELEASE "${QRencode_LIBRARY_RELEASE}" + ) + endif() + if(QRencode_LIBRARY_DEBUG) + set_property(TARGET QRencode::QRencode APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG + ) + set_target_properties(QRencode::QRencode PROPERTIES + IMPORTED_LOCATION_DEBUG "${QRencode_LIBRARY_DEBUG}" + ) + endif() + set_target_properties(QRencode::QRencode PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${QRencode_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + QRencode_INCLUDE_DIR +) diff --git a/cmake/module/FindQt.cmake b/cmake/module/FindQt.cmake new file mode 100644 index 0000000000..d98af5bb56 --- /dev/null +++ b/cmake/module/FindQt.cmake @@ -0,0 +1,45 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +#[=======================================================================[ +FindQt +------ + +Finds the Qt headers and libraries. + +This is a wrapper around find_package() command that: + - facilitates searching in various build environments + - prints a standard log message + +#]=======================================================================] + +set(_qt_homebrew_prefix) +if(CMAKE_HOST_APPLE) + find_program(HOMEBREW_EXECUTABLE brew) + if(HOMEBREW_EXECUTABLE) + execute_process( + COMMAND ${HOMEBREW_EXECUTABLE} --prefix qt@${Qt_FIND_VERSION_MAJOR} + OUTPUT_VARIABLE _qt_homebrew_prefix + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif() +endif() + +find_package(Qt${Qt_FIND_VERSION_MAJOR} ${Qt_FIND_VERSION} + COMPONENTS ${Qt_FIND_COMPONENTS} + HINTS ${_qt_homebrew_prefix} + PATH_SUFFIXES Qt${Qt_FIND_VERSION_MAJOR} # Required on OpenBSD systems. +) +unset(_qt_homebrew_prefix) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Qt + REQUIRED_VARS Qt${Qt_FIND_VERSION_MAJOR}_DIR + VERSION_VAR Qt${Qt_FIND_VERSION_MAJOR}_VERSION +) + +foreach(component IN LISTS Qt_FIND_COMPONENTS ITEMS "") + mark_as_advanced(Qt${Qt_FIND_VERSION_MAJOR}${component}_DIR) +endforeach() diff --git a/cmake/module/FindUSDT.cmake b/cmake/module/FindUSDT.cmake new file mode 100644 index 0000000000..0be7c28ff5 --- /dev/null +++ b/cmake/module/FindUSDT.cmake @@ -0,0 +1,67 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +#[=======================================================================[ +FindUSDT +-------- + +Finds the Userspace, Statically Defined Tracing header(s). + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides imported target ``USDT::headers``, if +USDT has been found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +``USDT_FOUND`` + "True" if USDT found. + +#]=======================================================================] + +find_path(USDT_INCLUDE_DIR + NAMES sys/sdt.h +) +mark_as_advanced(USDT_INCLUDE_DIR) + +if(USDT_INCLUDE_DIR) + include(CMakePushCheckState) + cmake_push_check_state(RESET) + + include(CheckCXXSourceCompiles) + set(CMAKE_REQUIRED_INCLUDES ${USDT_INCLUDE_DIR}) + check_cxx_source_compiles(" + // Setting SDT_USE_VARIADIC lets systemtap (sys/sdt.h) know that we want to use + // the optional variadic macros to define tracepoints. + #define SDT_USE_VARIADIC 1 + #include + + int main() + { + STAP_PROBEV(context, event); + int a, b, c, d, e, f, g; + STAP_PROBEV(context, event, a, b, c, d, e, f, g); + } + " HAVE_USDT_H + ) + + cmake_pop_check_state() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(USDT + REQUIRED_VARS USDT_INCLUDE_DIR HAVE_USDT_H +) + +if(USDT_FOUND AND NOT TARGET USDT::headers) + add_library(USDT::headers INTERFACE IMPORTED) + set_target_properties(USDT::headers PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${USDT_INCLUDE_DIR}" + ) + set(ENABLE_TRACING TRUE) +endif() diff --git a/cmake/module/FindZeroMQ.cmake b/cmake/module/FindZeroMQ.cmake new file mode 100644 index 0000000000..eecd9b2453 --- /dev/null +++ b/cmake/module/FindZeroMQ.cmake @@ -0,0 +1,41 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +#[=======================================================================[ +FindZeroMQ +---------- + +Finds the ZeroMQ headers and library. + +This is a wrapper around find_package()/pkg_check_modules() commands that: + - facilitates searching in various build environments + - prints a standard log message + +#]=======================================================================] + +include(FindPackageHandleStandardArgs) +find_package(ZeroMQ ${ZeroMQ_FIND_VERSION} NO_MODULE QUIET) +if(ZeroMQ_FOUND) + find_package_handle_standard_args(ZeroMQ + REQUIRED_VARS ZeroMQ_DIR + VERSION_VAR ZeroMQ_VERSION + ) + if(TARGET libzmq) + add_library(zeromq ALIAS libzmq) + elseif(TARGET libzmq-static) + add_library(zeromq ALIAS libzmq-static) + endif() + mark_as_advanced(ZeroMQ_DIR) +else() + find_package(PkgConfig REQUIRED) + pkg_check_modules(libzmq QUIET + IMPORTED_TARGET + libzmq>=${ZeroMQ_FIND_VERSION} + ) + find_package_handle_standard_args(ZeroMQ + REQUIRED_VARS libzmq_LIBRARY_DIRS + VERSION_VAR libzmq_VERSION + ) + add_library(zeromq ALIAS PkgConfig::libzmq) +endif() diff --git a/cmake/module/FlagsSummary.cmake b/cmake/module/FlagsSummary.cmake new file mode 100644 index 0000000000..91d1df90d9 --- /dev/null +++ b/cmake/module/FlagsSummary.cmake @@ -0,0 +1,74 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +function(indent_message header content indent_num) + if(indent_num GREATER 0) + string(REPEAT " " ${indent_num} indentation) + string(REPEAT "." ${indent_num} tail) + string(REGEX REPLACE "${tail}$" "" header "${header}") + endif() + message("${indentation}${header} ${content}") +endfunction() + +# Print tools' flags on best-effort. Include the abstracted +# CMake flags that we touch ourselves. +function(print_flags_per_config config indent_num) + string(TOUPPER "${config}" config_uppercase) + + include(GetTargetInterface) + get_target_interface(definitions "${config}" core_interface COMPILE_DEFINITIONS) + indent_message("Preprocessor defined macros ..........." "${definitions}" ${indent_num}) + + string(STRIP "${CMAKE_CXX_COMPILER_ARG1} ${CMAKE_CXX_FLAGS}" combined_cxx_flags) + string(STRIP "${combined_cxx_flags} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_cxx_flags) + string(STRIP "${combined_cxx_flags} ${CMAKE_CXX${CMAKE_CXX_STANDARD}_STANDARD_COMPILE_OPTION}" combined_cxx_flags) + if(CMAKE_POSITION_INDEPENDENT_CODE) + string(JOIN " " combined_cxx_flags ${combined_cxx_flags} ${CMAKE_CXX_COMPILE_OPTIONS_PIC}) + endif() + get_target_interface(core_cxx_flags "${config}" core_interface COMPILE_OPTIONS) + string(STRIP "${combined_cxx_flags} ${core_cxx_flags}" combined_cxx_flags) + string(STRIP "${combined_cxx_flags} ${APPEND_CPPFLAGS}" combined_cxx_flags) + string(STRIP "${combined_cxx_flags} ${APPEND_CXXFLAGS}" combined_cxx_flags) + indent_message("C++ compiler flags ...................." "${combined_cxx_flags}" ${indent_num}) + + string(STRIP "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${config_uppercase}}" combined_linker_flags) + string(STRIP "${combined_linker_flags} ${CMAKE_EXE_LINKER_FLAGS}" combined_linker_flags) + get_target_interface(common_link_options "${config}" core_interface LINK_OPTIONS) + string(STRIP "${combined_linker_flags} ${common_link_options}" combined_linker_flags) + if(CMAKE_CXX_LINK_PIE_SUPPORTED) + string(JOIN " " combined_linker_flags ${combined_linker_flags} ${CMAKE_CXX_LINK_OPTIONS_PIE}) + endif() + string(STRIP "${combined_linker_flags} ${APPEND_LDFLAGS}" combined_linker_flags) + indent_message("Linker flags .........................." "${combined_linker_flags}" ${indent_num}) +endfunction() + +function(flags_summary) + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + list(JOIN CMAKE_CONFIGURATION_TYPES ", " configs) + message("Available build configurations ........ ${configs}") + if(CMAKE_GENERATOR MATCHES "Visual Studio") + set(default_config "Debug") + else() + list(GET CMAKE_CONFIGURATION_TYPES 0 default_config) + endif() + message("Default build configuration ........... ${default_config}") + foreach(config IN LISTS CMAKE_CONFIGURATION_TYPES) + message("") + message("'${config}' build configuration:") + print_flags_per_config("${config}" 2) + endforeach() + else() + message("CMAKE_BUILD_TYPE ...................... ${CMAKE_BUILD_TYPE}") + print_flags_per_config("${CMAKE_BUILD_TYPE}" 0) + endif() + message("") + message([=[ +NOTE: The summary above may not exactly match the final applied build flags + if any additional CMAKE_* or environment variables have been modified. + To see the exact flags applied, build with the --verbose option. +]=]) +endfunction() diff --git a/cmake/module/GenerateSetupNsi.cmake b/cmake/module/GenerateSetupNsi.cmake new file mode 100644 index 0000000000..c8d5bd67c5 --- /dev/null +++ b/cmake/module/GenerateSetupNsi.cmake @@ -0,0 +1,19 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +function(generate_setup_nsi) + set(abs_top_srcdir ${PROJECT_SOURCE_DIR}) + set(abs_top_builddir ${PROJECT_BINARY_DIR}) + set(CLIENT_URL ${PROJECT_HOMEPAGE_URL}) + set(CLIENT_TARNAME "bitcoin") + set(BITCOIN_WRAPPER_NAME "bitcoin") + set(BITCOIN_GUI_NAME "bitcoin-qt") + set(BITCOIN_DAEMON_NAME "bitcoind") + set(BITCOIN_CLI_NAME "bitcoin-cli") + set(BITCOIN_TX_NAME "bitcoin-tx") + set(BITCOIN_WALLET_TOOL_NAME "bitcoin-wallet") + set(BITCOIN_TEST_NAME "test_bitcoin") + set(EXEEXT ${CMAKE_EXECUTABLE_SUFFIX}) + configure_file(${PROJECT_SOURCE_DIR}/share/setup.nsi.in ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi USE_SOURCE_PERMISSIONS @ONLY) +endfunction() diff --git a/cmake/module/GetTargetInterface.cmake b/cmake/module/GetTargetInterface.cmake new file mode 100644 index 0000000000..1e455d456b --- /dev/null +++ b/cmake/module/GetTargetInterface.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +# Evaluates config-specific generator expressions in a list. +# Recognizable patterns are: +# - $<$:[value]> +# - $<$>:[value]> +function(evaluate_generator_expressions list config) + set(input ${${list}}) + set(result) + foreach(token IN LISTS input) + if(token MATCHES "\\$<\\$]+)>:([^>]+)>") + if(CMAKE_MATCH_1 STREQUAL config) + list(APPEND result ${CMAKE_MATCH_2}) + endif() + elseif(token MATCHES "\\$<\\$]+)>>:([^>]+)>") + if(NOT CMAKE_MATCH_1 STREQUAL config) + list(APPEND result ${CMAKE_MATCH_2}) + endif() + else() + list(APPEND result ${token}) + endif() + endforeach() + set(${list} ${result} PARENT_SCOPE) +endfunction() + + +# Gets target's interface properties recursively. +function(get_target_interface var config target property) + get_target_property(result ${target} INTERFACE_${property}) + if(result) + evaluate_generator_expressions(result "${config}") + list(JOIN result " " result) + else() + set(result) + endif() + + get_target_property(dependencies ${target} INTERFACE_LINK_LIBRARIES) + if(dependencies) + evaluate_generator_expressions(dependencies "${config}") + foreach(dependency IN LISTS dependencies) + if(TARGET ${dependency}) + get_target_interface(dep_result "${config}" ${dependency} ${property}) + string(STRIP "${result} ${dep_result}" result) + endif() + endforeach() + endif() + + set(${var} "${result}" PARENT_SCOPE) +endfunction() diff --git a/cmake/module/InstallBinaryComponent.cmake b/cmake/module/InstallBinaryComponent.cmake new file mode 100644 index 0000000000..c7b2ed9ae6 --- /dev/null +++ b/cmake/module/InstallBinaryComponent.cmake @@ -0,0 +1,26 @@ +# Copyright (c) 2025-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) +include(GNUInstallDirs) + +function(install_binary_component component) + cmake_parse_arguments(PARSE_ARGV 1 + IC # prefix + "HAS_MANPAGE" # options + "" # one_value_keywords + "" # multi_value_keywords + ) + set(target_name ${component}) + install(TARGETS ${target_name} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + COMPONENT ${component} + ) + if(INSTALL_MAN AND IC_HAS_MANPAGE) + install(FILES ${PROJECT_SOURCE_DIR}/doc/man/${target_name}.1 + DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 + COMPONENT ${component} + ) + endif() +endfunction() diff --git a/cmake/module/Maintenance.cmake b/cmake/module/Maintenance.cmake new file mode 100644 index 0000000000..d09559c5a9 --- /dev/null +++ b/cmake/module/Maintenance.cmake @@ -0,0 +1,144 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +function(setup_split_debug_script) + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + set(OBJCOPY ${CMAKE_OBJCOPY}) + set(STRIP ${CMAKE_STRIP}) + configure_file( + contrib/devtools/split-debug.sh.in split-debug.sh + FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ + @ONLY + ) + endif() +endfunction() + +function(add_maintenance_targets) + if(NOT PYTHON_COMMAND) + return() + endif() + + foreach(target IN ITEMS bitcoin bitcoind bitcoin-qt bitcoin-cli bitcoin-tx bitcoin-util bitcoin-wallet test_bitcoin bench_bitcoin) + if(TARGET ${target}) + list(APPEND executables $) + endif() + endforeach() + + add_custom_target(check-symbols + COMMAND ${CMAKE_COMMAND} -E echo "Running symbol and dynamic library checks..." + COMMAND ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/guix/symbol-check.py ${executables} + VERBATIM + ) + + add_custom_target(check-security + COMMAND ${CMAKE_COMMAND} -E echo "Checking binary security..." + COMMAND ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/guix/security-check.py ${executables} + VERBATIM + ) +endfunction() + +function(add_windows_deploy_target) + if(MINGW AND TARGET bitcoin AND TARGET bitcoin-qt AND TARGET bitcoind AND TARGET bitcoin-cli AND TARGET bitcoin-tx AND TARGET bitcoin-wallet AND TARGET bitcoin-util AND TARGET test_bitcoin) + find_program(MAKENSIS_EXECUTABLE makensis) + if(NOT MAKENSIS_EXECUTABLE) + add_custom_target(deploy + COMMAND ${CMAKE_COMMAND} -E echo "Error: NSIS not found" + ) + return() + endif() + + # TODO: Consider replacing this code with the CPack NSIS Generator. + # See https://cmake.org/cmake/help/latest/cpack_gen/nsis.html + include(GenerateSetupNsi) + generate_setup_nsi() + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/release + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${CMAKE_STRIP} $ -o ${PROJECT_BINARY_DIR}/release/$ + COMMAND ${MAKENSIS_EXECUTABLE} -V2 ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.nsi + VERBATIM + ) + add_custom_target(deploy DEPENDS ${PROJECT_BINARY_DIR}/bitcoin-win64-setup.exe) + endif() +endfunction() + +function(add_macos_deploy_target) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND TARGET bitcoin-qt) + set(macos_app "Bitcoin-Qt.app") + # Populate Contents subdirectory. + configure_file(${PROJECT_SOURCE_DIR}/share/qt/Info.plist.in ${macos_app}/Contents/Info.plist NO_SOURCE_PERMISSIONS) + file(CONFIGURE OUTPUT ${macos_app}/Contents/PkgInfo CONTENT "APPL????") + # Populate Contents/Resources subdirectory. + file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/empty.lproj CONTENT "") + configure_file(${PROJECT_SOURCE_DIR}/src/qt/res/icons/bitcoin.icns ${macos_app}/Contents/Resources/bitcoin.icns NO_SOURCE_PERMISSIONS COPYONLY) + file(CONFIGURE OUTPUT ${macos_app}/Contents/Resources/Base.lproj/InfoPlist.strings + CONTENT "{ CFBundleDisplayName = \"@CLIENT_NAME@\"; CFBundleName = \"@CLIENT_NAME@\"; }" + ) + + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + COMMAND ${CMAKE_COMMAND} --install ${PROJECT_BINARY_DIR} --config $ --component bitcoin-qt --prefix ${macos_app}/Contents/MacOS --strip + COMMAND ${CMAKE_COMMAND} -E rename ${macos_app}/Contents/MacOS/bin/$ ${macos_app}/Contents/MacOS/Bitcoin-Qt + COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/bin + COMMAND ${CMAKE_COMMAND} -E rm -rf ${macos_app}/Contents/MacOS/share + VERBATIM + ) + + string(REPLACE " " "-" osx_volname ${CLIENT_NAME}) + if(CMAKE_HOST_APPLE) + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/${osx_volname}.zip + COMMAND ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} -zip + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + VERBATIM + ) + add_custom_target(deploydir + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip + ) + add_custom_target(deploy + DEPENDS ${PROJECT_BINARY_DIR}/${osx_volname}.zip + ) + else() + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt + COMMAND OBJDUMP=${CMAKE_OBJDUMP} ${PYTHON_COMMAND} ${PROJECT_SOURCE_DIR}/contrib/macdeploy/macdeployqtplus ${macos_app} ${osx_volname} -translations-dir=${QT_TRANSLATIONS_DIR} + DEPENDS ${PROJECT_BINARY_DIR}/${macos_app}/Contents/MacOS/Bitcoin-Qt + VERBATIM + ) + add_custom_target(deploydir + DEPENDS ${PROJECT_BINARY_DIR}/dist/${macos_app}/Contents/MacOS/Bitcoin-Qt + ) + + find_program(ZIP_EXECUTABLE zip) + if(NOT ZIP_EXECUTABLE) + add_custom_target(deploy + COMMAND ${CMAKE_COMMAND} -E echo "Error: ZIP not found" + ) + else() + add_custom_command( + OUTPUT ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip + WORKING_DIRECTORY dist + COMMAND ${PROJECT_SOURCE_DIR}/cmake/script/macos_zip.sh ${ZIP_EXECUTABLE} ${osx_volname}.zip + VERBATIM + ) + add_custom_target(deploy + DEPENDS ${PROJECT_BINARY_DIR}/dist/${osx_volname}.zip + ) + endif() + endif() + add_dependencies(deploydir bitcoin-qt) + add_dependencies(deploy deploydir) + endif() +endfunction() diff --git a/cmake/module/ProcessConfigurations.cmake b/cmake/module/ProcessConfigurations.cmake new file mode 100644 index 0000000000..d5426f6e08 --- /dev/null +++ b/cmake/module/ProcessConfigurations.cmake @@ -0,0 +1,166 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +macro(normalize_string string) + string(REGEX REPLACE " +" " " ${string} "${${string}}") + string(STRIP "${${string}}" ${string}) +endmacro() + +function(are_flags_overridden flags_var result_var) + normalize_string(${flags_var}) + normalize_string(${flags_var}_INIT) + if(${flags_var} STREQUAL ${flags_var}_INIT) + set(${result_var} FALSE PARENT_SCOPE) + else() + set(${result_var} TRUE PARENT_SCOPE) + endif() +endfunction() + + +# Removes duplicated flags. The relative order of flags is preserved. +# If duplicates are encountered, only the last instance is preserved. +function(deduplicate_flags flags) + separate_arguments(${flags}) + list(REVERSE ${flags}) + list(REMOVE_DUPLICATES ${flags}) + list(REVERSE ${flags}) + list(JOIN ${flags} " " result) + set(${flags} "${result}" PARENT_SCOPE) +endfunction() + + +function(get_all_configs output) + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + set(all_configs ${CMAKE_CONFIGURATION_TYPES}) + else() + get_property(all_configs CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS) + if(NOT all_configs) + # See https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations + set(all_configs Debug Release RelWithDebInfo MinSizeRel) + endif() + endif() + set(${output} "${all_configs}" PARENT_SCOPE) +endfunction() + + +#[=[ +Set the default build configuration. + +See: https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#build-configurations. + +On single-configuration generators, this function sets the CMAKE_BUILD_TYPE variable to +the default build configuration, which can be overridden by the user at configure time if needed. + +On multi-configuration generators, this function rearranges the CMAKE_CONFIGURATION_TYPES list, +ensuring that the default build configuration appears first while maintaining the order of the +remaining configurations. The user can choose a build configuration at build time. +]=] +function(set_default_config config) + get_all_configs(all_configs) + if(NOT ${config} IN_LIST all_configs) + message(FATAL_ERROR "The default config is \"${config}\", but must be one of ${all_configs}.") + endif() + + list(REMOVE_ITEM all_configs ${config}) + list(PREPEND all_configs ${config}) + + get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(is_multi_config) + get_property(help_string CACHE CMAKE_CONFIGURATION_TYPES PROPERTY HELPSTRING) + set(CMAKE_CONFIGURATION_TYPES "${all_configs}" CACHE STRING "${help_string}" FORCE) + # Also see https://gitlab.kitware.com/cmake/cmake/-/issues/19512. + set(CMAKE_TRY_COMPILE_CONFIGURATION "${config}" PARENT_SCOPE) + else() + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY + STRINGS "${all_configs}" + ) + if(NOT CMAKE_BUILD_TYPE) + message(STATUS "Setting build type to \"${config}\" as none was specified") + get_property(help_string CACHE CMAKE_BUILD_TYPE PROPERTY HELPSTRING) + set(CMAKE_BUILD_TYPE "${config}" CACHE STRING "${help_string}" FORCE) + endif() + set(CMAKE_TRY_COMPILE_CONFIGURATION "${CMAKE_BUILD_TYPE}" PARENT_SCOPE) + endif() +endfunction() + +function(remove_cxx_flag_from_all_configs flag) + get_all_configs(all_configs) + foreach(config IN LISTS all_configs) + string(TOUPPER "${config}" config_uppercase) + set(flags "${CMAKE_CXX_FLAGS_${config_uppercase}}") + separate_arguments(flags) + list(FILTER flags EXCLUDE REGEX "${flag}") + list(JOIN flags " " new_flags) + set(CMAKE_CXX_FLAGS_${config_uppercase} "${new_flags}" PARENT_SCOPE) + set(CMAKE_CXX_FLAGS_${config_uppercase} "${new_flags}" + CACHE STRING + "Flags used by the CXX compiler during ${config_uppercase} builds." + FORCE + ) + endforeach() +endfunction() + +function(replace_cxx_flag_in_config config old_flag new_flag) + string(TOUPPER "CMAKE_CXX_FLAGS_${config}" var_name) + if("${var_name}" IN_LIST precious_variables) + return() + endif() + string(REGEX REPLACE "(^| )${old_flag}( |$)" "\\1${new_flag}\\2" ${var_name} "${${var_name}}") + set(${var_name} "${${var_name}}" PARENT_SCOPE) + set_property(CACHE ${var_name} PROPERTY VALUE "${${var_name}}") +endfunction() + +set_default_config(RelWithDebInfo) + +include(TryAppendCXXFlags) + +# We leave assertions on. +if(MSVC) + remove_cxx_flag_from_all_configs(/DNDEBUG) +else() + remove_cxx_flag_from_all_configs(-DNDEBUG) + + # Adjust flags used by the CXX compiler during RELEASE builds. + # Prefer -O2 optimization level. (-O3 is CMake's default for Release for many compilers.) + replace_cxx_flag_in_config(Release -O3 -O2) + + are_flags_overridden(CMAKE_CXX_FLAGS_DEBUG cxx_flags_debug_overridden) + if(NOT cxx_flags_debug_overridden) + # Redefine flags used by the CXX compiler during DEBUG builds. + try_append_cxx_flags("-g3" RESULT_VAR compiler_supports_g3) + if(compiler_supports_g3) + replace_cxx_flag_in_config(Debug -g -g3) + endif() + unset(compiler_supports_g3) + + try_append_cxx_flags("-ftrapv" RESULT_VAR compiler_supports_ftrapv) + if(compiler_supports_ftrapv) + string(PREPEND CMAKE_CXX_FLAGS_DEBUG "-ftrapv ") + endif() + unset(compiler_supports_ftrapv) + + string(PREPEND CMAKE_CXX_FLAGS_DEBUG "-O0 ") + + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" + CACHE STRING + "Flags used by the CXX compiler during DEBUG builds." + FORCE + ) + endif() + unset(cxx_flags_debug_overridden) +endif() + +set(CMAKE_CXX_FLAGS_COVERAGE "-g -Og --coverage") +set(CMAKE_OBJCXX_FLAGS_COVERAGE "-g -Og --coverage") +set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage") +set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage") +get_property(is_multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(is_multi_config) + if(NOT "Coverage" IN_LIST CMAKE_CONFIGURATION_TYPES) + list(APPEND CMAKE_CONFIGURATION_TYPES Coverage) + endif() +endif() diff --git a/cmake/module/TargetDataSources.cmake b/cmake/module/TargetDataSources.cmake new file mode 100644 index 0000000000..a549f9a2df --- /dev/null +++ b/cmake/module/TargetDataSources.cmake @@ -0,0 +1,55 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +macro(set_add_custom_command_options) + set(DEPENDS_EXPLICIT_OPT "") + if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27) + set(DEPENDS_EXPLICIT_OPT DEPENDS_EXPLICIT_ONLY) + endif() + set(CODEGEN_OPT "") + if(POLICY CMP0171) + cmake_policy(GET CMP0171 _cmp0171_status) + if(_cmp0171_status STREQUAL "NEW") + set(CODEGEN_OPT CODEGEN) + endif() + unset(_cmp0171_status) + endif() +endmacro() + +# Specifies JSON data files to be processed into corresponding +# header files for inclusion when building a target. +function(target_json_data_sources target) + set_add_custom_command_options() + foreach(json_file IN LISTS ARGN) + set(header ${CMAKE_CURRENT_BINARY_DIR}/${json_file}.h) + add_custom_command( + OUTPUT ${header} + COMMAND ${CMAKE_COMMAND} -DJSON_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${json_file} -DHEADER_PATH=${header} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromJson.cmake + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${json_file} ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromJson.cmake + VERBATIM + ${CODEGEN_OPT} + ${DEPENDS_EXPLICIT_OPT} + ) + target_sources(${target} PRIVATE ${header}) + endforeach() +endfunction() + +# Specifies raw binary data files to be processed into corresponding +# header files for inclusion when building a target. +function(target_raw_data_sources target) + cmake_parse_arguments(PARSE_ARGV 1 _ "" "NAMESPACE" "") + set_add_custom_command_options() + foreach(raw_file IN LISTS __UNPARSED_ARGUMENTS) + set(header ${CMAKE_CURRENT_BINARY_DIR}/${raw_file}.h) + add_custom_command( + OUTPUT ${header} + COMMAND ${CMAKE_COMMAND} -DRAW_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${raw_file} -DHEADER_PATH=${header} -DRAW_NAMESPACE=${__NAMESPACE} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${raw_file} ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake + VERBATIM + ${CODEGEN_OPT} + ${DEPENDS_EXPLICIT_OPT} + ) + target_sources(${target} PRIVATE ${header}) + endforeach() +endfunction() diff --git a/cmake/module/TestAppendRequiredLibraries.cmake b/cmake/module/TestAppendRequiredLibraries.cmake new file mode 100644 index 0000000000..1fc339a954 --- /dev/null +++ b/cmake/module/TestAppendRequiredLibraries.cmake @@ -0,0 +1,95 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +# Illumos/SmartOS requires linking with -lsocket if +# using getifaddrs & freeifaddrs. +# See: +# - https://github.com/bitcoin/bitcoin/pull/21486 +# - https://smartos.org/man/3socket/getifaddrs +function(test_append_socket_library target) + if (NOT TARGET ${target}) + message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION}() called with non-existent target \"${target}\".") + endif() + + set(check_socket_source " + #include + #include + + int main() { + struct ifaddrs* ifaddr; + getifaddrs(&ifaddr); + freeifaddrs(ifaddr); + } + ") + + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("${check_socket_source}" IFADDR_LINKS_WITHOUT_LIBSOCKET) + if(NOT IFADDR_LINKS_WITHOUT_LIBSOCKET) + include(CheckSourceCompilesWithFlags) + check_cxx_source_compiles_with_flags("${check_socket_source}" IFADDR_NEEDS_LINK_TO_LIBSOCKET + LINK_LIBRARIES socket + ) + if(IFADDR_NEEDS_LINK_TO_LIBSOCKET) + target_link_libraries(${target} INTERFACE socket) + else() + message(FATAL_ERROR "Cannot figure out how to use getifaddrs/freeifaddrs.") + endif() + endif() + set(HAVE_IFADDRS TRUE PARENT_SCOPE) +endfunction() + +# Clang, when building for 32-bit, +# and linking against libstdc++, requires linking with +# -latomic if using the C++ atomic library. +# Can be tested with: clang++ -std=c++20 test.cpp -m32 +# +# Sourced from http://bugs.debian.org/797228 +function(test_append_atomic_library target) + if (NOT TARGET ${target}) + message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION}() called with non-existent target \"${target}\".") + endif() + + set(check_atomic_source " + #include + #include + #include + + using namespace std::chrono_literals; + + int main() { + std::atomic lock{true}; + lock.exchange(false); + + std::atomic t{0s}; + t.store(2s); + auto t1 = t.load(); + t.compare_exchange_strong(t1, 3s); + + std::atomic d{}; + d.store(3.14); + auto d1 = d.load(); + + std::atomic a{}; + int64_t v = 5; + int64_t r = a.fetch_add(v); + return static_cast(r); + } + ") + + include(CheckCXXSourceCompiles) + check_cxx_source_compiles("${check_atomic_source}" STD_ATOMIC_LINKS_WITHOUT_LIBATOMIC) + if(NOT STD_ATOMIC_LINKS_WITHOUT_LIBATOMIC) + include(CheckSourceCompilesWithFlags) + check_cxx_source_compiles_with_flags("${check_atomic_source}" STD_ATOMIC_NEEDS_LINK_TO_LIBATOMIC + LINK_LIBRARIES atomic + ) + if(STD_ATOMIC_NEEDS_LINK_TO_LIBATOMIC) + target_link_libraries(${target} INTERFACE atomic) + else() + message(FATAL_ERROR "Cannot figure out how to use std::atomic.") + endif() + endif() +endfunction() diff --git a/cmake/module/TryAppendCXXFlags.cmake b/cmake/module/TryAppendCXXFlags.cmake new file mode 100644 index 0000000000..dc0a9b7f8f --- /dev/null +++ b/cmake/module/TryAppendCXXFlags.cmake @@ -0,0 +1,126 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) +include(CheckCXXSourceCompiles) + +#[=[ +Add language-wide flags, which will be passed to all invocations of the compiler. +This includes invocations that drive compiling and those that drive linking. + +Usage examples: + + try_append_cxx_flags("-Wformat -Wformat-security" VAR warn_cxx_flags) + + + try_append_cxx_flags("-Wsuggest-override" VAR warn_cxx_flags + SOURCE "struct A { virtual void f(); }; struct B : A { void f() final; };" + ) + + + try_append_cxx_flags("-fsanitize=${SANITIZERS}" TARGET core_interface + RESULT_VAR cxx_supports_sanitizers + ) + if(NOT cxx_supports_sanitizers) + message(FATAL_ERROR "Compiler did not accept requested flags.") + endif() + + + try_append_cxx_flags("-Wunused-parameter" TARGET core_interface + IF_CHECK_PASSED "-Wno-unused-parameter" + ) + + +In configuration output, this function prints a string by the following pattern: + + -- Performing Test CXX_SUPPORTS_[flags] + -- Performing Test CXX_SUPPORTS_[flags] - Success + +]=] +function(try_append_cxx_flags flags) + cmake_parse_arguments(PARSE_ARGV 1 + TACXXF # prefix + "SKIP_LINK" # options + "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords + ) + + set(flags_as_string "${flags}") + separate_arguments(flags) + + string(MAKE_C_IDENTIFIER "${flags_as_string}" id_string) + string(TOUPPER "${id_string}" id_string) + + set(source "int main() { return 0; }") + if(DEFINED TACXXF_SOURCE AND NOT TACXXF_SOURCE STREQUAL source) + set(source "${TACXXF_SOURCE}") + string(SHA256 source_hash "${source}") + string(SUBSTRING ${source_hash} 0 4 source_hash_head) + string(APPEND id_string _${source_hash_head}) + endif() + + # This avoids running a linker. + set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY) + set(CMAKE_REQUIRED_FLAGS "${flags_as_string} ${working_compiler_werror_flag}") + set(compiler_result CXX_SUPPORTS_${id_string}) + check_cxx_source_compiles("${source}" ${compiler_result}) + + if(${compiler_result}) + if(DEFINED TACXXF_IF_CHECK_PASSED) + if(DEFINED TACXXF_TARGET) + target_compile_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_PASSED}) + endif() + if(DEFINED TACXXF_VAR) + list(JOIN TACXXF_IF_CHECK_PASSED " " flags_if_check_passed_as_string) + string(STRIP "${${TACXXF_VAR}} ${flags_if_check_passed_as_string}" ${TACXXF_VAR}) + endif() + else() + if(DEFINED TACXXF_TARGET) + target_compile_options(${TACXXF_TARGET} INTERFACE ${flags}) + endif() + if(DEFINED TACXXF_VAR) + string(STRIP "${${TACXXF_VAR}} ${flags_as_string}" ${TACXXF_VAR}) + endif() + endif() + endif() + + if(DEFINED TACXXF_VAR) + set(${TACXXF_VAR} "${${TACXXF_VAR}}" PARENT_SCOPE) + endif() + + if(DEFINED TACXXF_RESULT_VAR) + set(${TACXXF_RESULT_VAR} "${${compiler_result}}" PARENT_SCOPE) + endif() + + if(NOT ${compiler_result} OR TACXXF_SKIP_LINK) + return() + endif() + + # This forces running a linker. + set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) + set(CMAKE_REQUIRED_FLAGS "${flags_as_string}") + set(CMAKE_REQUIRED_LINK_OPTIONS ${working_linker_werror_flag}) + set(linker_result LINKER_SUPPORTS_${id_string}) + check_cxx_source_compiles("${source}" ${linker_result}) + + if(${linker_result}) + if(DEFINED TACXXF_IF_CHECK_PASSED) + if(DEFINED TACXXF_TARGET) + target_link_options(${TACXXF_TARGET} INTERFACE ${TACXXF_IF_CHECK_PASSED}) + endif() + else() + if(DEFINED TACXXF_TARGET) + target_link_options(${TACXXF_TARGET} INTERFACE ${flags}) + endif() + endif() + else() + message(WARNING "'${flags_as_string}' fail(s) to link.") + endif() +endfunction() + +if(MSVC) + try_append_cxx_flags("/WX /options:strict" VAR working_compiler_werror_flag SKIP_LINK) +else() + try_append_cxx_flags("-Werror" VAR working_compiler_werror_flag SKIP_LINK) +endif() diff --git a/cmake/module/TryAppendLinkerFlag.cmake b/cmake/module/TryAppendLinkerFlag.cmake new file mode 100644 index 0000000000..fe7c2bce51 --- /dev/null +++ b/cmake/module/TryAppendLinkerFlag.cmake @@ -0,0 +1,83 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) +include(CheckCXXSourceCompiles) + +#[=[ +Usage example: + + try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface) + + +In configuration output, this function prints a string by the following pattern: + + -- Performing Test LINKER_SUPPORTS_[flag] + -- Performing Test LINKER_SUPPORTS_[flag] - Success + +]=] +function(try_append_linker_flag flag) + cmake_parse_arguments(PARSE_ARGV 1 + TALF # prefix + "NO_CACHE_IF_FAILED" # options + "TARGET;VAR;SOURCE;RESULT_VAR" # one_value_keywords + "IF_CHECK_PASSED" # multi_value_keywords + ) + + string(MAKE_C_IDENTIFIER "${flag}" result) + string(TOUPPER "${result}" result) + string(PREPEND result LINKER_SUPPORTS_) + + set(source "int main() { return 0; }") + if(DEFINED TALF_SOURCE AND NOT TALF_SOURCE STREQUAL source) + set(source "${TALF_SOURCE}") + string(SHA256 source_hash "${source}") + string(SUBSTRING ${source_hash} 0 4 source_hash_head) + string(APPEND result _${source_hash_head}) + endif() + + # This forces running a linker. + set(CMAKE_TRY_COMPILE_TARGET_TYPE EXECUTABLE) + set(CMAKE_REQUIRED_LINK_OPTIONS ${flag} ${working_linker_werror_flag}) + check_cxx_source_compiles("${source}" ${result}) + + if(${result}) + if(DEFINED TALF_IF_CHECK_PASSED) + if(DEFINED TALF_TARGET) + target_link_options(${TALF_TARGET} INTERFACE ${TALF_IF_CHECK_PASSED}) + endif() + if(DEFINED TALF_VAR) + list(JOIN TALF_IF_CHECK_PASSED " " flags_if_check_passed_as_string) + string(STRIP "${${TALF_VAR}} ${flags_if_check_passed_as_string}" ${TALF_VAR}) + endif() + else() + if(DEFINED TALF_TARGET) + target_link_options(${TALF_TARGET} INTERFACE ${flag}) + endif() + if(DEFINED TALF_VAR) + string(STRIP "${${TALF_VAR}} ${flag}" ${TALF_VAR}) + endif() + endif() + endif() + + if(DEFINED TALF_VAR) + set(${TALF_VAR} "${${TALF_VAR}}" PARENT_SCOPE) + endif() + + if(DEFINED TALF_RESULT_VAR) + set(${TALF_RESULT_VAR} "${${result}}" PARENT_SCOPE) + endif() + + if(NOT ${result} AND TALF_NO_CACHE_IF_FAILED) + unset(${result} CACHE) + endif() +endfunction() + +if(MSVC) + try_append_linker_flag("/WX" VAR working_linker_werror_flag) +elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + try_append_linker_flag("-Wl,-fatal_warnings" VAR working_linker_werror_flag) +else() + try_append_linker_flag("-Wl,--fatal-warnings" VAR working_linker_werror_flag) +endif() diff --git a/cmake/module/WarnAboutGlobalProperties.cmake b/cmake/module/WarnAboutGlobalProperties.cmake new file mode 100644 index 0000000000..faa56a2a7f --- /dev/null +++ b/cmake/module/WarnAboutGlobalProperties.cmake @@ -0,0 +1,36 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include_guard(GLOBAL) + +# Avoid the directory-wide add_definitions() and add_compile_definitions() commands. +# Instead, prefer the target-specific target_compile_definitions() one. +get_directory_property(global_compile_definitions COMPILE_DEFINITIONS) +if(global_compile_definitions) + message(AUTHOR_WARNING "The directory's COMPILE_DEFINITIONS property is not empty: ${global_compile_definitions}") +endif() + +# Avoid the directory-wide add_compile_options() command. +# Instead, prefer the target-specific target_compile_options() one. +get_directory_property(global_compile_options COMPILE_OPTIONS) +if(global_compile_options) + message(AUTHOR_WARNING "The directory's COMPILE_OPTIONS property is not empty: ${global_compile_options}") +endif() + +# Avoid the directory-wide add_link_options() command. +# Instead, prefer the target-specific target_link_options() one. +get_directory_property(global_link_options LINK_OPTIONS) +if(global_link_options) + message(AUTHOR_WARNING "The directory's LINK_OPTIONS property is not empty: ${global_link_options}") +endif() + +# Avoid the directory-wide link_libraries() command. +# Instead, prefer the target-specific target_link_libraries() one. +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/dummy_cxx_source.cpp "#error") +add_library(check_loose_linked_libraries OBJECT EXCLUDE_FROM_ALL ${CMAKE_CURRENT_BINARY_DIR}/dummy_cxx_source.cpp) +set_target_properties(check_loose_linked_libraries PROPERTIES EXPORT_COMPILE_COMMANDS OFF) +get_target_property(global_linked_libraries check_loose_linked_libraries LINK_LIBRARIES) +if(global_linked_libraries) + message(AUTHOR_WARNING "There are libraries linked with `link_libraries` commands: ${global_linked_libraries}") +endif() diff --git a/cmake/script/Coverage.cmake b/cmake/script/Coverage.cmake new file mode 100644 index 0000000000..72587a5eb6 --- /dev/null +++ b/cmake/script/Coverage.cmake @@ -0,0 +1,89 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include(${CMAKE_CURRENT_LIST_DIR}/CoverageInclude.cmake) + +set(functional_test_runner test/functional/test_runner.py) +if(EXTENDED_FUNCTIONAL_TESTS) + list(APPEND functional_test_runner --extended) +endif() +if(DEFINED JOBS) + list(APPEND CMAKE_CTEST_COMMAND -j ${JOBS}) + list(APPEND functional_test_runner -j ${JOBS}) +endif() + +execute_process( + COMMAND ${CMAKE_CTEST_COMMAND} --build-config Coverage + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --capture --directory src --test-name test_bitcoin --output-file test_bitcoin.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --zerocounters --directory src + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_FILTER_COMMAND} test_bitcoin.info test_bitcoin_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile test_bitcoin_filtered.info --output-file test_bitcoin_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --add-tracefile test_bitcoin_filtered.info --output-file test_bitcoin_coverage.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${GENHTML_COMMAND} test_bitcoin_coverage.info --output-directory test_bitcoin.coverage + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) + +execute_process( + COMMAND ${functional_test_runner} + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --capture --directory src --test-name functional-tests --output-file functional_test.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --zerocounters --directory src + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_FILTER_COMMAND} functional_test.info functional_test_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile functional_test_filtered.info --output-file functional_test_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --add-tracefile test_bitcoin_filtered.info --add-tracefile functional_test_filtered.info --output-file total_coverage.info + COMMAND ${GREP_EXECUTABLE} "%" + COMMAND ${AWK_EXECUTABLE} "{ print substr($3,2,50) \"/\" $5 }" + OUTPUT_FILE coverage_percent.txt + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${GENHTML_COMMAND} total_coverage.info --output-directory total.coverage + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/cmake/script/CoverageFuzz.cmake b/cmake/script/CoverageFuzz.cmake new file mode 100644 index 0000000000..0558805394 --- /dev/null +++ b/cmake/script/CoverageFuzz.cmake @@ -0,0 +1,53 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include(${CMAKE_CURRENT_LIST_DIR}/CoverageInclude.cmake) + +if(NOT DEFINED FUZZ_CORPORA_DIR) + set(FUZZ_CORPORA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/qa-assets/fuzz_corpora) +endif() + +set(fuzz_test_runner test/fuzz/test_runner.py ${FUZZ_CORPORA_DIR}) +if(DEFINED JOBS) + list(APPEND fuzz_test_runner -j ${JOBS}) +endif() + +execute_process( + COMMAND ${fuzz_test_runner} --loglevel DEBUG + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --capture --directory src --test-name fuzz-tests --output-file fuzz.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --zerocounters --directory src + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_FILTER_COMMAND} fuzz.info fuzz_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile fuzz_filtered.info --output-file fuzz_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --add-tracefile fuzz_filtered.info --output-file fuzz_coverage.info + COMMAND ${GREP_EXECUTABLE} "%" + COMMAND ${AWK_EXECUTABLE} "{ print substr($3,2,50) \"/\" $5 }" + OUTPUT_FILE coverage_percent.txt + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${GENHTML_COMMAND} fuzz_coverage.info --output-directory fuzz.coverage + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/cmake/script/CoverageInclude.cmake.in b/cmake/script/CoverageInclude.cmake.in new file mode 100644 index 0000000000..8fe11b4803 --- /dev/null +++ b/cmake/script/CoverageInclude.cmake.in @@ -0,0 +1,59 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +if("@CMAKE_CXX_COMPILER_ID@" STREQUAL "Clang") + find_program(LLVM_COV_EXECUTABLE llvm-cov REQUIRED) + set(COV_TOOL "${LLVM_COV_EXECUTABLE} gcov") +else() + find_program(GCOV_EXECUTABLE gcov REQUIRED) + set(COV_TOOL "${GCOV_EXECUTABLE}") +endif() + +# COV_TOOL is used to replace a placeholder. +configure_file( + ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh.in ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh + FILE_PERMISSIONS OWNER_READ OWNER_EXECUTE + GROUP_READ GROUP_EXECUTE + WORLD_READ + @ONLY +) + +find_program(LCOV_EXECUTABLE lcov REQUIRED) +separate_arguments(LCOV_OPTS) +set(LCOV_COMMAND ${LCOV_EXECUTABLE} --gcov-tool ${CMAKE_CURRENT_LIST_DIR}/cov_tool_wrapper.sh ${LCOV_OPTS}) + +find_program(GENHTML_EXECUTABLE genhtml REQUIRED) +set(GENHTML_COMMAND ${GENHTML_EXECUTABLE} --show-details ${LCOV_OPTS}) + +find_program(GREP_EXECUTABLE grep REQUIRED) +find_program(AWK_EXECUTABLE awk REQUIRED) + +set(LCOV_FILTER_COMMAND ./filter-lcov.py) +list(APPEND LCOV_FILTER_COMMAND -p "/usr/local/") +list(APPEND LCOV_FILTER_COMMAND -p "/usr/include/") +list(APPEND LCOV_FILTER_COMMAND -p "/usr/lib/") +list(APPEND LCOV_FILTER_COMMAND -p "/usr/lib64/") +list(APPEND LCOV_FILTER_COMMAND -p "src/leveldb/") +list(APPEND LCOV_FILTER_COMMAND -p "src/crc32c/") +list(APPEND LCOV_FILTER_COMMAND -p "src/bench/") +list(APPEND LCOV_FILTER_COMMAND -p "src/crypto/ctaes") +list(APPEND LCOV_FILTER_COMMAND -p "src/minisketch") +list(APPEND LCOV_FILTER_COMMAND -p "src/secp256k1") +list(APPEND LCOV_FILTER_COMMAND -p "depends") + +execute_process( + COMMAND ${LCOV_COMMAND} --capture --initial --directory src --output-file baseline.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_FILTER_COMMAND} baseline.info baseline_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) +execute_process( + COMMAND ${LCOV_COMMAND} --add-tracefile baseline_filtered.info --output-file baseline_filtered.info + WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR} + COMMAND_ERROR_IS_FATAL ANY +) diff --git a/cmake/script/GenerateBuildInfo.cmake b/cmake/script/GenerateBuildInfo.cmake new file mode 100644 index 0000000000..d3ee2eb062 --- /dev/null +++ b/cmake/script/GenerateBuildInfo.cmake @@ -0,0 +1,113 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +macro(fatal_error) + message(FATAL_ERROR "\n" + "Usage:\n" + " cmake -D BUILD_INFO_HEADER_PATH= [-D SOURCE_DIR=] -P ${CMAKE_CURRENT_LIST_FILE}\n" + "All specified paths must be absolute ones.\n" + ) +endmacro() + +if(DEFINED BUILD_INFO_HEADER_PATH AND IS_ABSOLUTE "${BUILD_INFO_HEADER_PATH}") + if(EXISTS "${BUILD_INFO_HEADER_PATH}") + file(STRINGS ${BUILD_INFO_HEADER_PATH} INFO LIMIT_COUNT 1) + endif() +else() + fatal_error() +endif() + +if(DEFINED SOURCE_DIR) + if(IS_ABSOLUTE "${SOURCE_DIR}" AND IS_DIRECTORY "${SOURCE_DIR}") + set(WORKING_DIR ${SOURCE_DIR}) + else() + fatal_error() + endif() +else() + set(WORKING_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +endif() + +set(GIT_TAG) +set(GIT_COMMIT) +if(NOT "$ENV{BITCOIN_GENBUILD_NO_GIT}" STREQUAL "1") + find_package(Git QUIET) + if(Git_FOUND) + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_VARIABLE IS_INSIDE_WORK_TREE + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + if(IS_INSIDE_WORK_TREE) + # Clean 'dirty' status of touched files that haven't been modified. + execute_process( + COMMAND ${GIT_EXECUTABLE} diff + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_QUIET + ERROR_QUIET + ) + + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_VARIABLE MOST_RECENT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-list -1 ${MOST_RECENT_TAG} + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_VARIABLE MOST_RECENT_TAG_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse HEAD + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_VARIABLE HEAD_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + + execute_process( + COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD -- + WORKING_DIRECTORY ${WORKING_DIR} + RESULT_VARIABLE IS_DIRTY + ) + + if(HEAD_COMMIT STREQUAL MOST_RECENT_TAG_COMMIT AND NOT IS_DIRTY) + # If latest commit is tagged and not dirty, then use the tag name. + set(GIT_TAG ${MOST_RECENT_TAG}) + else() + # Otherwise, generate suffix from git, i.e. string like "0e0a5173fae3-dirty". + execute_process( + COMMAND ${GIT_EXECUTABLE} rev-parse --short=12 HEAD + WORKING_DIRECTORY ${WORKING_DIR} + OUTPUT_VARIABLE GIT_COMMIT + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_QUIET + ) + if(IS_DIRTY) + string(APPEND GIT_COMMIT "-dirty") + endif() + endif() + endif() + endif() +endif() + +if(GIT_TAG) + set(NEWINFO "#define BUILD_GIT_TAG \"${GIT_TAG}\"") +elseif(GIT_COMMIT) + set(NEWINFO "#define BUILD_GIT_COMMIT \"${GIT_COMMIT}\"") +else() + set(NEWINFO "// No build information available") +endif() + +# Only update the header if necessary. +if(NOT "${INFO}" STREQUAL "${NEWINFO}") + file(WRITE ${BUILD_INFO_HEADER_PATH} "${NEWINFO}\n") +endif() diff --git a/cmake/script/GenerateHeaderFromJson.cmake b/cmake/script/GenerateHeaderFromJson.cmake new file mode 100644 index 0000000000..384ac20d10 --- /dev/null +++ b/cmake/script/GenerateHeaderFromJson.cmake @@ -0,0 +1,22 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +cmake_path(GET JSON_SOURCE_PATH STEM json_source_basename) + +file(READ ${JSON_SOURCE_PATH} hex_content HEX) +string(REGEX REPLACE "................" "\\0\n" formatted_bytes "${hex_content}") +string(REGEX REPLACE "[^\n][^\n]" "'\\\\x\\0'," formatted_bytes "${formatted_bytes}") + +set(header_content +"#include + +namespace json_tests { +inline constexpr char detail_${json_source_basename}_bytes[] { +${formatted_bytes} +}; + +inline constexpr std::string_view ${json_source_basename}{std::begin(detail_${json_source_basename}_bytes), std::end(detail_${json_source_basename}_bytes)}; +} +") +file(WRITE ${HEADER_PATH} "${header_content}") diff --git a/cmake/script/GenerateHeaderFromRaw.cmake b/cmake/script/GenerateHeaderFromRaw.cmake new file mode 100644 index 0000000000..d373d1c4f8 --- /dev/null +++ b/cmake/script/GenerateHeaderFromRaw.cmake @@ -0,0 +1,23 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +cmake_path(GET RAW_SOURCE_PATH STEM raw_source_basename) + +file(READ ${RAW_SOURCE_PATH} hex_content HEX) +string(REGEX REPLACE "................" "\\0\n" formatted_bytes "${hex_content}") +string(REGEX REPLACE "[^\n][^\n]" "std::byte{0x\\0}," formatted_bytes "${formatted_bytes}") + +set(header_content +"#include +#include + +namespace ${RAW_NAMESPACE} { +inline constexpr std::byte detail_${raw_source_basename}_raw[] { +${formatted_bytes} +}; + +inline constexpr std::span ${raw_source_basename}{detail_${raw_source_basename}_raw}; +} +") +file(WRITE ${HEADER_PATH} "${header_content}") diff --git a/cmake/script/cov_tool_wrapper.sh.in b/cmake/script/cov_tool_wrapper.sh.in new file mode 100644 index 0000000000..f6b7ff3419 --- /dev/null +++ b/cmake/script/cov_tool_wrapper.sh.in @@ -0,0 +1,5 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +exec @COV_TOOL@ "$@" diff --git a/cmake/script/macos_zip.sh b/cmake/script/macos_zip.sh new file mode 100755 index 0000000000..cc51699dc9 --- /dev/null +++ b/cmake/script/macos_zip.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +export LC_ALL=C + +if [ -n "$SOURCE_DATE_EPOCH" ]; then + find . -exec touch -d "@$SOURCE_DATE_EPOCH" {} + +fi + +find . | sort | "$1" -X@ "$2" diff --git a/cmake/tests.cmake b/cmake/tests.cmake new file mode 100644 index 0000000000..2791329800 --- /dev/null +++ b/cmake/tests.cmake @@ -0,0 +1,15 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +if(TARGET bitcoin-util AND TARGET bitcoin-tx AND PYTHON_COMMAND) + add_test(NAME util_test_runner + COMMAND ${CMAKE_COMMAND} -E env BITCOINUTIL=$ BITCOINTX=$ ${PYTHON_COMMAND} ${PROJECT_BINARY_DIR}/test/util/test_runner.py + ) +endif() + +if(PYTHON_COMMAND) + add_test(NAME util_rpcauth_test + COMMAND ${PYTHON_COMMAND} ${PROJECT_BINARY_DIR}/test/util/rpcauth-test.py + ) +endif() diff --git a/cmake/windows-app.manifest.in b/cmake/windows-app.manifest.in new file mode 100644 index 0000000000..c3bd333a22 --- /dev/null +++ b/cmake/windows-app.manifest.in @@ -0,0 +1,15 @@ + + + + + + + + + + + diff --git a/configure.ac b/configure.ac deleted file mode 100644 index f0ebc50623..0000000000 --- a/configure.ac +++ /dev/null @@ -1,2010 +0,0 @@ -AC_PREREQ([2.69]) -define(_CLIENT_VERSION_MAJOR, 25) -define(_CLIENT_VERSION_MINOR, 99) -define(_CLIENT_VERSION_BUILD, 0) -define(_CLIENT_VERSION_RC, 0) -define(_CLIENT_VERSION_IS_RELEASE, false) -define(_COPYRIGHT_YEAR, 2023) -define(_COPYRIGHT_HOLDERS,[The %s developers]) -define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[Bitcoin Core]]) -AC_INIT([Bitcoin Core],m4_join([.], _CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MINOR, _CLIENT_VERSION_BUILD)m4_if(_CLIENT_VERSION_RC, [0], [], [rc]_CLIENT_VERSION_RC),[https://github.com/bitcoin/bitcoin/issues],[bitcoin],[https://bitcoincore.org/]) -AC_CONFIG_SRCDIR([src/validation.cpp]) -AC_CONFIG_HEADERS([src/config/bitcoin-config.h]) -AC_CONFIG_AUX_DIR([build-aux]) -AC_CONFIG_MACRO_DIR([build-aux/m4]) - -m4_ifndef([PKG_PROG_PKG_CONFIG], [m4_fatal([PKG_PROG_PKG_CONFIG macro not found. Please install pkg-config and re-run autogen.sh])]) -PKG_PROG_PKG_CONFIG -if test "$PKG_CONFIG" = ""; then - AC_MSG_ERROR([pkg-config not found]) -fi - -# When compiling with depends, the `PKG_CONFIG_PATH` and `PKG_CONFIG_LIBDIR` variables, -# being set in a `config.site` file, are not exported to let the `--config-cache` option -# work properly. -if test -n "$PKG_CONFIG_PATH"; then - PKG_CONFIG="env PKG_CONFIG_PATH=$PKG_CONFIG_PATH $PKG_CONFIG" -fi -if test -n "$PKG_CONFIG_LIBDIR"; then - PKG_CONFIG="env PKG_CONFIG_LIBDIR=$PKG_CONFIG_LIBDIR $PKG_CONFIG" -fi - -BITCOIN_DAEMON_NAME=bitcoind -BITCOIN_GUI_NAME=bitcoin-qt -BITCOIN_TEST_NAME=test_bitcoin -BITCOIN_CLI_NAME=bitcoin-cli -BITCOIN_TX_NAME=bitcoin-tx -BITCOIN_UTIL_NAME=bitcoin-util -BITCOIN_CHAINSTATE_NAME=bitcoin-chainstate -BITCOIN_WALLET_TOOL_NAME=bitcoin-wallet -dnl Multi Process -BITCOIN_MP_NODE_NAME=bitcoin-node -BITCOIN_MP_GUI_NAME=bitcoin-gui - -dnl Unless the user specified ARFLAGS, force it to be cr -dnl This is also the default as-of libtool 2.4.7 -AC_ARG_VAR([ARFLAGS], [Flags for the archiver, defaults to if not set]) -if test "${ARFLAGS+set}" != "set"; then - ARFLAGS="cr" -fi - -AC_CANONICAL_HOST - -AH_TOP([#ifndef BITCOIN_CONFIG_H]) -AH_TOP([#define BITCOIN_CONFIG_H]) -AH_BOTTOM([#endif //BITCOIN_CONFIG_H]) - -dnl Automake init set-up and checks -AM_INIT_AUTOMAKE([1.13 no-define subdir-objects foreign]) - -AM_MAINTAINER_MODE([enable]) - -dnl make the compilation flags quiet unless V=1 is used -AM_SILENT_RULES([yes]) - -dnl Compiler checks (here before libtool). -if test "${CXXFLAGS+set}" = "set"; then - CXXFLAGS_overridden=yes -else - CXXFLAGS_overridden=no -fi -AC_PROG_CXX - -dnl libtool overrides -case $host in - *mingw*) - dnl By default, libtool for mingw refuses to link static libs into a dll for - dnl fear of mixing pic/non-pic objects, and import/export complications. Since - dnl we have those under control, re-enable that functionality. - lt_cv_deplibs_check_method="pass_all" - - dnl Remove unwanted -DDLL_EXPORT from these variables. - dnl We do not use this macro, but system headers may export unwanted symbols - dnl if it's set. - lt_cv_prog_compiler_pic="-DPIC" - lt_cv_prog_compiler_pic_CXX="-DPIC" - ;; - *darwin*) - dnl Because it prints a verbose warning, lld fails the following check - dnl for "-Wl,-single_module" from libtool.m4: - dnl # If there is a non-empty error log, and "single_module" - dnl # appears in it, assume the flag caused a linker warning - dnl "-single_module" works fine on ld64 and lld, so just bypass the test. - dnl Failure to set this to "yes" causes libtool to use a very broken - dnl link-line for shared libs. - lt_cv_apple_cc_single_mod="yes" - ;; -esac - -AC_ARG_ENABLE([c++20], - [AS_HELP_STRING([--enable-c++20], - [enable compilation in c++20 mode (disabled by default)])], - [use_cxx20=$enableval], - [use_cxx20=no]) - -dnl Require C++17 compiler (no GNU extensions) -if test "$use_cxx20" = "no"; then -AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) -else -AX_CXX_COMPILE_STDCXX([20], [noext], [mandatory]) -fi - -dnl Unless the user specified OBJCXX, force it to be the same as CXX. This ensures -dnl that we get the same -std flags for both. -m4_ifdef([AC_PROG_OBJCXX],[ -if test "${OBJCXX+set}" = ""; then - OBJCXX="${CXX}" -fi -AC_PROG_OBJCXX -]) - -dnl OpenBSD ships with 2.4.2 -LT_PREREQ([2.4.2]) -dnl Libtool init checks. -LT_INIT([pic-only win32-dll]) - -dnl Check/return PATH for base programs. -AC_PATH_TOOL([AR], [ar]) -AC_PATH_TOOL([GCOV], [gcov]) -AC_PATH_TOOL([LLVM_COV], [llvm-cov]) -AC_PATH_PROG([LCOV], [lcov]) -dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md -AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python]) -AC_PATH_PROG([GENHTML], [genhtml]) -AC_PATH_PROG([GIT], [git]) -AC_PATH_PROG([CCACHE], [ccache]) -AC_PATH_PROG([XGETTEXT], [xgettext]) -AC_PATH_PROG([HEXDUMP], [hexdump]) -AC_PATH_TOOL([OBJCOPY], [objcopy]) -AC_PATH_PROG([DOXYGEN], [doxygen]) -AM_CONDITIONAL([HAVE_DOXYGEN], [test -n "$DOXYGEN"]) - -AC_ARG_VAR([PYTHONPATH], [Augments the default search path for python module files]) - -AC_ARG_ENABLE([wallet], - [AS_HELP_STRING([--disable-wallet], - [disable wallet (enabled by default)])], - [enable_wallet=$enableval], - [enable_wallet=auto]) - -AC_ARG_WITH([sqlite], - [AS_HELP_STRING([--with-sqlite=yes|no|auto], - [enable sqlite wallet support (default: auto, i.e., enabled if wallet is enabled and sqlite is found)])], - [use_sqlite=$withval], - [use_sqlite=auto]) - -AC_ARG_WITH([bdb], - [AS_HELP_STRING([--without-bdb], - [disable bdb wallet support (default is enabled if wallet is enabled)])], - [use_bdb=$withval], - [use_bdb=auto]) - -AC_ARG_ENABLE([usdt], - [AS_HELP_STRING([--enable-usdt], - [enable tracepoints for Userspace, Statically Defined Tracing (default is yes if sys/sdt.h is found)])], - [use_usdt=$enableval], - [use_usdt=yes]) - -AC_ARG_WITH([miniupnpc], - [AS_HELP_STRING([--with-miniupnpc], - [enable UPNP (default is yes if libminiupnpc is found)])], - [use_upnp=$withval], - [use_upnp=auto]) - -AC_ARG_WITH([natpmp], - [AS_HELP_STRING([--with-natpmp], - [enable NAT-PMP (default is yes if libnatpmp is found)])], - [use_natpmp=$withval], - [use_natpmp=auto]) - -AC_ARG_ENABLE(tests, - AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]), - [use_tests=$enableval], - [use_tests=yes]) - -AC_ARG_ENABLE(gui-tests, - AS_HELP_STRING([--disable-gui-tests],[do not compile GUI tests (default is to compile if GUI and tests enabled)]), - [use_gui_tests=$enableval], - [use_gui_tests=$use_tests]) - -AC_ARG_ENABLE(bench, - AS_HELP_STRING([--disable-bench],[do not compile benchmarks (default is to compile)]), - [use_bench=$enableval], - [use_bench=yes]) - -AC_ARG_ENABLE([extended-functional-tests], - AS_HELP_STRING([--enable-extended-functional-tests],[enable expensive functional tests when using lcov (default no)]), - [use_extended_functional_tests=$enableval], - [use_extended_functional_tests=no]) - -AC_ARG_ENABLE([fuzz], - AS_HELP_STRING([--enable-fuzz], - [build for fuzzing (default no). enabling this will disable all other targets and override --{enable,disable}-fuzz-binary]), - [enable_fuzz=$enableval], - [enable_fuzz=no]) - -AC_ARG_ENABLE([fuzz-binary], - AS_HELP_STRING([--enable-fuzz-binary], - [enable building of fuzz binary (default yes).]), - [enable_fuzz_binary=$enableval], - [enable_fuzz_binary=yes]) - -AC_ARG_WITH([qrencode], - [AS_HELP_STRING([--with-qrencode], - [enable QR code support (default is yes if qt is enabled and libqrencode is found)])], - [use_qr=$withval], - [use_qr=auto]) - -AC_ARG_ENABLE([hardening], - [AS_HELP_STRING([--disable-hardening], - [do not attempt to harden the resulting executables (default is to harden when possible)])], - [use_hardening=$enableval], - [use_hardening=auto]) - -AC_ARG_ENABLE([reduce-exports], - [AS_HELP_STRING([--enable-reduce-exports], - [attempt to reduce exported symbols in the resulting executables (default is no)])], - [use_reduce_exports=$enableval], - [use_reduce_exports=no]) - -AC_ARG_ENABLE([ccache], - [AS_HELP_STRING([--disable-ccache], - [do not use ccache for building (default is to use if found)])], - [use_ccache=$enableval], - [use_ccache=auto]) - -dnl Suppress warnings from external headers (e.g. Boost, Qt). -dnl May be useful if warnings from external headers clutter the build output -dnl too much, so that it becomes difficult to spot Bitcoin Core warnings -dnl or if they cause a build failure with --enable-werror. -AC_ARG_ENABLE([suppress-external-warnings], - [AS_HELP_STRING([--disable-suppress-external-warnings], - [Do not suppress warnings from external headers (default is to suppress)])], - [suppress_external_warnings=$enableval], - [suppress_external_warnings=yes]) - -AC_ARG_ENABLE([lcov], - [AS_HELP_STRING([--enable-lcov], - [enable lcov testing (default is no)])], - [use_lcov=$enableval], - [use_lcov=no]) - -AC_ARG_ENABLE([lcov-branch-coverage], - [AS_HELP_STRING([--enable-lcov-branch-coverage], - [enable lcov testing branch coverage (default is no)])], - [use_lcov_branch=yes], - [use_lcov_branch=no]) - -AC_ARG_ENABLE([threadlocal], - [AS_HELP_STRING([--enable-threadlocal], - [enable features that depend on the c++ thread_local keyword (currently just thread names in debug logs). (default is to enable if there is platform support)])], - [use_thread_local=$enableval], - [use_thread_local=auto]) - -AC_ARG_ENABLE([asm], - [AS_HELP_STRING([--disable-asm], - [disable assembly routines (enabled by default)])], - [use_asm=$enableval], - [use_asm=yes]) - -if test "$use_asm" = "yes"; then - AC_DEFINE([USE_ASM], [1], [Define this symbol to build in assembly routines]) -fi - -AC_ARG_ENABLE([zmq], - [AS_HELP_STRING([--disable-zmq], - [disable ZMQ notifications])], - [use_zmq=$enableval], - [use_zmq=yes]) - -AC_ARG_WITH([libmultiprocess], - [AS_HELP_STRING([--with-libmultiprocess=yes|no|auto], - [Build with libmultiprocess library. (default: auto, i.e. detect with pkg-config)])], - [with_libmultiprocess=$withval], - [with_libmultiprocess=auto]) - -AC_ARG_WITH([mpgen], - [AS_HELP_STRING([--with-mpgen=yes|no|auto|PREFIX], - [Build with libmultiprocess codegen tool. Useful to specify different libmultiprocess host system library and build system codegen tool prefixes when cross-compiling (default is host system libmultiprocess prefix)])], - [with_mpgen=$withval], - [with_mpgen=auto]) - -AC_ARG_ENABLE([multiprocess], - [AS_HELP_STRING([--enable-multiprocess], - [build multiprocess bitcoin-node, bitcoin-wallet, and bitcoin-gui executables in addition to monolithic bitcoind and bitcoin-qt executables. Requires libmultiprocess library. Experimental (default is no)])], - [enable_multiprocess=$enableval], - [enable_multiprocess=no]) - -AC_ARG_ENABLE(man, - [AS_HELP_STRING([--disable-man], - [do not install man pages (default is to install)])],, - enable_man=yes) -AM_CONDITIONAL([ENABLE_MAN], [test "$enable_man" != "no"]) - -dnl Enable debug -AC_ARG_ENABLE([debug], - [AS_HELP_STRING([--enable-debug], - [use compiler flags and macros suited for debugging (default is no)])], - [enable_debug=$enableval], - [enable_debug=no]) - -dnl Enable different -fsanitize options -AC_ARG_WITH([sanitizers], - [AS_HELP_STRING([--with-sanitizers], - [comma separated list of extra sanitizers to build with (default is none enabled)])], - [use_sanitizers=$withval]) - -dnl Enable gprof profiling -AC_ARG_ENABLE([gprof], - [AS_HELP_STRING([--enable-gprof], - [use gprof profiling compiler flags (default is no)])], - [enable_gprof=$enableval], - [enable_gprof=no]) - -dnl Turn warnings into errors -AC_ARG_ENABLE([werror], - [AS_HELP_STRING([--enable-werror], - [Treat compiler warnings as errors (default is no)])], - [enable_werror=$enableval], - [enable_werror=no]) - -AC_ARG_ENABLE([external-signer], - [AS_HELP_STRING([--enable-external-signer],[compile external signer support (default is auto, requires Boost::Process)])], - [use_external_signer=$enableval], - [use_external_signer=auto]) - -AC_ARG_ENABLE([lto], - [AS_HELP_STRING([--enable-lto],[build using LTO (default is no)])], - [enable_lto=$enableval], - [enable_lto=no]) - -AC_LANG_PUSH([C++]) - -dnl Check for a flag to turn compiler warnings into errors. This is helpful for checks which may -dnl appear to succeed because by default they merely emit warnings when they fail. -dnl -dnl Note that this is not necessarily a check to see if -Werror is supported, but rather to see if -dnl a compile with -Werror can succeed. This is important because the compiler may already be -dnl warning about something unrelated, for example about some path issue. If that is the case, -dnl -Werror cannot be used because all of those warnings would be turned into errors. -AX_CHECK_COMPILE_FLAG([-Werror], [CXXFLAG_WERROR="-Werror"], [CXXFLAG_WERROR=""]) - -dnl Check for a flag to turn linker warnings into errors. When flags are passed to linkers via the -dnl compiler driver using a -Wl,-foo flag, linker warnings may be swallowed rather than bubbling up. -dnl See note above, the same applies here as well. -dnl -dnl LDFLAG_WERROR Should only be used when testing -Wl,* -case $host in - *darwin*) - AX_CHECK_LINK_FLAG([-Wl,-fatal_warnings], [LDFLAG_WERROR="-Wl,-fatal_warnings"], [LDFLAG_WERROR=""]) - ;; - *) - AX_CHECK_LINK_FLAG([-Wl,--fatal-warnings], [LDFLAG_WERROR="-Wl,--fatal-warnings"], [LDFLAG_WERROR=""]) - ;; -esac - -if test "$enable_debug" = "yes"; then - dnl If debugging is enabled, and the user hasn't overridden CXXFLAGS, clear - dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up - dnl with "-O0 -g3 -g -O2". - if test "$CXXFLAGS_overridden" = "no"; then - CXXFLAGS="" - fi - - dnl Disable all optimizations - AX_CHECK_COMPILE_FLAG([-O0], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -O0"], [], [$CXXFLAG_WERROR]) - - dnl Prefer -g3, fall back to -g if that is unavailable. - AX_CHECK_COMPILE_FLAG( - [-g3], - [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g3"], - [AX_CHECK_COMPILE_FLAG([-g], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g"], [], [$CXXFLAG_WERROR])], - [$CXXFLAG_WERROR]) - - AX_CHECK_PREPROC_FLAG([-DDEBUG], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"], [], [$CXXFLAG_WERROR]) - AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"], [], [$CXXFLAG_WERROR]) - AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKCONTENTION], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKCONTENTION"], [], [$CXXFLAG_WERROR]) - AX_CHECK_PREPROC_FLAG([-DRPC_DOC_CHECK], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DRPC_DOC_CHECK"], [], [$CXXFLAG_WERROR]) - AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-ftrapv], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"], [], [$CXXFLAG_WERROR]) -fi - -if test "$enable_lto" = "yes"; then - AX_CHECK_COMPILE_FLAG([-flto], [LTO_CXXFLAGS="$LTO_CXXFLAGS -flto"], [AC_MSG_ERROR([compile failed with -flto])], [$CXXFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-flto], [LTO_LDFLAGS="$LTO_LDFLAGS -flto"], [AC_MSG_ERROR([link failed with -flto])], [$CXXFLAG_WERROR]) -fi - -if test "$use_sanitizers" != ""; then - dnl First check if the compiler accepts flags. If an incompatible pair like - dnl -fsanitize=address,thread is used here, this check will fail. This will also - dnl fail if a bad argument is passed, e.g. -fsanitize=undfeined - AX_CHECK_COMPILE_FLAG( - [-fsanitize=$use_sanitizers], - [SANITIZER_CXXFLAGS="-fsanitize=$use_sanitizers"], - [AC_MSG_ERROR([compiler did not accept requested flags])]) - - dnl Some compilers (e.g. GCC) require additional libraries like libasan, - dnl libtsan, libubsan, etc. Make sure linking still works with the sanitize - dnl flag. This is a separate check so we can give a better error message when - dnl the sanitize flags are supported by the compiler but the actual sanitizer - dnl libs are missing. - AX_CHECK_LINK_FLAG( - [-fsanitize=$use_sanitizers], - [SANITIZER_LDFLAGS="-fsanitize=$use_sanitizers"], - [AC_MSG_ERROR([linker did not accept requested flags, you are missing required libraries])], - [], - [AC_LANG_PROGRAM([[ - #include - #include - extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { return 0; } - __attribute__((weak)) // allow for libFuzzer linking - ]],[[]])]) -fi - -ERROR_CXXFLAGS= -if test "$enable_werror" = "yes"; then - if test "$CXXFLAG_WERROR" = ""; then - AC_MSG_ERROR([enable-werror set but -Werror is not usable]) - fi - ERROR_CXXFLAGS=$CXXFLAG_WERROR -fi - -if test "$CXXFLAGS_overridden" = "no"; then - AX_CHECK_COMPILE_FLAG([-Wall], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wextra], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wextra"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wgnu], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wgnu"], [], [$CXXFLAG_WERROR]) - dnl some compilers will ignore -Wformat-security without -Wformat, so just combine the two here. - AX_CHECK_COMPILE_FLAG([-Wformat -Wformat-security], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat -Wformat-security"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wvla], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wvla"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wshadow-field], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow-field"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wthread-safety], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wthread-safety"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wloop-analysis], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wloop-analysis"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wredundant-decls], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wredundant-decls"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wunused-member-function], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunused-member-function"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wdate-time], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdate-time"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wconditional-uninitialized], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wconditional-uninitialized"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wduplicated-branches], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-branches"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wduplicated-cond"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wlogical-op], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wlogical-op"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Woverloaded-virtual], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Woverloaded-virtual"], [], [$CXXFLAG_WERROR]) - dnl -Wsuggest-override is broken with GCC before 9.2 - dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78010 - AX_CHECK_COMPILE_FLAG([-Wsuggest-override], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wsuggest-override"], [], [$CXXFLAG_WERROR], - [AC_LANG_SOURCE([[struct A { virtual void f(); }; struct B : A { void f() final; };]])]) - AX_CHECK_COMPILE_FLAG([-Wunreachable-code-loop-increment], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wunreachable-code-loop-increment"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wimplicit-fallthrough"], [], [$CXXFLAG_WERROR]) - - if test "$suppress_external_warnings" != "no" ; then - AX_CHECK_COMPILE_FLAG([-Wdocumentation], [WARN_CXXFLAGS="$WARN_CXXFLAGS -Wdocumentation"], [], [$CXXFLAG_WERROR]) - fi - - dnl Some compilers (gcc) ignore unknown -Wno-* options, but warn about all - dnl unknown options if any other warning is produced. Test the -Wfoo case, and - dnl set the -Wno-foo case if it works. - AX_CHECK_COMPILE_FLAG([-Wunused-parameter], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-unused-parameter"], [], [$CXXFLAG_WERROR]) - AX_CHECK_COMPILE_FLAG([-Wself-assign], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-self-assign"], [], [$CXXFLAG_WERROR]) - if test "$suppress_external_warnings" != "yes" ; then - AX_CHECK_COMPILE_FLAG([-Wdeprecated-copy], [NOWARN_CXXFLAGS="$NOWARN_CXXFLAGS -Wno-deprecated-copy"], [], [$CXXFLAG_WERROR]) - fi -fi - -dnl Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review. -AX_CHECK_COMPILE_FLAG([-fno-extended-identifiers], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fno-extended-identifiers"], [], [$CXXFLAG_WERROR]) - -enable_arm_crc=no -enable_arm_shani=no -enable_sse42=no -enable_sse41=no -enable_avx2=no -enable_x86_shani=no - -if test "$use_asm" = "yes"; then - -dnl Check for optional instruction set support. Enabling these does _not_ imply that all code will -dnl be compiled with them, rather that specific objects/libs may use them after checking for runtime -dnl compatibility. - -dnl x86 -AX_CHECK_COMPILE_FLAG([-msse4.2], [SSE42_CXXFLAGS="-msse4.2"], [], [$CXXFLAG_WERROR]) -AX_CHECK_COMPILE_FLAG([-msse4.1], [SSE41_CXXFLAGS="-msse4.1"], [], [$CXXFLAG_WERROR]) -AX_CHECK_COMPILE_FLAG([-mavx -mavx2], [AVX2_CXXFLAGS="-mavx -mavx2"], [], [$CXXFLAG_WERROR]) -AX_CHECK_COMPILE_FLAG([-msse4 -msha], [X86_SHANI_CXXFLAGS="-msse4 -msha"], [], [$CXXFLAG_WERROR]) - -enable_clmul= -AX_CHECK_COMPILE_FLAG([-mpclmul], [enable_clmul=yes], [], [$CXXFLAG_WERROR], [AC_LANG_PROGRAM([ - #include - #include -], [ - __m128i a = _mm_cvtsi64_si128((uint64_t)7); - __m128i b = _mm_clmulepi64_si128(a, a, 37); - __m128i c = _mm_srli_epi64(b, 41); - __m128i d = _mm_xor_si128(b, c); - uint64_t e = _mm_cvtsi128_si64(d); - return e == 0; -])]) - -if test "$enable_clmul" = "yes"; then - CLMUL_CXXFLAGS="-mpclmul" - AC_DEFINE([HAVE_CLMUL], [1], [Define this symbol if clmul instructions can be used]) -fi - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$SSE42_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for SSE4.2 intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #if defined(_MSC_VER) - #include - #elif defined(__GNUC__) && defined(__SSE4_2__) - #include - #endif - ]],[[ - uint64_t l = 0; - l = _mm_crc32_u8(l, 0); - l = _mm_crc32_u32(l, 0); - l = _mm_crc32_u64(l, 0); - return l; - ]])], - [ AC_MSG_RESULT([yes]); enable_sse42=yes], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$SSE41_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for SSE4.1 intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ - __m128i l = _mm_set1_epi32(0); - return _mm_extract_epi32(l, 3); - ]])], - [ AC_MSG_RESULT([yes]); enable_sse41=yes; AC_DEFINE([ENABLE_SSE41], [1], [Define this symbol to build code that uses SSE4.1 intrinsics]) ], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$AVX2_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for AVX2 intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ - __m256i l = _mm256_set1_epi32(0); - return _mm256_extract_epi32(l, 7); - ]])], - [ AC_MSG_RESULT([yes]); enable_avx2=yes; AC_DEFINE([ENABLE_AVX2], [1], [Define this symbol to build code that uses AVX2 intrinsics]) ], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$X86_SHANI_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for x86 SHA-NI intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ - __m128i i = _mm_set1_epi32(0); - __m128i j = _mm_set1_epi32(1); - __m128i k = _mm_set1_epi32(2); - return _mm_extract_epi32(_mm_sha256rnds2_epu32(i, i, k), 0); - ]])], - [ AC_MSG_RESULT([yes]); enable_x86_shani=yes; AC_DEFINE([ENABLE_X86_SHANI], [1], [Define this symbol to build code that uses x86 SHA-NI intrinsics]) ], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -# ARM -AX_CHECK_COMPILE_FLAG([-march=armv8-a+crc], [ARM_CRC_CXXFLAGS="-march=armv8-a+crc"], [], [$CXXFLAG_WERROR]) -AX_CHECK_COMPILE_FLAG([-march=armv8-a+crypto], [ARM_SHANI_CXXFLAGS="-march=armv8-a+crypto"], [], [$CXXFLAG_WERROR]) - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$ARM_CRC_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for ARMv8 CRC32 intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ -#ifdef __aarch64__ - __crc32cb(0, 0); __crc32ch(0, 0); __crc32cw(0, 0); __crc32cd(0, 0); - vmull_p64(0, 0); -#else -#error "crc32c library does not support hardware acceleration on 32-bit ARM" -#endif - ]])], - [ AC_MSG_RESULT([yes]); enable_arm_crc=yes; ], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -TEMP_CXXFLAGS="$CXXFLAGS" -CXXFLAGS="$ARM_SHANI_CXXFLAGS $CXXFLAGS" -AC_MSG_CHECKING([for ARMv8 SHA-NI intrinsics]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]],[[ - uint32x4_t a, b, c; - vsha256h2q_u32(a, b, c); - vsha256hq_u32(a, b, c); - vsha256su0q_u32(a, b); - vsha256su1q_u32(a, b, c); - ]])], - [ AC_MSG_RESULT([yes]); enable_arm_shani=yes; AC_DEFINE([ENABLE_ARM_SHANI], [1], [Define this symbol to build code that uses ARMv8 SHA-NI intrinsics]) ], - [ AC_MSG_RESULT([no])] -) -CXXFLAGS="$TEMP_CXXFLAGS" - -fi - -CORE_CPPFLAGS="$CORE_CPPFLAGS -DHAVE_BUILD_INFO" - -AC_ARG_WITH([utils], - [AS_HELP_STRING([--with-utils], - [build bitcoin-cli bitcoin-tx bitcoin-util bitcoin-wallet (default=yes)])], - [build_bitcoin_utils=$withval], - [build_bitcoin_utils=yes]) - -AC_ARG_ENABLE([util-cli], - [AS_HELP_STRING([--enable-util-cli], - [build bitcoin-cli])], - [build_bitcoin_cli=$enableval], - [build_bitcoin_cli=$build_bitcoin_utils]) - -AC_ARG_ENABLE([util-tx], - [AS_HELP_STRING([--enable-util-tx], - [build bitcoin-tx])], - [build_bitcoin_tx=$enableval], - [build_bitcoin_tx=$build_bitcoin_utils]) - -AC_ARG_ENABLE([util-wallet], - [AS_HELP_STRING([--enable-util-wallet], - [build bitcoin-wallet])], - [build_bitcoin_wallet=$enableval], - [build_bitcoin_wallet=$build_bitcoin_utils]) - -AC_ARG_ENABLE([util-util], - [AS_HELP_STRING([--enable-util-util], - [build bitcoin-util])], - [build_bitcoin_util=$enableval], - [build_bitcoin_util=$build_bitcoin_utils]) - -AC_ARG_ENABLE([experimental-util-chainstate], - [AS_HELP_STRING([--enable-experimental-util-chainstate], - [build experimental bitcoin-chainstate executable (default=no)])], - [build_bitcoin_chainstate=$enableval], - [build_bitcoin_chainstate=no]) - -AC_ARG_WITH([libs], - [AS_HELP_STRING([--with-libs], - [build libraries (default=yes)])], - [build_bitcoin_libs=$withval], - [build_bitcoin_libs=yes]) - -AC_ARG_WITH([experimental-kernel-lib], - [AS_HELP_STRING([--with-experimental-kernel-lib], - [build experimental bitcoinkernel library (default is to build if we're building libraries and the experimental build-chainstate executable)])], - [build_experimental_kernel_lib=$withval], - [build_experimental_kernel_lib=auto]) - -AC_ARG_WITH([daemon], - [AS_HELP_STRING([--with-daemon], - [build bitcoind daemon (default=yes)])], - [build_bitcoind=$withval], - [build_bitcoind=yes]) - -case $host in - *mingw*) - TARGET_OS=windows - AC_CHECK_LIB([kernel32], [GetModuleFileNameA], [], [AC_MSG_ERROR([libkernel32 missing])]) - AC_CHECK_LIB([user32], [main], [], [AC_MSG_ERROR([libuser32 missing])]) - AC_CHECK_LIB([gdi32], [main], [], [AC_MSG_ERROR([libgdi32 missing])]) - AC_CHECK_LIB([comdlg32], [main], [], [AC_MSG_ERROR([libcomdlg32 missing])]) - AC_CHECK_LIB([winmm], [main], [], [AC_MSG_ERROR([libwinmm missing])]) - AC_CHECK_LIB([shell32], [SHGetSpecialFolderPathW], [], [AC_MSG_ERROR([libshell32 missing])]) - AC_CHECK_LIB([comctl32], [main], [], [AC_MSG_ERROR([libcomctl32 missing])]) - AC_CHECK_LIB([ole32], [CoCreateInstance], [], [AC_MSG_ERROR([libole32 missing])]) - AC_CHECK_LIB([oleaut32], [main], [], [AC_MSG_ERROR([liboleaut32 missing])]) - AC_CHECK_LIB([uuid], [main], [], [AC_MSG_ERROR([libuuid missing])]) - AC_CHECK_LIB([advapi32], [CryptAcquireContextW], [], [AC_MSG_ERROR([libadvapi32 missing])]) - AC_CHECK_LIB([ws2_32], [WSAStartup], [], [AC_MSG_ERROR([libws2_32 missing])]) - AC_CHECK_LIB([shlwapi], [PathRemoveFileSpecW], [], [AC_MSG_ERROR([libshlwapi missing])]) - AC_CHECK_LIB([iphlpapi], [GetAdaptersAddresses], [], [AC_MSG_ERROR([libiphlpapi missing])]) - - dnl -static is interpreted by libtool, where it has a different meaning. - dnl In libtool-speak, it's -all-static. - AX_CHECK_LINK_FLAG([-static], [LIBTOOL_APP_LDFLAGS="$LIBTOOL_APP_LDFLAGS -all-static"]) - - AC_PATH_PROG([MAKENSIS], [makensis], [none]) - if test "$MAKENSIS" = "none"; then - AC_MSG_WARN([makensis not found. Cannot create installer.]) - fi - - AC_PATH_TOOL([WINDRES], [windres], [none]) - if test "$WINDRES" = "none"; then - AC_MSG_ERROR([windres not found]) - fi - - CORE_CPPFLAGS="$CORE_CPPFLAGS -DSECP256K1_STATIC" - - CORE_CPPFLAGS="$CORE_CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0601 -D_WIN32_IE=0x0501 -DWIN32_LEAN_AND_MEAN" - dnl Prevent the definition of min/max macros. - dnl We always want to use the standard library. - CORE_CPPFLAGS="$CORE_CPPFLAGS -DNOMINMAX" - - dnl libtool insists upon adding -nostdlib and a list of objects/libs to link against. - dnl That breaks our ability to build dll's with static libgcc/libstdc++/libssp. Override - dnl its command here, with the predeps/postdeps removed, and -static inserted. Postdeps are - dnl also overridden to prevent their insertion later. - dnl This should only affect dll's. - archive_cmds_CXX="\$CC -shared \$libobjs \$deplibs \$compiler_flags -static -o \$output_objdir/\$soname \${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker \$lib" - postdeps_CXX= - - dnl We require Windows 7 (NT 6.1) or later - AX_CHECK_LINK_FLAG([-Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,--major-subsystem-version -Wl,6 -Wl,--minor-subsystem-version -Wl,1"], [], [$LDFLAG_WERROR]) - ;; - *darwin*) - TARGET_OS=darwin - if test $cross_compiling != "yes"; then - BUILD_OS=darwin - AC_CHECK_PROG([BREW], [brew], [brew]) - if test "$BREW" = "brew"; then - dnl These Homebrew packages may be keg-only, meaning that they won't be found - dnl in expected paths because they may conflict with system files. Ask - dnl Homebrew where each one is located, then adjust paths accordingly. - dnl It's safe to add these paths even if the functionality is disabled by - dnl the user (--without-wallet or --without-gui for example). - - dnl Homebrew may create symlinks in /usr/local/include for some packages. - dnl Because MacOS's clang internally adds "-I /usr/local/include" to its search - dnl paths, this will negate efforts to use -isystem for those packages, as they - dnl will be found first in /usr/local. Use the internal "-internal-isystem" - dnl option to system-ify all /usr/local/include paths without adding it to the list - dnl of search paths in case it's not already there. - if test "$suppress_external_warnings" != "no"; then - AX_CHECK_PREPROC_FLAG([-Xclang -internal-isystem/usr/local/include], [CORE_CPPFLAGS="$CORE_CPPFLAGS -Xclang -internal-isystem/usr/local/include"], [], [$CXXFLAG_WERROR]) - fi - - if test "$use_bdb" != "no" && $BREW list --versions berkeley-db@4 >/dev/null && test "$BDB_CFLAGS" = "" && test "$BDB_LIBS" = ""; then - bdb_prefix=$($BREW --prefix berkeley-db@4 2>/dev/null) - dnl This must precede the call to BITCOIN_FIND_BDB48 below. - BDB_CFLAGS="-I$bdb_prefix/include" - BDB_LIBS="-L$bdb_prefix/lib -ldb_cxx-4.8" - fi - - if $BREW list --versions qt@5 >/dev/null; then - export PKG_CONFIG_PATH="$($BREW --prefix qt@5 2>/dev/null)/lib/pkgconfig:$PKG_CONFIG_PATH" - fi - - case $host in - *aarch64*) - dnl The preferred Homebrew prefix for Apple Silicon is /opt/homebrew. - dnl Therefore, as we do not use pkg-config to detect miniupnpc and libnatpmp - dnl packages, we should set the CPPFLAGS and LDFLAGS variables for them - dnl explicitly. - if test "$use_upnp" != "no" && $BREW list --versions miniupnpc >/dev/null; then - miniupnpc_prefix=$($BREW --prefix miniupnpc 2>/dev/null) - if test "$suppress_external_warnings" != "no"; then - MINIUPNPC_CPPFLAGS="-isystem $miniupnpc_prefix/include" - else - MINIUPNPC_CPPFLAGS="-I$miniupnpc_prefix/include" - fi - MINIUPNPC_LIBS="-L$miniupnpc_prefix/lib" - fi - if test "$use_natpmp" != "no" && $BREW list --versions libnatpmp >/dev/null; then - libnatpmp_prefix=$($BREW --prefix libnatpmp 2>/dev/null) - if test "$suppress_external_warnings" != "no"; then - NATPMP_CPPFLAGS="-isystem $libnatpmp_prefix/include" - else - NATPMP_CPPFLAGS="-I$libnatpmp_prefix/include" - fi - NATPMP_LIBS="-L$libnatpmp_prefix/lib" - fi - ;; - esac - fi - else - case $build_os in - *darwin*) - BUILD_OS=darwin - ;; - *) - AC_PATH_TOOL([DSYMUTIL], [dsymutil], [dsymutil]) - AC_PATH_TOOL([INSTALL_NAME_TOOL], [install_name_tool], [install_name_tool]) - AC_PATH_TOOL([OTOOL], [otool], [otool]) - AC_PATH_PROGS([XORRISOFS], [xorrisofs], [xorrisofs]) - - dnl libtool will try to strip the static lib, which is a problem for - dnl cross-builds because strip attempts to call a hard-coded ld, - dnl which may not exist in the path. Stripping the .a is not - dnl necessary, so just disable it. - old_striplib= - ;; - esac - fi - - AX_CHECK_LINK_FLAG([-Wl,-headerpad_max_install_names], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-headerpad_max_install_names"], [], [$LDFLAG_WERROR]) - CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0" - OBJCXXFLAGS="$CXXFLAGS" - ;; - *android*) - dnl make sure android stays above linux for hosts like *linux-android* - TARGET_OS=android - case $host in - *x86_64*) - ANDROID_ARCH=x86_64 - ;; - *aarch64*) - ANDROID_ARCH=arm64-v8a - ;; - *armv7a*) - ANDROID_ARCH=armeabi-v7a - ;; - *) AC_MSG_ERROR([Could not determine Android arch, or it is unsupported]) ;; - esac - ;; - *linux*) - TARGET_OS=linux - ;; -esac - -if test "$use_extended_functional_tests" != "no"; then - AC_SUBST(EXTENDED_FUNCTIONAL_TESTS, --extended) -fi - -if test "$use_lcov" = "yes"; then - if test "$LCOV" = ""; then - AC_MSG_ERROR([lcov testing requested but lcov not found]) - fi - if test "$PYTHON" = ""; then - AC_MSG_ERROR([lcov testing requested but python not found]) - fi - if test "$GENHTML" = ""; then - AC_MSG_ERROR([lcov testing requested but genhtml not found]) - fi - - AC_MSG_CHECKING([whether compiler is Clang]) - AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ - #if defined(__clang__) && defined(__llvm__) - // Compiler is Clang - #else - # error Compiler is not Clang - #endif - ]])],[ - AC_MSG_RESULT([yes]) - if test "$LLVM_COV" = ""; then - AC_MSG_ERROR([lcov testing requested but llvm-cov not found]) - fi - COV_TOOL="$LLVM_COV gcov" - ],[ - AC_MSG_RESULT([no]) - if test "$GCOV" = "x"; then - AC_MSG_ERROR([lcov testing requested but gcov not found]) - fi - COV_TOOL="$GCOV" - ]) - AC_SUBST(COV_TOOL) - AC_SUBST(COV_TOOL_WRAPPER, "cov_tool_wrapper.sh") - LCOV="$LCOV --gcov-tool $(pwd)/$COV_TOOL_WRAPPER" - - AX_CHECK_LINK_FLAG([--coverage], [CORE_LDFLAGS="$CORE_LDFLAGS --coverage"], - [AC_MSG_ERROR([lcov testing requested but --coverage linker flag does not work])]) - AX_CHECK_COMPILE_FLAG([--coverage],[CORE_CXXFLAGS="$CORE_CXXFLAGS --coverage"], - [AC_MSG_ERROR([lcov testing requested but --coverage flag does not work])]) - dnl If coverage is enabled, and the user hasn't overridden CXXFLAGS, clear - dnl them, to prevent autoconfs "-g -O2" being added. Otherwise we'd end up - dnl with "--coverage -Og -O0 -g -O2". - if test "$CXXFLAGS_overridden" = "no"; then - CXXFLAGS="" - fi - CORE_CXXFLAGS="$CORE_CXXFLAGS -Og -O0" -fi - -if test "$use_lcov_branch" != "no"; then - AC_SUBST(LCOV_OPTS, "$LCOV_OPTS --rc lcov_branch_coverage=1") -fi - -dnl Check for endianness -AC_C_BIGENDIAN - -dnl Check for pthread compile/link requirements -AX_PTHREAD - -dnl Check if -latomic is required for -CHECK_ATOMIC - -dnl The following macro will add the necessary defines to bitcoin-config.h, but -dnl they also need to be passed down to any subprojects. Pull the results out of -dnl the cache and add them to CPPFLAGS. -AC_SYS_LARGEFILE -dnl detect POSIX or GNU variant of strerror_r -AC_FUNC_STRERROR_R - -if test "$ac_cv_sys_file_offset_bits" != "" && - test "$ac_cv_sys_file_offset_bits" != "no" && - test "$ac_cv_sys_file_offset_bits" != "unknown"; then - CORE_CPPFLAGS="$CORE_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits" -fi - -if test "$ac_cv_sys_large_files" != "" && - test "$ac_cv_sys_large_files" != "no" && - test "$ac_cv_sys_large_files" != "unknown"; then - CORE_CPPFLAGS="$CORE_CPPFLAGS -D_LARGE_FILES=$ac_cv_sys_large_files" -fi - -if test "$enable_gprof" = "yes"; then - dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense, - dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force - dnl -pie by default, in which case it needs to be turned off with -no-pie. - - if test "$use_hardening" = "yes"; then - AC_MSG_ERROR([gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof]) - fi - use_hardening=no - AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"], - [AC_MSG_ERROR([gprof profiling requested but not available])], [$CXXFLAG_WERROR]) - - AX_CHECK_LINK_FLAG([-no-pie], [GPROF_LDFLAGS="-no-pie"]) - AX_CHECK_LINK_FLAG([-pg], [GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"], - [AC_MSG_ERROR([gprof profiling requested but not available])], [$GPROF_LDFLAGS]) -fi - -if test "$TARGET_OS" != "windows"; then - dnl All windows code is PIC, forcing it on just adds useless compile warnings - AX_CHECK_COMPILE_FLAG([-fPIC], [PIC_FLAGS="-fPIC"]) -fi - -dnl Versions of gcc prior to 12.1 (commit -dnl https://github.com/gcc-mirror/gcc/commit/551aa75778a4c5165d9533cd447c8fc822f583e1) -dnl are subject to a bug, see the gccbug_90348 test case and -dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set -dnl -fstack-reuse=none for all gcc builds. (Only gcc understands this flag) -AX_CHECK_COMPILE_FLAG([-fstack-reuse=none], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"]) -if test "$use_hardening" != "no"; then - use_hardening=yes - AX_CHECK_COMPILE_FLAG([-Wstack-protector], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) - AX_CHECK_COMPILE_FLAG([-fstack-protector-all], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) - - AX_CHECK_COMPILE_FLAG([-fcf-protection=full], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fcf-protection=full"]) - - case $host in - *mingw*) - dnl stack-clash-protection doesn't compile with GCC 10 and earlier. - dnl In any case, it is a no-op for Windows. - dnl See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details. - ;; - *) - AX_CHECK_COMPILE_FLAG([-fstack-clash-protection], [HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-clash-protection"], [], [$CXXFLAG_WERROR]) - ;; - esac - - - dnl When enable_debug is yes, all optimizations are disabled. - dnl However, FORTIFY_SOURCE requires that there is some level of optimization, otherwise it does nothing and just creates a compiler warning. - dnl Since FORTIFY_SOURCE is a no-op without optimizations, do not enable it when enable_debug is yes. - if test "$enable_debug" != "yes"; then - AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=3],[ - AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ - HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" - ]) - HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=3" - ]) - fi - - AX_CHECK_LINK_FLAG([-Wl,--enable-reloc-section], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--enable-reloc-section"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,--dynamicbase], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--dynamicbase"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,--nxcompat], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--nxcompat"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,--high-entropy-va], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,--high-entropy-va"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-z,relro], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,relro"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-z,now], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,now"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-z,separate-code], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-z,separate-code"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-fPIE -pie], [PIE_FLAGS="-fPIE"; HARDENED_LDFLAGS="$HARDENED_LDFLAGS -pie"], [], [$CXXFLAG_WERROR]) - - case $host in - *mingw*) - AC_CHECK_LIB([ssp], [main], [], [AC_MSG_ERROR([libssp missing])]) - ;; - esac -fi - -dnl These flags are specific to ld64, and may cause issues with other linkers. -dnl For example: GNU ld will interpret -dead_strip as -de and then try and use -dnl "ad_strip" as the symbol for the entry point. -if test "$TARGET_OS" = "darwin"; then - AX_CHECK_LINK_FLAG([-Wl,-dead_strip], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-dead_strip"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-dead_strip_dylibs], [CORE_LDFLAGS="$CORE_LDFLAGS -Wl,-dead_strip_dylibs"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-bind_at_load], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-bind_at_load"], [], [$LDFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,-fixup_chains], [HARDENED_LDFLAGS="$HARDENED_LDFLAGS -Wl,-fixup_chains"], [], [$LDFLAG_WERROR]) -fi - -AC_CHECK_HEADERS([endian.h sys/endian.h byteswap.h sys/select.h sys/prctl.h sys/sysctl.h vm/vm_param.h sys/vmmeter.h sys/resources.h]) - -AC_CHECK_DECLS([getifaddrs, freeifaddrs],[CHECK_SOCKET],, - [#include - #include ] -) - -dnl These are used for daemonization in bitcoind -AC_CHECK_DECLS([fork]) -AC_CHECK_DECLS([setsid]) - -AC_CHECK_DECLS([pipe2]) - -AC_CHECK_FUNCS([timingsafe_bcmp]) - -AC_CHECK_DECLS([le16toh, le32toh, le64toh, htole16, htole32, htole64, be16toh, be32toh, be64toh, htobe16, htobe32, htobe64],,, - [#if HAVE_ENDIAN_H - #include - #elif HAVE_SYS_ENDIAN_H - #include - #endif]) - -AC_CHECK_DECLS([bswap_16, bswap_32, bswap_64],,, - [#if HAVE_BYTESWAP_H - #include - #endif]) - -AC_MSG_CHECKING([for __builtin_clzl]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ - (void) __builtin_clzl(0); - ]])], - [ AC_MSG_RESULT([yes]); have_clzl=yes; AC_DEFINE([HAVE_BUILTIN_CLZL], [1], [Define this symbol if you have __builtin_clzl])], - [ AC_MSG_RESULT([no]); have_clzl=no;] -) - -AC_MSG_CHECKING([for __builtin_clzll]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ - (void) __builtin_clzll(0); - ]])], - [ AC_MSG_RESULT([yes]); have_clzll=yes; AC_DEFINE([HAVE_BUILTIN_CLZLL], [1], [Define this symbol if you have __builtin_clzll])], - [ AC_MSG_RESULT([no]); have_clzll=no;] -) - -dnl Check for malloc_info (for memory statistics information in getmemoryinfo) -AC_MSG_CHECKING([for getmemoryinfo]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ int f = malloc_info(0, NULL); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_MALLOC_INFO], [1], [Define this symbol if you have malloc_info]) ], - [ AC_MSG_RESULT([no])] -) - -dnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas) -AC_MSG_CHECKING([for mallopt M_ARENA_MAX]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ mallopt(M_ARENA_MAX, 1); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_MALLOPT_ARENA_MAX], [1], [Define this symbol if you have mallopt with M_ARENA_MAX]) ], - [ AC_MSG_RESULT([no])] -) - -dnl Check for posix_fallocate -AC_MSG_CHECKING([for posix_fallocate]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - // same as in src/util/fs_helpers.cpp - #ifdef __linux__ - #ifdef _POSIX_C_SOURCE - #undef _POSIX_C_SOURCE - #endif - #define _POSIX_C_SOURCE 200112L - #endif // __linux__ - #include ]], - [[ int f = posix_fallocate(0, 0, 0); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_POSIX_FALLOCATE], [1], [Define this symbol if you have posix_fallocate]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for default visibility attribute]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([ - int foo(void) __attribute__((visibility("default"))); - int main(){} - ])], - [ - AC_DEFINE([HAVE_DEFAULT_VISIBILITY_ATTRIBUTE], [1], [Define if the visibility attribute is supported.]) - AC_MSG_RESULT([yes]) - ], - [ - AC_MSG_RESULT([no]) - if test "$use_reduce_exports" = "yes"; then - AC_MSG_ERROR([Cannot find a working visibility attribute. Use --disable-reduce-exports.]) - fi - ] -) - -AC_MSG_CHECKING([for dllexport attribute]) -AC_COMPILE_IFELSE([AC_LANG_SOURCE([ - __declspec(dllexport) int foo(void); - int main(){} - ])], - [ - AC_DEFINE([HAVE_DLLEXPORT_ATTRIBUTE], [1], [Define if the dllexport attribute is supported.]) - AC_MSG_RESULT([yes]) - ], - [AC_MSG_RESULT([no])] -) - -if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then - TEMP_LDFLAGS="$LDFLAGS" - LDFLAGS="$TEMP_LDFLAGS $PTHREAD_CFLAGS" - AC_MSG_CHECKING([for thread_local support]) - AC_LINK_IFELSE([AC_LANG_SOURCE([ - #include - static thread_local int foo = 0; - static void run_thread() { foo++;} - int main(){ - for(int i = 0; i < 10; i++) { std::thread(run_thread).detach();} - return foo; - } - ])], - [ - case $host in - *mingw*) - dnl mingw32's implementation of thread_local has also been shown to behave - dnl erroneously under concurrent usage; see: - dnl https://gist.github.com/jamesob/fe9a872051a88b2025b1aa37bfa98605 - AC_MSG_RESULT([no]) - ;; - *freebsd*) - dnl FreeBSD's implementation of thread_local is also buggy (per - dnl https://groups.google.com/d/msg/bsdmailinglist/22ncTZAbDp4/Dii_pII5AwAJ) - AC_MSG_RESULT([no]) - ;; - *) - AC_DEFINE([HAVE_THREAD_LOCAL], [1], [Define if thread_local is supported.]) - AC_MSG_RESULT([yes]) - ;; - esac - ], - [ - AC_MSG_RESULT([no]) - ] - ) - LDFLAGS="$TEMP_LDFLAGS" -fi - -dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable -dnl fail if neither are available. -AC_MSG_CHECKING([for gmtime_r]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GMTIME_R], [1], [Define this symbol if gmtime_r is available]) ], - [ AC_MSG_RESULT([no]); - AC_MSG_CHECKING([for gmtime_s]); - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])], - [ AC_MSG_RESULT([yes])], - [ AC_MSG_RESULT([no]); AC_MSG_ERROR([Both gmtime_r and gmtime_s are unavailable]) ] - ) - ] -) - -dnl Check for different ways of gathering OS randomness -AC_MSG_CHECKING([for Linux getrandom function]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include ]], - [[ getrandom(nullptr, 32, 0); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GETRANDOM], [1], [Define this symbol if the Linux getrandom function call is available]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for getentropy via sys/random.h]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include ]], - [[ getentropy(nullptr, 32) ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GETENTROPY_RAND], [1], [Define this symbol if the BSD getentropy system call is available with sys/random.h]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for sysctl]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include - #include ]], - [[ #ifdef __linux__ - #error "Don't use sysctl on Linux, it's deprecated even when it works" - #endif - sysctl(nullptr, 2, nullptr, nullptr, nullptr, 0); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SYSCTL], [1], [Define this symbol if the BSD sysctl() is available]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for sysctl KERN_ARND]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include - #include ]], - [[ #ifdef __linux__ - #error "Don't use sysctl on Linux, it's deprecated even when it works" - #endif - static int name[2] = {CTL_KERN, KERN_ARND}; - sysctl(name, 2, nullptr, nullptr, nullptr, 0); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_SYSCTL_ARND], [1], [Define this symbol if the BSD sysctl(KERN_ARND) is available]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for if type char equals int8_t]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include - #include ]], - [[ static_assert(std::is_same::value, ""); ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([CHAR_EQUALS_INT8], [1], [Define this symbol if type char equals int8_t]) ], - [ AC_MSG_RESULT([no])] -) - -AC_MSG_CHECKING([for fdatasync]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ fdatasync(0); ]])], - [ AC_MSG_RESULT([yes]); HAVE_FDATASYNC=1 ], - [ AC_MSG_RESULT([no]); HAVE_FDATASYNC=0 ] -) -AC_DEFINE_UNQUOTED([HAVE_FDATASYNC], [$HAVE_FDATASYNC], [Define to 1 if fdatasync is available.]) - -AC_MSG_CHECKING([for F_FULLFSYNC]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ fcntl(0, F_FULLFSYNC, 0); ]])], - [ AC_MSG_RESULT([yes]); HAVE_FULLFSYNC=1 ], - [ AC_MSG_RESULT([no]); HAVE_FULLFSYNC=0 ] -) - -AC_MSG_CHECKING([for O_CLOEXEC]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[ open("", O_CLOEXEC); ]])], - [ AC_MSG_RESULT([yes]); HAVE_O_CLOEXEC=1 ], - [ AC_MSG_RESULT([no]); HAVE_O_CLOEXEC=0 ] -) -AC_DEFINE_UNQUOTED([HAVE_O_CLOEXEC], [$HAVE_O_CLOEXEC], [Define to 1 if O_CLOEXEC flag is available.]) - -dnl crc32c platform checks -AC_MSG_CHECKING([for __builtin_prefetch]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ ]], [[ - char data = 0; - const char* address = &data; - __builtin_prefetch(address, 0, 0); - ]])], - [ AC_MSG_RESULT([yes]); HAVE_BUILTIN_PREFETCH=1 ], - [ AC_MSG_RESULT([no]); HAVE_BUILTIN_PREFETCH=0 ] -) - -AC_MSG_CHECKING([for _mm_prefetch]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ - char data = 0; - const char* address = &data; - _mm_prefetch(address, _MM_HINT_NTA); - ]])], - [ AC_MSG_RESULT([yes]); HAVE_MM_PREFETCH=1 ], - [ AC_MSG_RESULT([no]); HAVE_MM_PREFETCH=0 ] -) - -AC_MSG_CHECKING([for strong getauxval support in the system headers]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - ]], [[ - getauxval(AT_HWCAP); - ]])], - [ AC_MSG_RESULT([yes]); HAVE_STRONG_GETAUXVAL=1; AC_DEFINE([HAVE_STRONG_GETAUXVAL], [1], [Define this symbol to build code that uses getauxval)]) ], - [ AC_MSG_RESULT([no]); HAVE_STRONG_GETAUXVAL=0 ] -) - -have_any_system=no -AC_MSG_CHECKING([for std::system]) -AC_LINK_IFELSE( - [ AC_LANG_PROGRAM( - [[ #include ]], - [[ int nErr = std::system(""); ]] - )], - [ AC_MSG_RESULT([yes]); have_any_system=yes], - [ AC_MSG_RESULT([no]) ] -) - -AC_MSG_CHECKING([for ::_wsystem]) -AC_LINK_IFELSE( - [ AC_LANG_PROGRAM( - [[ #include ]], - [[ int nErr = ::_wsystem(NULL); ]] - )], - [ AC_MSG_RESULT([yes]); have_any_system=yes], - [ AC_MSG_RESULT([no]) ] -) - -if test "$have_any_system" != "no"; then - AC_DEFINE([HAVE_SYSTEM], [1], [Define to 1 if std::system or ::wsystem is available.]) -fi - -dnl SUPPRESSED_CPPFLAGS=SUPPRESS_WARNINGS([$SOME_CPPFLAGS]) -dnl Replace -I with -isystem in $SOME_CPPFLAGS to suppress warnings from -dnl headers from its include directories and return the result. -dnl See -isystem documentation: -dnl https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html -dnl https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-isystem-directory -dnl Do not change "-I/usr/include" to "-isystem /usr/include" because that -dnl is not necessary (/usr/include is already a system directory) and because -dnl it would break GCC's #include_next. -AC_DEFUN([SUPPRESS_WARNINGS], - [[$(echo $1 |${SED} -E -e 's/(^| )-I/\1-isystem /g' -e 's;-isystem /usr/include/*( |$);-I/usr/include\1;g')]]) - -dnl enable-fuzz should disable all other targets -if test "$enable_fuzz" = "yes"; then - AC_MSG_WARN([enable-fuzz will disable all other targets and force --enable-fuzz-binary=yes]) - build_bitcoin_utils=no - build_bitcoin_cli=no - build_bitcoin_tx=no - build_bitcoin_util=no - build_bitcoin_chainstate=no - build_bitcoin_wallet=no - build_bitcoind=no - build_bitcoin_libs=no - bitcoin_enable_qt=no - bitcoin_enable_qt_test=no - bitcoin_enable_qt_dbus=no - use_bench=no - use_tests=no - use_external_signer=no - use_upnp=no - use_natpmp=no - use_zmq=no - enable_fuzz_binary=yes - - AX_CHECK_PREPROC_FLAG([-DABORT_ON_FAILED_ASSUME], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DABORT_ON_FAILED_ASSUME"], [], [$CXXFLAG_WERROR]) -else - BITCOIN_QT_INIT - - dnl sets $bitcoin_enable_qt, $bitcoin_enable_qt_test, $bitcoin_enable_qt_dbus - BITCOIN_QT_CONFIGURE([5.11.3]) - - dnl Keep a copy of the original $QT_INCLUDES and use it when invoking qt's moc - QT_INCLUDES_UNSUPPRESSED=$QT_INCLUDES - if test "$suppress_external_warnings" != "no" ; then - QT_INCLUDES=SUPPRESS_WARNINGS($QT_INCLUDES) - QT_DBUS_INCLUDES=SUPPRESS_WARNINGS($QT_DBUS_INCLUDES) - QT_TEST_INCLUDES=SUPPRESS_WARNINGS($QT_TEST_INCLUDES) - fi -fi - -if test "$enable_fuzz_binary" = "yes"; then - AC_MSG_CHECKING([whether main function is needed for fuzz binary]) - AX_CHECK_LINK_FLAG( - [], - [AC_MSG_RESULT([no])], - [AC_MSG_RESULT([yes]); CORE_CPPFLAGS="$CORE_CPPFLAGS -DPROVIDE_FUZZ_MAIN_FUNCTION"], - [$SANITIZER_LDFLAGS], - [AC_LANG_PROGRAM([[ - #include - #include - extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { return 0; } - /* comment to remove the main function ... - ]],[[ - */ int not_main() { - ]])]) - - CHECK_RUNTIME_LIB -fi - -if test "$enable_wallet" != "no"; then - dnl Check for libdb_cxx only if wallet enabled - if test "$use_bdb" != "no"; then - BITCOIN_FIND_BDB48 - if test "$suppress_external_warnings" != "no" ; then - BDB_CPPFLAGS=SUPPRESS_WARNINGS($BDB_CPPFLAGS) - fi - fi - - dnl Check for sqlite3 - if test "$use_sqlite" != "no"; then - PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.17], [have_sqlite=yes], [have_sqlite=no]) - fi - AC_MSG_CHECKING([whether to build wallet with support for sqlite]) - if test "$use_sqlite" = "no"; then - use_sqlite=no - elif test "$have_sqlite" = "no"; then - if test "$use_sqlite" = "yes"; then - AC_MSG_ERROR([sqlite support requested but cannot be built. Use --without-sqlite]) - fi - use_sqlite=no - else - if test "$use_sqlite" != "no"; then - AC_DEFINE([USE_SQLITE],[1],[Define if sqlite support should be compiled in]) - use_sqlite=yes - fi - fi - AC_MSG_RESULT([$use_sqlite]) - - dnl Disable wallet if both --without-bdb and --without-sqlite - if test "$use_bdb$use_sqlite" = "nono"; then - if test "$enable_wallet" = "yes"; then - AC_MSG_ERROR([wallet functionality requested but no BDB or SQLite support available.]) - fi - enable_wallet=no - fi -fi - -if test "$use_usdt" != "no"; then - AC_MSG_CHECKING([whether Userspace, Statically Defined Tracing tracepoints are supported]) - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM( - [#include ], - [DTRACE_PROBE(context, event); - int a, b, c, d, e, f, g; - DTRACE_PROBE7(context, event, a, b, c, d, e, f, g);] - )], - [AC_MSG_RESULT([yes]); AC_DEFINE([ENABLE_TRACING], [1], [Define to 1 to enable tracepoints for Userspace, Statically Defined Tracing])], - [AC_MSG_RESULT([no]); use_usdt=no;] - ) -fi -AM_CONDITIONAL([ENABLE_USDT_TRACEPOINTS], [test "$use_usdt" = "yes"]) - -if test "$build_bitcoind$bitcoin_enable_qt$use_bench$use_tests" = "nononono"; then - use_upnp=no - use_natpmp=no - use_zmq=no -fi - -dnl Check for libminiupnpc (optional) -if test "$use_upnp" != "no"; then - TEMP_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $MINIUPNPC_CPPFLAGS" - AC_CHECK_HEADERS( - [miniupnpc/miniupnpc.h miniupnpc/upnpcommands.h miniupnpc/upnperrors.h], - [AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])], - [have_miniupnpc=no] - ) - - dnl The minimum supported miniUPnPc API version is set to 17. This excludes - dnl versions with known vulnerabilities. - if test "$have_miniupnpc" != "no"; then - AC_MSG_CHECKING([whether miniUPnPc API version is supported]) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ - @%:@include - ]], [[ - #if MINIUPNPC_API_VERSION >= 17 - // Everything is okay - #else - # error miniUPnPc API version is too old - #endif - ]])],[ - AC_MSG_RESULT([yes]) - ],[ - AC_MSG_RESULT([no]) - AC_MSG_WARN([miniUPnPc API version < 17 is unsupported, disabling UPnP support.]) - have_miniupnpc=no - ]) - fi - CPPFLAGS="$TEMP_CPPFLAGS" -fi - -dnl Check for libnatpmp (optional). -if test "$use_natpmp" != "no"; then - TEMP_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $NATPMP_CPPFLAGS" - AC_CHECK_HEADERS([natpmp.h], - [AC_CHECK_LIB([natpmp], [initnatpmp], [NATPMP_LIBS="$NATPMP_LIBS -lnatpmp"], [have_natpmp=no], [$NATPMP_LIBS])], - [have_natpmp=no]) - CPPFLAGS="$TEMP_CPPFLAGS" -fi - -if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoind$bitcoin_enable_qt$use_tests$use_bench$enable_fuzz_binary" = "nonononononononono"; then - use_boost=no -else - use_boost=yes -fi - -if test "$use_boost" = "yes"; then - - dnl Check for Boost headers - AX_BOOST_BASE([1.64.0],[],[AC_MSG_ERROR([Boost is not available!])]) - if test "$want_boost" = "no"; then - AC_MSG_ERROR([only libbitcoinconsensus can be built without Boost]) - fi - - dnl we don't use multi_index serialization - BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION" - - dnl Prevent use of std::unary_function, which was removed in C++17, - dnl and will generate warnings with newer compilers for Boost - dnl older than 1.80. - dnl See: https://github.com/boostorg/config/pull/430. - AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR], - [AC_LANG_PROGRAM([[#include ]])]) - - if test "$suppress_external_warnings" != "no"; then - BOOST_CPPFLAGS=SUPPRESS_WARNINGS($BOOST_CPPFLAGS) - fi -fi - -if test "$use_external_signer" != "no"; then - AC_MSG_CHECKING([whether Boost.Process can be used]) - TEMP_CXXFLAGS="$CXXFLAGS" - dnl Boost 1.78 requires the following workaround. - dnl See: https://github.com/boostorg/process/issues/235 - CXXFLAGS="$CXXFLAGS -Wno-error=narrowing" - TEMP_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS" - TEMP_LDFLAGS="$LDFLAGS" - dnl Boost 1.73 and older require the following workaround. - LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS" - AC_LINK_IFELSE([AC_LANG_PROGRAM([[ - #define BOOST_PROCESS_USE_STD_FS - #include - ]],[[ - namespace bp = boost::process; - bp::opstream stdin_stream; - bp::ipstream stdout_stream; - bp::child c("dummy", bp::std_out > stdout_stream, bp::std_err > stdout_stream, bp::std_in < stdin_stream); - stdin_stream << std::string{"test"} << std::endl; - if (c.running()) c.terminate(); - c.wait(); - c.exit_code(); - ]])], - [have_boost_process="yes"], - [have_boost_process="no"]) - LDFLAGS="$TEMP_LDFLAGS" - CPPFLAGS="$TEMP_CPPFLAGS" - CXXFLAGS="$TEMP_CXXFLAGS" - AC_MSG_RESULT([$have_boost_process]) - if test "$have_boost_process" = "yes"; then - use_external_signer="yes" - AC_DEFINE([ENABLE_EXTERNAL_SIGNER], [1], [Define if external signer support is enabled]) - AC_DEFINE([BOOST_PROCESS_USE_STD_FS], [1], [Defined to avoid Boost::Process trying to use Boost Filesystem]) - else - if test "$use_external_signer" = "yes"; then - AC_MSG_ERROR([External signing is not supported for this Boost version]) - fi - use_external_signer="no"; - fi -fi -AM_CONDITIONAL([ENABLE_EXTERNAL_SIGNER], [test "$use_external_signer" = "yes"]) - -dnl Check for reduced exports -if test "$use_reduce_exports" = "yes"; then - AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [CORE_CXXFLAGS="$CORE_CXXFLAGS -fvisibility=hidden"], - [AC_MSG_ERROR([Cannot set hidden symbol visibility. Use --disable-reduce-exports.])], [$CXXFLAG_WERROR]) - AX_CHECK_LINK_FLAG([-Wl,--exclude-libs,ALL], [RELDFLAGS="-Wl,--exclude-libs,ALL"], [], [$LDFLAG_WERROR]) -fi - -if test "$use_tests" = "yes"; then - - if test "$HEXDUMP" = ""; then - AC_MSG_ERROR([hexdump is required for tests]) - fi -fi - -dnl libevent check - -use_libevent=no -if test "$build_bitcoin_cli$build_bitcoind$bitcoin_enable_qt$enable_fuzz_binary$use_tests$use_bench" != "nononononono"; then - PKG_CHECK_MODULES([EVENT], [libevent >= 2.1.8], [use_libevent=yes], [AC_MSG_ERROR([libevent version 2.1.8 or greater not found.])]) - if test "$TARGET_OS" != "windows"; then - PKG_CHECK_MODULES([EVENT_PTHREADS], [libevent_pthreads >= 2.1.8], [], [AC_MSG_ERROR([libevent_pthreads version 2.1.8 or greater not found.])]) - fi - - if test "$suppress_external_warnings" != "no"; then - EVENT_CFLAGS=SUPPRESS_WARNINGS($EVENT_CFLAGS) - fi -fi - -if test x$use_libevent = xyes; then - TEMP_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $EVENT_CFLAGS" - AC_MSG_CHECKING([if evhttp_connection_get_peer expects const char**]) - AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ - #include - #include - ]], [[ - evhttp_connection *conn = (evhttp_connection *)1; - const char *host; - uint16_t port; - - evhttp_connection_get_peer(conn, &host, &port); - ]])], - [ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR], [1], [Define this symbol if evhttp_connection_get_peer expects const char**]) ], - [ AC_MSG_RESULT([no]) ] - ) - CXXFLAGS="$TEMP_CXXFLAGS" -fi - -dnl QR Code encoding library check - -if test "$use_qr" != "no"; then - BITCOIN_QT_CHECK([PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])]) -fi - -dnl ZMQ check - -if test "$use_zmq" = "yes"; then - PKG_CHECK_MODULES([ZMQ], [libzmq >= 4], - AC_DEFINE([ENABLE_ZMQ], [1], [Define this symbol to enable ZMQ functions]), - [AC_MSG_WARN([libzmq version 4.x or greater not found, disabling]) - use_zmq=no]) -fi - -if test "$use_zmq" = "yes"; then - dnl Assume libzmq was built for static linking - case $host in - *mingw*) - ZMQ_CFLAGS="$ZMQ_CFLAGS -DZMQ_STATIC" - ;; - esac -fi - -AM_CONDITIONAL([ENABLE_ZMQ], [test "$use_zmq" = "yes"]) - -dnl libmultiprocess library check - -libmultiprocess_found=no -if test "$with_libmultiprocess" = "yes" || test "$with_libmultiprocess" = "auto"; then - PKG_CHECK_MODULES([LIBMULTIPROCESS], [libmultiprocess], [ - libmultiprocess_found=yes; - libmultiprocess_prefix=`$PKG_CONFIG --variable=prefix libmultiprocess`; - ], [true]) -elif test "$with_libmultiprocess" != "no"; then - AC_MSG_ERROR([--with-libmultiprocess=$with_libmultiprocess value is not yes, auto, or no]) -fi - -dnl Enable multiprocess check - -if test "$enable_multiprocess" = "yes"; then - if test "$libmultiprocess_found" != "yes"; then - AC_MSG_ERROR([--enable-multiprocess=yes option specified but libmultiprocess library was not found. May need to install libmultiprocess library, or specify install path with PKG_CONFIG_PATH environment variable. Running 'pkg-config --debug libmultiprocess' may be helpful for debugging.]) - fi - build_multiprocess=yes -elif test "$enable_multiprocess" = "auto"; then - build_multiprocess=$libmultiprocess_found -else - build_multiprocess=no -fi - -AM_CONDITIONAL([BUILD_MULTIPROCESS], [test "$build_multiprocess" = "yes"]) -AM_CONDITIONAL([BUILD_BITCOIN_NODE], [test "$build_multiprocess" = "yes"]) -AM_CONDITIONAL([BUILD_BITCOIN_GUI], [test "$build_multiprocess" = "yes"]) - -dnl codegen tools check - -if test "$build_multiprocess" != "no"; then - if test "$with_mpgen" = "yes" || test "$with_mpgen" = "auto"; then - MPGEN_PREFIX="$libmultiprocess_prefix" - elif test "$with_mpgen" != "no"; then - MPGEN_PREFIX="$with_mpgen"; - fi - AC_SUBST(MPGEN_PREFIX) -fi - -AC_MSG_CHECKING([whether to build bitcoind]) -AM_CONDITIONAL([BUILD_BITCOIND], [test $build_bitcoind = "yes"]) -AC_MSG_RESULT($build_bitcoind) - -AC_MSG_CHECKING([whether to build bitcoin-cli]) -AM_CONDITIONAL([BUILD_BITCOIN_CLI], [test $build_bitcoin_cli = "yes"]) -AC_MSG_RESULT($build_bitcoin_cli) - -AC_MSG_CHECKING([whether to build bitcoin-tx]) -AM_CONDITIONAL([BUILD_BITCOIN_TX], [test $build_bitcoin_tx = "yes"]) -AC_MSG_RESULT($build_bitcoin_tx) - -AC_MSG_CHECKING([whether to build bitcoin-wallet]) -AM_CONDITIONAL([BUILD_BITCOIN_WALLET], [test $build_bitcoin_wallet = "yes"]) -AC_MSG_RESULT($build_bitcoin_wallet) - -AC_MSG_CHECKING([whether to build bitcoin-util]) -AM_CONDITIONAL([BUILD_BITCOIN_UTIL], [test $build_bitcoin_util = "yes"]) -AC_MSG_RESULT($build_bitcoin_util) - -AC_MSG_CHECKING([whether to build experimental bitcoin-chainstate]) -if test "$build_bitcoin_chainstate" = "yes"; then - if test "$build_experimental_kernel_lib" = "no"; then - AC_MSG_ERROR([experimental bitcoin-chainstate cannot be built without the experimental bitcoinkernel library. Use --with-experimental-kernel-lib]); - fi -fi -AM_CONDITIONAL([BUILD_BITCOIN_CHAINSTATE], [test $build_bitcoin_chainstate = "yes"]) -AC_MSG_RESULT($build_bitcoin_chainstate) - -AC_MSG_CHECKING([whether to build libraries]) -AM_CONDITIONAL([BUILD_BITCOIN_LIBS], [test $build_bitcoin_libs = "yes"]) - -if test "$build_bitcoin_libs" = "yes"; then - AC_DEFINE([HAVE_CONSENSUS_LIB], [1], [Define this symbol if the consensus lib has been built]) - AC_CONFIG_FILES([libbitcoinconsensus.pc:libbitcoinconsensus.pc.in]) -fi - -AM_CONDITIONAL([BUILD_BITCOIN_KERNEL_LIB], [test "$build_experimental_kernel_lib" != "no" && ( test "$build_experimental_kernel_lib" = "yes" || test "$build_bitcoin_chainstate" = "yes" )]) - -AC_MSG_RESULT($build_bitcoin_libs) - -AC_LANG_POP - -if test "$use_ccache" != "no"; then - AC_MSG_CHECKING([if ccache should be used]) - if test "$CCACHE" = ""; then - if test "$use_ccache" = "yes"; then - AC_MSG_ERROR([ccache not found.]); - else - use_ccache=no - fi - else - use_ccache=yes - CC="$ac_cv_path_CCACHE $CC" - CXX="$ac_cv_path_CCACHE $CXX" - fi - AC_MSG_RESULT($use_ccache) - if test "$use_ccache" = "yes"; then - AX_CHECK_COMPILE_FLAG([-fdebug-prefix-map=A=B], [DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -fdebug-prefix-map=\$(abs_top_srcdir)=."], [], [$CXXFLAG_WERROR]) - AX_CHECK_PREPROC_FLAG([-fmacro-prefix-map=A=B], [DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -fmacro-prefix-map=\$(abs_top_srcdir)=."], [], [$CXXFLAG_WERROR]) - fi -fi - -dnl enable wallet -AC_MSG_CHECKING([if wallet should be enabled]) -if test "$enable_wallet" != "no"; then - AC_MSG_RESULT([yes]) - AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions]) - enable_wallet=yes - -else - AC_MSG_RESULT([no]) -fi - -dnl enable upnp support -AC_MSG_CHECKING([whether to build with support for UPnP]) -if test "$have_miniupnpc" = "no"; then - if test "$use_upnp" = "yes"; then - AC_MSG_ERROR([UPnP requested but cannot be built. Use --without-miniupnpc]) - fi - AC_MSG_RESULT([no]) - use_upnp=no -else - if test "$use_upnp" != "no"; then - AC_MSG_RESULT([yes]) - use_upnp=yes - AC_DEFINE([USE_UPNP], [1], [Define to 1 if UPnP support should be compiled in.]) - if test "$TARGET_OS" = "windows"; then - MINIUPNPC_CPPFLAGS="$MINIUPNPC_CPPFLAGS -DMINIUPNP_STATICLIB" - fi - else - AC_MSG_RESULT([no]) - fi -fi - -dnl Enable NAT-PMP support. -AC_MSG_CHECKING([whether to build with support for NAT-PMP]) -if test "$have_natpmp" = "no"; then - if test "$use_natpmp" = "yes"; then - AC_MSG_ERROR([NAT-PMP requested but cannot be built. Use --without-natpmp]) - fi - AC_MSG_RESULT([no]) - use_natpmp=no -else - if test "$use_natpmp" != "no"; then - AC_MSG_RESULT([yes]) - use_natpmp=yes - AC_DEFINE([USE_NATPMP], [1], [Define to 1 if UPnP support should be compiled in.]) - if test "$TARGET_OS" = "windows"; then - NATPMP_CPPFLAGS="$NATPMP_CPPFLAGS -DSTATICLIB -DNATPMP_STATICLIB" - fi - else - AC_MSG_RESULT([no]) - fi -fi - -dnl these are only used when qt is enabled -BUILD_TEST_QT="" -if test "$bitcoin_enable_qt" != "no"; then - dnl enable dbus support - AC_MSG_CHECKING([whether to build GUI with support for D-Bus]) - if test "$bitcoin_enable_qt_dbus" != "no"; then - AC_DEFINE([USE_DBUS], [1], [Define if dbus support should be compiled in]) - fi - AC_MSG_RESULT([$bitcoin_enable_qt_dbus]) - - dnl enable qr support - AC_MSG_CHECKING([whether to build GUI with support for QR codes]) - if test "$have_qrencode" = "no"; then - if test "$use_qr" = "yes"; then - AC_MSG_ERROR([QR support requested but cannot be built. Use --without-qrencode]) - fi - use_qr=no - else - if test "$use_qr" != "no"; then - AC_DEFINE([USE_QRCODE], [1], [Define if QR support should be compiled in]) - use_qr=yes - fi - fi - AC_MSG_RESULT([$use_qr]) - - if test "$XGETTEXT" = ""; then - AC_MSG_WARN([xgettext is required to update qt translations]) - fi - - AC_MSG_CHECKING([whether to build test_bitcoin-qt]) - if test "$use_gui_tests$bitcoin_enable_qt_test" = "yesyes"; then - AC_MSG_RESULT([yes]) - BUILD_TEST_QT="yes" - else - AC_MSG_RESULT([no]) - fi -fi - -AC_MSG_CHECKING([whether to build test_bitcoin]) -if test "$use_tests" = "yes"; then - if test "$enable_fuzz" = "yes"; then - AC_MSG_RESULT([no, because fuzzing is enabled]) - else - AC_MSG_RESULT([yes]) - fi - BUILD_TEST="yes" -else - AC_MSG_RESULT([no]) - BUILD_TEST="" -fi - -AC_MSG_CHECKING([whether to reduce exports]) -if test "$use_reduce_exports" = "yes"; then - AC_MSG_RESULT([yes]) -else - AC_MSG_RESULT([no]) -fi - -if test "$build_bitcoin_wallet$build_bitcoin_cli$build_bitcoin_tx$build_bitcoin_util$build_bitcoin_libs$build_bitcoind$bitcoin_enable_qt$enable_fuzz_binary$use_bench$use_tests" = "nononononononononono"; then - AC_MSG_ERROR([No targets! Please specify at least one of: --with-utils --with-libs --with-daemon --with-gui --enable-fuzz(-binary) --enable-bench or --enable-tests]) -fi - -AM_CONDITIONAL([TARGET_DARWIN], [test "$TARGET_OS" = "darwin"]) -AM_CONDITIONAL([BUILD_DARWIN], [test "$BUILD_OS" = "darwin"]) -AM_CONDITIONAL([TARGET_LINUX], [test "$TARGET_OS" = "linux"]) -AM_CONDITIONAL([TARGET_WINDOWS], [test "$TARGET_OS" = "windows"]) -AM_CONDITIONAL([ENABLE_WALLET], [test "$enable_wallet" = "yes"]) -AM_CONDITIONAL([USE_SQLITE], [test "$use_sqlite" = "yes"]) -AM_CONDITIONAL([USE_BDB], [test "$use_bdb" = "yes"]) -AM_CONDITIONAL([ENABLE_TESTS], [test "$BUILD_TEST" = "yes"]) -AM_CONDITIONAL([ENABLE_FUZZ], [test "$enable_fuzz" = "yes"]) -AM_CONDITIONAL([ENABLE_FUZZ_BINARY], [test "$enable_fuzz_binary" = "yes"]) -AM_CONDITIONAL([ENABLE_QT], [test "$bitcoin_enable_qt" = "yes"]) -AM_CONDITIONAL([ENABLE_QT_TESTS], [test "$BUILD_TEST_QT" = "yes"]) -AM_CONDITIONAL([ENABLE_BENCH], [test "$use_bench" = "yes"]) -AM_CONDITIONAL([USE_QRCODE], [test "$use_qr" = "yes"]) -AM_CONDITIONAL([USE_LCOV], [test "$use_lcov" = "yes"]) -AM_CONDITIONAL([USE_LIBEVENT], [test "$use_libevent" = "yes"]) -AM_CONDITIONAL([HARDEN], [test "$use_hardening" = "yes"]) -AM_CONDITIONAL([ENABLE_SSE42], [test "$enable_sse42" = "yes"]) -AM_CONDITIONAL([ENABLE_SSE41], [test "$enable_sse41" = "yes"]) -AM_CONDITIONAL([ENABLE_AVX2], [test "$enable_avx2" = "yes"]) -AM_CONDITIONAL([ENABLE_X86_SHANI], [test "$enable_x86_shani" = "yes"]) -AM_CONDITIONAL([ENABLE_ARM_CRC], [test "$enable_arm_crc" = "yes"]) -AM_CONDITIONAL([ENABLE_ARM_SHANI], [test "$enable_arm_shani" = "yes"]) -AM_CONDITIONAL([USE_ASM], [test "$use_asm" = "yes"]) -AM_CONDITIONAL([WORDS_BIGENDIAN], [test "$ac_cv_c_bigendian" = "yes"]) -AM_CONDITIONAL([USE_NATPMP], [test "$use_natpmp" = "yes"]) -AM_CONDITIONAL([USE_UPNP], [test "$use_upnp" = "yes"]) - -dnl for minisketch -AM_CONDITIONAL([ENABLE_CLMUL], [test "$enable_clmul" = "yes"]) -AM_CONDITIONAL([HAVE_CLZ], [test "$have_clzl$have_clzll" = "yesyes"]) - -AC_DEFINE([CLIENT_VERSION_MAJOR], [_CLIENT_VERSION_MAJOR], [Major version]) -AC_DEFINE([CLIENT_VERSION_MINOR], [_CLIENT_VERSION_MINOR], [Minor version]) -AC_DEFINE([CLIENT_VERSION_BUILD], [_CLIENT_VERSION_BUILD], [Version Build]) -AC_DEFINE([CLIENT_VERSION_IS_RELEASE], [_CLIENT_VERSION_IS_RELEASE], [Version is release]) -AC_DEFINE([COPYRIGHT_YEAR], [_COPYRIGHT_YEAR], [Copyright year]) -AC_DEFINE([COPYRIGHT_HOLDERS], ["_COPYRIGHT_HOLDERS"], [Copyright holder(s) before %s replacement]) -AC_DEFINE([COPYRIGHT_HOLDERS_SUBSTITUTION], ["_COPYRIGHT_HOLDERS_SUBSTITUTION"], [Replacement for %s in copyright holders string]) -define(_COPYRIGHT_HOLDERS_FINAL, [patsubst(_COPYRIGHT_HOLDERS, [%s], [_COPYRIGHT_HOLDERS_SUBSTITUTION])]) -AC_DEFINE([COPYRIGHT_HOLDERS_FINAL], ["_COPYRIGHT_HOLDERS_FINAL"], [Copyright holder(s)]) -AC_SUBST(CLIENT_VERSION_MAJOR, _CLIENT_VERSION_MAJOR) -AC_SUBST(CLIENT_VERSION_MINOR, _CLIENT_VERSION_MINOR) -AC_SUBST(CLIENT_VERSION_BUILD, _CLIENT_VERSION_BUILD) -AC_SUBST(CLIENT_VERSION_IS_RELEASE, _CLIENT_VERSION_IS_RELEASE) -AC_SUBST(COPYRIGHT_YEAR, _COPYRIGHT_YEAR) -AC_SUBST(COPYRIGHT_HOLDERS, "_COPYRIGHT_HOLDERS") -AC_SUBST(COPYRIGHT_HOLDERS_SUBSTITUTION, "_COPYRIGHT_HOLDERS_SUBSTITUTION") -AC_SUBST(COPYRIGHT_HOLDERS_FINAL, "_COPYRIGHT_HOLDERS_FINAL") -AC_SUBST(BITCOIN_DAEMON_NAME) -AC_SUBST(BITCOIN_GUI_NAME) -AC_SUBST(BITCOIN_TEST_NAME) -AC_SUBST(BITCOIN_CLI_NAME) -AC_SUBST(BITCOIN_TX_NAME) -AC_SUBST(BITCOIN_UTIL_NAME) -AC_SUBST(BITCOIN_CHAINSTATE_NAME) -AC_SUBST(BITCOIN_WALLET_TOOL_NAME) -AC_SUBST(BITCOIN_MP_NODE_NAME) -AC_SUBST(BITCOIN_MP_GUI_NAME) - -AC_SUBST(RELDFLAGS) -AC_SUBST(CORE_LDFLAGS) -AC_SUBST(CORE_CPPFLAGS) -AC_SUBST(CORE_CXXFLAGS) -AC_SUBST(DEBUG_CPPFLAGS) -AC_SUBST(WARN_CXXFLAGS) -AC_SUBST(NOWARN_CXXFLAGS) -AC_SUBST(DEBUG_CXXFLAGS) -AC_SUBST(ERROR_CXXFLAGS) -AC_SUBST(GPROF_CXXFLAGS) -AC_SUBST(GPROF_LDFLAGS) -AC_SUBST(HARDENED_CXXFLAGS) -AC_SUBST(HARDENED_CPPFLAGS) -AC_SUBST(HARDENED_LDFLAGS) -AC_SUBST(LTO_CXXFLAGS) -AC_SUBST(LTO_LDFLAGS) -AC_SUBST(PIC_FLAGS) -AC_SUBST(PIE_FLAGS) -AC_SUBST(SANITIZER_CXXFLAGS) -AC_SUBST(SANITIZER_LDFLAGS) -AC_SUBST(SSE42_CXXFLAGS) -AC_SUBST(SSE41_CXXFLAGS) -AC_SUBST(CLMUL_CXXFLAGS) -AC_SUBST(AVX2_CXXFLAGS) -AC_SUBST(X86_SHANI_CXXFLAGS) -AC_SUBST(ARM_CRC_CXXFLAGS) -AC_SUBST(ARM_SHANI_CXXFLAGS) -AC_SUBST(LIBTOOL_APP_LDFLAGS) -AC_SUBST(USE_SQLITE) -AC_SUBST(USE_BDB) -AC_SUBST(ENABLE_EXTERNAL_SIGNER) -AC_SUBST(USE_UPNP) -AC_SUBST(USE_QRCODE) -AC_SUBST(TESTDEFS) -AC_SUBST(MINIUPNPC_CPPFLAGS) -AC_SUBST(MINIUPNPC_LIBS) -AC_SUBST(NATPMP_CPPFLAGS) -AC_SUBST(NATPMP_LIBS) -AC_SUBST(HAVE_GMTIME_R) -AC_SUBST(HAVE_FDATASYNC) -AC_SUBST(HAVE_FULLFSYNC) -AC_SUBST(HAVE_O_CLOEXEC) -AC_SUBST(HAVE_BUILTIN_PREFETCH) -AC_SUBST(HAVE_MM_PREFETCH) -AC_SUBST(HAVE_STRONG_GETAUXVAL) -AC_SUBST(ANDROID_ARCH) -AC_SUBST(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR) -AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini]) -AC_CONFIG_FILES([contrib/devtools/split-debug.sh],[chmod +x contrib/devtools/split-debug.sh]) -AM_COND_IF([HAVE_DOXYGEN], [AC_CONFIG_FILES([doc/Doxyfile])]) -AC_CONFIG_LINKS([contrib/devtools/iwyu/bitcoin.core.imp:contrib/devtools/iwyu/bitcoin.core.imp]) -AC_CONFIG_LINKS([contrib/filter-lcov.py:contrib/filter-lcov.py]) -AC_CONFIG_LINKS([contrib/macdeploy/background.tiff:contrib/macdeploy/background.tiff]) -AC_CONFIG_LINKS([src/.bear-tidy-config:src/.bear-tidy-config]) -AC_CONFIG_LINKS([src/.clang-tidy:src/.clang-tidy]) -AC_CONFIG_LINKS([test/functional/test_runner.py:test/functional/test_runner.py]) -AC_CONFIG_LINKS([test/fuzz/test_runner.py:test/fuzz/test_runner.py]) -AC_CONFIG_LINKS([test/util/test_runner.py:test/util/test_runner.py]) -AC_CONFIG_LINKS([test/util/rpcauth-test.py:test/util/rpcauth-test.py]) -AC_CONFIG_LINKS([src/qt/Makefile:src/qt/Makefile]) -AC_CONFIG_LINKS([src/qt/test/Makefile:src/qt/test/Makefile]) -AC_CONFIG_LINKS([src/test/Makefile:src/test/Makefile]) - -dnl boost's m4 checks do something really nasty: they export these vars. As a -dnl result, they leak into secp256k1's configure and crazy things happen. -dnl Until this is fixed upstream and we've synced, we'll just un-export them. -CPPFLAGS_TEMP="$CPPFLAGS" -unset CPPFLAGS -CPPFLAGS="$CPPFLAGS_TEMP" - -ac_configure_args="${ac_configure_args} --disable-shared --with-pic --enable-benchmark=no --enable-module-recovery --disable-module-ecdh" -AC_CONFIG_SUBDIRS([src/secp256k1]) - -AC_OUTPUT - -dnl Replace the BUILDDIR path with the correct Windows path if compiling on Native Windows -case ${OS} in - *Windows*) - sed 's/BUILDDIR="\/\([[a-z]]\)/BUILDDIR="\1:/' test/config.ini > test/config-2.ini - mv test/config-2.ini test/config.ini - ;; -esac - -echo -echo "Options used to compile and link:" -echo " external signer = $use_external_signer" -echo " multiprocess = $build_multiprocess" -echo " with libs = $build_bitcoin_libs" -echo " with wallet = $enable_wallet" -if test "$enable_wallet" != "no"; then - echo " with sqlite = $use_sqlite" - echo " with bdb = $use_bdb" -fi -echo " with gui / qt = $bitcoin_enable_qt" -if test $bitcoin_enable_qt != "no"; then - echo " with qr = $use_qr" -fi -echo " with zmq = $use_zmq" -if test $enable_fuzz = "no"; then - echo " with test = $use_tests" -else - echo " with test = not building test_bitcoin because fuzzing is enabled" -fi -echo " with fuzz binary = $enable_fuzz_binary" -echo " with bench = $use_bench" -echo " with upnp = $use_upnp" -echo " with natpmp = $use_natpmp" -echo " use asm = $use_asm" -echo " USDT tracing = $use_usdt" -echo " sanitizers = $use_sanitizers" -echo " debug enabled = $enable_debug" -echo " gprof enabled = $enable_gprof" -echo " werror = $enable_werror" -echo " LTO = $enable_lto" -echo -echo " target os = $host_os" -echo " build os = $build_os" -echo -echo " CC = $CC" -echo " CFLAGS = $PTHREAD_CFLAGS $CFLAGS" -echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CORE_CPPFLAGS $CPPFLAGS" -echo " CXX = $CXX" -echo " CXXFLAGS = $LTO_CXXFLAGS $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $GPROF_CXXFLAGS $CORE_CXXFLAGS $CXXFLAGS" -echo " LDFLAGS = $LTO_LDFLAGS $PTHREAD_LIBS $HARDENED_LDFLAGS $GPROF_LDFLAGS $CORE_LDFLAGS $LDFLAGS" -echo " AR = $AR" -echo " ARFLAGS = $ARFLAGS" -echo diff --git a/contrib/README.md b/contrib/README.md index f375993ac4..f23d7ac557 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -43,3 +43,11 @@ Command Line Tools ### [Completions](/contrib/completions) ### Shell completions for bash and fish. + +UTXO Set Tools +-------------- + +### [UTXO-to-SQLite](/contrib/utxo-tools/utxo_to_sqlite.py) ### +This script converts a compact-serialized UTXO set (as generated by Bitcoin Core with `dumptxoutset`) +to a SQLite3 database. For more details like e.g. the created table name and schema, refer to the +module docstring on top of the script, which is also contained in the command's `--help` output. diff --git a/contrib/asmap/README.md b/contrib/asmap/README.md new file mode 100644 index 0000000000..0a9d95e49c --- /dev/null +++ b/contrib/asmap/README.md @@ -0,0 +1,83 @@ +# ASMap Tool + +Tool for performing various operations on textual and binary asmap files, +particularly encoding/compressing the raw data to the binary format that can +be used in Bitcoin Core with the `-asmap` option. + +Example usage: +``` +python3 asmap-tool.py encode /path/to/input.file /path/to/output.file +python3 asmap-tool.py decode /path/to/input.file /path/to/output.file +python3 asmap-tool.py diff /path/to/first.file /path/to/second.file +python3 asmap-tool.py diff-addrs /path/to/first.file /path/to/second.file addrs.file +``` +These commands may take a few minutes to run with `python3`, +depending on the amount of data involved and your machine specs. +Consider using `pypy3` for a faster run time. + +### Encoding and Decoding + +ASmap files are somewhat large in text form, and need to be encoded +to binary before being used with Bitcoin Core. + +The `encode` command takes an ASmap and an output file. + +The `--fill`/`-f` flag further reduces the size of the output file +by assuming an AS assignment for an unmapped network if an adjacent network is assigned. +This procedure is lossy, in the sense that it loses information +about which ranges were unassigned. +However, if the input ASmap is incomplete, +this procedure will also reassign ranges that should have an AS assignment, +resulting in an ASmap that may diverge from reality significantly. +Finally, another consequence is that the resulting encoded file +will no longer be meaningful for diffs. +Therefore only use `--fill` if +you want to optimise space, you have a reasonably complete ASmap, +and do not intend to diff the file at a later time. + +The `decode` command takes an encoded ASmap and an output file. +As with `encode`, the `--fill`/`-f` flag reduces the output file size +by reassigning subnets. Conversely, the `--non-overlapping`/`-n` flag +increases output size by outputting strictly non-overlapping network ranges. + +### Comparing ASmaps + +AS control of IP networks changes frequently, therefore it can be useful to get +the changes between to ASmaps via the `diff` and `diff_addrs` commands. + +`diff` takes two ASmap files, and returns a file detailing the changes +in the state of a network's AS assignment between the first and the second file. +This command may take a few minutes to run, depending on your machine. + +The example below shows the three possible output states: +- reassigned to a new AS (`AS26496 # was AS20738`), +- present in the first but not the second (`# 220.157.65.0/24 was AS9723`), +- or present in the second but not the first (`# was unassigned`). + +``` +217.199.160.0/19 AS26496 # was AS20738 +# 220.157.65.0/24 was AS9723 +216.151.172.0/23 AS400080 # was unassigned +2001:470:49::/48 AS20205 # was AS6939 +# 2001:678:bd0::/48 was AS207631 +2001:67c:308::/48 AS26496 # was unassigned +``` +`diff` accepts a `--ignore-unassigned`/`-i` flag +which ignores networks present in the second but not the first. + +`diff_addrs` is intended to provide changes between two ASmaps and +a node's known peers. +The command takes two ASmap files, and a file of IP addresses as output by +the `bitcoin-cli getnodeaddresses` command. +It returns the changes between the two ASmaps for the peer IPs provided in +the `getnodeaddresses` output. +The resulting file is in the same format as the `diff` command shown above. + +You can output address data to a file: +``` +bitcoin-cli getnodeaddresses 0 > addrs.json +``` +and pass in the address file as the third argument: +``` +python3 asmap-tool.py diff_addrs path/to/first.file path/to/second.file addrs.json +``` diff --git a/contrib/asmap/asmap-tool.py b/contrib/asmap/asmap-tool.py new file mode 100755 index 0000000000..33a380a2e7 --- /dev/null +++ b/contrib/asmap/asmap-tool.py @@ -0,0 +1,197 @@ +#!/usr/bin/env python3 +# Copyright (c) 2022 Pieter Wuille +# Distributed under the MIT software license, see the accompanying +# file LICENSE or http://www.opensource.org/licenses/mit-license.php. + +import argparse +import sys +import ipaddress +import json +import math +from collections import defaultdict + +import asmap + +def load_file(input_file): + try: + contents = input_file.read() + except OSError as err: + sys.exit(f"Input file '{input_file.name}' cannot be read: {err.strerror}.") + try: + bin_asmap = asmap.ASMap.from_binary(contents) + except ValueError: + bin_asmap = None + txt_error = None + entries = None + try: + txt_contents = str(contents, encoding="utf-8") + except UnicodeError: + txt_error = "invalid UTF-8" + txt_contents = None + if txt_contents is not None: + entries = [] + for line in txt_contents.split("\n"): + idx = line.find('#') + if idx >= 0: + line = line[:idx] + line = line.lstrip(' ').rstrip(' \t\r\n') + if len(line) == 0: + continue + fields = line.split(' ') + if len(fields) != 2: + txt_error = f"unparseable line '{line}'" + entries = None + break + prefix, asn = fields + if len(asn) <= 2 or asn[:2] != "AS" or any(c < '0' or c > '9' for c in asn[2:]): + txt_error = f"invalid ASN '{asn}'" + entries = None + break + try: + net = ipaddress.ip_network(prefix) + except ValueError: + txt_error = f"invalid network '{prefix}'" + entries = None + break + entries.append((asmap.net_to_prefix(net), int(asn[2:]))) + if entries is not None and bin_asmap is not None and len(contents) > 0: + sys.exit(f"Input file '{input_file.name}' is ambiguous.") + if entries is not None: + state = asmap.ASMap() + state.update_multi(entries) + return state + if bin_asmap is not None: + return bin_asmap + sys.exit(f"Input file '{input_file.name}' is neither a valid binary asmap file nor valid text input ({txt_error}).") + + +def save_binary(output_file, state, fill): + contents = state.to_binary(fill=fill) + try: + output_file.write(contents) + output_file.close() + except OSError as err: + sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.") + +def save_text(output_file, state, fill, overlapping): + for prefix, asn in state.to_entries(fill=fill, overlapping=overlapping): + net = asmap.prefix_to_net(prefix) + try: + print(f"{net} AS{asn}", file=output_file) + except OSError as err: + sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.") + try: + output_file.close() + except OSError as err: + sys.exit(f"Output file '{output_file.name}' cannot be written to: {err.strerror}.") + +def main(): + parser = argparse.ArgumentParser(description="Tool for performing various operations on textual and binary asmap files.") + subparsers = parser.add_subparsers(title="valid subcommands", dest="subcommand") + + parser_encode = subparsers.add_parser("encode", help="convert asmap data to binary format") + parser_encode.add_argument('-f', '--fill', dest="fill", default=False, action="store_true", + help="permit reassigning undefined network ranges arbitrarily to reduce size") + parser_encode.add_argument('infile', nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer, + help="input asmap file (text or binary); default is stdin") + parser_encode.add_argument('outfile', nargs='?', type=argparse.FileType('wb'), default=sys.stdout.buffer, + help="output binary asmap file; default is stdout") + + parser_decode = subparsers.add_parser("decode", help="convert asmap data to text format") + parser_decode.add_argument('-f', '--fill', dest="fill", default=False, action="store_true", + help="permit reassigning undefined network ranges arbitrarily to reduce length") + parser_decode.add_argument('-n', '--nonoverlapping', dest="overlapping", default=True, action="store_false", + help="output strictly non-overall ping network ranges (increases output size)") + parser_decode.add_argument('infile', nargs='?', type=argparse.FileType('rb'), default=sys.stdin.buffer, + help="input asmap file (text or binary); default is stdin") + parser_decode.add_argument('outfile', nargs='?', type=argparse.FileType('w'), default=sys.stdout, + help="output text file; default is stdout") + + parser_diff = subparsers.add_parser("diff", help="compute the difference between two asmap files") + parser_diff.add_argument('-i', '--ignore-unassigned', dest="ignore_unassigned", default=False, action="store_true", + help="ignore unassigned ranges in the first input (useful when second input is filled)") + parser_diff.add_argument('infile1', type=argparse.FileType('rb'), + help="first file to compare (text or binary)") + parser_diff.add_argument('infile2', type=argparse.FileType('rb'), + help="second file to compare (text or binary)") + + parser_diff_addrs = subparsers.add_parser("diff_addrs", + help="compute difference between two asmap files for a set of addresses") + parser_diff_addrs.add_argument('-s', '--show-addresses', dest="show_addresses", default=False, action="store_true", + help="include reassigned addresses in the output") + parser_diff_addrs.add_argument("infile1", type=argparse.FileType("rb"), + help="first file to compare (text or binary)") + parser_diff_addrs.add_argument("infile2", type=argparse.FileType("rb"), + help="second file to compare (text or binary)") + parser_diff_addrs.add_argument("addrs_file", type=argparse.FileType("r"), + help="address file containing getnodeaddresses output to use in the comparison " + "(make sure to set the count parameter to zero to get all node addresses, " + "e.g. 'bitcoin-cli getnodeaddresses 0 > addrs.json')") + args = parser.parse_args() + if args.subcommand is None: + parser.print_help() + elif args.subcommand == "encode": + state = load_file(args.infile) + save_binary(args.outfile, state, fill=args.fill) + elif args.subcommand == "decode": + state = load_file(args.infile) + save_text(args.outfile, state, fill=args.fill, overlapping=args.overlapping) + elif args.subcommand == "diff": + state1 = load_file(args.infile1) + state2 = load_file(args.infile2) + ipv4_changed = 0 + ipv6_changed = 0 + for prefix, old_asn, new_asn in state1.diff(state2): + if args.ignore_unassigned and old_asn == 0: + continue + net = asmap.prefix_to_net(prefix) + if isinstance(net, ipaddress.IPv4Network): + ipv4_changed += 1 << (32 - net.prefixlen) + elif isinstance(net, ipaddress.IPv6Network): + ipv6_changed += 1 << (128 - net.prefixlen) + if new_asn == 0: + print(f"# {net} was AS{old_asn}") + elif old_asn == 0: + print(f"{net} AS{new_asn} # was unassigned") + else: + print(f"{net} AS{new_asn} # was AS{old_asn}") + ipv4_change_str = "" if ipv4_changed == 0 else f" (2^{math.log2(ipv4_changed):.2f})" + ipv6_change_str = "" if ipv6_changed == 0 else f" (2^{math.log2(ipv6_changed):.2f})" + + print( + f"# {ipv4_changed}{ipv4_change_str} IPv4 addresses changed; " + f"{ipv6_changed}{ipv6_change_str} IPv6 addresses changed" + ) + elif args.subcommand == "diff_addrs": + state1 = load_file(args.infile1) + state2 = load_file(args.infile2) + address_info = json.load(args.addrs_file) + addrs = {a["address"] for a in address_info if a["network"] in ["ipv4", "ipv6"]} + reassignments = defaultdict(list) + for addr in addrs: + net = ipaddress.ip_network(addr) + prefix = asmap.net_to_prefix(net) + old_asn = state1.lookup(prefix) + new_asn = state2.lookup(prefix) + if new_asn != old_asn: + reassignments[(old_asn, new_asn)].append(addr) + reassignments = sorted(reassignments.items(), key=lambda item: len(item[1]), reverse=True) + num_reassignment_type = defaultdict(int) + for (old_asn, new_asn), reassigned_addrs in reassignments: + num_reassigned = len(reassigned_addrs) + num_reassignment_type[(bool(old_asn), bool(new_asn))] += num_reassigned + old_asn_str = f"AS{old_asn}" if old_asn else "unassigned" + new_asn_str = f"AS{new_asn}" if new_asn else "unassigned" + opt = ": " + ", ".join(reassigned_addrs) if args.show_addresses else "" + print(f"{num_reassigned} address(es) reassigned from {old_asn_str} to {new_asn_str}{opt}") + num_reassignments = sum(len(addrs) for _, addrs in reassignments) + share = num_reassignments / len(addrs) if len(addrs) > 0 else 0 + print(f"Summary: {num_reassignments:,} ({share:.2%}) of {len(addrs):,} addresses were reassigned " + f"(migrations={num_reassignment_type[True, True]}, assignments={num_reassignment_type[False, True]}, " + f"unassignments={num_reassignment_type[True, False]})") + else: + parser.print_help() + sys.exit("No command provided.") + +if __name__ == '__main__': + main() diff --git a/contrib/seeds/asmap.py b/contrib/asmap/asmap.py similarity index 93% rename from contrib/seeds/asmap.py rename to contrib/asmap/asmap.py index e28e5cf532..2ae84a3f31 100644 --- a/contrib/seeds/asmap.py +++ b/contrib/asmap/asmap.py @@ -10,11 +10,12 @@ import ipaddress import random import unittest +from collections.abc import Callable, Iterable from enum import Enum from functools import total_ordering -from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union, overload +from typing import Optional, Union, overload -def net_to_prefix(net: Union[ipaddress.IPv4Network,ipaddress.IPv6Network]) -> List[bool]: +def net_to_prefix(net: Union[ipaddress.IPv4Network,ipaddress.IPv6Network]) -> list[bool]: """ Convert an IPv4 or IPv6 network to a prefix represented as a list of bits. @@ -32,7 +33,7 @@ def net_to_prefix(net: Union[ipaddress.IPv4Network,ipaddress.IPv6Network]) -> Li assert (netrange & ((1 << (128 - num_bits)) - 1)) == 0 return [((netrange >> (127 - i)) & 1) != 0 for i in range(num_bits)] -def prefix_to_net(prefix: List[bool]) -> Union[ipaddress.IPv4Network,ipaddress.IPv6Network]: +def prefix_to_net(prefix: list[bool]) -> Union[ipaddress.IPv4Network,ipaddress.IPv6Network]: """The reverse operation of net_to_prefix.""" # Convert to number netrange = sum(b << (127 - i) for i, b in enumerate(prefix)) @@ -47,10 +48,10 @@ def prefix_to_net(prefix: List[bool]) -> Union[ipaddress.IPv4Network,ipaddress.I return ipaddress.IPv6Network((netrange, num_bits), True) # Shortcut for (prefix, ASN) entries. -ASNEntry = Tuple[List[bool], int] +ASNEntry = tuple[list[bool], int] # Shortcut for (prefix, old ASN, new ASN) entries. -ASNDiff = Tuple[List[bool], int, int] +ASNDiff = tuple[list[bool], int, int] class _VarLenCoder: """ @@ -75,7 +76,7 @@ class _VarLenCoder: other classes start one past the last element of the class before it. """ - def __init__(self, minval: int, clsbits: List[int]): + def __init__(self, minval: int, clsbits: list[int]): """Construct a new _VarLenCoder.""" self._minval = minval self._clsbits = clsbits @@ -85,7 +86,7 @@ def can_encode(self, val: int) -> bool: """Check whether value val is in the range this coder supports.""" return self._minval <= val <= self._maxval - def encode(self, val: int, ret: List[int]) -> None: + def encode(self, val: int, ret: list[int]) -> None: """Append encoding of val onto integer list ret.""" assert self._minval <= val <= self._maxval @@ -120,7 +121,7 @@ def encode_size(self, val: int) -> int: break return ret + bits - def decode(self, stream, bitpos) -> Tuple[int,int]: + def decode(self, stream, bitpos) -> tuple[int,int]: """Decode a number starting at bitpos in stream, returning value and new bitpos.""" val = self._minval bits = 0 @@ -281,11 +282,11 @@ class ASMap: - mappings, represented by new trie nodes. """ - def update(self, prefix: List[bool], asn: int) -> None: + def update(self, prefix: list[bool], asn: int) -> None: """Update this ASMap object to map prefix to the specified asn.""" assert asn == 0 or _CODER_ASN.can_encode(asn) - def recurse(node: List, offset: int) -> None: + def recurse(node: list, offset: int) -> None: if offset == len(prefix): # Reached the end of prefix; overwrite this node. node.clear() @@ -306,7 +307,7 @@ def recurse(node: List, offset: int) -> None: node.append(oldasn) recurse(self._trie, 0) - def update_multi(self, entries: List[Tuple[List[bool], int]]) -> None: + def update_multi(self, entries: list[tuple[list[bool], int]]) -> None: """Apply multiple update operations, where longer prefixes take precedence.""" entries.sort(key=lambda entry: len(entry[0])) for prefix, asn in entries: @@ -314,7 +315,7 @@ def update_multi(self, entries: List[Tuple[List[bool], int]]) -> None: def _set_trie(self, trie) -> None: """Set trie directly. Internal use only.""" - def recurse(node: List) -> None: + def recurse(node: list) -> None: if len(node) < 2: return recurse(node[0]) @@ -342,7 +343,7 @@ def entry_key(entry): for prefix, asn in sorted(entries, key=entry_key): self.update(prefix, asn) - def lookup(self, prefix: List[bool]) -> Optional[int]: + def lookup(self, prefix: list[bool]) -> Optional[int]: """Look up a prefix. Returns ASN, or 0 if unassigned, or None if indeterminate.""" node = self._trie for bit in prefix: @@ -353,11 +354,11 @@ def lookup(self, prefix: List[bool]) -> Optional[int]: return node[0] return None - def _to_entries_flat(self, fill: bool = False) -> List[ASNEntry]: + def _to_entries_flat(self, fill: bool = False) -> list[ASNEntry]: """Convert an ASMap object to a list of non-overlapping (prefix, asn) objects.""" - prefix : List[bool] = [] + prefix : list[bool] = [] - def recurse(node: List) -> List[ASNEntry]: + def recurse(node: list) -> list[ASNEntry]: ret = [] if len(node) == 1: if node[0] > 0: @@ -375,24 +376,24 @@ def recurse(node: List) -> List[ASNEntry]: return ret return recurse(self._trie) - def _to_entries_minimal(self, fill: bool = False) -> List[ASNEntry]: + def _to_entries_minimal(self, fill: bool = False) -> list[ASNEntry]: """Convert a trie to a minimal list of ASNEntry objects, exploiting overlap.""" - prefix : List[bool] = [] + prefix : list[bool] = [] - def recurse(node: List) -> (Tuple[Dict[Optional[int], List[ASNEntry]], bool]): + def recurse(node: list) -> (tuple[dict[Optional[int], list[ASNEntry]], bool]): if len(node) == 1 and node[0] == 0: return {None if fill else 0: []}, True if len(node) == 1: return {node[0]: [], None: [(list(prefix), node[0])]}, False - ret: Dict[Optional[int], List[ASNEntry]] = {} + ret: dict[Optional[int], list[ASNEntry]] = {} prefix.append(False) left, lhole = recurse(node[0]) prefix[-1] = True right, rhole = recurse(node[1]) prefix.pop() hole = not fill and (lhole or rhole) - def candidate(ctx: Optional[int], res0: Optional[List[ASNEntry]], - res1: Optional[List[ASNEntry]]): + def candidate(ctx: Optional[int], res0: Optional[list[ASNEntry]], + res1: Optional[list[ASNEntry]]): if res0 is not None and res1 is not None: if ctx not in ret or len(res0) + len(res1) < len(ret[ctx]): ret[ctx] = res0 + res1 @@ -417,7 +418,7 @@ def __str__(self) -> str: """Convert this ASMap object to a string containing Python code constructing it.""" return f"ASMap({self._trie})" - def to_entries(self, overlapping: bool = True, fill: bool = False) -> List[ASNEntry]: + def to_entries(self, overlapping: bool = True, fill: bool = False) -> list[ASNEntry]: """ Convert the mappings in this ASMap object to a list of ASNEntry objects. @@ -448,7 +449,7 @@ def from_random(num_leaves: int = 10, max_asn: int = 6, assert max_asn >= 1 or unassigned_prob == 1 assert _CODER_ASN.can_encode(max_asn) assert 0.0 <= unassigned_prob <= 1.0 - trie: List = [] + trie: list = [] leaves = [trie] ret = ASMap() for i in range(1, num_leaves): @@ -472,12 +473,12 @@ def from_random(num_leaves: int = 10, max_asn: int = 6, def _to_binnode(self, fill: bool = False) -> _BinNode: """Convert a trie to a _BinNode object.""" - def recurse(node: List) -> Tuple[Dict[Optional[int], _BinNode], bool]: + def recurse(node: list) -> tuple[dict[Optional[int], _BinNode], bool]: if len(node) == 1 and node[0] == 0: return {(None if fill else 0): _BinNode.make_end()}, True if len(node) == 1: return {None: _BinNode.make_leaf(node[0]), node[0]: _BinNode.make_end()}, False - ret: Dict[Optional[int], _BinNode] = {} + ret: dict[Optional[int], _BinNode] = {} left, lhole = recurse(node[0]) right, rhole = recurse(node[1]) hole = (lhole or rhole) and not fill @@ -488,12 +489,14 @@ def candidate(ctx: Optional[int], arg1, arg2, func: Callable): if ctx not in ret or cand.size < ret[ctx].size: ret[ctx] = cand - for ctx in set(left) | set(right): + union = set(left) | set(right) + sorted_union = sorted(union, key=lambda x: (x is None, x)) + for ctx in sorted_union: candidate(ctx, left.get(ctx), right.get(ctx), _BinNode.make_branch) candidate(ctx, left.get(None), right.get(ctx), _BinNode.make_branch) candidate(ctx, left.get(ctx), right.get(None), _BinNode.make_branch) if not hole: - for ctx in set(ret) - set([None]): + for ctx in sorted(set(ret) - set([None])): candidate(None, ctx, ret[ctx], _BinNode.make_default) if None in ret: ret = {ctx:enc for ctx, enc in ret.items() @@ -507,7 +510,7 @@ def candidate(ctx: Optional[int], arg1, arg2, func: Callable): @staticmethod def _from_binnode(binnode: _BinNode) -> "ASMap": """Construct an ASMap object from a _BinNode. Internal use only.""" - def recurse(node: _BinNode, default: int) -> List: + def recurse(node: _BinNode, default: int) -> list: if node.ins == _Instruction.RETURN: return [node.arg1] if node.ins == _Instruction.JUMP: @@ -542,7 +545,7 @@ def to_binary(self, fill: bool = False) -> bytes: Returns: A bytes object with the encoding of this ASMap object. """ - bits: List[int] = [] + bits: list[int] = [] def recurse(node: _BinNode) -> None: _CODER_INS.encode(node.ins.value, bits) @@ -582,11 +585,11 @@ def recurse(node: _BinNode) -> None: def from_binary(bindata: bytes) -> Optional["ASMap"]: """Decode an ASMap object from the provided binary encoding.""" - bits: List[int] = [] + bits: list[int] = [] for byte in bindata: bits.extend((byte >> i) & 1 for i in range(8)) - def recurse(bitpos: int) -> Tuple[_BinNode, int]: + def recurse(bitpos: int) -> tuple[_BinNode, int]: insval, bitpos = _CODER_INS.decode(bits, bitpos) ins = _Instruction(insval) if ins == _Instruction.RETURN: @@ -632,7 +635,7 @@ def __eq__(self, other: object) -> bool: def extends(self, req: "ASMap") -> bool: """Determine whether this matches req for all subranges where req is assigned.""" - def recurse(actual: List, require: List) -> bool: + def recurse(actual: list, require: list) -> bool: if len(require) == 1 and require[0] == 0: return True if len(require) == 1: @@ -646,20 +649,20 @@ def recurse(actual: List, require: List) -> bool: #pylint: disable=protected-access return recurse(self._trie, req._trie) - def diff(self, other: "ASMap") -> List[ASNDiff]: + def diff(self, other: "ASMap") -> list[ASNDiff]: """Compute the diff from self to other.""" - prefix: List[bool] = [] - ret: List[ASNDiff] = [] + prefix: list[bool] = [] + ret: list[ASNDiff] = [] - def recurse(old_node: List, new_node: List): + def recurse(old_node: list, new_node: list): if len(old_node) == 1 and len(new_node) == 1: if old_node[0] != new_node[0]: ret.append((list(prefix), old_node[0], new_node[0])) else: - old_left: List = old_node if len(old_node) == 1 else old_node[0] - old_right: List = old_node if len(old_node) == 1 else old_node[1] - new_left: List = new_node if len(new_node) == 1 else new_node[0] - new_right: List = new_node if len(new_node) == 1 else new_node[1] + old_left: list = old_node if len(old_node) == 1 else old_node[0] + old_right: list = old_node if len(old_node) == 1 else old_node[1] + new_left: list = new_node if len(new_node) == 1 else new_node[0] + new_right: list = new_node if len(new_node) == 1 else new_node[1] prefix.append(False) recurse(old_left, new_left) prefix[-1] = True @@ -760,7 +763,7 @@ def test_patching(self) -> None: # It starts off being equal to asmap. patched = copy.copy(asmap) # Keep a list of patches performed. - patches: List[ASNEntry] = [] + patches: list[ASNEntry] = [] # Initially there cannot be any difference. self.assertEqual(asmap.diff(patched), []) # Make 5 patches, each building on top of the previous ones. diff --git a/contrib/completions/bash/bitcoin-cli.bash-completion b/contrib/completions/bash/bitcoin-cli.bash similarity index 91% rename from contrib/completions/bash/bitcoin-cli.bash-completion rename to contrib/completions/bash/bitcoin-cli.bash index 89e01bc09a..3018d076c6 100644 --- a/contrib/completions/bash/bitcoin-cli.bash-completion +++ b/contrib/completions/bash/bitcoin-cli.bash @@ -9,7 +9,7 @@ _bitcoin_rpc() { local rpcargs=() for i in ${COMP_LINE}; do case "$i" in - -conf=*|-datadir=*|-regtest|-rpc*|-testnet) + -conf=*|-datadir=*|-regtest|-rpc*|-testnet|-testnet4) rpcargs=( "${rpcargs[@]}" "$i" ) ;; esac @@ -39,7 +39,7 @@ _bitcoin_cli() { if ((cword > 4)); then case ${words[cword-4]} in - importaddress|listtransactions|setban) + listtransactions|setban) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -52,10 +52,7 @@ _bitcoin_cli() { if ((cword > 3)); then case ${words[cword-3]} in - addmultisigaddress) - return 0 - ;; - getbalance|gettxout|importaddress|importpubkey|importprivkey|listreceivedbyaddress|listsinceblock) + getbalance|gettxout|listreceivedbyaddress|listsinceblock) COMPREPLY=( $( compgen -W "true false" -- "$cur" ) ) return 0 ;; @@ -80,7 +77,7 @@ _bitcoin_cli() { fi case "$prev" in - backupwallet|dumpwallet|importwallet) + backupwallet) _filedir return 0 ;; diff --git a/contrib/completions/bash/bitcoin-tx.bash-completion b/contrib/completions/bash/bitcoin-tx.bash similarity index 100% rename from contrib/completions/bash/bitcoin-tx.bash-completion rename to contrib/completions/bash/bitcoin-tx.bash diff --git a/contrib/completions/bash/bitcoind.bash-completion b/contrib/completions/bash/bitcoind.bash similarity index 100% rename from contrib/completions/bash/bitcoind.bash-completion rename to contrib/completions/bash/bitcoind.bash diff --git a/contrib/debian/copyright b/contrib/debian/copyright index ca430170a1..4e4deef9a1 100644 --- a/contrib/debian/copyright +++ b/contrib/debian/copyright @@ -5,7 +5,7 @@ Upstream-Contact: Satoshi Nakamoto Source: https://github.com/bitcoin/bitcoin Files: * -Copyright: 2009-2023, Bitcoin Core Developers +Copyright: 2009-2025, Bitcoin Core Developers License: Expat Comment: The Bitcoin Core Developers encompasses all contributors to the project, listed in the release notes or the git log. @@ -121,17 +121,6 @@ Comment: You should have received a copy of the GNU General Public License along with this program. If not, see . -License: GPL-3+ - Permission is granted to copy, distribute and/or modify this document - under the terms of the GNU General Public License, Version 3 or any - later version published by the Free Software Foundation. -Comment: - On Debian systems the GNU General Public License (GPL) version 3 is - located in '/usr/share/common-licenses/GPL-3'. - . - You should have received a copy of the GNU General Public License along - with this program. If not, see . - License: public-domain This work is in the public domain. diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md index 54b1a85588..366cd4a07d 100644 --- a/contrib/devtools/README.md +++ b/contrib/devtools/README.md @@ -2,6 +2,50 @@ Contents ======== This directory contains tools for developers working on this repository. +deterministic-fuzz-coverage +=========================== + +A tool to check for non-determinism in fuzz coverage. To get the help, run: + +``` +cargo run --manifest-path ./contrib/devtools/deterministic-fuzz-coverage/Cargo.toml -- --help +``` + +To execute the tool, compilation has to be done with the build options: + +``` +-DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DBUILD_FOR_FUZZING=ON -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping' +``` + +Both llvm-profdata and llvm-cov must be installed. Also, the qa-assets +repository must have been cloned. Finally, a fuzz target has to be picked +before running the tool: + +``` +cargo run --manifest-path ./contrib/devtools/deterministic-fuzz-coverage/Cargo.toml -- $PWD/build_dir $PWD/qa-assets/fuzz_corpora fuzz_target_name +``` + +deterministic-unittest-coverage +=========================== + +A tool to check for non-determinism in unit-test coverage. To get the help, run: + +``` +cargo run --manifest-path ./contrib/devtools/deterministic-unittest-coverage/Cargo.toml -- --help +``` + +To execute the tool, compilation has to be done with the build options: + +``` +-DCMAKE_C_COMPILER='clang' -DCMAKE_CXX_COMPILER='clang++' -DCMAKE_CXX_FLAGS='-fprofile-instr-generate -fcoverage-mapping' +``` + +Both llvm-profdata and llvm-cov must be installed. + +``` +cargo run --manifest-path ./contrib/devtools/deterministic-unittest-coverage/Cargo.toml -- $PWD/build_dir +``` + clang-format-diff.py =================== @@ -82,12 +126,22 @@ gen-manpages.py A small script to automatically create manpages in ../../doc/man by running the release binaries with the -help option. This requires help2man which can be found at: https://www.gnu.org/software/help2man/ -With in-tree builds this tool can be run from any directory within the -repostitory. To use this tool with out-of-tree builds set `BUILDDIR`. For -example: +This script assumes a build directory named `build` as suggested by example build documentation. +To use it with a different build directory, set `BUILDDIR`. +For example: ```bash -BUILDDIR=$PWD/build contrib/devtools/gen-manpages.py +BUILDDIR=$PWD/my-build-dir contrib/devtools/gen-manpages.py +``` + +headerssync-params.py +===================== + +A script to generate optimal parameters for the headerssync module (src/headerssync.cpp). It takes no command-line +options, as all its configuration is set at the top of the file. It runs many times faster inside PyPy. Invocation: + +```bash +pypy3 contrib/devtools/headerssync-params.py ``` gen-bitcoin-conf.sh @@ -97,43 +151,14 @@ Generates a bitcoin.conf file in `share/examples/` by parsing the output from `b release process to include a bitcoin.conf with the release binaries and can also be run by users to generate a file locally. When generating a file as part of the release process, make sure to commit the changes after running the script. -With in-tree builds this tool can be run from any directory within the -repository. To use this tool with out-of-tree builds set `BUILDDIR`. For -example: +This script assumes a build directory named `build` as suggested by example build documentation. +To use it with a different build directory, set `BUILDDIR`. +For example: ```bash -BUILDDIR=$PWD/build contrib/devtools/gen-bitcoin-conf.sh +BUILDDIR=$PWD/my-build-dir contrib/devtools/gen-bitcoin-conf.sh ``` -security-check.py and test-security-check.py -============================================ - -Perform basic security checks on a series of executables. - -symbol-check.py -=============== - -A script to check that release executables only contain -certain symbols and are only linked against allowed libraries. - -For Linux this means checking for allowed gcc, glibc and libstdc++ version symbols. -This makes sure they are still compatible with the minimum supported distribution versions. - -For macOS and Windows we check that the executables are only linked against libraries we allow. - -Example usage: - - find ../path/to/executables -type f -executable | xargs python3 contrib/devtools/symbol-check.py - -If no errors occur the return value will be 0 and the output will be empty. - -If there are any errors the return value will be 1 and output like this will be printed: - - .../64/test_bitcoin: symbol memcpy from unsupported version GLIBC_2.14 - .../64/test_bitcoin: symbol __fdelt_chk from unsupported version GLIBC_2.15 - .../64/test_bitcoin: symbol std::out_of_range::~out_of_range() from unsupported version GLIBCXX_3.4.15 - .../64/test_bitcoin: symbol _ZNSt8__detail15_List_nod from unsupported version GLIBCXX_3.4.15 - circular-dependencies.py ======================== diff --git a/contrib/devtools/bitcoin-tidy/CMakeLists.txt b/contrib/devtools/bitcoin-tidy/CMakeLists.txt index 35e60d1d87..c6f683f7ab 100644 --- a/contrib/devtools/bitcoin-tidy/CMakeLists.txt +++ b/contrib/devtools/bitcoin-tidy/CMakeLists.txt @@ -1,20 +1,31 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.22) -project(bitcoin-tidy VERSION 1.0.0 DESCRIPTION "clang-tidy checks for Bitcoin Core") +project(bitcoin-tidy + VERSION + 1.0.0 + DESCRIPTION "clang-tidy checks for Bitcoin Core" + LANGUAGES CXX) include(GNUInstallDirs) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED True) set(CMAKE_CXX_EXTENSIONS False) -# TODO: Figure out how to avoid the terminfo check +set(CMAKE_DISABLE_FIND_PACKAGE_CURL ON) +set(CMAKE_DISABLE_FIND_PACKAGE_FFI ON) +set(CMAKE_DISABLE_FIND_PACKAGE_LibEdit ON) +set(CMAKE_DISABLE_FIND_PACKAGE_LibXml2 ON) +set(CMAKE_DISABLE_FIND_PACKAGE_Terminfo ON) +set(CMAKE_DISABLE_FIND_PACKAGE_ZLIB ON) +set(CMAKE_DISABLE_FIND_PACKAGE_zstd ON) + find_package(LLVM REQUIRED CONFIG) find_program(CLANG_TIDY_EXE NAMES "clang-tidy-${LLVM_VERSION_MAJOR}" "clang-tidy" HINTS ${LLVM_TOOLS_BINARY_DIR}) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Found clang-tidy: ${CLANG_TIDY_EXE}") -add_library(bitcoin-tidy MODULE bitcoin-tidy.cpp logprintf.cpp) +add_library(bitcoin-tidy MODULE bitcoin-tidy.cpp nontrivial-threadlocal.cpp) target_include_directories(bitcoin-tidy SYSTEM PRIVATE ${LLVM_INCLUDE_DIRS}) # Disable RTTI and exceptions as necessary @@ -47,7 +58,7 @@ else() endif() # Create a dummy library that runs clang-tidy tests as a side-effect of building -add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_logprintf.cpp) +add_library(bitcoin-tidy-tests OBJECT EXCLUDE_FROM_ALL example_nontrivial-threadlocal.cpp) add_dependencies(bitcoin-tidy-tests bitcoin-tidy) set_target_properties(bitcoin-tidy-tests PROPERTIES CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}") diff --git a/contrib/devtools/bitcoin-tidy/README b/contrib/devtools/bitcoin-tidy/README.md similarity index 100% rename from contrib/devtools/bitcoin-tidy/README rename to contrib/devtools/bitcoin-tidy/README.md diff --git a/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp b/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp index 0f34d37793..f2658b5a58 100644 --- a/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp +++ b/contrib/devtools/bitcoin-tidy/bitcoin-tidy.cpp @@ -2,7 +2,7 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#include "logprintf.h" +#include "nontrivial-threadlocal.h" #include #include @@ -12,7 +12,7 @@ class BitcoinModule final : public clang::tidy::ClangTidyModule public: void addCheckFactories(clang::tidy::ClangTidyCheckFactories& CheckFactories) override { - CheckFactories.registerCheck("bitcoin-unterminated-logprintf"); + CheckFactories.registerCheck("bitcoin-nontrivial-threadlocal"); } }; diff --git a/contrib/devtools/bitcoin-tidy/example_logprintf.cpp b/contrib/devtools/bitcoin-tidy/example_logprintf.cpp deleted file mode 100644 index a12a666c08..0000000000 --- a/contrib/devtools/bitcoin-tidy/example_logprintf.cpp +++ /dev/null @@ -1,108 +0,0 @@ -// Copyright (c) 2023 Bitcoin Developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include - -// Test for bitcoin-unterminated-logprintf - -enum LogFlags { - NONE -}; - -enum Level { - None -}; - -template -static inline void LogPrintf_(const std::string& logging_function, const std::string& source_file, const int source_line, const LogFlags flag, const Level level, const char* fmt, const Args&... args) -{ -} - -#define LogPrintLevel_(category, level, ...) LogPrintf_(__func__, __FILE__, __LINE__, category, level, __VA_ARGS__) -#define LogPrintf(...) LogPrintLevel_(LogFlags::NONE, Level::None, __VA_ARGS__) - -#define LogPrint(category, ...) \ - do { \ - LogPrintf(__VA_ARGS__); \ - } while (0) - - -class CWallet -{ - std::string GetDisplayName() const - { - return "default wallet"; - } - -public: - template - void WalletLogPrintf(const char* fmt, Params... parameters) const - { - LogPrintf(("%s " + std::string{fmt}).c_str(), GetDisplayName(), parameters...); - }; -}; - -struct ScriptPubKeyMan -{ - std::string GetDisplayName() const - { - return "default wallet"; - } - - template - void WalletLogPrintf(const char* fmt, Params... parameters) const - { - LogPrintf(("%s " + std::string{fmt}).c_str(), GetDisplayName(), parameters...); - }; -}; - -void good_func() -{ - LogPrintf("hello world!\n"); -} -void good_func2() -{ - CWallet wallet; - wallet.WalletLogPrintf("hi\n"); - ScriptPubKeyMan spkm; - spkm.WalletLogPrintf("hi\n"); - - const CWallet& walletref = wallet; - walletref.WalletLogPrintf("hi\n"); - - auto* walletptr = new CWallet(); - walletptr->WalletLogPrintf("hi\n"); - delete walletptr; -} -void bad_func() -{ - LogPrintf("hello world!"); -} -void bad_func2() -{ - LogPrintf(""); -} -void bad_func3() -{ - // Ending in "..." has no special meaning. - LogPrintf("hello world!..."); -} -void bad_func4_ignored() -{ - LogPrintf("hello world!"); // NOLINT(bitcoin-unterminated-logprintf) -} -void bad_func5() -{ - CWallet wallet; - wallet.WalletLogPrintf("hi"); - ScriptPubKeyMan spkm; - spkm.WalletLogPrintf("hi"); - - const CWallet& walletref = wallet; - walletref.WalletLogPrintf("hi"); - - auto* walletptr = new CWallet(); - walletptr->WalletLogPrintf("hi"); - delete walletptr; -} diff --git a/contrib/devtools/bitcoin-tidy/example_nontrivial-threadlocal.cpp b/contrib/devtools/bitcoin-tidy/example_nontrivial-threadlocal.cpp new file mode 100644 index 0000000000..2b74df5d0e --- /dev/null +++ b/contrib/devtools/bitcoin-tidy/example_nontrivial-threadlocal.cpp @@ -0,0 +1,2 @@ +#include +thread_local std::string foo; diff --git a/contrib/devtools/bitcoin-tidy/logprintf.cpp b/contrib/devtools/bitcoin-tidy/logprintf.cpp deleted file mode 100644 index 36beac28c8..0000000000 --- a/contrib/devtools/bitcoin-tidy/logprintf.cpp +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2023 Bitcoin Developers -// Distributed under the MIT software license, see the accompanying -// file COPYING or http://www.opensource.org/licenses/mit-license.php. - -#include "logprintf.h" - -#include -#include - - -namespace { -AST_MATCHER(clang::StringLiteral, unterminated) -{ - size_t len = Node.getLength(); - if (len > 0 && Node.getCodeUnit(len - 1) == '\n') { - return false; - } - return true; -} -} // namespace - -namespace bitcoin { - -void LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder* finder) -{ - using namespace clang::ast_matchers; - - /* - Logprintf(..., ..., ..., ..., ..., "foo", ...) - */ - - finder->addMatcher( - callExpr( - callee(functionDecl(hasName("LogPrintf_"))), - hasArgument(5, stringLiteral(unterminated()).bind("logstring"))), - this); - - /* - auto walletptr = &wallet; - wallet.WalletLogPrintf("foo"); - wallet->WalletLogPrintf("foo"); - */ - finder->addMatcher( - cxxMemberCallExpr( - callee(cxxMethodDecl(hasName("WalletLogPrintf"))), - hasArgument(0, stringLiteral(unterminated()).bind("logstring"))), - this); -} - -void LogPrintfCheck::check(const clang::ast_matchers::MatchFinder::MatchResult& Result) -{ - if (const clang::StringLiteral* lit = Result.Nodes.getNodeAs("logstring")) { - const clang::ASTContext& ctx = *Result.Context; - const auto user_diag = diag(lit->getEndLoc(), "Unterminated format string used with LogPrintf"); - const auto& loc = lit->getLocationOfByte(lit->getByteLength(), *Result.SourceManager, ctx.getLangOpts(), ctx.getTargetInfo()); - user_diag << clang::FixItHint::CreateInsertion(loc, "\\n"); - } -} - -} // namespace bitcoin diff --git a/contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.cpp b/contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.cpp new file mode 100644 index 0000000000..d2bc78a31b --- /dev/null +++ b/contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.cpp @@ -0,0 +1,44 @@ +// Copyright (c) 2023 Bitcoin Developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. + +#include "nontrivial-threadlocal.h" + +#include +#include + + +// Copied from clang-tidy's UnusedRaiiCheck +namespace { +AST_MATCHER(clang::CXXRecordDecl, hasNonTrivialDestructor) { + // TODO: If the dtor is there but empty we don't want to warn either. + return Node.hasDefinition() && Node.hasNonTrivialDestructor(); +} +} // namespace + +namespace bitcoin { + +void NonTrivialThreadLocal::registerMatchers(clang::ast_matchers::MatchFinder* finder) +{ + using namespace clang::ast_matchers; + + /* + thread_local std::string foo; + */ + + finder->addMatcher( + varDecl( + hasThreadStorageDuration(), + hasType(hasCanonicalType(recordType(hasDeclaration(cxxRecordDecl(hasNonTrivialDestructor()))))) + ).bind("nontrivial_threadlocal"), + this); +} + +void NonTrivialThreadLocal::check(const clang::ast_matchers::MatchFinder::MatchResult& Result) +{ + if (const clang::VarDecl* var = Result.Nodes.getNodeAs("nontrivial_threadlocal")) { + const auto user_diag = diag(var->getBeginLoc(), "Variable with non-trivial destructor cannot be thread_local."); + } +} + +} // namespace bitcoin diff --git a/contrib/devtools/bitcoin-tidy/logprintf.h b/contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.h similarity index 64% rename from contrib/devtools/bitcoin-tidy/logprintf.h rename to contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.h index db95dfe143..c853073467 100644 --- a/contrib/devtools/bitcoin-tidy/logprintf.h +++ b/contrib/devtools/bitcoin-tidy/nontrivial-threadlocal.h @@ -2,18 +2,18 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. -#ifndef LOGPRINTF_CHECK_H -#define LOGPRINTF_CHECK_H +#ifndef NONTRIVIAL_THREADLOCAL_CHECK_H +#define NONTRIVIAL_THREADLOCAL_CHECK_H #include namespace bitcoin { -// Warn about any use of LogPrintf that does not end with a newline. -class LogPrintfCheck final : public clang::tidy::ClangTidyCheck +// Warn about any thread_local variable with a non-trivial destructor. +class NonTrivialThreadLocal final : public clang::tidy::ClangTidyCheck { public: - LogPrintfCheck(clang::StringRef Name, clang::tidy::ClangTidyContext* Context) + NonTrivialThreadLocal(clang::StringRef Name, clang::tidy::ClangTidyContext* Context) : clang::tidy::ClangTidyCheck(Name, Context) {} bool isLanguageVersionSupported(const clang::LangOptions& LangOpts) const override @@ -26,4 +26,4 @@ class LogPrintfCheck final : public clang::tidy::ClangTidyCheck } // namespace bitcoin -#endif // LOGPRINTF_CHECK_H +#endif // NONTRIVIAL_THREADLOCAL_CHECK_H diff --git a/contrib/devtools/check-deps.sh b/contrib/devtools/check-deps.sh new file mode 100755 index 0000000000..0ae817254d --- /dev/null +++ b/contrib/devtools/check-deps.sh @@ -0,0 +1,197 @@ +#!/usr/bin/env bash + +export LC_ALL=C +set -Eeuo pipefail + +# Declare paths to libraries +declare -A LIBS +LIBS[cli]="libbitcoin_cli.a" +LIBS[common]="libbitcoin_common.a" +LIBS[consensus]="libbitcoin_consensus.a" +LIBS[crypto]="libbitcoin_crypto.a" +LIBS[node]="libbitcoin_node.a" +LIBS[util]="libbitcoin_util.a" +LIBS[wallet]="libbitcoin_wallet.a" + +# Declare allowed dependencies "X Y" where X is allowed to depend on Y. This +# list is taken from doc/design/libraries.md. +ALLOWED_DEPENDENCIES=( + "cli common" + "cli util" + "common consensus" + "common crypto" + "common util" + "consensus crypto" + "node common" + "node consensus" + "node crypto" + "node kernel" + "node util" + "util crypto" + "wallet common" + "wallet crypto" + "wallet util" +) + +# Add minor dependencies omitted from doc/design/libraries.md to keep the +# dependency diagram simple. +ALLOWED_DEPENDENCIES+=( + "wallet consensus" +) + +# Declare list of known errors that should be suppressed. +declare -A SUPPRESS +# init/common.cpp file calls InitError and InitWarning from interface_ui which +# is currently part of the node library. interface_ui should just be part of the +# common library instead, and is moved in +# https://github.com/bitcoin/bitcoin/issues/10102 +SUPPRESS["common.cpp.o interface_ui.cpp.o _Z11InitWarningRK13bilingual_str"]=1 +SUPPRESS["common.cpp.o interface_ui.cpp.o _Z9InitErrorRK13bilingual_str"]=1 + +usage() { + echo "Usage: $(basename "${BASH_SOURCE[0]}") [BUILD_DIR]" +} + +# Output makefile targets, converting library .a paths to CMake targets +lib_targets() { + for lib in "${!LIBS[@]}"; do + for lib_path in ${LIBS[$lib]}; do + local name="${lib_path##*/}" + name="${name#lib}" + name="${name%.a}" + echo "$name" + done + done +} + +# Extract symbol names and object names and write to text files +extract_symbols() { + local temp_dir="$1" + for lib in "${!LIBS[@]}"; do + for lib_path in ${LIBS[$lib]}; do + nm -o "$lib_path" | { grep ' T \| W ' || true; } | awk '{print $3, $1}' >> "${temp_dir}/${lib}_exports.txt" + nm -o "$lib_path" | { grep ' U ' || true; } | awk '{print $3, $1}' >> "${temp_dir}/${lib}_imports.txt" + awk '{print $1}' "${temp_dir}/${lib}_exports.txt" | sort -u > "${temp_dir}/${lib}_exported_symbols.txt" + awk '{print $1}' "${temp_dir}/${lib}_imports.txt" | sort -u > "${temp_dir}/${lib}_imported_symbols.txt" + done + done +} + +# Lookup object name(s) corresponding to symbol name in text file +obj_names() { + local symbol="$1" + local txt_file="$2" + sed -n "s/^$symbol [^:]\\+:\\([^:]\\+\\):[^:]*\$/\\1/p" "$txt_file" | sort -u +} + +# Iterate through libraries and find disallowed dependencies +check_libraries() { + local temp_dir="$1" + local result=0 + for src in "${!LIBS[@]}"; do + for dst in "${!LIBS[@]}"; do + if [ "$src" != "$dst" ] && ! is_allowed "$src" "$dst"; then + if ! check_disallowed "$src" "$dst" "$temp_dir"; then + result=1 + fi + fi + done + done + check_not_suppressed + return $result +} + +# Return whether src library is allowed to depend on dst. +is_allowed() { + local src="$1" + local dst="$2" + for allowed in "${ALLOWED_DEPENDENCIES[@]}"; do + if [ "$src $dst" = "$allowed" ]; then + return 0 + fi + done + return 1 +} + +# Return whether src library imports any symbols from dst, assuming src is not +# allowed to depend on dst. +check_disallowed() { + local src="$1" + local dst="$2" + local temp_dir="$3" + local result=0 + + # Loop over symbol names exported by dst and imported by src + while read symbol; do + local dst_obj + dst_obj=$(obj_names "$symbol" "${temp_dir}/${dst}_exports.txt") + while read src_obj; do + if ! check_suppress "$src_obj" "$dst_obj" "$symbol"; then + echo "Error: $src_obj depends on $dst_obj symbol '$(c++filt "$symbol")', can suppress with:" + echo " SUPPRESS[\"$src_obj $dst_obj $symbol\"]=1" + result=1 + fi + done < <(obj_names "$symbol" "${temp_dir}/${src}_imports.txt") + done < <(comm -12 "${temp_dir}/${dst}_exported_symbols.txt" "${temp_dir}/${src}_imported_symbols.txt") + return $result +} + +# Declare array to track errors which were suppressed. +declare -A SUPPRESSED + +# Return whether error should be suppressed and record suppression in +# SUPPRESSED array. +check_suppress() { + local src_obj="$1" + local dst_obj="$2" + local symbol="$3" + for suppress in "${!SUPPRESS[@]}"; do + read suppress_src suppress_dst suppress_pattern <<<"$suppress" + if [[ "$src_obj" == "$suppress_src" && "$dst_obj" == "$suppress_dst" && "$symbol" =~ $suppress_pattern ]]; then + SUPPRESSED["$suppress"]=1 + return 0 + fi + done + return 1 +} + +# Warn about error which were supposed to be suppressed, but were not encountered. +check_not_suppressed() { + for suppress in "${!SUPPRESS[@]}"; do + if [[ ! -v SUPPRESSED[$suppress] ]]; then + echo >&2 "Warning: suppression '$suppress' was ignored, consider deleting." + fi + done +} + +# Check arguments. +if [ "$#" = 0 ]; then + BUILD_DIR="$(dirname "${BASH_SOURCE[0]}")/../../build" +elif [ "$#" = 1 ]; then + BUILD_DIR="$1" +else + echo >&2 "Error: wrong number of arguments." + usage >&2 + exit 1 +fi +if [ ! -f "$BUILD_DIR/Makefile" ]; then + echo >&2 "Error: directory '$BUILD_DIR' does not contain a makefile, please specify path to build directory for library targets." + usage >&2 + exit 1 +fi + +# Build libraries and run checks. +# shellcheck disable=SC2046 +cmake --build "$BUILD_DIR" -j"$(nproc)" -t $(lib_targets) +TEMP_DIR="$(mktemp -d)" +cd "$BUILD_DIR/lib" +extract_symbols "$TEMP_DIR" +if check_libraries "$TEMP_DIR"; then + echo "Success! No unexpected dependencies were detected." + RET=0 +else + echo >&2 "Error: Unexpected dependencies were detected. Check previous output." + RET=1 +fi +rm -r "$TEMP_DIR" +exit $RET diff --git a/contrib/devtools/circular-dependencies.py b/contrib/devtools/circular-dependencies.py index b1d9f2b7db..b742a8cea6 100755 --- a/contrib/devtools/circular-dependencies.py +++ b/contrib/devtools/circular-dependencies.py @@ -5,7 +5,6 @@ import sys import re -from typing import Dict, List, Set MAPPING = { 'core_read.cpp': 'core_io.cpp', @@ -33,7 +32,7 @@ def module_name(path): return None files = dict() -deps: Dict[str, Set[str]] = dict() +deps: dict[str, set[str]] = dict() RE = re.compile("^#include <(.*)>") @@ -65,7 +64,7 @@ def module_name(path): shortest_cycle = None for module in sorted(deps.keys()): # Build the transitive closure of dependencies of module - closure: Dict[str, List[str]] = dict() + closure: dict[str, list[str]] = dict() for dep in deps[module]: closure[dep] = [] while True: diff --git a/contrib/devtools/clang-format-diff.py b/contrib/devtools/clang-format-diff.py index 420bf7ff33..30e804dbe2 100755 --- a/contrib/devtools/clang-format-diff.py +++ b/contrib/devtools/clang-format-diff.py @@ -1,166 +1,190 @@ #!/usr/bin/env python3 # -#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# +# ===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# # -# The LLVM Compiler Infrastructure +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # -# This file is distributed under the University of Illinois Open Source -# License. -# -# ============================================================ -# -# University of Illinois/NCSA -# Open Source License -# -# Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign. -# All rights reserved. -# -# Developed by: -# -# LLVM Team -# -# University of Illinois at Urbana-Champaign -# -# http://llvm.org -# -# Permission is hereby granted, free of charge, to any person obtaining a copy of -# this software and associated documentation files (the "Software"), to deal with -# the Software without restriction, including without limitation the rights to -# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -# of the Software, and to permit persons to whom the Software is furnished to do -# so, subject to the following conditions: -# -# * Redistributions of source code must retain the above copyright notice, -# this list of conditions and the following disclaimers. -# -# * Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimers in the -# documentation and/or other materials provided with the distribution. -# -# * Neither the names of the LLVM Team, University of Illinois at -# Urbana-Champaign, nor the names of its contributors may be used to -# endorse or promote products derived from this Software without specific -# prior written permission. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -# SOFTWARE. -# -# ============================================================ -# -#===------------------------------------------------------------------------===# - -r""" -ClangFormat Diff Reformatter -============================ +# ===------------------------------------------------------------------------===# +""" This script reads input from a unified diff and reformats all the changed lines. This is useful to reformat all the lines touched by a specific patch. Example usage for git/svn users: - git diff -U0 HEAD^ | clang-format-diff.py -p1 -i - svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i + git diff -U0 --no-color --relative HEAD^ | {clang_format_diff} -p1 -i + svn diff --diff-cmd=diff -x-U0 | {clang_format_diff} -i +It should be noted that the filename contained in the diff is used unmodified +to determine the source file to update. Users calling this script directly +should be careful to ensure that the path in the diff is correct relative to the +current working directory. """ +from __future__ import absolute_import, division, print_function import argparse import difflib -import io import re import subprocess import sys - -# Change this to the full path if clang-format is not on the path. -binary = 'clang-format' +from io import StringIO def main(): - parser = argparse.ArgumentParser(description= - 'Reformat changed lines in diff. Without -i ' - 'option just output the diff that would be ' - 'introduced.') - parser.add_argument('-i', action='store_true', default=False, - help='apply edits to files instead of displaying a diff') - parser.add_argument('-p', metavar='NUM', default=0, - help='strip the smallest prefix containing P slashes') - parser.add_argument('-regex', metavar='PATTERN', default=None, - help='custom pattern selecting file paths to reformat ' - '(case sensitive, overrides -iregex)') - parser.add_argument('-iregex', metavar='PATTERN', default= - r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc|js|ts|proto' - r'|protodevel|java)', - help='custom pattern selecting file paths to reformat ' - '(case insensitive, overridden by -regex)') - parser.add_argument('-sort-includes', action='store_true', default=False, - help='let clang-format sort include blocks') - parser.add_argument('-v', '--verbose', action='store_true', - help='be more verbose, ineffective without -i') - args = parser.parse_args() - - # Extract changed lines for each file. - filename = None - lines_by_file = {} - for line in sys.stdin: - match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) - if match: - filename = match.group(2) - if filename is None: - continue - - if args.regex is not None: - if not re.match('^%s$' % args.regex, filename): - continue - else: - if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): - continue - - match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line) - if match: - start_line = int(match.group(1)) - line_count = 1 - if match.group(3): - line_count = int(match.group(3)) - if line_count == 0: - continue - end_line = start_line + line_count - 1 - lines_by_file.setdefault(filename, []).extend( - ['-lines', str(start_line) + ':' + str(end_line)]) - - # Reformat files containing changes in place. - for filename, lines in lines_by_file.items(): - if args.i and args.verbose: - print('Formatting {}'.format(filename)) - command = [binary, filename] - if args.i: - command.append('-i') - if args.sort_includes: - command.append('-sort-includes') - command.extend(lines) - command.extend(['-style=file', '-fallback-style=none']) - p = subprocess.Popen(command, - stdout=subprocess.PIPE, - stderr=None, - stdin=subprocess.PIPE, - text=True) - stdout, stderr = p.communicate() - if p.returncode != 0: - sys.exit(p.returncode) - - if not args.i: - with open(filename, encoding="utf8") as f: - code = f.readlines() - formatted_code = io.StringIO(stdout).readlines() - diff = difflib.unified_diff(code, formatted_code, - filename, filename, - '(before formatting)', '(after formatting)') - diff_string = ''.join(diff) - if len(diff_string) > 0: - sys.stdout.write(diff_string) - -if __name__ == '__main__': - main() + parser = argparse.ArgumentParser( + description=__doc__.format(clang_format_diff="%(prog)s"), + formatter_class=argparse.RawDescriptionHelpFormatter, + ) + parser.add_argument( + "-i", + action="store_true", + default=False, + help="apply edits to files instead of displaying a diff", + ) + parser.add_argument( + "-p", + metavar="NUM", + default=0, + help="strip the smallest prefix containing P slashes", + ) + parser.add_argument( + "-regex", + metavar="PATTERN", + default=None, + help="custom pattern selecting file paths to reformat " + "(case sensitive, overrides -iregex)", + ) + parser.add_argument( + "-iregex", + metavar="PATTERN", + default=r".*\.(?:cpp|cc|c\+\+|cxx|cppm|ccm|cxxm|c\+\+m|c|cl|h|hh|hpp" + r"|hxx|m|mm|inc|js|ts|proto|protodevel|java|cs|json|s?vh?)", + help="custom pattern selecting file paths to reformat " + "(case insensitive, overridden by -regex)", + ) + parser.add_argument( + "-sort-includes", + action="store_true", + default=False, + help="let clang-format sort include blocks", + ) + parser.add_argument( + "-v", + "--verbose", + action="store_true", + help="be more verbose, ineffective without -i", + ) + parser.add_argument( + "-style", + help="formatting style to apply (LLVM, GNU, Google, Chromium, " + "Microsoft, Mozilla, WebKit)", + ) + parser.add_argument( + "-fallback-style", + help="The name of the predefined style used as a" + "fallback in case clang-format is invoked with" + "-style=file, but can not find the .clang-format" + "file to use.", + ) + parser.add_argument( + "-binary", + default="clang-format", + help="location of binary to use for clang-format", + ) + args = parser.parse_args() + + # Extract changed lines for each file. + filename = None + lines_by_file = {} + for line in sys.stdin: + match = re.search(r"^\+\+\+\ (.*?/){%s}(\S*)" % args.p, line) + if match: + filename = match.group(2) + if filename is None: + continue + + if args.regex is not None: + if not re.match("^%s$" % args.regex, filename): + continue + else: + if not re.match("^%s$" % args.iregex, filename, re.IGNORECASE): + continue + + match = re.search(r"^@@.*\+(\d+)(?:,(\d+))?", line) + if match: + start_line = int(match.group(1)) + line_count = 1 + if match.group(2): + line_count = int(match.group(2)) + # The input is something like + # + # @@ -1, +0,0 @@ + # + # which means no lines were added. + if line_count == 0: + continue + # Also format lines range if line_count is 0 in case of deleting + # surrounding statements. + end_line = start_line + if line_count != 0: + end_line += line_count - 1 + lines_by_file.setdefault(filename, []).extend( + ["-lines", str(start_line) + ":" + str(end_line)] + ) + + # Reformat files containing changes in place. + for filename, lines in lines_by_file.items(): + if args.i and args.verbose: + print("Formatting {}".format(filename)) + command = [args.binary, filename] + if args.i: + command.append("-i") + if args.sort_includes: + command.append("-sort-includes") + command.extend(lines) + if args.style: + command.extend(["-style", args.style]) + if args.fallback_style: + command.extend(["-fallback-style", args.fallback_style]) + + try: + p = subprocess.Popen( + command, + stdout=subprocess.PIPE, + stderr=None, + stdin=subprocess.PIPE, + universal_newlines=True, + ) + except OSError as e: + # Give the user more context when clang-format isn't + # found/isn't executable, etc. + raise RuntimeError( + 'Failed to run "%s" - %s"' % (" ".join(command), e.strerror) + ) + + stdout, _stderr = p.communicate() + if p.returncode != 0: + sys.exit(p.returncode) + + if not args.i: + with open(filename, encoding="utf8") as f: + code = f.readlines() + formatted_code = StringIO(stdout).readlines() + diff = difflib.unified_diff( + code, + formatted_code, + filename, + filename, + "(before formatting)", + "(after formatting)", + ) + diff_string = "".join(diff) + if len(diff_string) > 0: + sys.stdout.write(diff_string) + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py index 3dddffe324..12d7276455 100755 --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -19,11 +19,9 @@ 'src/qt/bitcoinstrings.cpp', 'src/chainparamsseeds.h', # other external copyrights: - 'src/reverse_iterator.h', 'src/test/fuzz/FuzzedDataProvider.h', 'src/tinyformat.h', 'src/bench/nanobench.h', - 'test/functional/test_framework/bignum.py', # python init: '*__init__.py', ] @@ -95,7 +93,6 @@ def compile_copyright_regex(copyright_style, year_style, name): r"Satoshi Nakamoto", r"The Bitcoin Core developers", r"BitPay Inc\.", - r"University of Illinois at Urbana-Champaign\.", r"Pieter Wuille", r"Wladimir J\. van der Laan", r"Jeff Garzik", diff --git a/contrib/devtools/deterministic-fuzz-coverage/Cargo.lock b/contrib/devtools/deterministic-fuzz-coverage/Cargo.lock new file mode 100644 index 0000000000..319e7bfa6d --- /dev/null +++ b/contrib/devtools/deterministic-fuzz-coverage/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "deterministic-fuzz-coverage" +version = "0.1.0" diff --git a/contrib/devtools/deterministic-fuzz-coverage/Cargo.toml b/contrib/devtools/deterministic-fuzz-coverage/Cargo.toml new file mode 100644 index 0000000000..b559b0c591 --- /dev/null +++ b/contrib/devtools/deterministic-fuzz-coverage/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deterministic-fuzz-coverage" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/contrib/devtools/deterministic-fuzz-coverage/src/main.rs b/contrib/devtools/deterministic-fuzz-coverage/src/main.rs new file mode 100644 index 0000000000..3eeb121db0 --- /dev/null +++ b/contrib/devtools/deterministic-fuzz-coverage/src/main.rs @@ -0,0 +1,281 @@ +// Copyright (c) The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://opensource.org/license/mit/. + +use std::collections::VecDeque; +use std::env; +use std::fs::{read_dir, DirEntry, File}; +use std::path::{Path, PathBuf}; +use std::process::{Command, ExitCode}; +use std::str; +use std::thread; + +/// A type for a complete and readable error message. +type AppError = String; +type AppResult = Result<(), AppError>; + +const LLVM_PROFDATA: &str = "llvm-profdata"; +const LLVM_COV: &str = "llvm-cov"; +const GIT: &str = "git"; + +const DEFAULT_PAR: usize = 1; + +fn exit_help(err: &str) -> AppError { + format!( + r#" +Error: {err} + +Usage: program ./build_dir ./qa-assets/fuzz_corpora fuzz_target_name [parallelism={DEFAULT_PAR}] + +Refer to the devtools/README.md for more details."# + ) +} + +fn sanity_check(corpora_dir: &Path, fuzz_exe: &Path) -> AppResult { + for tool in [LLVM_PROFDATA, LLVM_COV, GIT] { + let output = Command::new(tool).arg("--help").output(); + match output { + Ok(output) if output.status.success() => {} + _ => Err(exit_help(&format!("The tool {} is not installed", tool)))?, + } + } + if !corpora_dir.is_dir() { + Err(exit_help(&format!( + "Fuzz corpora path ({}) must be a directory", + corpora_dir.display() + )))?; + } + if !fuzz_exe.exists() { + Err(exit_help(&format!( + "Fuzz executable ({}) not found", + fuzz_exe.display() + )))?; + } + Ok(()) +} + +fn app() -> AppResult { + // Parse args + let args = env::args().collect::>(); + let build_dir = args.get(1).ok_or(exit_help("Must set build dir"))?; + if build_dir == "--help" { + Err(exit_help("--help requested"))?; + } + let corpora_dir = args.get(2).ok_or(exit_help("Must set fuzz corpora dir"))?; + let fuzz_target = args + .get(3) + // Require fuzz target for now. In the future it could be optional and the tool could + // iterate over all compiled fuzz targets + .ok_or(exit_help("Must set fuzz target"))?; + let par = match args.get(4) { + Some(s) => s + .parse::() + .map_err(|e| exit_help(&format!("Could not parse parallelism as usize ({s}): {e}")))?, + None => DEFAULT_PAR, + } + .max(1); + if args.get(5).is_some() { + Err(exit_help("Too many args"))?; + } + + let build_dir = Path::new(build_dir); + let corpora_dir = Path::new(corpora_dir); + let fuzz_exe = build_dir.join("bin/fuzz"); + + sanity_check(corpora_dir, &fuzz_exe)?; + + deterministic_coverage(build_dir, corpora_dir, &fuzz_exe, fuzz_target, par) +} + +fn using_libfuzzer(fuzz_exe: &Path) -> Result { + println!("Check if using libFuzzer ..."); + let stderr = Command::new(fuzz_exe) + .arg("-help=1") // Will be interpreted as option (libfuzzer) or as input file + .env("FUZZ", "addition_overflow") // Any valid target + .output() + .map_err(|e| format!("fuzz failed with {e}"))? + .stderr; + let help_output = str::from_utf8(&stderr) + .map_err(|e| format!("The libFuzzer -help=1 output must be valid text ({e})"))?; + Ok(help_output.contains("libFuzzer")) +} + +fn deterministic_coverage( + build_dir: &Path, + corpora_dir: &Path, + fuzz_exe: &Path, + fuzz_target: &str, + par: usize, +) -> AppResult { + let using_libfuzzer = using_libfuzzer(fuzz_exe)?; + if using_libfuzzer { + println!("Warning: The fuzz executable was compiled with libFuzzer as sanitizer."); + println!("This tool may be tripped by libFuzzer misbehavior."); + println!("It is recommended to compile without libFuzzer."); + } + let corpus_dir = corpora_dir.join(fuzz_target); + let mut entries = read_dir(&corpus_dir) + .map_err(|err| { + exit_help(&format!( + "The fuzz target's input directory must exist! ({}; {})", + corpus_dir.display(), + err + )) + })? + .map(|entry| entry.expect("IO error")) + .collect::>(); + entries.sort_by_key(|entry| entry.file_name()); + let run_single = |run_id: char, entry: &Path, thread_id: usize| -> Result { + let cov_txt_path = build_dir.join(format!("fuzz_det_cov.show.t{thread_id}.{run_id}.txt")); + let profraw_file = build_dir.join(format!("fuzz_det_cov.t{thread_id}.{run_id}.profraw")); + let profdata_file = build_dir.join(format!("fuzz_det_cov.t{thread_id}.{run_id}.profdata")); + { + let output = { + let mut cmd = Command::new(fuzz_exe); + if using_libfuzzer { + cmd.args(["-runs=1", "-shuffle=1", "-prefer_small=0"]); + } + cmd + } + .env("LLVM_PROFILE_FILE", &profraw_file) + .env("FUZZ", fuzz_target) + .arg(entry) + .output() + .map_err(|e| format!("fuzz failed: {e}"))?; + if !output.status.success() { + Err(format!( + "fuzz failed!\nstdout:\n{}\nstderr:\n{}\n", + String::from_utf8_lossy(&output.stdout), + String::from_utf8_lossy(&output.stderr) + ))?; + } + } + if !Command::new(LLVM_PROFDATA) + .arg("merge") + .arg("--sparse") + .arg(&profraw_file) + .arg("-o") + .arg(&profdata_file) + .status() + .map_err(|e| format!("{LLVM_PROFDATA} merge failed with {e}"))? + .success() + { + Err(format!("{LLVM_PROFDATA} merge failed. This can be a sign of compiling without code coverage support."))?; + } + let cov_file = File::create(&cov_txt_path) + .map_err(|e| format!("Failed to create coverage txt file ({e})"))?; + if !Command::new(LLVM_COV) + .args([ + "show", + "--show-line-counts-or-regions", + "--show-branches=count", + "--show-expansions", + "--show-instantiation-summary", + "-Xdemangler=llvm-cxxfilt", + &format!("--instr-profile={}", profdata_file.display()), + ]) + .arg(fuzz_exe) + .stdout(cov_file) + .spawn() + .map_err(|e| format!("{LLVM_COV} show failed with {e}"))? + .wait() + .map_err(|e| format!("{LLVM_COV} show failed with {e}"))? + .success() + { + Err(format!("{LLVM_COV} show failed"))?; + }; + Ok(cov_txt_path) + }; + let check_diff = |a: &Path, b: &Path, err: &str| -> AppResult { + let same = Command::new(GIT) + .args(["--no-pager", "diff", "--no-index"]) + .arg(a) + .arg(b) + .status() + .map_err(|e| format!("{GIT} diff failed with {e}"))? + .success(); + if !same { + Err(format!( + r#" +The coverage was not deterministic between runs. +{err}"# + ))?; + } + Ok(()) + }; + // First, check that each fuzz input is deterministic running by itself in a process. + // + // This can catch issues and isolate where a single fuzz input triggers non-determinism, but + // all other fuzz inputs are deterministic. + // + // Also, This can catch issues where several fuzz inputs are non-deterministic, but the sum of + // their overall coverage trace remains the same across runs and thus remains undetected. + println!( + "Check each fuzz input individually ... ({} inputs with parallelism {par})", + entries.len() + ); + let check_individual = |entry: &DirEntry, thread_id: usize| -> AppResult { + let entry = entry.path(); + if !entry.is_file() { + Err(format!("{} should be a file", entry.display()))?; + } + let cov_txt_base = run_single('a', &entry, thread_id)?; + let cov_txt_repeat = run_single('b', &entry, thread_id)?; + check_diff( + &cov_txt_base, + &cov_txt_repeat, + &format!("The fuzz target input was {}.", entry.display()), + )?; + Ok(()) + }; + thread::scope(|s| -> AppResult { + let mut handles = VecDeque::with_capacity(par); + let mut res = Ok(()); + for (i, entry) in entries.iter().enumerate() { + println!("[{}/{}]", i + 1, entries.len()); + handles.push_back(s.spawn(move || check_individual(entry, i % par))); + while handles.len() >= par || i == (entries.len() - 1) || res.is_err() { + if let Some(th) = handles.pop_front() { + let thread_result = match th.join() { + Err(_e) => Err("A scoped thread panicked".to_string()), + Ok(r) => r, + }; + if thread_result.is_err() { + res = thread_result; + } + } else { + return res; + } + } + } + res + })?; + // Finally, check that running over all fuzz inputs in one process is deterministic as well. + // This can catch issues where mutable global state is leaked from one fuzz input execution to + // the next. + println!("Check all fuzz inputs in one go ..."); + { + if !corpus_dir.is_dir() { + Err(format!("{} should be a folder", corpus_dir.display()))?; + } + let cov_txt_base = run_single('a', &corpus_dir, 0)?; + let cov_txt_repeat = run_single('b', &corpus_dir, 0)?; + check_diff( + &cov_txt_base, + &cov_txt_repeat, + &format!("All fuzz inputs in {} were used.", corpus_dir.display()), + )?; + } + println!("✨ Coverage test passed for {fuzz_target}. ✨"); + Ok(()) +} + +fn main() -> ExitCode { + match app() { + Ok(()) => ExitCode::SUCCESS, + Err(err) => { + eprintln!("⚠️\n{}", err); + ExitCode::FAILURE + } + } +} diff --git a/contrib/devtools/deterministic-unittest-coverage/Cargo.lock b/contrib/devtools/deterministic-unittest-coverage/Cargo.lock new file mode 100644 index 0000000000..3901330445 --- /dev/null +++ b/contrib/devtools/deterministic-unittest-coverage/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "deterministic-unittest-coverage" +version = "0.1.0" diff --git a/contrib/devtools/deterministic-unittest-coverage/Cargo.toml b/contrib/devtools/deterministic-unittest-coverage/Cargo.toml new file mode 100644 index 0000000000..d581021305 --- /dev/null +++ b/contrib/devtools/deterministic-unittest-coverage/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "deterministic-unittest-coverage" +version = "0.1.0" +edition = "2021" + +[dependencies] diff --git a/contrib/devtools/deterministic-unittest-coverage/src/main.rs b/contrib/devtools/deterministic-unittest-coverage/src/main.rs new file mode 100644 index 0000000000..047c8d24ed --- /dev/null +++ b/contrib/devtools/deterministic-unittest-coverage/src/main.rs @@ -0,0 +1,149 @@ +// Copyright (c) The Bitcoin Core developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or https://opensource.org/license/mit/. + +use std::env; +use std::fs::File; +use std::path::{Path, PathBuf}; +use std::process::{Command, ExitCode}; +use std::str; + +/// A type for a complete and readable error message. +type AppError = String; +type AppResult = Result<(), AppError>; + +const LLVM_PROFDATA: &str = "llvm-profdata"; +const LLVM_COV: &str = "llvm-cov"; +const GIT: &str = "git"; + +fn exit_help(err: &str) -> AppError { + format!( + r#" +Error: {err} + +Usage: program ./build_dir boost_unittest_filter + +Refer to the devtools/README.md for more details."# + ) +} + +fn sanity_check(test_exe: &Path) -> AppResult { + for tool in [LLVM_PROFDATA, LLVM_COV, GIT] { + let output = Command::new(tool).arg("--help").output(); + match output { + Ok(output) if output.status.success() => {} + _ => Err(exit_help(&format!("The tool {} is not installed", tool)))?, + } + } + if !test_exe.exists() { + Err(exit_help(&format!( + "Test executable ({}) not found", + test_exe.display() + )))?; + } + Ok(()) +} + +fn app() -> AppResult { + // Parse args + let args = env::args().collect::>(); + let build_dir = args.get(1).ok_or(exit_help("Must set build dir"))?; + if build_dir == "--help" { + Err(exit_help("--help requested"))?; + } + let filter = args + .get(2) + // Require filter for now. In the future it could be optional and the tool could provide a + // default filter. + .ok_or(exit_help("Must set boost test filter"))?; + if args.get(3).is_some() { + Err(exit_help("Too many args"))?; + } + + let build_dir = Path::new(build_dir); + let test_exe = build_dir.join("bin/test_bitcoin"); + + sanity_check(&test_exe)?; + + deterministic_coverage(build_dir, &test_exe, filter) +} + +fn deterministic_coverage(build_dir: &Path, test_exe: &Path, filter: &str) -> AppResult { + let profraw_file = build_dir.join("test_det_cov.profraw"); + let profdata_file = build_dir.join("test_det_cov.profdata"); + let run_single = |run_id: char| -> Result { + println!("Run with id {run_id}"); + let cov_txt_path = build_dir.join(format!("test_det_cov.show.{run_id}.txt")); + if !Command::new(test_exe) + .env("LLVM_PROFILE_FILE", &profraw_file) + .env("BOOST_TEST_RUN_FILTERS", filter) + .env("RANDOM_CTX_SEED", "21") + .status() + .map_err(|e| format!("test failed with {e}"))? + .success() + { + Err("test failed".to_string())?; + } + if !Command::new(LLVM_PROFDATA) + .arg("merge") + .arg("--sparse") + .arg(&profraw_file) + .arg("-o") + .arg(&profdata_file) + .status() + .map_err(|e| format!("{LLVM_PROFDATA} merge failed with {e}"))? + .success() + { + Err(format!("{LLVM_PROFDATA} merge failed. This can be a sign of compiling without code coverage support."))?; + } + let cov_file = File::create(&cov_txt_path) + .map_err(|e| format!("Failed to create coverage txt file ({e})"))?; + if !Command::new(LLVM_COV) + .args([ + "show", + "--show-line-counts-or-regions", + "--show-branches=count", + "--show-expansions", + "--show-instantiation-summary", + "-Xdemangler=llvm-cxxfilt", + &format!("--instr-profile={}", profdata_file.display()), + ]) + .arg(test_exe) + .stdout(cov_file) + .status() + .map_err(|e| format!("{LLVM_COV} show failed with {e}"))? + .success() + { + Err(format!("{LLVM_COV} show failed"))?; + } + Ok(cov_txt_path) + }; + let check_diff = |a: &Path, b: &Path| -> AppResult { + let same = Command::new(GIT) + .args(["--no-pager", "diff", "--no-index"]) + .arg(a) + .arg(b) + .status() + .map_err(|e| format!("{GIT} diff failed with {e}"))? + .success(); + if !same { + Err("The coverage was not deterministic between runs.".to_string())?; + } + Ok(()) + }; + let r0 = run_single('a')?; + let r1 = run_single('b')?; + check_diff(&r0, &r1)?; + println!("✨ The coverage was deterministic across two runs. ✨"); + Ok(()) +} + +fn main() -> ExitCode { + match app() { + Ok(()) => ExitCode::SUCCESS, + Err(err) => { + eprintln!("⚠️\n{}", err); + ExitCode::FAILURE + } + } +} diff --git a/contrib/devtools/gen-bitcoin-conf.sh b/contrib/devtools/gen-bitcoin-conf.sh index 2ebbd42022..d31f546295 100755 --- a/contrib/devtools/gen-bitcoin-conf.sh +++ b/contrib/devtools/gen-bitcoin-conf.sh @@ -5,8 +5,8 @@ export LC_ALL=C TOPDIR=${TOPDIR:-$(git rev-parse --show-toplevel)} -BUILDDIR=${BUILDDIR:-$TOPDIR} -BINDIR=${BINDIR:-$BUILDDIR/src} +BUILDDIR=${BUILDDIR:-$TOPDIR/build} +BINDIR=${BINDIR:-$BUILDDIR/bin} BITCOIND=${BITCOIND:-$BINDIR/bitcoind} SHARE_EXAMPLES_DIR=${SHARE_EXAMPLES_DIR:-$TOPDIR/share/examples} EXAMPLE_CONF_FILE=${EXAMPLE_CONF_FILE:-$SHARE_EXAMPLES_DIR/bitcoin.conf} @@ -50,7 +50,8 @@ EOF # adding newlines is a bit funky to ensure portability for BSD # see here for more details: https://stackoverflow.com/a/24575385 ${BITCOIND} --help \ - | sed '1,/Print this help message and exit/d' \ + | sed '1,/Options:/d' \ + | sed -E '/^[[:space:]]{2}-help/,/^[[:space:]]*$/d' \ | sed -E 's/^[[:space:]]{2}\-/#/' \ | sed -E 's/^[[:space:]]{7}/# /' \ | sed -E '/[=[:space:]]/!s/#.*$/&=1/' \ @@ -72,9 +73,12 @@ cat >> "${EXAMPLE_CONF_FILE}" << 'EOF' # Options for mainnet [main] -# Options for testnet +# Options for testnet3 [test] +# Options for testnet4 +[testnet4] + # Options for signet [signet] diff --git a/contrib/devtools/gen-manpages.py b/contrib/devtools/gen-manpages.py index 2860e7db99..c7678817a9 100755 --- a/contrib/devtools/gen-manpages.py +++ b/contrib/devtools/gen-manpages.py @@ -6,16 +6,29 @@ import subprocess import sys import tempfile +import argparse BINARIES = [ -'src/bitcoind', -'src/bitcoin-cli', -'src/bitcoin-tx', -'src/bitcoin-wallet', -'src/bitcoin-util', -'src/qt/bitcoin-qt', +'bin/bitcoind', +'bin/bitcoin-cli', +'bin/bitcoin-tx', +'bin/bitcoin-wallet', +'bin/bitcoin-util', +'bin/bitcoin-qt', ] +parser = argparse.ArgumentParser( + formatter_class=argparse.RawDescriptionHelpFormatter, +) +parser.add_argument( + "-s", + "--skip-missing-binaries", + action="store_true", + default=False, + help="skip generation for binaries that are not found in the build path", +) +args = parser.parse_args() + # Paths to external utilities. git = os.getenv('GIT', 'git') help2man = os.getenv('HELP2MAN', 'help2man') @@ -27,7 +40,7 @@ topdir = r.stdout.rstrip() # Get input and output directories. -builddir = os.getenv('BUILDDIR', topdir) +builddir = os.getenv('BUILDDIR', os.path.join(topdir, 'build')) mandir = os.getenv('MANDIR', os.path.join(topdir, 'doc/man')) # Verify that all the required binaries are usable, and extract copyright @@ -38,8 +51,12 @@ try: r = subprocess.run([abspath, "--version"], stdout=subprocess.PIPE, check=True, text=True) except IOError: - print(f'{abspath} not found or not an executable', file=sys.stderr) - sys.exit(1) + if(args.skip_missing_binaries): + print(f'{abspath} not found or not an executable. Skipping...', file=sys.stderr) + continue + else: + print(f'{abspath} not found or not an executable', file=sys.stderr) + sys.exit(1) # take first line (which must contain version) verstr = r.stdout.splitlines()[0] # last word of line is the actual version e.g. v22.99.0-5c6b3d5b3508 @@ -51,6 +68,10 @@ versions.append((abspath, verstr, copyright)) +if not versions: + print(f'No binaries found in {builddir}. Please ensure the binaries are present in {builddir}, or set another build path using the BUILDDIR env variable.') + sys.exit(1) + if any(verstr.endswith('-dirty') for (_, verstr, _) in versions): print("WARNING: Binaries were built from a dirty tree.") print('man pages generated from dirty binaries should NOT be committed.') @@ -62,6 +83,10 @@ # Copyright is the same for all binaries, so just use the first. footer.write('[COPYRIGHT]\n') footer.write('\n'.join(versions[0][2]).strip()) + # Create SEE ALSO section + footer.write('\n[SEE ALSO]\n') + footer.write(', '.join(s.rpartition('/')[2] + '(1)' for s in BINARIES)) + footer.write('\n') footer.flush() # Call the binaries through help2man to produce a manual page for each of them. diff --git a/contrib/devtools/headerssync-params.py b/contrib/devtools/headerssync-params.py new file mode 100755 index 0000000000..4640718cb7 --- /dev/null +++ b/contrib/devtools/headerssync-params.py @@ -0,0 +1,357 @@ +#!/usr/bin/env python3 +# Copyright (c) 2022 Pieter Wuille +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. + +"""Script to find the optimal parameters for the headerssync module through simulation.""" + +from math import log, exp, sqrt +from datetime import datetime, timedelta +import random + +# Parameters: + +# Aim for still working fine at some point in the future. [datetime] +TIME = datetime(2027, 10, 6) + +# Expected block interval. [timedelta] +BLOCK_INTERVAL = timedelta(seconds=600) + +# The number of headers corresponding to the minchainwork parameter. [headers] +MINCHAINWORK_HEADERS = 886157 + +# Combined processing bandwidth from all attackers to one victim. [bit/s] +# 6 Gbit/s is approximately the speed at which a single thread of a Ryzen 5950X CPU thread can hash +# headers. In practice, the victim's network bandwidth and network processing overheads probably +# impose a far lower number, but it's a useful upper bound. +ATTACK_BANDWIDTH = 6000000000 + +# How much additional permanent memory usage are attackers (jointly) allowed to cause in the victim, +# expressed as fraction of the normal memory usage due to mainchain growth, for the duration the +# attack is sustained. [unitless] +# 0.2 means that attackers, while they keep up the attack, can cause permanent memory usage due to +# headers storage to grow at 1.2 header per BLOCK_INTERVAL. +ATTACK_FRACTION = 0.2 + +# When this is set, the mapping from period size to memory usage (at optimal buffer size for that +# period) is assumed to be convex. This greatly speeds up the computation, and does not appear +# to influence the outcome. Set to False for a stronger guarantee to get the optimal result. +ASSUME_CONVEX = True + +# Explanation: +# +# The headerssync module implements a DoS protection against low-difficulty header spam which does +# not rely on checkpoints. In short it works as follows: +# +# - (initial) header synchronization is split into two phases: +# - A commitment phase, in which headers are downloaded from the peer, and a very compact +# commitment to them is remembered in per-peer memory. The commitment phase ends when the +# received chain's combined work reaches a predetermined threshold. +# - A redownload phase, during which the headers are downloaded a second time from the same peer, +# and compared against the commitment constructed in the first phase. If there is a match, the +# redownloaded headers are fed to validation and accepted into permanent storage. +# +# This separation guarantees that no headers are accepted into permanent storage without +# requiring the peer to first prove the chain actually has sufficient work. +# +# - To actually implement this commitment mechanism, the following approach is used: +# - Keep a *1 bit* commitment (constructed using a salted hash function), for every block whose +# height is a multiple of {period} plus an offset value. If RANDOMIZE_OFFSET, the offset, +# like the salt, is chosen randomly when the synchronization starts and kept fixed afterwards. +# - When redownloading, headers are fed through a per-peer queue that holds {bufsize} headers, +# before passing them to validation. All the headers in this queue are verified against the +# commitment bits created in the first phase before any header is released from it. This means +# {bufsize/period} bits are checked "on top of" each header before actually processing it, +# which results in a commitment structure with roughly {bufsize/period} bits of security, as +# once a header is modified, due to the prevhash inclusion, all future headers necessarily +# change as well. +# +# The question is what these {period} and {bufsize} parameters need to be set to. This program +# exhaustively tests a range of values to find the optimal choice, taking into account: +# +# - Minimizing the (maximum of) two scenarios that trigger per-peer memory usage: +# +# - When downloading a (likely honest) chain that reaches the chainwork threshold after {n} +# blocks, and then redownloads them, we will consume per-peer memory that is sufficient to +# store {n/period} commitment bits and {bufsize} headers. We only consider attackers without +# sufficient hashpower (as otherwise they are from a PoW perspective not attackers), which +# means {n} is restricted to the honest chain's length before reaching minchainwork. +# +# - When downloading a (likely false) chain of {n} headers that never reaches the chainwork +# threshold, we will consume per-peer memory that is sufficient to store {n/period} +# commitment bits. Such a chain may be very long, by exploiting the timewarp bug to avoid +# ramping up difficulty. There is however an absolute limit on how long such a chain can be: 6 +# blocks per second since genesis, due to the increasing MTP consensus rule. +# +# - Not gratuitously preventing synchronizing any valid chain, however difficult such a chain may +# be to construct. In particular, the above scenario with an enormous timewarp-expoiting chain +# cannot simply be ignored, as it is legal that the honest main chain is like that. We however +# do not bother minimizing the memory usage in that case (because a billion-header long honest +# chain will inevitably use far larger amounts of memory than designed for). +# +# - Keep the rate at which attackers can get low-difficulty headers accepted to the block index +# negligible. Specifically, the possibility exists for an attacker to send the honest main +# chain's headers during the commitment phase, but then start deviating at an attacker-chosen +# point by sending novel low-difficulty headers instead. Depending on how high we set the +# {bufsize/period} ratio, we can make the probability that such a header makes it in +# arbitrarily small, but at the cost of higher memory during the redownload phase. It turns out, +# some rate of memory usage growth is expected anyway due to chain growth, so permitting the +# attacker to increase that rate by a small factor isn't concerning. The attacker may start +# somewhat later than genesis, as long as the difficulty doesn't get too high. This reduces +# the attacker bandwidth required at the cost of higher PoW needed for constructing the +# alternate chain. This trade-off is ignored here, as it results in at most a small constant +# factor in attack rate. + + +# System properties: + +# Headers in the redownload buffer are stored without prevhash. [bits] +COMPACT_HEADER_SIZE = 48 * 8 + +# How many bits a header uses in P2P protocol. [bits] +NET_HEADER_SIZE = 81 * 8 + +# How many headers are sent at once. [headers] +HEADER_BATCH_COUNT = 2000 + +# Whether or not the offset of which blocks heights get checksummed is randomized. +RANDOMIZE_OFFSET = True + +# Timestamp of the genesis block +GENESIS_TIME = datetime(2009, 1, 3) + +# Derived values: + +# What rate of headers worth of RAM attackers are allowed to cause in the victim. [headers/s] +LIMIT_HEADERRATE = ATTACK_FRACTION / BLOCK_INTERVAL.total_seconds() + +# How many headers can attackers (jointly) send a victim per second. [headers/s] +NET_HEADERRATE = ATTACK_BANDWIDTH / NET_HEADER_SIZE + +# What fraction of headers sent by attackers can at most be accepted by a victim [unitless] +LIMIT_FRACTION = LIMIT_HEADERRATE / NET_HEADERRATE + +# How many headers we permit attackers to cause being accepted per attack. [headers/attack] +ATTACK_HEADERS = LIMIT_FRACTION * MINCHAINWORK_HEADERS + + +def find_max_headers(when): + """Compute the maximum number of headers a valid Bitcoin chain can have at given time.""" + # When exploiting the timewarp attack, this can be up to 6 per second since genesis. + return 6 * ((when - GENESIS_TIME) // timedelta(seconds=1)) + + +def lambert_w(value): + """Solve the equation x*exp(x)=value (x > 0, value > 0).""" + # Initial approximation. + approx = max(log(value), 0.0) + for _ in range(10): + # Newton-Rhapson iteration steps. + approx += (value * exp(-approx) - approx) / (approx + 1.0) + return approx + + +def attack_rate(period, bufsize, limit=None): + """Compute maximal accepted headers per attack in (period, bufsize) configuration. + + If limit is provided, the computation is stopped early when the result is known to exceed the + value in limit. + """ + + max_rate = None + max_honest = None + # Let the current batch 0 being received be the first one in which the attacker starts lying. + # They will only ever start doing so right after a commitment block, but where that is can be + # in a number of places. Let honest be the number of honest headers in this current batch, + # preceding the forged ones. + for honest in range(HEADER_BATCH_COUNT): + # The number of headers the attack under consideration will on average get accepted. + # This is the number being computed. + rate = 0 + + # Iterate over the possible alignments of commitments w.r.t. the first batch. In case + # the alignments are randomized, try all values. If not, the attacker can know/choose + # the alignment, and will always start forging right after a commitment. + if RANDOMIZE_OFFSET: + align_choices = list(range(period)) + else: + align_choices = [(honest - 1) % period] + # Now loop over those possible alignment values, computing the average attack rate + # over them by dividing each contribution by len(align_choices). + for align in align_choices: + # These state variables capture the situation after receiving the first batch. + # - The number of headers received after the last commitment for an honest block: + after_good_commit = HEADER_BATCH_COUNT - honest + ((honest - align - 1) % period) + # - The number of forged headers in the redownload buffer: + forged_in_buf = HEADER_BATCH_COUNT - honest + + # Now iterate over the next batches of headers received, adding contributions to the + # rate variable. + while True: + # Process the first HEADER_BATCH_COUNT headers in the buffer: + accept_forged_headers = max(forged_in_buf - bufsize, 0) + forged_in_buf -= accept_forged_headers + if accept_forged_headers: + # The probability the attack has not been detected yet at this point: + prob = 0.5 ** (after_good_commit // period) + # Update attack rate, divided by align_choices to average over the alignments. + rate += accept_forged_headers * prob / len(align_choices) + # If this means we exceed limit, bail out early (performance optimization). + if limit is not None and rate >= limit: + return rate, None + # If the maximal term being added is negligible compared to rate, stop + # iterating. + if HEADER_BATCH_COUNT * prob < 1.0e-16 * rate * len(align_choices): + break + # Update state from a new incoming batch (which is all forged) + after_good_commit += HEADER_BATCH_COUNT + forged_in_buf += HEADER_BATCH_COUNT + + if max_rate is None or rate > max_rate: + max_rate = rate + max_honest = honest + + return max_rate, max_honest + + +def memory_usage(period, bufsize, when): + """How much memory (max,mainchain,timewarp) does the (period,bufsize) configuration need?""" + + # Per-peer memory usage for a timewarp chain that never meets minchainwork + mem_timewarp = find_max_headers(when) // period + # Per-peer memory usage for being fed the main chain + mem_mainchain = (MINCHAINWORK_HEADERS // period) + bufsize * COMPACT_HEADER_SIZE + # Maximum per-peer memory usage + max_mem = max(mem_timewarp, mem_mainchain) + + return max_mem, mem_mainchain, mem_timewarp + +def find_bufsize(period, attack_headers, when, max_mem=None, min_bufsize=1): + """Determine how big bufsize needs to be given a specific period length. + + Given a period, find the smallest value of bufsize such that the attack rate against the + (period, bufsize) configuration is below attack_headers. If max_mem is provided, and no + such bufsize exists that needs less than max_mem bits of memory, None is returned. + min_bufsize is the minimal result to be considered.""" + + if max_mem is None: + succ_buf = min_bufsize - 1 + fail_buf = min_bufsize + # First double iteratively until an upper bound for failure is found. + while True: + if attack_rate(period, fail_buf, attack_headers)[0] < attack_headers: + break + succ_buf, fail_buf = fail_buf, 3 * fail_buf - 2 * succ_buf + else: + # If a long low-work header chain exists that exceeds max_mem already, give up. + if find_max_headers(when) // period > max_mem: + return None + # Otherwise, verify that the maximal buffer size that permits a mainchain sync with less + # than max_mem memory is sufficient to get the attack rate below attack_headers. If not, + # also give up. + max_buf = (max_mem - (MINCHAINWORK_HEADERS // period)) // COMPACT_HEADER_SIZE + if max_buf < min_bufsize: + return None + if attack_rate(period, max_buf, attack_headers)[0] >= attack_headers: + return None + # If it is sufficient, that's an upper bound to start our search. + succ_buf = min_bufsize - 1 + fail_buf = max_buf + + # Then perform a bisection search to narrow it down. + while fail_buf > succ_buf + 1: + try_buf = (succ_buf + fail_buf) // 2 + if attack_rate(period, try_buf, attack_headers)[0] >= attack_headers: + succ_buf = try_buf + else: + fail_buf = try_buf + return fail_buf + + +def optimize(when): + """Find the best (period, bufsize) configuration.""" + + # When period*bufsize = memory_scale, the per-peer memory for a mainchain sync and a maximally + # long low-difficulty header sync are equal. + memory_scale = (find_max_headers(when) - MINCHAINWORK_HEADERS) / COMPACT_HEADER_SIZE + # Compute approximation for {bufsize/period}, using a formula for a simplified problem. + approx_ratio = lambert_w(log(4) * memory_scale / ATTACK_HEADERS**2) / log(4) + # Use those for a first attempt. + print("Searching configurations:") + period = int(sqrt(memory_scale / approx_ratio) + 0.5) + bufsize = find_bufsize(period, ATTACK_HEADERS, when) + mem = memory_usage(period, bufsize, when) + best = (period, bufsize, mem) + maps = [(period, bufsize), (MINCHAINWORK_HEADERS + 1, None)] + print(f"- Initial: period={period}, buffer={bufsize}, mem={mem[0] / 8192:.3f} KiB") + + # Consider all period values between 1 and MINCHAINWORK_HEADERS, except the one just tried. + periods = [iv for iv in range(1, MINCHAINWORK_HEADERS + 1) if iv != period] + # Iterate, picking a random element from periods, computing its corresponding bufsize, and + # then using the result to shrink the period. + while True: + # Remove all periods whose memory usage for low-work long chain sync exceed the best + # memory usage we've found so far. + periods = [p for p in periods if find_max_headers(when) // p < best[2][0]] + # Stop if there is nothing left to try. + if len(periods) == 0: + break + # Pick a random remaining option for period size, and compute corresponding bufsize. + period = periods.pop(random.randrange(len(periods))) + # The buffer size (at a given attack level) cannot shrink as the period grows. Find the + # largest period smaller than the selected one we know the buffer size for, and use that + # as a lower bound to find_bufsize. + min_bufsize = max([(p, b) for p, b in maps if p < period] + [(0,0)])[1] + bufsize = find_bufsize(period, ATTACK_HEADERS, when, best[2][0], min_bufsize) + if bufsize is not None: + # We found a (period, bufsize) configuration with better memory usage than our best + # so far. Remember it for future lower bounds. + maps.append((period, bufsize)) + mem = memory_usage(period, bufsize, when) + assert mem[0] <= best[2][0] + if ASSUME_CONVEX: + # Remove all periods that are on the other side of the former best as the new + # best. + periods = [p for p in periods if (p < best[0]) == (period < best[0])] + best = (period, bufsize, mem) + print(f"- New best: period={period}, buffer={bufsize}, mem={mem[0] / 8192:.3f} KiB") + else: + # The (period, bufsize) configuration we found is worse than what we already had. + if ASSUME_CONVEX: + # Remove all periods that are on the other side of the tried configuration as the + # best one. + periods = [p for p in periods if (p < period) == (best[0] < period)] + + # Return the result. + period, bufsize, _ = best + return period, bufsize + + +def analyze(when): + """Find the best configuration and print it out.""" + + period, bufsize = optimize(when) + # Compute accurate statistics for the best found configuration. + _, mem_mainchain, mem_timewarp = memory_usage(period, bufsize, when) + headers_per_attack, _ = attack_rate(period, bufsize) + attack_volume = NET_HEADER_SIZE * MINCHAINWORK_HEADERS + # And report them. + print() + print("Optimal configuration:") + print() + print("//! Store one header commitment per HEADER_COMMITMENT_PERIOD blocks.") + print(f"constexpr size_t HEADER_COMMITMENT_PERIOD{{{period}}};") + print() + print("//! Only feed headers to validation once this many headers on top have been") + print("//! received and validated against commitments.") + print(f"constexpr size_t REDOWNLOAD_BUFFER_SIZE{{{bufsize}}};" + f" // {bufsize}/{period} = ~{bufsize/period:.1f} commitments") + print() + print("Properties:") + print(f"- Per-peer memory for mainchain sync: {mem_mainchain / 8192:.3f} KiB") + print(f"- Per-peer memory for timewarp attack: {mem_timewarp / 8192:.3f} KiB") + print(f"- Attack rate: {1/headers_per_attack:.1f} attacks for 1 header of memory growth") + print(f" (where each attack costs {attack_volume / 8388608:.3f} MiB bandwidth)") + + +analyze(TIME) diff --git a/contrib/devtools/iwyu/bitcoin.core.imp b/contrib/devtools/iwyu/bitcoin.core.imp index 919ffab102..c4c4ba4ceb 100644 --- a/contrib/devtools/iwyu/bitcoin.core.imp +++ b/contrib/devtools/iwyu/bitcoin.core.imp @@ -1,7 +1,3 @@ -# Fixups / upstreamed changes +# Nothing for now. [ - { include: [ "", private, "", public ] }, - { include: [ "", private, "", public ] }, - { include: [ "", private, "", public ] }, - { include: [ "", private, "", public ] }, ] diff --git a/contrib/devtools/test-security-check.py b/contrib/devtools/test-security-check.py deleted file mode 100755 index 802bf9fd30..0000000000 --- a/contrib/devtools/test-security-check.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2015-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -''' -Test script for security-check.py -''' -import lief -import os -import subprocess -from typing import List -import unittest - -from utils import determine_wellknown_cmd - -def write_testcode(filename): - with open(filename, 'w', encoding="utf8") as f: - f.write(''' - #include - int main() - { - printf("the quick brown fox jumps over the lazy god\\n"); - return 0; - } - ''') - -def clean_files(source, executable): - os.remove(source) - os.remove(executable) - -def call_security_check(cc: str, source: str, executable: str, options) -> tuple: - # This should behave the same as AC_TRY_LINK, so arrange well-known flags - # in the same order as autoconf would. - # - # See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for - # reference. - env_flags: List[str] = [] - for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']: - env_flags += filter(None, os.environ.get(var, '').split(' ')) - - subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True) - p = subprocess.run([os.path.join(os.path.dirname(__file__), 'security-check.py'), executable], stdout=subprocess.PIPE, text=True) - return (p.returncode, p.stdout.rstrip()) - -def get_arch(cc, source, executable): - subprocess.run([*cc, source, '-o', executable], check=True) - binary = lief.parse(executable) - arch = binary.abstract.header.architecture - os.remove(executable) - return arch - -class TestSecurityChecks(unittest.TestCase): - def test_ELF(self): - source = 'test1.c' - executable = 'test1' - cc = determine_wellknown_cmd('CC', 'gcc') - write_testcode(source) - arch = get_arch(cc, source, executable) - - if arch == lief.ARCHITECTURES.X86: - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE NX RELRO Canary CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE RELRO Canary CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE RELRO CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE', '-Wl,-z,separate-code']), - (1, executable+': failed RELRO CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,noseparate-code']), - (1, executable+': failed separate_code CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code']), - (1, executable+': failed CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code', '-fcf-protection=full']), - (0, '')) - else: - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-zexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE NX RELRO Canary')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fno-stack-protector','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE RELRO Canary')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-no-pie','-fno-PIE', '-Wl,-z,separate-code']), - (1, executable+': failed PIE RELRO')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-znorelro','-pie','-fPIE', '-Wl,-z,separate-code']), - (1, executable+': failed RELRO')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,noseparate-code']), - (1, executable+': failed separate_code')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-znoexecstack','-fstack-protector-all','-Wl,-zrelro','-Wl,-z,now','-pie','-fPIE', '-Wl,-z,separate-code']), - (0, '')) - - clean_files(source, executable) - - def test_PE(self): - source = 'test1.c' - executable = 'test1.exe' - cc = determine_wellknown_cmd('CC', 'x86_64-w64-mingw32-gcc') - write_testcode(source) - - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--disable-nxcompat','-Wl,--disable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fno-stack-protector']), - (1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA NX RELOC_SECTION CONTROL_FLOW Canary')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--disable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fstack-protector-all', '-lssp']), - (1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA RELOC_SECTION CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-no-pie','-fno-PIE','-fstack-protector-all', '-lssp']), - (1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--disable-dynamicbase','-Wl,--disable-high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']), - (1, executable+': failed PIE DYNAMIC_BASE HIGH_ENTROPY_VA CONTROL_FLOW')) # -pie -fPIE does nothing unless --dynamicbase is also supplied - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--disable-high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']), - (1, executable+': failed HIGH_ENTROPY_VA CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--high-entropy-va','-pie','-fPIE','-fstack-protector-all', '-lssp']), - (1, executable+': failed CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,--nxcompat','-Wl,--enable-reloc-section','-Wl,--dynamicbase','-Wl,--high-entropy-va','-pie','-fPIE', '-fcf-protection=full','-fstack-protector-all', '-lssp']), - (0, '')) - - clean_files(source, executable) - - def test_MACHO(self): - source = 'test1.c' - executable = 'test1' - cc = determine_wellknown_cmd('CC', 'clang') - write_testcode(source) - arch = get_arch(cc, source, executable) - - if arch == lief.ARCHITECTURES.X86: - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-no_fixup_chains']), - (1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fno-stack-protector', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS Canary PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-Wl,-allow_stack_execute','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS PIE NX CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed PIE CONTROL_FLOW')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-no_pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']), - (1, executable+': failed PIE')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-pie','-Wl,-bind_at_load','-fstack-protector-all', '-fcf-protection=full', '-Wl,-fixup_chains']), - (0, '')) - else: - # arm64 darwin doesn't support non-PIE binaries, control flow or executable stacks - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-no_fixup_chains']), - (1, executable+': failed NOUNDEFS Canary FIXUP_CHAINS')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fno-stack-protector', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS Canary')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-flat_namespace','-fstack-protector-all', '-Wl,-fixup_chains']), - (1, executable+': failed NOUNDEFS')) - self.assertEqual(call_security_check(cc, source, executable, ['-Wl,-bind_at_load','-fstack-protector-all', '-Wl,-fixup_chains']), - (0, '')) - - - clean_files(source, executable) - -if __name__ == '__main__': - unittest.main() diff --git a/contrib/devtools/test-symbol-check.py b/contrib/devtools/test-symbol-check.py deleted file mode 100755 index fe8a99739f..0000000000 --- a/contrib/devtools/test-symbol-check.py +++ /dev/null @@ -1,179 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2020-2022 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -''' -Test script for symbol-check.py -''' -import os -import subprocess -from typing import List -import unittest - -from utils import determine_wellknown_cmd - -def call_symbol_check(cc: List[str], source, executable, options): - # This should behave the same as AC_TRY_LINK, so arrange well-known flags - # in the same order as autoconf would. - # - # See the definitions for ac_link in autoconf's lib/autoconf/c.m4 file for - # reference. - env_flags: List[str] = [] - for var in ['CFLAGS', 'CPPFLAGS', 'LDFLAGS']: - env_flags += filter(None, os.environ.get(var, '').split(' ')) - - subprocess.run([*cc,source,'-o',executable] + env_flags + options, check=True) - p = subprocess.run([os.path.join(os.path.dirname(__file__), 'symbol-check.py'), executable], stdout=subprocess.PIPE, text=True) - os.remove(source) - os.remove(executable) - return (p.returncode, p.stdout.rstrip()) - -def get_machine(cc: List[str]): - p = subprocess.run([*cc,'-dumpmachine'], stdout=subprocess.PIPE, text=True) - return p.stdout.rstrip() - -class TestSymbolChecks(unittest.TestCase): - def test_ELF(self): - source = 'test1.c' - executable = 'test1' - cc = determine_wellknown_cmd('CC', 'gcc') - - # -lutil is part of the libc6 package so a safe bet that it's installed - # it's also out of context enough that it's unlikely to ever become a real dependency - source = 'test2.c' - executable = 'test2' - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - login(0); - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-lutil']), - (1, executable + ': libutil.so.1 is not in ALLOWED_LIBRARIES!\n' + - executable + ': failed LIBRARY_DEPENDENCIES')) - - # finally, check a simple conforming binary - source = 'test3.c' - executable = 'test3' - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - printf("42"); - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, []), - (0, '')) - - def test_MACHO(self): - source = 'test1.c' - executable = 'test1' - cc = determine_wellknown_cmd('CC', 'clang') - - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - XML_ExpatVersion(); - return 0; - } - - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-lexpat', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']), - (1, 'libexpat.1.dylib is not in ALLOWED_LIBRARIES!\n' + - f'{executable}: failed DYNAMIC_LIBRARIES MIN_OS SDK')) - - source = 'test2.c' - executable = 'test2' - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - CGMainDisplayID(); - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-framework', 'CoreGraphics', '-Wl,-platform_version','-Wl,macos', '-Wl,11.4', '-Wl,11.4']), - (1, f'{executable}: failed MIN_OS SDK')) - - source = 'test3.c' - executable = 'test3' - with open(source, 'w', encoding="utf8") as f: - f.write(''' - int main() - { - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,-platform_version','-Wl,macos', '-Wl,11.0', '-Wl,11.4']), - (1, f'{executable}: failed SDK')) - - def test_PE(self): - source = 'test1.c' - executable = 'test1.exe' - cc = determine_wellknown_cmd('CC', 'x86_64-w64-mingw32-gcc') - - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - PdhConnectMachineA(NULL); - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']), - (1, 'pdh.dll is not in ALLOWED_LIBRARIES!\n' + - executable + ': failed DYNAMIC_LIBRARIES')) - - source = 'test2.c' - executable = 'test2.exe' - - with open(source, 'w', encoding="utf8") as f: - f.write(''' - int main() - { - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-Wl,--major-subsystem-version', '-Wl,9', '-Wl,--minor-subsystem-version', '-Wl,9']), - (1, executable + ': failed SUBSYSTEM_VERSION')) - - source = 'test3.c' - executable = 'test3.exe' - with open(source, 'w', encoding="utf8") as f: - f.write(''' - #include - - int main() - { - CoFreeUnusedLibrariesEx(0,0); - return 0; - } - ''') - - self.assertEqual(call_symbol_check(cc, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']), - (0, '')) - - -if __name__ == '__main__': - unittest.main() diff --git a/contrib/devtools/test_deterministic_coverage.sh b/contrib/devtools/test_deterministic_coverage.sh deleted file mode 100755 index 8501c72f04..0000000000 --- a/contrib/devtools/test_deterministic_coverage.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-2020 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -# Test for deterministic coverage across unit test runs. - -export LC_ALL=C - -# Use GCOV_EXECUTABLE="gcov" if compiling with gcc. -# Use GCOV_EXECUTABLE="llvm-cov gcov" if compiling with clang. -GCOV_EXECUTABLE="gcov" - -# Disable tests known to cause non-deterministic behaviour and document the source or point of non-determinism. -NON_DETERMINISTIC_TESTS=( - "blockfilter_index_tests/blockfilter_index_initial_sync" # src/checkqueue.h: In CCheckQueue::Loop(): while (queue.empty()) { ... } - "coinselector_tests/knapsack_solver_test" # coinselector_tests.cpp: if (equal_sets(setCoinsRet, setCoinsRet2)) - "fs_tests/fsbridge_fstream" # deterministic test failure? - "miner_tests/CreateNewBlock_validity" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "scheduler_tests/manythreads" # scheduler.cpp: CScheduler::serviceQueue() - "scheduler_tests/singlethreadedscheduler_ordered" # scheduler.cpp: CScheduler::serviceQueue() - "txvalidationcache_tests/checkinputs_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "txvalidationcache_tests/tx_mempool_block_doublespend" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "txindex_tests/txindex_initial_sync" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "txvalidation_tests/tx_mempool_reject_coinbase" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "validation_block_tests/processnewblock_signals_ordering" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/coin_mark_dirty_immature_credit" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/dummy_input_size_test" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/importmulti_rescan" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/importwallet_rescan" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/ListCoins" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/scan_for_wallet_transactions" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) - "wallet_tests/wallet_disableprivkeys" # validation.cpp: if (GetMainSignals().CallbacksPending() > 10) -) - -TEST_BITCOIN_BINARY="src/test/test_bitcoin" - -print_usage() { - echo "Usage: $0 [custom test filter (default: all but known non-deterministic tests)] [number of test runs (default: 2)]" -} - -N_TEST_RUNS=2 -BOOST_TEST_RUN_FILTERS="" -if [[ $# != 0 ]]; then - if [[ $1 == "--help" ]]; then - print_usage - exit - fi - PARSED_ARGUMENTS=0 - if [[ $1 =~ [a-z] ]]; then - BOOST_TEST_RUN_FILTERS=$1 - PARSED_ARGUMENTS=$((PARSED_ARGUMENTS + 1)) - shift - fi - if [[ $1 =~ ^[0-9]+$ ]]; then - N_TEST_RUNS=$1 - PARSED_ARGUMENTS=$((PARSED_ARGUMENTS + 1)) - shift - fi - if [[ ${PARSED_ARGUMENTS} == 0 || $# -gt 2 || ${N_TEST_RUNS} -lt 2 ]]; then - print_usage - exit - fi -fi -if [[ ${BOOST_TEST_RUN_FILTERS} == "" ]]; then - BOOST_TEST_RUN_FILTERS="$(IFS=":"; echo "!${NON_DETERMINISTIC_TESTS[*]}" | sed 's/:/:!/g')" -else - echo "Using Boost test filter: ${BOOST_TEST_RUN_FILTERS}" - echo -fi - -if ! command -v gcov > /dev/null; then - echo "Error: gcov not installed. Exiting." - exit 1 -fi - -if ! command -v gcovr > /dev/null; then - echo "Error: gcovr not installed. Exiting." - exit 1 -fi - -if [[ ! -e ${TEST_BITCOIN_BINARY} ]]; then - echo "Error: Executable ${TEST_BITCOIN_BINARY} not found. Run \"./configure --enable-lcov\" and compile." - exit 1 -fi - -get_file_suffix_count() { - find src/ -type f -name "*.$1" | wc -l -} - -if [[ $(get_file_suffix_count gcno) == 0 ]]; then - echo "Error: Could not find any *.gcno files. The *.gcno files are generated by the compiler. Run \"./configure --enable-lcov\" and re-compile." - exit 1 -fi - -get_covr_filename() { - echo "gcovr.run-$1.txt" -} - -TEST_RUN_ID=0 -while [[ ${TEST_RUN_ID} -lt ${N_TEST_RUNS} ]]; do - TEST_RUN_ID=$((TEST_RUN_ID + 1)) - echo "[$(date +"%Y-%m-%d %H:%M:%S")] Measuring coverage, run #${TEST_RUN_ID} of ${N_TEST_RUNS}" - find src/ -type f -name "*.gcda" -exec rm {} \; - if [[ $(get_file_suffix_count gcda) != 0 ]]; then - echo "Error: Stale *.gcda files found. Exiting." - exit 1 - fi - TEST_OUTPUT_TEMPFILE=$(mktemp) - if ! BOOST_TEST_RUN_FILTERS="${BOOST_TEST_RUN_FILTERS}" ${TEST_BITCOIN_BINARY} > "${TEST_OUTPUT_TEMPFILE}" 2>&1; then - cat "${TEST_OUTPUT_TEMPFILE}" - rm "${TEST_OUTPUT_TEMPFILE}" - exit 1 - fi - rm "${TEST_OUTPUT_TEMPFILE}" - if [[ $(get_file_suffix_count gcda) == 0 ]]; then - echo "Error: Running the test suite did not create any *.gcda files. The gcda files are generated when the instrumented test programs are executed. Run \"./configure --enable-lcov\" and re-compile." - exit 1 - fi - GCOVR_TEMPFILE=$(mktemp) - if ! gcovr --gcov-executable "${GCOV_EXECUTABLE}" -r src/ > "${GCOVR_TEMPFILE}"; then - echo "Error: gcovr failed. Output written to ${GCOVR_TEMPFILE}. Exiting." - exit 1 - fi - GCOVR_FILENAME=$(get_covr_filename ${TEST_RUN_ID}) - mv "${GCOVR_TEMPFILE}" "${GCOVR_FILENAME}" - if grep -E "^TOTAL *0 *0 " "${GCOVR_FILENAME}"; then - echo "Error: Spurious gcovr output. Make sure the correct GCOV_EXECUTABLE variable is set in $0 (\"gcov\" for gcc, \"llvm-cov gcov\" for clang)." - exit 1 - fi - if [[ ${TEST_RUN_ID} != 1 ]]; then - COVERAGE_DIFF=$(diff -u "$(get_covr_filename 1)" "${GCOVR_FILENAME}") - if [[ ${COVERAGE_DIFF} != "" ]]; then - echo - echo "The line coverage is non-deterministic between runs. Exiting." - echo - echo "The test suite must be deterministic in the sense that the set of lines executed at least" - echo "once must be identical between runs. This is a necessary condition for meaningful" - echo "coverage measuring." - echo - echo "${COVERAGE_DIFF}" - exit 1 - fi - rm "${GCOVR_FILENAME}" - fi -done - -echo -echo "Coverage test passed: Deterministic coverage across ${N_TEST_RUNS} runs." -exit diff --git a/contrib/devtools/utils.py b/contrib/devtools/utils.py index 68ad1c3aba..8b4c67c6c0 100755 --- a/contrib/devtools/utils.py +++ b/contrib/devtools/utils.py @@ -8,10 +8,9 @@ import shutil import sys import os -from typing import List -def determine_wellknown_cmd(envvar, progname) -> List[str]: +def determine_wellknown_cmd(envvar, progname) -> list[str]: maybe_env = os.getenv(envvar) maybe_which = shutil.which(progname) if maybe_env: diff --git a/contrib/devtools/utxo_snapshot.sh b/contrib/devtools/utxo_snapshot.sh deleted file mode 100755 index dee25ff67b..0000000000 --- a/contrib/devtools/utxo_snapshot.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -export LC_ALL=C - -set -ueo pipefail - -if (( $# < 3 )); then - echo 'Usage: utxo_snapshot.sh ' - echo - echo " if is '-', don't produce a snapshot file but instead print the " - echo " expected assumeutxo hash" - echo - echo 'Examples:' - echo - echo " ./contrib/devtools/utxo_snapshot.sh 570000 utxo.dat ./src/bitcoin-cli -datadir=\$(pwd)/testdata" - echo ' ./contrib/devtools/utxo_snapshot.sh 570000 - ./src/bitcoin-cli' - exit 1 -fi - -GENERATE_AT_HEIGHT="${1}"; shift; -OUTPUT_PATH="${1}"; shift; -# Most of the calls we make take a while to run, so pad with a lengthy timeout. -BITCOIN_CLI_CALL="${*} -rpcclienttimeout=9999999" - -# Block we'll invalidate/reconsider to rewind/fast-forward the chain. -PIVOT_BLOCKHASH=$($BITCOIN_CLI_CALL getblockhash $(( GENERATE_AT_HEIGHT + 1 )) ) - -(>&2 echo "Rewinding chain back to height ${GENERATE_AT_HEIGHT} (by invalidating ${PIVOT_BLOCKHASH}); this may take a while") -${BITCOIN_CLI_CALL} invalidateblock "${PIVOT_BLOCKHASH}" - -if [[ "${OUTPUT_PATH}" = "-" ]]; then - (>&2 echo "Generating txoutset info...") - ${BITCOIN_CLI_CALL} gettxoutsetinfo | grep hash_serialized_2 | sed 's/^.*: "\(.\+\)\+",/\1/g' -else - (>&2 echo "Generating UTXO snapshot...") - ${BITCOIN_CLI_CALL} dumptxoutset "${OUTPUT_PATH}" -fi - -(>&2 echo "Restoring chain to original height; this may take a while") -${BITCOIN_CLI_CALL} reconsiderblock "${PIVOT_BLOCKHASH}" diff --git a/contrib/guix/INSTALL.md b/contrib/guix/INSTALL.md index bbd88e58f3..f9a79f6634 100644 --- a/contrib/guix/INSTALL.md +++ b/contrib/guix/INSTALL.md @@ -18,10 +18,10 @@ Otherwise, you may choose from one of the following options to install Guix: - Works on nearly all Linux distributions - Installs any release - Binary installation only, requires high level of trust -3. Using fanquake's **Docker image** [↗︎ external instructions][install-fanquake-docker] +3. Using fanquake's **container image** [↗︎ external instructions][install-fanquake-container] - Maintained by fanquake - Easy (automatically performs *some* setup) - - Works wherever Docker images work + - Works wherever container images work (Docker/Podman) - Installs any release - Binary installation only, requires high level of trust 4. Using a **distribution-maintained package** [⤓ skip to section][install-distro-pkg] @@ -57,14 +57,11 @@ Regardless of which installation option you chose, the changes to `/etc/profile.d` will not take effect until the next shell or desktop session, so you should log out and log back in. -## Option 3: Using fanquake's Docker image +## Option 3: Using fanquake's container image Please refer to fanquake's instructions [here](https://github.com/fanquake/core-review/tree/master/guix). -Note that the `Dockerfile` is largely equivalent to running through the binary -tarball installation steps. - ## Option 4: Using a distribution-maintained package Note that this section is based on the distro packaging situation at the time of @@ -74,25 +71,15 @@ https://repology.org/project/guix/versions ### Debian / Ubuntu -Guix v1.2.0 is available as a distribution package starting in [Debian -11](https://packages.debian.org/bullseye/guix) and [Ubuntu -21.04](https://packages.ubuntu.com/search?keywords=guix). - -Note that if you intend on using Guix without using any substitutes (more -details [here][security-model]), v1.2.0 has a known problem when building GnuTLS -from source. Solutions and workarounds are documented -[here](#gnutls-test-suite-fail-status-request-revoked). - +Guix is available as a distribution package in [Debian +](https://packages.debian.org/search?keywords=guix) and [Ubuntu +](https://packages.ubuntu.com/search?keywords=guix). To install: ```sh sudo apt install guix ``` -For up-to-date information on Debian and Ubuntu's release history: -- [Debian release history](https://www.debian.org/releases/) -- [Ubuntu release history](https://ubuntu.com/about/release-cycle) - ### Arch Linux Guix is available in the AUR as @@ -167,80 +154,41 @@ For reference, the graphic below outlines Guix v1.3.0's dependency graph: ![bootstrap map](https://user-images.githubusercontent.com/6399679/125064185-a9a59880-e0b0-11eb-82c1-9b8e5dc9950d.png) -#### Consider /tmp on tmpfs - -If you use an NVME (SSD) drive, you may encounter [cryptic build errors](#coreutils-fail-teststail-2inotify-dir-recreate). Mounting a [tmpfs at /tmp](https://ubuntu.com/blog/data-driven-analysis-tmp-on-tmpfs) should prevent this and may improve performance as a bonus. - -#### Guile - -##### Choosing a Guile version and sticking to it - -One of the first things you need to decide is which Guile version you want to -use: Guile v2.2 or Guile v3.0. Unlike the python2 to python3 transition, Guile -v2.2 and Guile v3.0 are largely compatible, as evidenced by the fact that most -Guile packages and even [Guix -itself](https://guix.gnu.org/en/blog/2020/guile-3-and-guix/) support running on -both. - -What is important here is that you **choose one**, and you **remain consistent** -with your choice throughout **all Guile-related packages**, no matter if they -are installed via the distribution's package manager or installed from source. -This is because the files for Guile packages are installed to directories which -are separated based on the Guile version. - -###### Example: Checking that Ubuntu's `guile-git` is compatible with your chosen Guile version - -On Ubuntu Focal: +If you do not care about building each dependency from source, and Guix is +already packaged for your distribution, you can easily install only the build +dependencies of Guix. For example, to enable deb-src and install the Guix build +dependencies on Ubuntu/Debian: ```sh -$ apt show guile-git -Package: guile-git -... -Depends: guile-2.2, guile-bytestructures, libgit2-dev -... +sed -i 's|# deb-src|deb-src|g' /etc/apt/sources.list +apt update +apt-get build-dep -y guix ``` -As you can see, the package `guile-git` depends on `guile-2.2`, meaning that it -was likely built for Guile v2.2. This means that if you decided to use Guile -v3.0 on Ubuntu Focal, you would need to build guile-git from source instead of -using the distribution package. +If this succeeded, you can likely skip to section +["Building and Installing Guix itself"](#building-and-installing-guix-itself). -On Ubuntu Hirsute: - -```sh -$ apt show guile-git -Package: guile-git -... -Depends: guile-3.0 | guile-2.2, guile-bytestructures (>= 1.0.7-3~), libgit2-dev (>= 1.0) -... -``` - -In this case, `guile-git` depends on either `guile-3.0` or `guile-2.2`, meaning -that it would work no matter what Guile version you decided to use. +#### Guile ###### Corner case: Multiple versions of Guile on one system -It is recommended to only install one version of Guile, so that build systems do +It is recommended to only install the required version of Guile, so that build systems do not get confused about which Guile to use. -However, if you insist on having both Guile v2.2 and Guile v3.0 installed on -your system, then you need to **consistently** specify one of -`GUILE_EFFECTIVE_VERSION=3.0` or `GUILE_EFFECTIVE_VERSION=2.2` to all +However, if you insist on having more versions of Guile installed on +your system, then you need to **consistently** specify +`GUILE_EFFECTIVE_VERSION=3.0` to all `./configure` invocations for Guix and its dependencies. ##### Installing Guile -Guile is most likely already packaged for your distribution, so after you have -[chosen a Guile version](#choosing-a-guile-version-and-sticking-to-it), install -it via your distribution's package manager. - If your distribution splits packages into `-dev`-suffixed and non-`-dev`-suffixed sub-packages (as is the case for Debian-derived distributions), please make sure to install both. For example, to install Guile -v2.2 on Debian/Ubuntu: +v3.0 on Debian/Ubuntu: ```sh -apt install guile-2.2 guile-2.2-dev +apt install guile-3.0 guile-3.0-dev ``` #### Mixing distribution packages and source-built packages @@ -258,16 +206,16 @@ source-built packages, you will need to augment the `GUILE_LOAD_PATH` and `GUILE_LOAD_COMPILED_PATH` environment variables so that Guile will look under the right prefix and find your source-built packages. -For example, if you are using Guile v2.2, and have Guile packages in the +For example, if you are using Guile v3.0, and have Guile packages in the `/usr/local` prefix, either add the following lines to your `.profile` or `.bash_profile` so that the environment variable is properly set for all future shell logins, or paste the lines into a POSIX-style shell to temporarily modify the environment variables of your current shell session. ```sh -# Help Guile v2.2.x find packages in /usr/local -export GUILE_LOAD_PATH="/usr/local/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" -export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/2.2/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH" +# Help Guile v3.0.x find packages in /usr/local +export GUILE_LOAD_PATH="/usr/local/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH" +export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH" ``` Note that these environment variables are used to check for packages during @@ -352,7 +300,7 @@ Relevant for: - Those installing `guile-git` from their distribution where `guile-git` is built against `libgit2 < 1.1` -As of v0.4.0, `guile-git` claims to only require `libgit2 >= 0.28.0`, however, +As of v0.5.2, `guile-git` claims to only require `libgit2 >= 0.28.0`, however, it actually requires `libgit2 >= 1.1`, otherwise, it will be confused by a reference of `origin/keyring`: instead of interpreting the reference as "the 'keyring' branch of the 'origin' remote", the reference is interpreted as "the @@ -366,33 +314,17 @@ Should you be in this situation, you need to build both `libgit2 v1.1.x` and Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527 -##### `{scheme,guile}-bytestructures` v1.0.8 and v1.0.9 are broken for Guile v2.2 - -Relevant for: -- Those building `{scheme,guile}-bytestructures` from source against Guile v2.2 - -Commit -[707eea3](https://github.com/TaylanUB/scheme-bytestructures/commit/707eea3a85e1e375e86702229ebf73d496377669) -introduced a regression for Guile v2.2 and was first included in v1.0.8, this -was later corrected in commit -[ec9a721](https://github.com/TaylanUB/scheme-bytestructures/commit/ec9a721957c17bcda13148f8faa5f06934431ff7) -and included in v1.1.0. - -TL;DR If you decided to use Guile v2.2, do not use `{scheme,guile}-bytestructures` v1.0.8 or v1.0.9. - ### Building and Installing Guix itself Start by cloning Guix: ``` -git clone https://git.savannah.gnu.org/git/guix.git +git clone https://codeberg.org/guix/guix.git cd guix ``` -You will likely want to build the latest release, however, if the latest release -when you're reading this is still 1.3.0 then you may want to use 998eda30 instead -to avoid the issues described in [#25099]( -https://github.com/bitcoin/bitcoin/pull/25099). +You will likely want to build the latest release. +At the time of writing (November 2023), the latest release was `v1.4.0`. ``` git branch -a -l 'origin/version-*' # check for the latest release @@ -483,7 +415,7 @@ make it "what Guix intended", then read the next few subsections. This section definitely does not apply to you if you installed Guix using: 1. The shell installer script -2. fanquake's Docker image +2. fanquake's container image 3. Debian's `guix` package #### Background @@ -524,7 +456,7 @@ Alternately, see `guix package --search-paths -p "$HOME/.guix-profile"'. However, this is somewhat tedious to do for both `guix pull` and `guix install` for each user on the system that wants to properly use `guix`. I recommend that -you instead add an entry to `/etc/profile.d` instead. This is done by default +you add an entry to `/etc/profile.d` instead. This is done by default when installing the Debian package later than 1.2.0-4 and when using the shell script installer. @@ -578,7 +510,7 @@ sudo --login guix pull --commit= ``` `guix pull` is quite a long process (especially if you're using -`--no-substitute`). If you encounter build problems, please refer to the +`--no-substitutes`). If you encounter build problems, please refer to the [troubleshooting section](#troubleshooting). Note that running a bare `guix pull` with no commit or branch specified will @@ -616,7 +548,7 @@ systemctl enable guix-daemon systemctl start guix-daemon ``` -Remember to set `--no-substitute` in `$libdir/systemd/system/guix-daemon.service` and other customizations if you used them for `guix-daemon-original.service`. +Remember to set `--no-substitutes` in `$libdir/systemd/system/guix-daemon.service` and other customizations if you used them for `guix-daemon-original.service`. ##### If you installed Guix via the Debian/Ubuntu distribution packages @@ -675,7 +607,7 @@ checklist. ``` Generation 38 Feb 22 2021 16:39:31 (current) guix f350df4 - repository URL: https://git.savannah.gnu.org/git/guix.git + repository URL: https://codeberg.org/guix/guix.git branch: version-1.2.0 commit: f350df405fbcd5b9e27e6b6aa500da7f101f41e7 ``` @@ -726,26 +658,20 @@ $ bzcat /var/log/guix/drvs/../...-foo-3.6.12.drv.bz2 | less times, it may be `/tmp/...drv-1` or `/tmp/...drv-2`. Always consult the build failure output for the most accurate, up-to-date information. -### openssl-1.1.1l and openssl-1.1.1n - -OpenSSL includes tests that will fail once some certificate has expired. A workaround -is to change your system clock: - -```sh -sudo timedatectl set-ntp no -sudo date --set "28 may 2022 15:00:00" -sudo --login guix build --cores=1 /gnu/store/g9alz81w4q03ncm542487xd001s6akd4-openssl-1.1.1l.drv -sudo --login guix build --cores=1 /gnu/store/mw6ax0gk33gh082anrdrxp2flrbskxv6-openssl-1.1.1n.drv -sudo timedatectl set-ntp yes -``` - ### python(-minimal): [Errno 84] Invalid or incomplete multibyte or wide character This error occurs when your `$TMPDIR` (default: /tmp) exists on a filesystem which rejects characters not present in the UTF-8 character code set. An example is ZFS with the utf8only=on option set. -More information: https://bugs.python.org/issue37584 +More information: https://github.com/python/cpython/issues/81765 + +### openssl-1.1.1l and openssl-1.1.1n + +OpenSSL includes tests that will fail once some certificate has expired. +The workarounds from the GnuTLS section immediately below can be used. + +For openssl-1.1.1l use 2022-05-01 as the date. ### GnuTLS: test-suite FAIL: status-request-revoked @@ -781,13 +707,42 @@ authorized. This workaround was described [here](https://issues.guix.gnu.org/44559#5). Basically: -1. Turn off networking -2. Turn off NTP -3. Set system time to 2020-10-01 -4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv -5. Set system time back to accurate current time -6. Turn NTP back on -7. Turn networking back on + +1. Turn off NTP +2. Set system time to 2020-10-01 +3. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv +4. Set system time back to accurate current time +5. Turn NTP back on + +For example, + +```sh +sudo timedatectl set-ntp no +sudo date --set "01 oct 2020 15:00:00" +guix build /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv +sudo timedatectl set-ntp yes +``` + +#### Workaround 3: Disable the tests in the Guix source code for this single derivation + +If all of the above workarounds fail, you can also disable the `tests` phase of +the derivation via the `arguments` option, as described in the official +[`package` +reference](https://guix.gnu.org/manual/en/html_node/package-Reference.html). + +For example, to disable the openssl-1.1 check phase: + +```diff +diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm +index f1e844b..1077c4b 100644 +--- a/gnu/packages/tls.scm ++++ b/gnu/packages/tls.scm +@@ -494,4 +494,5 @@ (define-public openssl-1.1 + (arguments + `(#:parallel-tests? #f ++ #:tests? #f + #:test-target "test" +``` ### coreutils: FAIL: tests/tail-2/inotify-dir-recreate @@ -796,7 +751,7 @@ The inotify-dir-create test fails on "remote" filesystems such as overlayfs as non-remote. A relatively easy workaround to this is to make sure that a somewhat traditional -filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds), see [/tmp on tmpfs](#consider-tmp-on-tmpfs). For +filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds). For Docker users, this might mean [using a volume][docker/volumes], [binding mounting][docker/bind-mnt] from host, or (for those with enough RAM and swap) [mounting a tmpfs][docker/tmpfs] using the `--tmpfs` flag. @@ -805,13 +760,13 @@ Please see the following links for more details: - An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940) - A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5) -- A commit to skip this test in Guix has been merged into the core-updates branch: -[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4) +- A commit to skip this test is included since Guix 1.4.0: +[codeberg/guix@6ba1058](https://codeberg.org/guix/guix/commit/6ba1058df0c4ce5611c2367531ae5c3cdc729ab4) [install-script]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball [install-bin-tarball]: #options-1-and-2-using-the-official-shell-installer-script-or-binary-tarball -[install-fanquake-docker]: #option-3-using-fanquakes-docker-image +[install-fanquake-container]: #option-3-using-fanquakes-container-image [install-distro-pkg]: #option-4-using-a-distribution-maintained-package [install-source]: #option-5-building-from-source diff --git a/contrib/guix/README.md b/contrib/guix/README.md index c0feb486ff..7f6b8232bb 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -11,7 +11,7 @@ We achieve bootstrappability by using Guix as a functional package manager. # Requirements -Conservatively, you will need an x86_64 machine with: +Conservatively, you will need: - 16GB of free disk space on the partition that /gnu/store will reside in - 8GB of free disk space **per platform triple** you're planning on building @@ -31,7 +31,7 @@ section](#choosing-your-security-model) before proceeding to perform a build. In order to perform a build for macOS (which is included in the default set of platform triples to build), you'll need to extract the macOS SDK tarball using -tools found in the [`macdeploy` directory](../macdeploy/README.md). +tools found in the [`macdeploy` directory](../macdeploy/README.md#sdk-extraction). You can then either point to the SDK using the `SDK_PATH` environment variable: @@ -68,7 +68,7 @@ following from the top of a clean repository: The `guix-codesign` command attaches codesignatures (produced by codesigners) to existing non-codesigned outputs. Please see the [release process -documentation](/doc/release-process.md) for more context. +documentation](/doc/release-process.md#codesigning) for more context. It respects many of the same environment variable flags as `guix-build`, with 2 crucial differences: @@ -247,7 +247,7 @@ details. * _**SDK_PATH**_ Set the path where _extracted_ SDKs can be found. This is passed through to - the depends tree. Note that this is should be set to the _parent_ directory of + the depends tree. Note that this should be set to the _parent_ directory of the actual SDK (e.g. `SDK_PATH=$HOME/Downloads/macOS-SDKs` instead of `$HOME/Downloads/macOS-SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers`). @@ -259,8 +259,9 @@ details. Override the number of jobs to run simultaneously, you might want to do so on a memory-limited machine. This may be passed to: - - `guix` build commands as in `guix environment --cores="$JOBS"` + - `guix` build commands as in `guix shell --cores="$JOBS"` - `make` as in `make --jobs="$JOBS"` + - `cmake` as in `cmake --build build -j "$JOBS"` - `xargs` as in `xargs -P"$JOBS"` See [here](#controlling-the-number-of-threads-used-by-guix-build-commands) for @@ -301,7 +302,7 @@ details. * _**ADDITIONAL_GUIX_ENVIRONMENT_FLAGS**_ - Additional flags to be passed to the invocation of `guix environment` inside + Additional flags to be passed to the invocation of `guix shell` inside `guix time-machine`. # Choosing your security model @@ -364,12 +365,6 @@ Where `` is likely: - `/usr/local` if you installed Guix from source and didn't supply any prefix-modifying flags to Guix's `./configure` -For dongcarl's substitute server at https://guix.carldong.io, run as root: - -```sh -wget -qO- 'https://guix.carldong.io/signing-key.pub' | guix archive --authorize -``` - #### Removing authorized keys To remove previously authorized keys, simply edit `/etc/guix/acl` and remove the @@ -381,28 +376,28 @@ Once its key is authorized, the official Guix build farm at https://ci.guix.gnu.org is automatically used unless the `--no-substitutes` flag is supplied. This default list of substitute servers is overridable both on a `guix-daemon` level and when you invoke `guix` commands. See examples below for -the various ways of adding dongcarl's substitute server after having [authorized -his signing key](#step-1-authorize-the-signing-keys). +the various ways of adding a substitute server after having [authorized +its signing key](#step-1-authorize-the-signing-keys). Change the **default list** of substitute servers by starting `guix-daemon` with the `--substitute-urls` option (you will likely need to edit your init script): ```sh -guix-daemon --substitute-urls='https://guix.carldong.io https://ci.guix.gnu.org' +guix-daemon --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' ``` Override the default list of substitute servers by passing the `--substitute-urls` option for invocations of `guix` commands: ```sh -guix --substitute-urls='https://guix.carldong.io https://ci.guix.gnu.org' +guix --substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' ``` For scripts under `./contrib/guix`, set the `SUBSTITUTE_URLS` environment variable: ```sh -export SUBSTITUTE_URLS='https://guix.carldong.io https://ci.guix.gnu.org' +export SUBSTITUTE_URLS='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' ``` ## Option 2: Disabling substitutes on an ad-hoc basis diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build index 74b24b9612..2ea574fe4b 100755 --- a/contrib/guix/guix-build +++ b/contrib/guix/guix-build @@ -74,7 +74,8 @@ mkdir -p "$VERSION_BASE" ################ # Default to building for all supported HOSTs (overridable by environment) -export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu powerpc64le-linux-gnu +# powerpc64le-linux-gnu currently disabled due non-determinism issues across build arches. +export HOSTS="${HOSTS:-x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu powerpc64-linux-gnu x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin}" @@ -360,12 +361,16 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}: ...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")' ...outputting in: '$(outdir_for_host "$HOST")' ...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")' + ADDITIONAL FLAGS (if set) + ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS} + ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} + ADDITIONAL_GUIX_TIMEMACHINE_FLAGS: ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} EOF # Run the build script 'contrib/guix/libexec/build.sh' in the build # container specified by 'contrib/guix/manifest.scm'. # - # Explanation of `guix environment` flags: + # Explanation of `guix shell` flags: # # --container run command within an isolated container # @@ -428,7 +433,7 @@ EOF # more information. # # shellcheck disable=SC2086,SC2031 - time-machine environment --manifest="${PWD}/contrib/guix/manifest.scm" \ + time-machine shell --manifest="${PWD}/contrib/guix/manifest.scm" \ --container \ --pure \ --no-cwd \ diff --git a/contrib/guix/guix-codesign b/contrib/guix/guix-codesign index 3279d431aa..dedee135b4 100755 --- a/contrib/guix/guix-codesign +++ b/contrib/guix/guix-codesign @@ -137,7 +137,7 @@ fi ################ -# Unsigned tarballs SHOULD exist +# Codesigning tarballs SHOULD exist ################ # Usage: outdir_for_host HOST SUFFIX @@ -149,13 +149,13 @@ outdir_for_host() { } -unsigned_tarball_for_host() { +codesigning_tarball_for_host() { case "$1" in *mingw*) - echo "$(outdir_for_host "$1")/${DISTNAME}-win64-unsigned.tar.gz" + echo "$(outdir_for_host "$1")/${DISTNAME}-win64-codesigning.tar.gz" ;; *darwin*) - echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-unsigned.tar.gz" + echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-codesigning.tar.gz" ;; *) exit 1 @@ -164,22 +164,22 @@ unsigned_tarball_for_host() { } # Accumulate a list of build directories that already exist... -hosts_unsigned_tarball_missing="" +hosts_codesigning_tarball_missing="" for host in $HOSTS; do - if [ ! -e "$(unsigned_tarball_for_host "$host")" ]; then - hosts_unsigned_tarball_missing+=" ${host}" + if [ ! -e "$(codesigning_tarball_for_host "$host")" ]; then + hosts_codesigning_tarball_missing+=" ${host}" fi done -if [ -n "$hosts_unsigned_tarball_missing" ]; then +if [ -n "$hosts_codesigning_tarball_missing" ]; then # ...so that we can print them out nicely in an error message cat << EOF -ERR: Unsigned tarballs do not exist +ERR: Codesigning tarballs do not exist ... EOF -for host in $hosts_unsigned_tarball_missing; do - echo " ${host} '$(unsigned_tarball_for_host "$host")'" +for host in $hosts_codesigning_tarball_missing; do + echo " ${host} '$(codesigning_tarball_for_host "$host")'" done exit 1 fi @@ -286,7 +286,7 @@ EOF # Run the build script 'contrib/guix/libexec/build.sh' in the build # container specified by 'contrib/guix/manifest.scm'. # - # Explanation of `guix environment` flags: + # Explanation of `guix shell` flags: # # --container run command within an isolated container # @@ -343,7 +343,7 @@ EOF # more information. # # shellcheck disable=SC2086,SC2031 - time-machine environment --manifest="${PWD}/contrib/guix/manifest.scm" \ + time-machine shell --manifest="${PWD}/contrib/guix/manifest.scm" \ --container \ --pure \ --no-cwd \ @@ -371,7 +371,7 @@ EOF OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST" codesigned)" \ DIST_ARCHIVE_BASE=/outdir-base/dist-archive \ DETACHED_SIGS_REPO=/detached-sigs \ - UNSIGNED_TARBALL="$(OUTDIR_BASE=/outdir-base && unsigned_tarball_for_host "$HOST")" \ + CODESIGNING_TARBALL="$(OUTDIR_BASE=/outdir-base && codesigning_tarball_for_host "$HOST")" \ bash -c "cd /bitcoin && bash contrib/guix/libexec/codesign.sh" ) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index 7ca2722098..ae98eba744 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -8,7 +8,7 @@ export TZ=UTC # Although Guix _does_ set umask when building its own packages (in our case, # this is all packages in manifest.scm), it does not set it for `guix -# environment`. It does make sense for at least `guix environment --container` +# shell`. It does make sense for at least `guix shell --container` # to set umask, so if that change gets merged upstream and we bump the # time-machine to a commit which includes the aforementioned change, we can # remove this line. @@ -61,7 +61,6 @@ store_path() { # Set environment variables to point the NATIVE toolchain to the right # includes/libs NATIVE_GCC="$(store_path gcc-toolchain)" -NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)" unset LIBRARY_PATH unset CPATH @@ -70,11 +69,18 @@ unset CPLUS_INCLUDE_PATH unset OBJC_INCLUDE_PATH unset OBJCPLUS_INCLUDE_PATH -export LIBRARY_PATH="${NATIVE_GCC}/lib:${NATIVE_GCC_STATIC}/lib" -export C_INCLUDE_PATH="${NATIVE_GCC}/include" -export CPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include" -export OBJC_INCLUDE_PATH="${NATIVE_GCC}/include" -export OBJCPLUS_INCLUDE_PATH="${NATIVE_GCC}/include/c++:${NATIVE_GCC}/include" +# Set native toolchain +build_CC="${NATIVE_GCC}/bin/gcc -isystem ${NATIVE_GCC}/include" +build_CXX="${NATIVE_GCC}/bin/g++ -isystem ${NATIVE_GCC}/include/c++ -isystem ${NATIVE_GCC}/include" + +case "$HOST" in + *darwin*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; # Required for qt/qmake + *mingw*) export LIBRARY_PATH="${NATIVE_GCC}/lib" ;; + *) + NATIVE_GCC_STATIC="$(store_path gcc-toolchain static)" + export LIBRARY_PATH="${NATIVE_GCC}/lib:${NATIVE_GCC_STATIC}/lib" + ;; +esac # Set environment variables to point the CROSS toolchain to the right # includes/libs for $HOST @@ -126,24 +132,12 @@ for p in "${PATHS[@]}"; do done # Disable Guix ld auto-rpath behavior -case "$HOST" in - *darwin*) - # The auto-rpath behavior is necessary for darwin builds as some native - # tools built by depends refer to and depend on Guix-built native - # libraries - # - # After the native packages in depends are built, the ld wrapper should - # no longer affect our build, as clang would instead reach for - # x86_64-apple-darwin-ld from cctools - ;; - *) export GUIX_LD_WRAPPER_DISABLE_RPATH=yes ;; -esac +export GUIX_LD_WRAPPER_DISABLE_RPATH=yes # Make /usr/bin if it doesn't exist [ -e /usr/bin ] || mkdir -p /usr/bin -# Symlink file and env to a conventional path -[ -e /usr/bin/file ] || ln -s --no-dereference "$(command -v file)" /usr/bin/file +# Symlink env to a conventional path [ -e /usr/bin/env ] || ln -s --no-dereference "$(command -v env)" /usr/bin/env # Determine the correct value for -Wl,--dynamic-linker for the current $HOST @@ -166,16 +160,6 @@ esac # Environment variables for determinism export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name" export TZ="UTC" -case "$HOST" in - *darwin*) - # cctools AR, unlike GNU binutils AR, does not have a deterministic mode - # or a configure flag to enable determinism by default, it only - # understands if this env-var is set or not. See: - # - # https://github.com/tpoechtrager/cctools-port/blob/55562e4073dea0fbfd0b20e0bf69ffe6390c7f97/cctools/ar/archive.c#L334 - export ZERO_AR_DATE=yes - ;; -esac #################### # Depends Building # @@ -187,14 +171,21 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \ ${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \ ${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \ ${SDK_PATH+SDK_PATH="$SDK_PATH"} \ + ${build_CC+build_CC="$build_CC"} \ + ${build_CXX+build_CXX="$build_CXX"} \ x86_64_linux_CC=x86_64-linux-gnu-gcc \ x86_64_linux_CXX=x86_64-linux-gnu-g++ \ x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \ x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \ x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \ - x86_64_linux_STRIP=x86_64-linux-gnu-strip \ - FORCE_USE_SYSTEM_CLANG=1 + x86_64_linux_STRIP=x86_64-linux-gnu-strip +case "$HOST" in + *darwin*) + # Unset now that Qt is built + unset LIBRARY_PATH + ;; +esac ########################### # Source Tarball Building # @@ -215,13 +206,12 @@ mkdir -p "$OUTDIR" ########################### # CONFIGFLAGS -CONFIGFLAGS="--enable-reduce-exports --disable-bench --disable-gui-tests --disable-fuzz-binary" +CONFIGFLAGS="-DREDUCE_EXPORTS=ON -DBUILD_BENCH=OFF -DBUILD_GUI_TESTS=OFF -DBUILD_FUZZ_BINARY=OFF" # CFLAGS HOST_CFLAGS="-O2 -g" HOST_CFLAGS+=$(find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) case "$HOST" in - *linux*) HOST_CFLAGS+=" -ffile-prefix-map=${PWD}=." ;; *mingw*) HOST_CFLAGS+=" -fno-ident" ;; *darwin*) unset HOST_CFLAGS ;; esac @@ -239,8 +229,6 @@ case "$HOST" in *mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;; esac -# Make $HOST-specific native binaries from depends available in $PATH -export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}" mkdir -p "$DISTSRC" ( cd "$DISTSRC" @@ -248,38 +236,29 @@ mkdir -p "$DISTSRC" # Extract the source tarball tar --strip-components=1 -xf "${GIT_ARCHIVE}" - ./autogen.sh - # Configure this DISTSRC for $HOST # shellcheck disable=SC2086 - env CONFIG_SITE="${BASEPREFIX}/${HOST}/share/config.site" \ - ./configure --prefix=/ \ - --disable-ccache \ - --disable-maintainer-mode \ - --disable-dependency-tracking \ - ${CONFIGFLAGS} \ - ${HOST_CFLAGS:+CFLAGS="${HOST_CFLAGS}"} \ - ${HOST_CXXFLAGS:+CXXFLAGS="${HOST_CXXFLAGS}"} \ - ${HOST_LDFLAGS:+LDFLAGS="${HOST_LDFLAGS}"} - - sed -i.old 's/-lstdc++ //g' config.status libtool + env CFLAGS="${HOST_CFLAGS}" CXXFLAGS="${HOST_CXXFLAGS}" LDFLAGS="${HOST_LDFLAGS}" \ + cmake -S . -B build \ + --toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \ + -DWITH_CCACHE=OFF \ + ${CONFIGFLAGS} # Build Bitcoin Core - make --jobs="$JOBS" ${V:+V=1} + cmake --build build -j "$JOBS" ${V:+--verbose} - # Check that symbol/security checks tools are sane. - make test-security-check ${V:+V=1} # Perform basic security checks on a series of executables. - make -C src --jobs=1 check-security ${V:+V=1} + cmake --build build -j 1 --target check-security ${V:+--verbose} # Check that executables only contain allowed version symbols. - make -C src --jobs=1 check-symbols ${V:+V=1} + cmake --build build -j 1 --target check-symbols ${V:+--verbose} mkdir -p "$OUTDIR" # Make the os-specific installers case "$HOST" in *mingw*) - make deploy ${V:+V=1} BITCOIN_WIN_INSTALLER="${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" + cmake --build build -j "$JOBS" -t deploy ${V:+--verbose} + mv build/bitcoin-win64-setup.exe "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" ;; esac @@ -291,57 +270,27 @@ mkdir -p "$DISTSRC" # Install built Bitcoin Core to $INSTALLPATH case "$HOST" in *darwin*) - make install-strip DESTDIR="${INSTALLPATH}" ${V:+V=1} + # This workaround can be dropped for CMake >= 3.27. + # See the upstream commit 689616785f76acd844fd448c51c5b2a0711aafa2. + find build -name 'cmake_install.cmake' -exec sed -i 's| -u -r | |g' {} + + + cmake --install build --strip --prefix "${INSTALLPATH}" ${V:+--verbose} ;; *) - make install DESTDIR="${INSTALLPATH}" ${V:+V=1} + cmake --install build --prefix "${INSTALLPATH}" ${V:+--verbose} ;; esac - case "$HOST" in - *darwin*) - make osx_volname ${V:+V=1} - make deploydir ${V:+V=1} - mkdir -p "unsigned-app-${HOST}" - cp --target-directory="unsigned-app-${HOST}" \ - osx_volname \ - contrib/macdeploy/detached-sig-create.sh - mv --target-directory="unsigned-app-${HOST}" dist - ( - cd "unsigned-app-${HOST}" - find . -print0 \ - | sort --zero-terminated \ - | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ - | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 ) - ) - make deploy ${V:+V=1} OSX_DMG="${OUTDIR}/${DISTNAME}-${HOST}-unsigned.dmg" - ;; - esac ( cd installed - case "$HOST" in - *mingw*) - mv --target-directory="$DISTNAME"/lib/ "$DISTNAME"/bin/*.dll - ;; - esac - - # Prune libtool and object archives - find . -name "lib*.la" -delete - find . -name "lib*.a" -delete - - # Prune pkg-config files - rm -rf "${DISTNAME}/lib/pkgconfig" - case "$HOST" in *darwin*) ;; *) - # Split binaries and libraries from their debug symbols + # Split binaries from their debug symbols { find "${DISTNAME}/bin" -type f -executable -print0 - find "${DISTNAME}/lib" -type f -print0 - } | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/contrib/devtools/split-debug.sh" {} {} {}.dbg + } | xargs -0 -P"$JOBS" -I{} "${DISTSRC}/build/split-debug.sh" {} {} {}.dbg ;; esac @@ -360,7 +309,7 @@ mkdir -p "$DISTSRC" cp -r "${DISTSRC}/share/rpcauth" "${DISTNAME}/share/" - # Finally, deterministically produce {non-,}debug binary tarballs ready + # Deterministically produce {non-,}debug binary tarballs ready # for release case "$HOST" in *mingw*) @@ -368,8 +317,8 @@ mkdir -p "$DISTSRC" | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" find "${DISTNAME}" -not -name "*.dbg" \ | sort \ - | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 ) + | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" && exit 1 ) find "${DISTNAME}" -name "*.dbg" -print0 \ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" find "${DISTNAME}" -name "*.dbg" \ @@ -393,12 +342,13 @@ mkdir -p "$DISTSRC" find "${DISTNAME}" -print0 \ | sort --zero-terminated \ | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ - | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 ) + | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 ) ;; esac ) # $DISTSRC/installed + # Finally make tarballs for codesigning case "$HOST" in *mingw*) cp -rf --target-directory=. contrib/windeploy @@ -406,11 +356,31 @@ mkdir -p "$DISTSRC" cd ./windeploy mkdir -p unsigned cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe" + cp -r --target-directory=unsigned/ "${INSTALLPATH}" + find unsigned/ -name "*.dbg" -print0 \ + | xargs -0r rm + find . -print0 \ + | sort --zero-terminated \ + | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ + | gzip -9n > "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" && exit 1 ) + ) + ;; + *darwin*) + cmake --build build --target deploy ${V:+--verbose} + mv build/dist/Bitcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip" + mkdir -p "unsigned-app-${HOST}" + cp --target-directory="unsigned-app-${HOST}" \ + contrib/macdeploy/detached-sig-create.sh + mv --target-directory="unsigned-app-${HOST}" build/dist + cp -r --target-directory="unsigned-app-${HOST}" "${INSTALLPATH}" + ( + cd "unsigned-app-${HOST}" find . -print0 \ | sort --zero-terminated \ | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ - | gzip -9n > "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" \ - || ( rm -f "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" && exit 1 ) + | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" && exit 1 ) ) ;; esac diff --git a/contrib/guix/libexec/codesign.sh b/contrib/guix/libexec/codesign.sh index 6ffa0f07b2..3a72937111 100755 --- a/contrib/guix/libexec/codesign.sh +++ b/contrib/guix/libexec/codesign.sh @@ -4,11 +4,14 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C set -e -o pipefail + +# Environment variables for determinism +export TAR_OPTIONS="--owner=0 --group=0 --numeric-owner --mtime='@${SOURCE_DATE_EPOCH}' --sort=name" export TZ=UTC # Although Guix _does_ set umask when building its own packages (in our case, # this is all packages in manifest.scm), it does not set it for `guix -# environment`. It does make sense for at least `guix environment --container` +# shell`. It does make sense for at least `guix shell --container` # to set umask, so if that change gets merged upstream and we bump the # time-machine to a commit which includes the aforementioned change, we can # remove this line. @@ -27,7 +30,7 @@ fi # Check that required environment variables are set cat << EOF Required environment variables as seen inside the container: - UNSIGNED_TARBALL: ${UNSIGNED_TARBALL:?not set} + CODESIGNING_TARBALL: ${CODESIGNING_TARBALL:?not set} DETACHED_SIGS_REPO: ${DETACHED_SIGS_REPO:?not set} DIST_ARCHIVE_BASE: ${DIST_ARCHIVE_BASE:?not set} DISTNAME: ${DISTNAME:?not set} @@ -63,33 +66,69 @@ mkdir -p "$DISTSRC" ( cd "$DISTSRC" - tar -xf "$UNSIGNED_TARBALL" + tar -xf "$CODESIGNING_TARBALL" mkdir -p codesignatures tar -C codesignatures -xf "$CODESIGNATURE_GIT_ARCHIVE" case "$HOST" in *mingw*) - find "$PWD" -name "*-unsigned.exe" | while read -r infile; do - infile_base="$(basename "$infile")" - - # Codesigned *-unsigned.exe and output to OUTDIR + # Apply detached codesignatures + WORKDIR=".tmp" + mkdir -p ${WORKDIR} + cp -r --target-directory="${WORKDIR}" "unsigned/${DISTNAME}" + find "${WORKDIR}/${DISTNAME}" -name "*.exe" -type f -exec rm {} \; + find unsigned/ -name "*.exe" -type f | while read -r bin + do + bin_base="$(realpath --relative-to=unsigned/ "${bin}")" + mkdir -p "${WORKDIR}/$(dirname "${bin_base}")" osslsigncode attach-signature \ - -in "$infile" \ - -out "${OUTDIR}/${infile_base/-unsigned}" \ + -in "${bin}" \ + -out "${WORKDIR}/${bin_base/-unsigned}" \ -CAfile "$GUIX_ENVIRONMENT/etc/ssl/certs/ca-certificates.crt" \ - -sigin codesignatures/win/"$infile_base".pem + -sigin codesignatures/win/"${bin_base}".pem done + + # Move installer to outdir + cd "${WORKDIR}" + find . -name "*setup.exe" -print0 \ + | xargs -0r mv --target-directory="${OUTDIR}" + + # Make .zip from binaries + find "${DISTNAME}" -print0 \ + | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" + find "${DISTNAME}" \ + | sort \ + | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 ) ;; *darwin*) - # Apply detached codesignatures to dist/ (in-place) - signapple apply dist/Bitcoin-Qt.app codesignatures/osx/dist - - # Make a DMG from dist/ - xorrisofs -D -l -V "$(< osx_volname)" -no-pad -r -dir-mode 0755 \ - -o "${OUTDIR}/${DISTNAME}-${HOST}.dmg" \ - dist \ - -- -volume_date all_file_dates ="$SOURCE_DATE_EPOCH" + case "$HOST" in + arm64*) ARCH="arm64" ;; + x86_64*) ARCH="x86_64" ;; + esac + + # Apply detached codesignatures (in-place) + signapple apply dist/Bitcoin-Qt.app codesignatures/osx/"${HOST}"/dist/Bitcoin-Qt.app + find "${DISTNAME}" -wholename "*/bin/*" -type f | while read -r bin + do + signapple apply "${bin}" "codesignatures/osx/${HOST}/${bin}.${ARCH}sign" + done + + # Make a .zip from dist/ + cd dist/ + find . -print0 \ + | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}" + find . | sort \ + | zip -X@ "${OUTDIR}/${DISTNAME}-${HOST}.zip" + cd .. + + # Make a .tar.gz from bins + find "${DISTNAME}" -print0 \ + | sort --zero-terminated \ + | tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \ + | gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \ + || ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 ) ;; *) exit 1 @@ -104,7 +143,7 @@ mv --no-target-directory "$OUTDIR" "$ACTUAL_OUTDIR" \ ( cd /outdir-base { - echo "$UNSIGNED_TARBALL" + echo "$CODESIGNING_TARBALL" echo "$CODESIGNATURE_GIT_ARCHIVE" find "$ACTUAL_OUTDIR" -type f } | xargs realpath --relative-base="$PWD" \ diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash index 4d5b06a54d..f7fc932dfd 100644 --- a/contrib/guix/libexec/prelude.bash +++ b/contrib/guix/libexec/prelude.bash @@ -50,8 +50,8 @@ fi # across time. time-machine() { # shellcheck disable=SC2086 - guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \ - --commit=160f78a4d92205df986ed9efcce7d3aac188cb24 \ + guix time-machine --url=https://codeberg.org/guix/guix.git \ + --commit=53396a22afc04536ddf75d8f82ad2eafa5082725 \ --cores="$JOBS" \ --keep-failed \ --fallback \ diff --git a/contrib/guix/manifest.scm b/contrib/guix/manifest.scm index 612a2526da..92fc1791f0 100644 --- a/contrib/guix/manifest.scm +++ b/contrib/guix/manifest.scm @@ -1,37 +1,35 @@ (use-modules (gnu packages) - (gnu packages autotools) ((gnu packages bash) #:select (bash-minimal)) (gnu packages bison) ((gnu packages certs) #:select (nss-certs)) - ((gnu packages cdrom) #:select (xorriso)) ((gnu packages cmake) #:select (cmake-minimal)) (gnu packages commencement) (gnu packages compression) (gnu packages cross-base) - (gnu packages file) (gnu packages gawk) (gnu packages gcc) ((gnu packages installers) #:select (nsis-x86_64)) - ((gnu packages linux) #:select (linux-libre-headers-5.15 util-linux)) + ((gnu packages linux) #:select (linux-libre-headers-6.1)) (gnu packages llvm) (gnu packages mingw) - (gnu packages moreutils) + (gnu packages ninja) (gnu packages pkg-config) ((gnu packages python) #:select (python-minimal)) - ((gnu packages python-build) #:select (python-tomli)) + ((gnu packages python-build) #:select (python-tomli python-poetry-core)) ((gnu packages python-crypto) #:select (python-asn1crypto)) - ((gnu packages python-web) #:select (python-requests)) ((gnu packages tls) #:select (openssl)) ((gnu packages version-control) #:select (git-minimal)) (guix build-system cmake) (guix build-system gnu) (guix build-system python) + (guix build-system pyproject) (guix build-system trivial) + (guix download) (guix gexp) (guix git-download) ((guix licenses) #:prefix license:) (guix packages) - ((guix utils) #:select (substitute-keyword-arguments))) + ((guix utils) #:select (cc-for-target substitute-keyword-arguments))) (define-syntax-rule (search-our-patches file-name ...) "Return the list of absolute file names corresponding to each @@ -82,25 +80,26 @@ FILE-NAME found in ./patches relative to the current file." (build-system trivial-build-system) (arguments '(#:builder (begin (mkdir %output) #t))) (propagated-inputs - `(("binutils" ,xbinutils) - ("libc" ,xlibc) - ("libc:static" ,xlibc "static") - ("gcc" ,xgcc) - ("gcc-lib" ,xgcc "lib"))) + (list xbinutils + xlibc + xgcc + `(,xlibc "static") + `(,xgcc "lib"))) (synopsis (string-append "Complete GCC tool chain for " target)) (description (string-append "This package provides a complete GCC tool chain for " target " development.")) (home-page (package-home-page xgcc)) (license (package-license xgcc))))) -(define base-gcc gcc-10) -(define base-linux-kernel-headers linux-libre-headers-5.15) +(define base-gcc gcc-13) ;; 13.3.0 + +(define base-linux-kernel-headers linux-libre-headers-6.1) (define* (make-bitcoin-cross-toolchain target #:key (base-gcc-for-libc linux-base-gcc) (base-kernel-headers base-linux-kernel-headers) - (base-libc glibc-2.27) + (base-libc glibc-2.31) (base-gcc linux-base-gcc)) "Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values desirable for building Bitcoin Core release binaries." @@ -112,13 +111,23 @@ desirable for building Bitcoin Core release binaries." (define (gcc-mingw-patches gcc) (package-with-extra-patches gcc - (search-our-patches "gcc-remap-guix-store.patch" - "vmov-alignment.patch"))) + (search-our-patches "gcc-remap-guix-store.patch"))) + +(define (binutils-mingw-patches binutils) + (package-with-extra-patches binutils + (search-our-patches "binutils-unaligned-default.patch"))) + +(define (winpthreads-patches mingw-w64-x86_64-winpthreads) + (package-with-extra-patches mingw-w64-x86_64-winpthreads + (search-our-patches "winpthreads-remap-guix-store.patch"))) (define (make-mingw-pthreads-cross-toolchain target) "Create a cross-compilation toolchain package for TARGET" - (let* ((xbinutils (cross-binutils target)) - (pthreads-xlibc mingw-w64-x86_64-winpthreads) + (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)) + #:with-winpthreads? #t))) (pthreads-xgcc (cross-gcc target #:xgcc (gcc-mingw-patches mingw-w64-base-gcc) #:xbinutils xbinutils @@ -132,20 +141,16 @@ desirable for building Bitcoin Core release binaries." (build-system trivial-build-system) (arguments '(#:builder (begin (mkdir %output) #t))) (propagated-inputs - `(("binutils" ,xbinutils) - ("libc" ,pthreads-xlibc) - ("gcc" ,pthreads-xgcc) - ("gcc-lib" ,pthreads-xgcc "lib"))) + (list xbinutils + pthreads-xlibc + pthreads-xgcc + `(,pthreads-xgcc "lib"))) (synopsis (string-append "Complete GCC tool chain for " target)) (description (string-append "This package provides a complete GCC tool chain for " target " development.")) (home-page (package-home-page pthreads-xgcc)) (license (package-license pthreads-xgcc))))) -(define (make-nsis-for-gcc-10 base-nsis) - (package-with-extra-patches base-nsis - (search-our-patches "nsis-gcc-10-memmove.patch"))) - ;; While LIEF is packaged in Guix, we maintain our own package, ;; to simplify building, and more easily apply updates. ;; Moreover, the Guix's package uses cmake, which caused build @@ -204,8 +209,7 @@ and abstract ELF, PE and MachO formats.") (base32 "1j47vwq4caxfv0xw68kw5yh00qcpbd56d7rq6c483ma3y7s96yyz")))) (build-system cmake-build-system) - (inputs - `(("openssl", openssl))) + (inputs (list openssl)) (home-page "https://github.com/mtrojnar/osslsigncode") (synopsis "Authenticode signing and timestamping tool") (description "osslsigncode is a small tool that implements part of the @@ -262,8 +266,7 @@ thus should be able to compile on most platforms where these exist.") (files '("etc/ssl/certs/ca-certificates.crt"))))) (propagated-inputs - `(("python-asn1crypto" ,python-asn1crypto) - ("openssl" ,openssl))) + (list python-asn1crypto openssl)) (arguments `(#:phases (modify-phases %standard-phases @@ -301,7 +304,7 @@ thus should be able to compile on most platforms where these exist.") (package (inherit python-oscrypto) (name "python-oscryptotests") (propagated-inputs - `(("python-oscrypto" ,python-oscrypto))) + (list python-oscrypto)) (arguments `(#:tests? #f #:phases @@ -328,9 +331,9 @@ thus should be able to compile on most platforms where these exist.") "1qw2k7xis53179lpqdqyylbcmp76lj7sagp883wmxg5i7chhc96k")))) (build-system python-build-system) (propagated-inputs - `(("python-asn1crypto" ,python-asn1crypto) - ("python-oscrypto" ,python-oscrypto) - ("python-oscryptotests", python-oscryptotests))) ;; certvalidator tests import oscryptotests + (list python-asn1crypto + python-oscrypto + python-oscryptotests)) ;; certvalidator tests import oscryptotests (arguments `(#:phases (modify-phases %standard-phases @@ -378,82 +381,11 @@ certificates or paths. Supports various options, including: validation at a specific moment in time, whitelisting and revocation checks.") (license license:expat)))) -(define-public python-altgraph - (package - (name "python-altgraph") - (version "0.17") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/ronaldoussoren/altgraph") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "09sm4srvvkw458pn48ga9q7ykr4xlz7q8gh1h9w7nxpf001qgpwb")))) - (build-system python-build-system) - (home-page "https://github.com/ronaldoussoren/altgraph") - (synopsis "Python graph (network) package") - (description "altgraph is a fork of graphlib: a graph (network) package for -constructing graphs, BFS and DFS traversals, topological sort, shortest paths, -etc. with graphviz output.") - (license license:expat))) - - -(define-public python-macholib - (package - (name "python-macholib") - (version "1.14") - (source - (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/ronaldoussoren/macholib") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "0aislnnfsza9wl4f0vp45ivzlc0pzhp9d4r08700slrypn5flg42")))) - (build-system python-build-system) - (propagated-inputs - `(("python-altgraph" ,python-altgraph))) - (arguments - '(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'disable-broken-tests - (lambda _ - ;; This test is broken as there is no keyboard interrupt. - (substitute* "macholib_tests/test_command_line.py" - (("^(.*)class TestCmdLine" line indent) - (string-append indent - "@unittest.skip(\"Disabled by Guix\")\n" - line))) - (substitute* "macholib_tests/test_dyld.py" - (("^(.*)def test_\\S+_find" line indent) - (string-append indent - "@unittest.skip(\"Disabled by Guix\")\n" - line)) - (("^(.*)def testBasic" line indent) - (string-append indent - "@unittest.skip(\"Disabled by Guix\")\n" - line)) - ) - #t))))) - (home-page "https://github.com/ronaldoussoren/macholib") - (synopsis "Python library for analyzing and editing Mach-O headers") - (description "macholib is a Macho-O header analyzer and editor. It's -typically used as a dependency analysis tool, and also to rewrite dylib -references in Mach-O headers to be @executable_path relative. Though this tool -targets a platform specific file format, it is pure python code that is platform -and endian independent.") - (license license:expat))) - (define-public python-signapple - (let ((commit "8a945a2e7583be2665cf3a6a89d665b70ecd1ab6")) + (let ((commit "85bfcecc33d2773bc09bc318cec0614af2c8e287")) (package (name "python-signapple") - (version (git-version "0.1" "1" commit)) + (version (git-version "0.2.0" "1" commit)) (source (origin (method git-fetch) @@ -463,15 +395,14 @@ and endian independent.") (file-name (git-file-name name commit)) (sha256 (base32 - "0fr1hangvfyiwflca6jg5g8zvg3jc9qr7vd2c12ff89pznf38dlg")))) - (build-system python-build-system) + "17yqjll8nw83q6dhgqhkl7w502z5vy9sln8m6mlx0f1c10isg8yg")))) + (build-system pyproject-build-system) (propagated-inputs - `(("python-asn1crypto" ,python-asn1crypto) - ("python-oscrypto" ,python-oscrypto) - ("python-certvalidator" ,python-certvalidator) - ("python-elfesteem" ,python-elfesteem) - ("python-requests" ,python-requests) - ("python-macholib" ,python-macholib))) + (list python-asn1crypto + python-oscrypto + python-certvalidator + python-elfesteem)) + (native-inputs (list python-poetry-core)) ;; There are no tests, but attempting to run python setup.py test leads to ;; problems, just disable the test (arguments '(#:tests? #f)) @@ -490,12 +421,9 @@ inspecting signatures in Mach-O binaries.") `(append ,flags ;; https://gcc.gnu.org/install/configure.html (list "--enable-threads=posix", - building-on))) - ((#:make-flags flags) - ;; Uses the SSP functions from glibc instead of from libssp.so. - ;; Our 'symbol-check' script will complain if we link against libssp.so, - ;; and thus will ensure that this works properly. - `(cons "gcc_cv_libc_provides_ssp=yes" ,flags)))))) + "--enable-default-ssp=yes", + "--disable-gcov", + building-on))))))) (define-public linux-base-gcc (package @@ -508,6 +436,9 @@ inspecting signatures in Mach-O binaries.") (list "--enable-initfini-array=yes", "--enable-default-ssp=yes", "--enable-default-pie=yes", + "--enable-standard-branch-protection=yes", + "--enable-cet=yes", + "--disable-gcov", building-on))) ((#:phases phases) `(modify-phases ,phases @@ -521,32 +452,32 @@ inspecting signatures in Mach-O binaries.") (("-rpath=") "-rpath-link=")) #t)))))))) -(define-public glibc-2.27 +(define-public glibc-2.31 + (let ((commit "7b27c450c34563a28e634cccb399cd415e71ebfe")) (package - (inherit glibc-2.31) - (version "2.27") + (inherit glibc) ;; 2.35 + (version "2.31") (source (origin (method git-fetch) (uri (git-reference (url "https://sourceware.org/git/glibc.git") - (commit "73886db6218e613bd6d4edf529f11e008a6c2fa6"))) - (file-name (git-file-name "glibc" "73886db6218e613bd6d4edf529f11e008a6c2fa6")) + (commit commit))) + (file-name (git-file-name "glibc" commit)) (sha256 (base32 - "0azpb9cvnbv25zg8019rqz48h8i2257ngyjg566dlnp74ivrs9vq")) - (patches (search-our-patches "glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch" - "glibc-2.27-fcommon.patch" - "glibc-2.27-guix-prefix.patch" - "glibc-2.27-no-librt.patch" - "glibc-2.27-powerpc-ldbrx.patch")))) + "017qdpr5id7ddb4lpkzj2li1abvw916m3fc6n7nw28z4h5qbv2n0")) + (patches (search-our-patches "glibc-guix-prefix.patch")))) (arguments (substitute-keyword-arguments (package-arguments glibc) ((#:configure-flags flags) `(append ,flags ;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html (list "--enable-stack-protector=all", + "--enable-cet", "--enable-bind-now", "--disable-werror", + "--disable-timezone-tools", + "--disable-profile", building-on))) ((#:phases phases) `(modify-phases ,phases @@ -554,12 +485,43 @@ inspecting signatures in Mach-O binaries.") (lambda* (#:key outputs #:allow-other-keys) ;; Install the rpc data base file under `$out/etc/rpc'. ;; Otherwise build will fail with "Permission denied." + ;; Can be removed when we are building 2.32 or later. (let ((out (assoc-ref outputs "out"))) (substitute* "sunrpc/Makefile" (("^\\$\\(inst_sysconfdir\\)/rpc(.*)$" _ suffix) (string-append out "/etc/rpc" suffix "\n")) (("^install-others =.*$") - (string-append "install-others = " out "/etc/rpc\n")))))))))))) + (string-append "install-others = " out "/etc/rpc\n"))))))))))))) + +;; The sponge tool from moreutils. +(define-public sponge + (package + (name "sponge") + (version "0.69") + (source (origin + (method url-fetch) + (uri (string-append + "https://git.joeyh.name/index.cgi/moreutils.git/snapshot/ + moreutils-" version ".tar.gz")) + (file-name (string-append "moreutils-" version ".tar.gz")) + (sha256 + (base32 + "1l859qnzccslvxlh5ghn863bkq2vgmqgnik6jr21b9kc6ljmsy8g")))) + (build-system gnu-build-system) + (arguments + (list #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let ((bin (string-append (assoc-ref outputs "out") "/bin"))) + (install-file "sponge" bin))))) + #:make-flags + #~(list "sponge" (string-append "CC=" #$(cc-for-target))))) + (home-page "https://joeyh.name/code/moreutils/") + (synopsis "Miscellaneous general-purpose command-line tools") + (description "Just sponge") + (license license:gpl2+))) (packages->manifest (append @@ -567,9 +529,7 @@ inspecting signatures in Mach-O binaries.") bash-minimal which coreutils-minimal - util-linux ;; File(system) inspection - file grep diffutils findutils @@ -577,22 +537,16 @@ inspecting signatures in Mach-O binaries.") patch gawk sed - moreutils + sponge ;; Compression and archiving tar - bzip2 gzip xz ;; Build tools + gcc-toolchain-13 + cmake-minimal gnu-make - libtool - autoconf-2.71 - automake - pkg-config - bison - ;; Native GCC 10 toolchain - gcc-toolchain-10 - (list gcc-toolchain-10 "static") + ninja ;; Scripting python-minimal ;; (3.10) ;; Git @@ -601,14 +555,20 @@ inspecting signatures in Mach-O binaries.") python-lief) (let ((target (getenv "HOST"))) (cond ((string-suffix? "-mingw32" target) - ;; Windows (list zip (make-mingw-pthreads-cross-toolchain "x86_64-w64-mingw32") - (make-nsis-for-gcc-10 nsis-x86_64) + nsis-x86_64 nss-certs osslsigncode)) ((string-contains target "-linux-") - (list (make-bitcoin-cross-toolchain target))) + (list bison + pkg-config + (list gcc-toolchain-13 "static") + (make-bitcoin-cross-toolchain target))) ((string-contains target "darwin") - (list clang-toolchain-15 binutils cmake-minimal xorriso python-signapple)) + (list clang-toolchain-18 + lld-18 + (make-lld-wrapper lld-18 #:lld-as-ld? #t) + python-signapple + zip)) (else '()))))) diff --git a/contrib/guix/patches/binutils-unaligned-default.patch b/contrib/guix/patches/binutils-unaligned-default.patch new file mode 100644 index 0000000000..d1bc71aee1 --- /dev/null +++ b/contrib/guix/patches/binutils-unaligned-default.patch @@ -0,0 +1,22 @@ +commit 6537181f59ed186a341db621812a6bc35e22eaf6 +Author: fanquake +Date: Wed Apr 10 12:15:52 2024 +0200 + + build: turn on -muse-unaligned-vector-move by default + + This allows us to avoid (more invasively) patching GCC, to avoid + unaligned instruction use. + +diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c +index e0632681477..14a9653abdf 100644 +--- a/gas/config/tc-i386.c ++++ b/gas/config/tc-i386.c +@@ -801,7 +801,7 @@ static unsigned int no_cond_jump_promotion = 0; + static unsigned int sse2avx; + + /* Encode aligned vector move as unaligned vector move. */ +-static unsigned int use_unaligned_vector_move; ++static unsigned int use_unaligned_vector_move = 1; + + /* Encode scalar AVX instructions with specific vector length. */ + static enum diff --git a/contrib/guix/patches/gcc-remap-guix-store.patch b/contrib/guix/patches/gcc-remap-guix-store.patch index a47ef7a2df..a8b41d485b 100644 --- a/contrib/guix/patches/gcc-remap-guix-store.patch +++ b/contrib/guix/patches/gcc-remap-guix-store.patch @@ -1,14 +1,9 @@ -From aad25427e74f387412e8bc9a9d7bbc6c496c792f Mon Sep 17 00:00:00 2001 -From: Andrew Chow -Date: Wed, 6 Jul 2022 16:49:41 -0400 -Subject: [PATCH] guix: remap guix store paths to /usr +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. ---- - libgcc/Makefile.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in -index 851e7657d07..476c2becd1c 100644 --- a/libgcc/Makefile.in +++ b/libgcc/Makefile.in @@ -854,7 +854,7 @@ endif diff --git a/contrib/guix/patches/glibc-2.27-fcommon.patch b/contrib/guix/patches/glibc-2.27-fcommon.patch deleted file mode 100644 index 817aa85bb9..0000000000 --- a/contrib/guix/patches/glibc-2.27-fcommon.patch +++ /dev/null @@ -1,34 +0,0 @@ -commit 264a4a0dbe1f4369db315080034b500bed66016c -Author: fanquake -Date: Fri May 6 11:03:04 2022 +0100 - - build: use -fcommon to retain legacy behaviour with GCC 10 - - GCC 10 started using -fno-common by default, which causes issues with - the powerpc builds using gibc 2.27. A patch was commited to glibc to fix - the issue, 18363b4f010da9ba459b13310b113ac0647c2fcc but is non-trvial - to backport, and was broken in at least one way, see the followup in - commit 7650321ce037302bfc2f026aa19e0213b8d02fe6. - - For now, retain the legacy GCC behaviour by passing -fcommon when - building glibc. - - https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html. - https://sourceware.org/git/?p=glibc.git;a=commit;h=18363b4f010da9ba459b13310b113ac0647c2fcc - https://sourceware.org/git/?p=glibc.git;a=commit;h=7650321ce037302bfc2f026aa19e0213b8d02fe6 - - This patch can be dropped when we are building with glibc 2.31+. - -diff --git a/Makeconfig b/Makeconfig -index 86a71e5802..aa2166be60 100644 ---- a/Makeconfig -+++ b/Makeconfig -@@ -896,7 +896,7 @@ ifeq "$(strip $(+cflags))" "" - endif # $(+cflags) == "" - - +cflags += $(cflags-cpu) $(+gccwarn) $(+merge-constants) $(+math-flags) \ -- $(+stack-protector) -+ $(+stack-protector) -fcommon - +gcc-nowarn := -w - - # Don't duplicate options if we inherited variables from the parent. diff --git a/contrib/guix/patches/glibc-2.27-no-librt.patch b/contrib/guix/patches/glibc-2.27-no-librt.patch deleted file mode 100644 index 4f2092ba7e..0000000000 --- a/contrib/guix/patches/glibc-2.27-no-librt.patch +++ /dev/null @@ -1,53 +0,0 @@ -This patch can be dropped when we are building with glibc 2.30+. - -commit 6e41ef56c9baab719a02f1377b1e7ce7bff61e73 -Author: Florian Weimer -Date: Fri Feb 8 10:21:56 2019 +0100 - - rt: Turn forwards from librt to libc into compat symbols [BZ #24194] - - As the result of commit 6e6249d0b461b952d0f544792372663feb6d792a - ("BZ#14743: Move clock_* symbols from librt to libc."), in glibc 2.17, - clock_gettime, clock_getres, clock_settime, clock_getcpuclockid, - clock_nanosleep were added to libc, and the file rt/clock-compat.c - was added with forwarders to the actual implementations in libc. - These forwarders were wrapped in - - #if SHLIB_COMPAT (librt, GLIBC_2_2, GLIBC_2_17) - - so that they are not present for newer architectures (such as - powerpc64le) with a 2.17 or later ABI baseline. But the forwarders - were not marked as compatibility symbols. As a result, on older - architectures, historic configure checks such as - - AC_CHECK_LIB(rt, clock_gettime) - - still cause linking against librt, even though this is completely - unnecessary. It also creates a needless porting hazard because - architectures behave differently when it comes to symbol availability. - - Reviewed-by: Carlos O'Donell - -diff --git a/rt/clock-compat.c b/rt/clock-compat.c -index f816973c05..11e71aa890 100644 ---- a/rt/clock-compat.c -+++ b/rt/clock-compat.c -@@ -30,14 +30,16 @@ - #if HAVE_IFUNC - # undef INIT_ARCH - # define INIT_ARCH() --# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) -+# define COMPAT_REDIRECT(name, proto, arglist) libc_ifunc (name, &__##name) \ -+ compat_symbol (librt, name, name, GLIBC_2_2); - #else - # define COMPAT_REDIRECT(name, proto, arglist) \ - int \ - name proto \ - { \ - return __##name arglist; \ -- } -+ } \ -+ compat_symbol (librt, name, name, GLIBC_2_2); - #endif - - COMPAT_REDIRECT (clock_getres, diff --git a/contrib/guix/patches/glibc-2.27-powerpc-ldbrx.patch b/contrib/guix/patches/glibc-2.27-powerpc-ldbrx.patch deleted file mode 100644 index 26716054c8..0000000000 --- a/contrib/guix/patches/glibc-2.27-powerpc-ldbrx.patch +++ /dev/null @@ -1,245 +0,0 @@ -From 50b0b3c9ff71ffd7ebbd74ae46844c3566478123 Mon Sep 17 00:00:00 2001 -From: "Gabriel F. T. Gomes" -Date: Mon, 27 May 2019 15:21:22 -0300 -Subject: [PATCH] powerpc: Fix build failures with current GCC - -Since GCC commit 271500 (svn), also known as the following commit on the -git mirror: - -commit e154242724b084380e3221df7c08fcdbd8460674 -Author: amodra -Date: Wed May 22 04:34:26 2019 +0000 - - [RS6000] Don't pass -many to the assembler - -glibc builds are failing when an assembly implementation does not -declare the correct '.machine' directive, or when no such directive is -declared at all. For example, when a POWER6 instruction is used, but -'.machine power6' is not declared, the assembler will fail with an error -similar to the following: - - ../sysdeps/powerpc/powerpc64/power8/strcmp.S: Assembler messages: - 24 ../sysdeps/powerpc/powerpc64/power8/strcmp.S:55: Error: unrecognized opcode: `cmpb' - -This patch adds '.machine powerN' directives where none existed, as well -as it updates '.machine power7' directives on POWER8 files, because the -minimum binutils version required to build glibc (binutils 2.25) now -provides this machine version. It also adds '-many' to the assembler -command used to build tst-set_ppr.c. - -Tested for powerpc, powerpc64, and powerpc64le, as well as with -build-many-glibcs.py for powerpc targets. - -Reviewed-by: Tulio Magno Quites Machado Filho ---- - sysdeps/powerpc/Makefile | 5 +++ - sysdeps/powerpc/powerpc64/power4/memcmp.S | 7 ++++ - sysdeps/powerpc/powerpc64/power7/strncmp.S | 1 + - .../powerpc/powerpc64/power8/fpu/s_llround.S | 1 + - sysdeps/powerpc/powerpc64/power8/strcasecmp.S | 36 ++++++------------- - sysdeps/powerpc/powerpc64/power8/strcasestr.S | 14 ++------ - sysdeps/powerpc/powerpc64/power8/strcmp.S | 1 + - 7 files changed, 28 insertions(+), 37 deletions(-) - -diff --git a/sysdeps/powerpc/Makefile b/sysdeps/powerpc/Makefile -index 6aa683b03f..23126147df 100644 ---- a/sysdeps/powerpc/Makefile -+++ b/sysdeps/powerpc/Makefile -@@ -45,6 +45,11 @@ ifeq ($(subdir),misc) - sysdep_headers += sys/platform/ppc.h - tests += test-gettimebase - tests += tst-set_ppr -+ -+# This test is expected to run and exit with EXIT_UNSUPPORTED on -+# processors that do not implement the Power ISA 2.06 or greater. -+# But the test makes use of instructions from Power ISA 2.06 and 2.07. -+CFLAGS-tst-set_ppr.c += -Wa,-many - endif - - ifneq (,$(filter %le,$(config-machine))) -diff --git a/sysdeps/powerpc/powerpc64/power4/memcmp.S b/sysdeps/powerpc/powerpc64/power4/memcmp.S -index e5319f101f..38dcf4c9a1 100644 ---- a/sysdeps/powerpc/powerpc64/power4/memcmp.S -+++ b/sysdeps/powerpc/powerpc64/power4/memcmp.S -@@ -26,7 +26,14 @@ - # define MEMCMP memcmp - #endif - -+#ifndef __LITTLE_ENDIAN__ - .machine power4 -+#else -+/* Little endian is only available since POWER8, so it's safe to -+ specify .machine as power8 (or older), even though this is a POWER4 -+ file. Since the little-endian code uses 'ldbrx', power7 is enough. */ -+ .machine power7 -+#endif - ENTRY_TOCLESS (MEMCMP, 4) - CALL_MCOUNT 3 - -diff --git a/sysdeps/powerpc/powerpc64/power7/strncmp.S b/sysdeps/powerpc/powerpc64/power7/strncmp.S -index 0c7429d19f..10f898c5a3 100644 ---- a/sysdeps/powerpc/powerpc64/power7/strncmp.S -+++ b/sysdeps/powerpc/powerpc64/power7/strncmp.S -@@ -28,6 +28,7 @@ - const char *s2 [r4], - size_t size [r5]) */ - -+ .machine power7 - ENTRY_TOCLESS (STRNCMP, 5) - CALL_MCOUNT 3 - -diff --git a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S -index a22fc63bb3..84c76ba0f9 100644 ---- a/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S -+++ b/sysdeps/powerpc/powerpc64/power8/fpu/s_llround.S -@@ -26,6 +26,7 @@ - - /* long long [r3] llround (float x [fp1]) */ - -+ .machine power8 - ENTRY_TOCLESS (__llround) - CALL_MCOUNT 0 - frin fp1,fp1 /* Round to nearest +-0.5. */ -diff --git a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S -index 3a2efe2a64..eeacd40c7f 100644 ---- a/sysdeps/powerpc/powerpc64/power8/strcasecmp.S -+++ b/sysdeps/powerpc/powerpc64/power8/strcasecmp.S -@@ -91,21 +91,7 @@ - 3: \ - TOLOWER() - --#ifdef _ARCH_PWR8 --# define VCLZD_V8_v7 vclzd v8, v7; --# define MFVRD_R3_V1 mfvrd r3, v1; --# define VSUBUDM_V9_V8 vsubudm v9, v9, v8; --# define VPOPCNTD_V8_V8 vpopcntd v8, v8; --# define VADDUQM_V7_V8 vadduqm v9, v7, v8; --#else --# define VCLZD_V8_v7 .long 0x11003fc2 --# define MFVRD_R3_V1 .long 0x7c230067 --# define VSUBUDM_V9_V8 .long 0x112944c0 --# define VPOPCNTD_V8_V8 .long 0x110047c3 --# define VADDUQM_V7_V8 .long 0x11274100 --#endif -- -- .machine power7 -+ .machine power8 - - ENTRY (__STRCASECMP) - #ifdef USE_AS_STRNCASECMP -@@ -265,15 +251,15 @@ L(different): - #ifdef __LITTLE_ENDIAN__ - /* Count trailing zero. */ - vspltisb v8, -1 -- VADDUQM_V7_V8 -+ vadduqm v9, v7, v8 - vandc v8, v9, v7 -- VPOPCNTD_V8_V8 -+ vpopcntd v8, v8 - vspltb v6, v8, 15 - vcmpequb. v6, v6, v1 - blt cr6, L(shift8) - #else - /* Count leading zero. */ -- VCLZD_V8_v7 -+ vclzd v8, v7 - vspltb v6, v8, 7 - vcmpequb. v6, v6, v1 - blt cr6, L(shift8) -@@ -291,7 +277,7 @@ L(skipsum): - /* Merge and move to GPR. */ - vmrglb v6, v6, v7 - vslo v1, v6, v1 -- MFVRD_R3_V1 -+ mfvrd r3, v1 - /* Place the characters that are different in first position. */ - sldi rSTR2, rRTN, 56 - srdi rSTR2, rSTR2, 56 -@@ -301,7 +287,7 @@ L(skipsum): - vslo v6, v5, v8 - vslo v7, v4, v8 - vmrghb v1, v6, v7 -- MFVRD_R3_V1 -+ mfvrd r3, v1 - srdi rSTR2, rRTN, 48 - sldi rSTR2, rSTR2, 56 - srdi rSTR2, rSTR2, 56 -@@ -320,15 +306,15 @@ L(null_found): - #ifdef __LITTLE_ENDIAN__ - /* Count trailing zero. */ - vspltisb v8, -1 -- VADDUQM_V7_V8 -+ vadduqm v9, v7, v8 - vandc v8, v9, v7 -- VPOPCNTD_V8_V8 -+ vpopcntd v8, v8 - vspltb v6, v8, 15 - vcmpequb. v6, v6, v10 - blt cr6, L(shift_8) - #else - /* Count leading zero. */ -- VCLZD_V8_v7 -+ vclzd v8, v7 - vspltb v6, v8, 7 - vcmpequb. v6, v6, v10 - blt cr6, L(shift_8) -@@ -343,10 +329,10 @@ L(skipsum1): - vspltisb v10, 7 - vslb v10, v10, v10 - vsldoi v9, v0, v10, 1 -- VSUBUDM_V9_V8 -+ vsubudm v9, v9, v8 - vspltisb v8, 8 - vsldoi v8, v0, v8, 1 -- VSUBUDM_V9_V8 -+ vsubudm v9, v9, v8 - /* Shift and remove junk after null character. */ - #ifdef __LITTLE_ENDIAN__ - vslo v5, v5, v9 -diff --git a/sysdeps/powerpc/powerpc64/power8/strcasestr.S b/sysdeps/powerpc/powerpc64/power8/strcasestr.S -index 9fc24c29f9..e10f06fd86 100644 ---- a/sysdeps/powerpc/powerpc64/power8/strcasestr.S -+++ b/sysdeps/powerpc/powerpc64/power8/strcasestr.S -@@ -73,18 +73,8 @@ - vor reg, v8, reg; \ - vcmpequb. v6, reg, v4; - --/* TODO: change these to the actual instructions when the minimum required -- binutils allows it. */ --#ifdef _ARCH_PWR8 --#define VCLZD_V8_v7 vclzd v8, v7; --#else --#define VCLZD_V8_v7 .long 0x11003fc2 --#endif -- - #define FRAMESIZE (FRAME_MIN_SIZE+48) --/* TODO: change this to .machine power8 when the minimum required binutils -- allows it. */ -- .machine power7 -+ .machine power8 - ENTRY (STRCASESTR, 4) - CALL_MCOUNT 2 - mflr r0 /* Load link register LR to r0. */ -@@ -291,7 +281,7 @@ L(nullchk1): - vcmpequb. v6, v0, v7 - /* Shift r3 by 16 bytes and proceed. */ - blt cr6, L(shift16) -- VCLZD_V8_v7 -+ vclzd v8, v7 - #ifdef __LITTLE_ENDIAN__ - vspltb v6, v8, 15 - #else -diff --git a/sysdeps/powerpc/powerpc64/power8/strcmp.S b/sysdeps/powerpc/powerpc64/power8/strcmp.S -index 15e7351d1b..d592266d1d 100644 ---- a/sysdeps/powerpc/powerpc64/power8/strcmp.S -+++ b/sysdeps/powerpc/powerpc64/power8/strcmp.S -@@ -31,6 +31,7 @@ - 64K as default, the page cross handling assumes minimum page size of - 4k. */ - -+ .machine power8 - ENTRY_TOCLESS (STRCMP, 4) - li r0,0 - --- -2.41.0 diff --git a/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch b/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch deleted file mode 100644 index ab8ae9c023..0000000000 --- a/contrib/guix/patches/glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch +++ /dev/null @@ -1,78 +0,0 @@ -Note that this has been modified from the original commit, to use __has_include -instead of __has_include__, as the later was causing build failures with GCC 10. -See also: http://lists.busybox.net/pipermail/buildroot/2020-July/590376.html. - -https://sourceware.org/git/?p=glibc.git;a=commit;h=0b9c84906f653978fb8768c7ebd0ee14a47e662e - -This patch can be dropped when we are building with glibc 2.28+. - -From 562c52cc81a4e456a62e6455feb32732049e9070 Mon Sep 17 00:00:00 2001 -From: "H.J. Lu" -Date: Mon, 31 Dec 2018 09:26:42 -0800 -Subject: [PATCH] riscv: Use __has_include__ to include [BZ - #24022] - - has been removed by - -commit 27f8899d6002e11a6e2d995e29b8deab5aa9cc25 -Author: David Abdurachmanov -Date: Thu Nov 8 20:02:39 2018 +0100 - - riscv: add asm/unistd.h UAPI header - - Marcin Juszkiewicz reported issues while generating syscall table for riscv - using 4.20-rc1. The patch refactors our unistd.h files to match some other - architectures. - - - Add asm/unistd.h UAPI header, which has __ARCH_WANT_NEW_STAT only for 64-bit - - Remove asm/syscalls.h UAPI header and merge to asm/unistd.h - - Adjust kernel asm/unistd.h - - So now asm/unistd.h UAPI header should show all syscalls for riscv. - - may be restored by - -Subject: [PATCH] riscv: restore asm/syscalls.h UAPI header -Date: Tue, 11 Dec 2018 09:09:35 +0100 - -UAPI header asm/syscalls.h was merged into UAPI asm/unistd.h header, -which did resolve issue with missing syscalls macros resulting in -glibc (2.28) build failure. It also broke glibc in a different way: -asm/syscalls.h is being used by glibc. I noticed this while doing -Fedora 30/Rawhide mass rebuild. - -The patch returns asm/syscalls.h header and incl. it into asm/unistd.h. -I plan to send a patch to glibc to use asm/unistd.h instead of -asm/syscalls.h - -In the meantime, we use __has_include__, which was added to GCC 5, to -check if exists before including it. Tested with -build-many-glibcs.py for riscv against kernel 4.19.12 and 4.20-rc7. - - [BZ #24022] - * sysdeps/unix/sysv/linux/riscv/flush-icache.c: Check if - exists with __has_include__ before including it. ---- - sysdeps/unix/sysv/linux/riscv/flush-icache.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/sysdeps/unix/sysv/linux/riscv/flush-icache.c b/sysdeps/unix/sysv/linux/riscv/flush-icache.c -index d612ef4c6c..0b2042620b 100644 ---- a/sysdeps/unix/sysv/linux/riscv/flush-icache.c -+++ b/sysdeps/unix/sysv/linux/riscv/flush-icache.c -@@ -21,7 +21,11 @@ - #include - #include - #include --#include -+#if __has_include () -+# include -+#else -+# include -+#endif - - typedef int (*func_type) (void *, void *, unsigned long int); - --- -2.31.1 - diff --git a/contrib/guix/patches/glibc-2.27-guix-prefix.patch b/contrib/guix/patches/glibc-guix-prefix.patch similarity index 78% rename from contrib/guix/patches/glibc-2.27-guix-prefix.patch rename to contrib/guix/patches/glibc-guix-prefix.patch index dc515907ff..60e12ca525 100644 --- a/contrib/guix/patches/glibc-2.27-guix-prefix.patch +++ b/contrib/guix/patches/glibc-guix-prefix.patch @@ -4,19 +4,13 @@ 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. -We might be able to drop this in favour of using --with-nonshared-cflags -when we begin using newer versions of glibc. - --- a/Makeconfig +++ b/Makeconfig -@@ -992,6 +992,10 @@ object-suffixes := +@@ -1007,6 +1007,7 @@ object-suffixes := CPPFLAGS-.o = $(pic-default) # libc.a must be compiled with -fPIE/-fpie for static PIE. CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) $(pie-default) -+ -+# Map Guix store paths to /usr +CFLAGS-.o += `find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;` -+ libtype.o := lib%.a object-suffixes += .o ifeq (yes,$(build-shared)) diff --git a/contrib/guix/patches/nsis-gcc-10-memmove.patch b/contrib/guix/patches/nsis-gcc-10-memmove.patch deleted file mode 100644 index a1aadfd4f3..0000000000 --- a/contrib/guix/patches/nsis-gcc-10-memmove.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit f6df41524e703dc471e283e566a48e05a735b7f2 -Author: Anders -Date: Sat Jun 27 23:18:45 2020 +0000 - - Don't let GCC 10 generate memmove calls (bug #1248) - - git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7189 212acab6-be3b-0410-9dea-997c60f758d6 - -diff --git a/SCons/Config/gnu b/SCons/Config/gnu -index bfcb362d..21fa446b 100644 ---- a/SCons/Config/gnu -+++ b/SCons/Config/gnu -@@ -103,6 +103,10 @@ stub_env.Append(LINKFLAGS = ['$NODEFLIBS_FLAG']) # no standard libraries - stub_env.Append(LINKFLAGS = ['$ALIGN_FLAG']) # 512 bytes align - stub_env.Append(LINKFLAGS = ['$MAP_FLAG']) # generate map file - -+conf = FlagsConfigure(stub_env) -+conf.CheckCompileFlag('-fno-tree-loop-distribute-patterns') # GCC 10: Don't generate msvcrt!memmove calls (bug #1248) -+conf.Finish() -+ - stub_uenv = stub_env.Clone() - stub_uenv.Append(CPPDEFINES = ['_UNICODE', 'UNICODE']) - diff --git a/contrib/guix/patches/vmov-alignment.patch b/contrib/guix/patches/vmov-alignment.patch deleted file mode 100644 index 7976b864af..0000000000 --- a/contrib/guix/patches/vmov-alignment.patch +++ /dev/null @@ -1,268 +0,0 @@ -Description: Use unaligned VMOV instructions -Author: Stephen Kitt -Bug-Debian: https://bugs.debian.org/939559 -See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412 - -Based on a patch originally by Claude Heiland-Allen - ---- a/gcc/config/i386/sse.md -+++ b/gcc/config/i386/sse.md -@@ -1058,17 +1058,11 @@ - { - if (FLOAT_MODE_P (GET_MODE_INNER (mode))) - { -- if (misaligned_operand (operands[1], mode)) -- return "vmovu\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; -- else -- return "vmova\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; -+ return "vmovu\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; - } - else - { -- if (misaligned_operand (operands[1], mode)) -- return "vmovdqu\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; -- else -- return "vmovdqa\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; -+ return "vmovdqu\t{%1, %0%{%3%}%N2|%0%{%3%}%N2, %1}"; - } - } - [(set_attr "type" "ssemov") -@@ -1184,17 +1178,11 @@ - { - if (FLOAT_MODE_P (GET_MODE_INNER (mode))) - { -- if (misaligned_operand (operands[0], mode)) -- return "vmovu\t{%1, %0%{%2%}|%0%{%2%}, %1}"; -- else -- return "vmova\t{%1, %0%{%2%}|%0%{%2%}, %1}"; -+ return "vmovu\t{%1, %0%{%2%}|%0%{%2%}, %1}"; - } - else - { -- if (misaligned_operand (operands[0], mode)) -- return "vmovdqu\t{%1, %0%{%2%}|%0%{%2%}, %1}"; -- else -- return "vmovdqa\t{%1, %0%{%2%}|%0%{%2%}, %1}"; -+ return "vmovdqu\t{%1, %0%{%2%}|%0%{%2%}, %1}"; - } - } - [(set_attr "type" "ssemov") -@@ -7806,7 +7794,7 @@ - "TARGET_SSE && !(MEM_P (operands[0]) && MEM_P (operands[1]))" - "@ - %vmovlps\t{%1, %0|%q0, %1} -- %vmovaps\t{%1, %0|%0, %1} -+ %vmovups\t{%1, %0|%0, %1} - %vmovlps\t{%1, %d0|%d0, %q1}" - [(set_attr "type" "ssemov") - (set_attr "prefix" "maybe_vex") -@@ -13997,29 +13985,15 @@ - switch (mode) - { - case E_V8DFmode: -- if (misaligned_operand (operands[2], mode)) -- return "vmovupd\t{%2, %x0|%x0, %2}"; -- else -- return "vmovapd\t{%2, %x0|%x0, %2}"; -+ return "vmovupd\t{%2, %x0|%x0, %2}"; - case E_V16SFmode: -- if (misaligned_operand (operands[2], mode)) -- return "vmovups\t{%2, %x0|%x0, %2}"; -- else -- return "vmovaps\t{%2, %x0|%x0, %2}"; -+ return "vmovups\t{%2, %x0|%x0, %2}"; - case E_V8DImode: -- if (misaligned_operand (operands[2], mode)) -- return which_alternative == 2 ? "vmovdqu64\t{%2, %x0|%x0, %2}" -+ return which_alternative == 2 ? "vmovdqu64\t{%2, %x0|%x0, %2}" - : "vmovdqu\t{%2, %x0|%x0, %2}"; -- else -- return which_alternative == 2 ? "vmovdqa64\t{%2, %x0|%x0, %2}" -- : "vmovdqa\t{%2, %x0|%x0, %2}"; - case E_V16SImode: -- if (misaligned_operand (operands[2], mode)) -- return which_alternative == 2 ? "vmovdqu32\t{%2, %x0|%x0, %2}" -+ return which_alternative == 2 ? "vmovdqu32\t{%2, %x0|%x0, %2}" - : "vmovdqu\t{%2, %x0|%x0, %2}"; -- else -- return which_alternative == 2 ? "vmovdqa32\t{%2, %x0|%x0, %2}" -- : "vmovdqa\t{%2, %x0|%x0, %2}"; - default: - gcc_unreachable (); - } -@@ -21225,63 +21199,27 @@ - switch (get_attr_mode (insn)) - { - case MODE_V16SF: -- if (misaligned_operand (operands[1], mode)) -- return "vmovups\t{%1, %t0|%t0, %1}"; -- else -- return "vmovaps\t{%1, %t0|%t0, %1}"; -+ return "vmovups\t{%1, %t0|%t0, %1}"; - case MODE_V8DF: -- if (misaligned_operand (operands[1], mode)) -- return "vmovupd\t{%1, %t0|%t0, %1}"; -- else -- return "vmovapd\t{%1, %t0|%t0, %1}"; -+ return "vmovupd\t{%1, %t0|%t0, %1}"; - case MODE_V8SF: -- if (misaligned_operand (operands[1], mode)) -- return "vmovups\t{%1, %x0|%x0, %1}"; -- else -- return "vmovaps\t{%1, %x0|%x0, %1}"; -+ return "vmovups\t{%1, %x0|%x0, %1}"; - case MODE_V4DF: -- if (misaligned_operand (operands[1], mode)) -- return "vmovupd\t{%1, %x0|%x0, %1}"; -- else -- return "vmovapd\t{%1, %x0|%x0, %1}"; -+ return "vmovupd\t{%1, %x0|%x0, %1}"; - case MODE_XI: -- if (misaligned_operand (operands[1], mode)) -- { -- if (which_alternative == 2) -- return "vmovdqu\t{%1, %t0|%t0, %1}"; -- else if (GET_MODE_SIZE (mode) == 8) -- return "vmovdqu64\t{%1, %t0|%t0, %1}"; -- else -- return "vmovdqu32\t{%1, %t0|%t0, %1}"; -- } -+ if (which_alternative == 2) -+ return "vmovdqu\t{%1, %t0|%t0, %1}"; -+ else if (GET_MODE_SIZE (mode) == 8) -+ return "vmovdqu64\t{%1, %t0|%t0, %1}"; - else -- { -- if (which_alternative == 2) -- return "vmovdqa\t{%1, %t0|%t0, %1}"; -- else if (GET_MODE_SIZE (mode) == 8) -- return "vmovdqa64\t{%1, %t0|%t0, %1}"; -- else -- return "vmovdqa32\t{%1, %t0|%t0, %1}"; -- } -+ return "vmovdqu32\t{%1, %t0|%t0, %1}"; - case MODE_OI: -- if (misaligned_operand (operands[1], mode)) -- { -- if (which_alternative == 2) -- return "vmovdqu\t{%1, %x0|%x0, %1}"; -- else if (GET_MODE_SIZE (mode) == 8) -- return "vmovdqu64\t{%1, %x0|%x0, %1}"; -- else -- return "vmovdqu32\t{%1, %x0|%x0, %1}"; -- } -+ if (which_alternative == 2) -+ return "vmovdqu\t{%1, %x0|%x0, %1}"; -+ else if (GET_MODE_SIZE (mode) == 8) -+ return "vmovdqu64\t{%1, %x0|%x0, %1}"; - else -- { -- if (which_alternative == 2) -- return "vmovdqa\t{%1, %x0|%x0, %1}"; -- else if (GET_MODE_SIZE (mode) == 8) -- return "vmovdqa64\t{%1, %x0|%x0, %1}"; -- else -- return "vmovdqa32\t{%1, %x0|%x0, %1}"; -- } -+ return "vmovdqu32\t{%1, %x0|%x0, %1}"; - default: - gcc_unreachable (); - } ---- a/gcc/config/i386/i386.c -+++ b/gcc/config/i386/i386.c -@@ -4981,13 +4981,13 @@ - switch (type) - { - case opcode_int: -- opcode = misaligned_p ? "vmovdqu32" : "vmovdqa32"; -+ opcode = "vmovdqu32"; - break; - case opcode_float: -- opcode = misaligned_p ? "vmovups" : "vmovaps"; -+ opcode = "vmovups"; - break; - case opcode_double: -- opcode = misaligned_p ? "vmovupd" : "vmovapd"; -+ opcode = "vmovupd"; - break; - } - } -@@ -4996,16 +4996,16 @@ - switch (scalar_mode) - { - case E_SFmode: -- opcode = misaligned_p ? "%vmovups" : "%vmovaps"; -+ opcode = "%vmovups"; - break; - case E_DFmode: -- opcode = misaligned_p ? "%vmovupd" : "%vmovapd"; -+ opcode = "%vmovupd"; - break; - case E_TFmode: - if (evex_reg_p) -- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64"; -+ opcode = "vmovdqu64"; - else -- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa"; -+ opcode = "%vmovdqu"; - break; - default: - gcc_unreachable (); -@@ -5017,48 +5017,32 @@ - { - case E_QImode: - if (evex_reg_p) -- opcode = (misaligned_p -- ? (TARGET_AVX512BW -- ? "vmovdqu8" -- : "vmovdqu64") -- : "vmovdqa64"); -+ opcode = TARGET_AVX512BW ? "vmovdqu8" : "vmovdqu64"; - else -- opcode = (misaligned_p -- ? (TARGET_AVX512BW -- ? "vmovdqu8" -- : "%vmovdqu") -- : "%vmovdqa"); -+ opcode = TARGET_AVX512BW ? "vmovdqu8" : "%vmovdqu"; - break; - case E_HImode: - if (evex_reg_p) -- opcode = (misaligned_p -- ? (TARGET_AVX512BW -- ? "vmovdqu16" -- : "vmovdqu64") -- : "vmovdqa64"); -+ opcode = TARGET_AVX512BW ? "vmovdqu16" : "vmovdqu64"; - else -- opcode = (misaligned_p -- ? (TARGET_AVX512BW -- ? "vmovdqu16" -- : "%vmovdqu") -- : "%vmovdqa"); -+ opcode = TARGET_AVX512BW ? "vmovdqu16" : "%vmovdqu"; - break; - case E_SImode: - if (evex_reg_p) -- opcode = misaligned_p ? "vmovdqu32" : "vmovdqa32"; -+ opcode = "vmovdqu32"; - else -- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa"; -+ opcode = "%vmovdqu"; - break; - case E_DImode: - case E_TImode: - case E_OImode: - if (evex_reg_p) -- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64"; -+ opcode = "vmovdqu64"; - else -- opcode = misaligned_p ? "%vmovdqu" : "%vmovdqa"; -+ opcode = "%vmovdqu"; - break; - case E_XImode: -- opcode = misaligned_p ? "vmovdqu64" : "vmovdqa64"; -+ opcode = "vmovdqu64"; - break; - default: - gcc_unreachable (); diff --git a/contrib/guix/patches/winpthreads-remap-guix-store.patch b/contrib/guix/patches/winpthreads-remap-guix-store.patch new file mode 100644 index 0000000000..e1f1a6eba5 --- /dev/null +++ b/contrib/guix/patches/winpthreads-remap-guix-store.patch @@ -0,0 +1,17 @@ +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/mingw-w64-libraries/winpthreads/Makefile.in ++++ b/mingw-w64-libraries/winpthreads/Makefile.in +@@ -478,7 +478,7 @@ top_build_prefix = @top_build_prefix@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + SUBDIRS = . tests +-AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) ++AM_CFLAGS = -Wall -DWIN32_LEAN_AND_MEAN $(am__append_1) $(shell find /gnu/store -maxdepth 1 -mindepth 1 -type d -exec echo -n " -ffile-prefix-map={}=/usr" \;) + ACLOCAL_AMFLAGS = -I m4 + lib_LTLIBRARIES = libwinpthread.la + include_HEADERS = include/pthread.h include/sched.h include/semaphore.h include/pthread_unistd.h include/pthread_time.h include/pthread_compat.h include/pthread_signal.h diff --git a/contrib/devtools/security-check.py b/contrib/guix/security-check.py similarity index 74% rename from contrib/devtools/security-check.py rename to contrib/guix/security-check.py index f90fa5785f..04185a2fae 100755 --- a/contrib/devtools/security-check.py +++ b/contrib/guix/security-check.py @@ -6,9 +6,13 @@ Perform basic security checks on a series of executables. Exit status will be 0 if successful, and the program will be silent. Otherwise the exit status will be 1 and it will log which executables failed which checks. + +Example usage: + + find ../path/to/guix/binaries -type f -executable | xargs python3 contrib/guix/security-check.py ''' +import re import sys -from typing import List import lief @@ -39,13 +43,13 @@ def check_ELF_RELRO(binary) -> bool: return have_gnu_relro and have_bindnow -def check_ELF_Canary(binary) -> bool: +def check_ELF_CANARY(binary) -> bool: ''' Check for use of stack canary ''' return binary.has_symbol('__stack_chk_fail') -def check_ELF_separate_code(binary): +def check_ELF_SEPARATE_CODE(binary): ''' Check that sections are appropriately separated in virtual memory, based on their permissions. This checks for missing -Wl,-z,separate-code @@ -106,7 +110,7 @@ def check_ELF_separate_code(binary): return False return True -def check_ELF_control_flow(binary) -> bool: +def check_ELF_CONTROL_FLOW(binary) -> bool: ''' Check for control flow instrumentation ''' @@ -117,6 +121,27 @@ def check_ELF_control_flow(binary) -> bool: return True return False +def check_ELF_FORTIFY(binary) -> bool: + + # bitcoin-util does not currently contain any fortified functions + if 'Bitcoin Core bitcoin-util utility version ' in binary.strings: + return True + # bitcoin wrapper does not currently contain any fortified functions + if '--monolithic' in binary.strings: + return True + + chk_funcs = set() + + for sym in binary.imported_symbols: + match = re.search(r'__[a-z]*_chk', sym.name) + if match: + chk_funcs.add(match.group(0)) + + # ignore stack-protector + chk_funcs.discard('__stack_chk') + + return len(chk_funcs) >= 1 + def check_PE_DYNAMIC_BASE(binary) -> bool: '''PIE: DllCharacteristics bit 0x40 signifies dynamicbase (ASLR)''' return lief.PE.DLL_CHARACTERISTICS.DYNAMIC_BASE in binary.optional_header.dll_characteristics_lists @@ -131,7 +156,7 @@ def check_PE_RELOC_SECTION(binary) -> bool: '''Check for a reloc section. This is required for functional ASLR.''' return binary.has_relocations -def check_PE_control_flow(binary) -> bool: +def check_PE_CONTROL_FLOW(binary) -> bool: ''' Check for control flow instrumentation ''' @@ -146,7 +171,7 @@ def check_PE_control_flow(binary) -> bool: return True return False -def check_PE_Canary(binary) -> bool: +def check_PE_CANARY(binary) -> bool: ''' Check for use of stack canary ''' @@ -164,7 +189,7 @@ def check_MACHO_FIXUP_CHAINS(binary) -> bool: ''' return binary.has_dyld_chained_fixups -def check_MACHO_Canary(binary) -> bool: +def check_MACHO_CANARY(binary) -> bool: ''' Check for use of stack canary ''' @@ -183,7 +208,7 @@ def check_NX(binary) -> bool: ''' return binary.has_nx -def check_MACHO_control_flow(binary) -> bool: +def check_MACHO_CONTROL_FLOW(binary) -> bool: ''' Check for control flow instrumentation ''' @@ -193,12 +218,22 @@ def check_MACHO_control_flow(binary) -> bool: return True return False +def check_MACHO_BRANCH_PROTECTION(binary) -> bool: + ''' + Check for branch protection instrumentation + ''' + content = binary.get_content_from_virtual_address(binary.entrypoint, 4, lief.Binary.VA_TYPES.AUTO) + + if content.tolist() == [95, 36, 3, 213]: # bti + return True + return False + BASE_ELF = [ ('PIE', check_PIE), ('NX', check_NX), ('RELRO', check_ELF_RELRO), - ('Canary', check_ELF_Canary), - ('separate_code', check_ELF_separate_code), + ('CANARY', check_ELF_CANARY), + ('SEPARATE_CODE', check_ELF_SEPARATE_CODE), ] BASE_PE = [ @@ -207,23 +242,23 @@ def check_MACHO_control_flow(binary) -> bool: ('HIGH_ENTROPY_VA', check_PE_HIGH_ENTROPY_VA), ('NX', check_NX), ('RELOC_SECTION', check_PE_RELOC_SECTION), - ('CONTROL_FLOW', check_PE_control_flow), - ('Canary', check_PE_Canary), + ('CONTROL_FLOW', check_PE_CONTROL_FLOW), + ('CANARY', check_PE_CANARY), ] BASE_MACHO = [ ('NOUNDEFS', check_MACHO_NOUNDEFS), - ('Canary', check_MACHO_Canary), + ('CANARY', check_MACHO_CANARY), ('FIXUP_CHAINS', check_MACHO_FIXUP_CHAINS), ] CHECKS = { lief.EXE_FORMATS.ELF: { - lief.ARCHITECTURES.X86: BASE_ELF + [('CONTROL_FLOW', check_ELF_control_flow)], - lief.ARCHITECTURES.ARM: BASE_ELF, - lief.ARCHITECTURES.ARM64: BASE_ELF, - lief.ARCHITECTURES.PPC: BASE_ELF, - lief.ARCHITECTURES.RISCV: BASE_ELF, + lief.ARCHITECTURES.X86: BASE_ELF + [('CONTROL_FLOW', check_ELF_CONTROL_FLOW), ('FORTIFY', check_ELF_FORTIFY)], + lief.ARCHITECTURES.ARM: BASE_ELF + [('FORTIFY', check_ELF_FORTIFY)], + lief.ARCHITECTURES.ARM64: BASE_ELF + [('FORTIFY', check_ELF_FORTIFY)], + lief.ARCHITECTURES.PPC: BASE_ELF + [('FORTIFY', check_ELF_FORTIFY)], + lief.ARCHITECTURES.RISCV: BASE_ELF, # Skip FORTIFY. See https://github.com/lief-project/LIEF/issues/1082. }, lief.EXE_FORMATS.PE: { lief.ARCHITECTURES.X86: BASE_PE, @@ -231,39 +266,24 @@ def check_MACHO_control_flow(binary) -> bool: lief.EXE_FORMATS.MACHO: { lief.ARCHITECTURES.X86: BASE_MACHO + [('PIE', check_PIE), ('NX', check_NX), - ('CONTROL_FLOW', check_MACHO_control_flow)], - lief.ARCHITECTURES.ARM64: BASE_MACHO, + ('CONTROL_FLOW', check_MACHO_CONTROL_FLOW)], + lief.ARCHITECTURES.ARM64: BASE_MACHO + [('BRANCH_PROTECTION', check_MACHO_BRANCH_PROTECTION)], } } if __name__ == '__main__': retval: int = 0 for filename in sys.argv[1:]: - try: - binary = lief.parse(filename) - etype = binary.format - arch = binary.abstract.header.architecture - binary.concrete - - if etype == lief.EXE_FORMATS.UNKNOWN: - print(f'{filename}: unknown executable format') - retval = 1 - continue - - if arch == lief.ARCHITECTURES.NONE: - print(f'{filename}: unknown architecture') - retval = 1 - continue - - failed: List[str] = [] - for (name, func) in CHECKS[etype][arch]: - if not func(binary): - failed.append(name) - if failed: - print(f'{filename}: failed {" ".join(failed)}') - retval = 1 - except IOError: - print(f'{filename}: cannot open') + binary = lief.parse(filename) + etype = binary.format + arch = binary.abstract.header.architecture + binary.concrete + + failed: list[str] = [] + for (name, func) in CHECKS[etype][arch]: + if not func(binary): + failed.append(name) + if failed: + print(f'{filename}: failed {" ".join(failed)}') retval = 1 sys.exit(retval) - diff --git a/contrib/devtools/symbol-check.py b/contrib/guix/symbol-check.py similarity index 73% rename from contrib/devtools/symbol-check.py rename to contrib/guix/symbol-check.py index c5f0a761f1..61e656114a 100755 --- a/contrib/devtools/symbol-check.py +++ b/contrib/guix/symbol-check.py @@ -8,38 +8,37 @@ Example usage: - find ../path/to/binaries -type f -executable | xargs python3 contrib/devtools/symbol-check.py + find ../path/to/guix/binaries -type f -executable | xargs python3 contrib/guix/symbol-check.py ''' import sys -from typing import List, Dict import lief -# Debian 10 (Buster) EOL: 2024. https://wiki.debian.org/LTS +# Debian 11 (Bullseye) EOL: 2026. https://wiki.debian.org/LTS # -# - libgcc version 8.3.0 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libgcc1) -# - libc version 2.28 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libc6) +# - libgcc version 10.2.1 (https://packages.debian.org/bullseye/libgcc-s1) +# - libc version 2.31 (https://packages.debian.org/source/bullseye/glibc) # -# Ubuntu 18.04 (Bionic) EOL: 2028. https://wiki.ubuntu.com/ReleaseTeam +# Ubuntu 20.04 (Focal) EOL: 2030. https://wiki.ubuntu.com/ReleaseTeam # -# - libgcc version 8.4.0 (https://packages.ubuntu.com/bionic/libgcc1) -# - libc version 2.27 (https://packages.ubuntu.com/bionic/libc6) +# - libgcc version 10.5.0 (https://packages.ubuntu.com/focal/libgcc1) +# - libc version 2.31 (https://packages.ubuntu.com/focal/libc6) # -# CentOS Stream 8 EOL: 2024. https://wiki.centos.org/About/Product +# CentOS Stream 9 EOL: 2027. https://www.centos.org/cl-vs-cs/#end-of-life # -# - libgcc version 8.5.0 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/) -# - libc version 2.28 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/) +# - 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': (4,8,0), +'GCC': (4,3,0), 'GLIBC': { - lief.ELF.ARCH.x86_64: (2,27), - lief.ELF.ARCH.ARM: (2,27), - lief.ELF.ARCH.AARCH64:(2,27), - lief.ELF.ARCH.PPC64: (2,27), - lief.ELF.ARCH.RISCV: (2,27), + 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) @@ -53,7 +52,7 @@ # Expected linker-loader names can be found here: # https://sourceware.org/glibc/wiki/ABIList?action=recall&rev=16 -ELF_INTERPRETER_NAMES: Dict[lief.ELF.ARCH, Dict[lief.ENDIANNESS, str]] = { +ELF_INTERPRETER_NAMES: dict[lief.ELF.ARCH, dict[lief.ENDIANNESS, str]] = { lief.ELF.ARCH.x86_64: { lief.ENDIANNESS.LITTLE: "/lib64/ld-linux-x86-64.so.2", }, @@ -72,7 +71,7 @@ }, } -ELF_ABIS: Dict[lief.ELF.ARCH, Dict[lief.ENDIANNESS, List[int]]] = { +ELF_ABIS: dict[lief.ELF.ARCH, dict[lief.ENDIANNESS, list[int]]] = { lief.ELF.ARCH.x86_64: { lief.ENDIANNESS.LITTLE: [3,2,0], }, @@ -113,6 +112,7 @@ 'libfontconfig.so.1', # font support 'libfreetype.so.6', # font parsing 'libdl.so.2', # programming interface to dynamic linker +'libxcb-cursor.so.0', 'libxcb-icccm.so.4', 'libxcb-image.so.0', 'libxcb-shm.so.0', @@ -147,19 +147,31 @@ 'IOSurface', # cross process image/drawing buffers 'libobjc.A.dylib', # Objective-C runtime library 'Metal', # 3D graphics -'Security', # access control and authentication 'QuartzCore', # animation +'Security', # access control and authentication +'UniformTypeIdentifiers', # collection of types that map to MIME and file types } PE_ALLOWED_LIBRARIES = { -'ADVAPI32.dll', # security & registry +'ADVAPI32.dll', # legacy security & registry +'bcrypt.dll', # newer security and identity API 'IPHLPAPI.DLL', # IP helper API 'KERNEL32.dll', # win32 base APIs 'msvcrt.dll', # C standard library for MSVC 'SHELL32.dll', # shell API 'WS2_32.dll', # sockets # bitcoin-qt only +'api-ms-win-core-synch-l1-2-0.dll', # Synchronization Primitives API +'api-ms-win-core-winrt-l1-1-0.dll', # Windows Runtime API +'api-ms-win-core-winrt-string-l1-1-0.dll', # WinRT String API +'AUTHZ.dll', # Windows Authorization Framework +'comdlg32.dll', # Common Dialog Box Library +'d3d11.dll', # Direct3D 11 API +'d3d12.dll', # Direct3D 12 API +'d3d9.dll', # Direct3D 9 API 'dwmapi.dll', # desktop window manager +'DWrite.dll', # DirectX Typography Services +'dxgi.dll', # DirectX Graphics Infrastructure 'GDI32.dll', # graphics device interface 'IMM32.dll', # input method editor 'NETAPI32.dll', # network management @@ -172,6 +184,8 @@ 'VERSION.dll', # version checking 'WINMM.dll', # WinMM audio API 'WTSAPI32.dll', # Remote Desktop +'SETUPAPI.dll', # Windows Setup API +'SHCORE.dll', # Stream Handler Core } def check_version(max_versions, version, arch) -> bool: @@ -213,6 +227,11 @@ def check_exported_symbols(binary) -> bool: ok = False return ok +def check_RUNPATH(binary) -> bool: + assert binary.get(lief.ELF.DYNAMIC_TAGS.RUNPATH) is None + assert binary.get(lief.ELF.DYNAMIC_TAGS.RPATH) is None + return True + def check_ELF_libraries(binary) -> bool: ok: bool = True for library in binary.libraries: @@ -231,12 +250,17 @@ def check_MACHO_libraries(binary) -> bool: return ok def check_MACHO_min_os(binary) -> bool: - if binary.build_version.minos == [11,0,0]: + if binary.build_version.minos == [13,0,0]: return True return False def check_MACHO_sdk(binary) -> bool: - if binary.build_version.sdk == [11, 0, 0]: + if binary.build_version.sdk == [14, 0, 0]: + return True + return False + +def check_MACHO_lld(binary) -> bool: + if binary.build_version.tools[0].version == [18, 1, 8]: return True return False @@ -251,10 +275,18 @@ def check_PE_libraries(binary) -> bool: def check_PE_subsystem_version(binary) -> bool: major: int = binary.optional_header.major_subsystem_version minor: int = binary.optional_header.minor_subsystem_version - if major == 6 and minor == 1: + if major == 6 and minor == 2: return True return False +def check_PE_application_manifest(binary) -> bool: + if not binary.has_resources: + # No resources at all. + return False + + rm = binary.resources_manager + return rm.has_manifest + def check_ELF_interpreter(binary) -> bool: expected_interpreter = ELF_INTERPRETER_NAMES[binary.header.machine_type][binary.abstract.header.endianness] @@ -273,37 +305,32 @@ def check_ELF_ABI(binary) -> bool: ('LIBRARY_DEPENDENCIES', check_ELF_libraries), ('INTERPRETER_NAME', check_ELF_interpreter), ('ABI', check_ELF_ABI), + ('RUNPATH', check_RUNPATH), ], lief.EXE_FORMATS.MACHO: [ ('DYNAMIC_LIBRARIES', check_MACHO_libraries), ('MIN_OS', check_MACHO_min_os), ('SDK', check_MACHO_sdk), + ('LLD', check_MACHO_lld), ], lief.EXE_FORMATS.PE: [ ('DYNAMIC_LIBRARIES', check_PE_libraries), ('SUBSYSTEM_VERSION', check_PE_subsystem_version), + ('APPLICATION_MANIFEST', check_PE_application_manifest), ] } if __name__ == '__main__': retval: int = 0 for filename in sys.argv[1:]: - try: - binary = lief.parse(filename) - etype = binary.format - if etype == lief.EXE_FORMATS.UNKNOWN: - print(f'{filename}: unknown executable format') - retval = 1 - continue - - failed: List[str] = [] - for (name, func) in CHECKS[etype]: - if not func(binary): - failed.append(name) - if failed: - print(f'{filename}: failed {" ".join(failed)}') - retval = 1 - except IOError: - print(f'{filename}: cannot open') + binary = lief.parse(filename) + etype = binary.format + + failed: list[str] = [] + for (name, func) in CHECKS[etype]: + if not func(binary): + failed.append(name) + if failed: + print(f'{filename}: failed {" ".join(failed)}') retval = 1 sys.exit(retval) diff --git a/contrib/init/bitcoind.service b/contrib/init/bitcoind.service index 87da17f955..ade8a05926 100644 --- a/contrib/init/bitcoind.service +++ b/contrib/init/bitcoind.service @@ -81,5 +81,8 @@ PrivateDevices=true # Deny the creation of writable and executable memory mappings. MemoryDenyWriteExecute=true +# Restrict ABIs to help ensure MemoryDenyWriteExecute is enforced +SystemCallArchitectures=native + [Install] WantedBy=multi-user.target diff --git a/contrib/linearize/linearize-data.py b/contrib/linearize/linearize-data.py index 24f6b29a26..74d9830705 100755 --- a/contrib/linearize/linearize-data.py +++ b/contrib/linearize/linearize-data.py @@ -76,6 +76,16 @@ def getFirstBlockFileId(block_dir_path): blkId = int(firstBlkFn[3:8]) return blkId +def read_xor_key(blocks_path): + NUM_XOR_BYTES = 8 # From InitBlocksdirXorKey::xor_key.size() + try: + xor_filename = os.path.join(blocks_path, "xor.dat") + with open(xor_filename, "rb") as xor_file: + return xor_file.read(NUM_XOR_BYTES) + # support also blockdirs created with pre-v28 versions, where no xor key exists yet + except FileNotFoundError: + return bytes([0] * NUM_XOR_BYTES) + # Block header and extent on disk BlockExtent = namedtuple('BlockExtent', ['fn', 'offset', 'inhdr', 'blkhdr', 'size']) @@ -95,6 +105,7 @@ def __init__(self, settings, blkindex, blkmap): self.outFname = None self.blkCountIn = 0 self.blkCountOut = 0 + self.xor_key = read_xor_key(self.settings['input']) self.lastDate = datetime.datetime(2000, 1, 1) self.highTS = 1408893517 - 315360000 @@ -113,6 +124,13 @@ def __init__(self, settings, blkindex, blkmap): self.outOfOrderData = {} self.outOfOrderSize = 0 # running total size for items in outOfOrderData + def read_xored(self, f, size): + offset = f.tell() + data = bytearray(f.read(size)) + for i in range(len(data)): + data[i] ^= self.xor_key[(i + offset) % len(self.xor_key)] + return bytes(data) + def writeBlock(self, inhdr, blk_hdr, rawblock): blockSizeOnDisk = len(inhdr) + len(blk_hdr) + len(rawblock) if not self.fileOutput and ((self.outsz + blockSizeOnDisk) > self.maxOutSz): @@ -165,7 +183,7 @@ def fetchBlock(self, extent): '''Fetch block contents from disk given extents''' with open(self.inFileName(extent.fn), "rb") as f: f.seek(extent.offset) - return f.read(extent.size) + return self.read_xored(f, extent.size) def copyOneBlock(self): '''Find the next block to be written in the input, and copy it to the output.''' @@ -190,7 +208,7 @@ def run(self): print("Premature end of block data") return - inhdr = self.inF.read(8) + inhdr = self.read_xored(self.inF, 8) if (not inhdr or (inhdr[0] == "\0")): self.inF.close() self.inF = None @@ -207,7 +225,7 @@ def run(self): inLenLE = inhdr[4:] su = struct.unpack("" - echo "example: $0 " +if [ "$#" -ne 3 ]; then + echo "usage: $0 " exit 1 fi rm -rf ${TEMPDIR} mkdir -p ${TEMPDIR} -${SIGNAPPLE} sign -f --detach "${TEMPDIR}/${OUTROOT}" "$@" "${BUNDLE}" +stty -echo +printf "Enter the passphrase for %s: " "$1" +read cs_key_pass +printf "\n" +printf "Enter the passphrase for %s: " "$2" +read api_key_pass +printf "\n" +stty echo + +# Sign and notarize app bundle +${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${cs_key_pass}" "$1" "${UNSIGNED_BUNDLE}" +${SIGNAPPLE} apply "${UNSIGNED_BUNDLE}" "${OUTROOT}/${BUNDLE_ROOT}/${BUNDLE_NAME}" +${SIGNAPPLE} notarize --detach "${OUTROOT}/${BUNDLE_ROOT}" --passphrase "${api_key_pass}" "$2" "$3" "${UNSIGNED_BUNDLE}" + +# Sign each binary +find . -maxdepth 3 -wholename "*/bin/*" -type f -exec realpath --relative-to=. {} \; | while read -r bin +do + bin_dir=$(dirname "${bin}") + bin_name=$(basename "${bin}") + ${SIGNAPPLE} sign -f --hardened-runtime --detach "${OUTROOT}/${bin_dir}" --passphrase "${cs_key_pass}" "$1" "${bin}" + ${SIGNAPPLE} apply "${bin}" "${OUTROOT}/${bin_dir}/${bin_name}.${ARCH}sign" +done + +# Notarize the binaries +# Binaries cannot have stapled notarizations so this does not actually generate any output +binaries_dir=$(dirname "$(find . -maxdepth 2 -wholename '*/bin' -type d -exec realpath --relative-to=. {} \;)") +${SIGNAPPLE} notarize --passphrase "${api_key_pass}" "$2" "$3" "${binaries_dir}" -tar -C "${TEMPDIR}" -czf "${OUT}" . +tar -C "${TEMPDIR}" -czf "${OUT}" "${OUTDIR}" rm -rf "${TEMPDIR}" echo "Created ${OUT}" diff --git a/contrib/macdeploy/gen-sdk b/contrib/macdeploy/gen-sdk index 6efaaccb8e..f0bbabf81f 100755 --- a/contrib/macdeploy/gen-sdk +++ b/contrib/macdeploy/gen-sdk @@ -8,21 +8,6 @@ import gzip import os import contextlib -# monkey-patch Python 3.8 and older to fix wrong TAR header handling -# see https://github.com/bitcoin/bitcoin/pull/24534 -# and https://github.com/python/cpython/pull/18080 for more info -if sys.version_info < (3, 9): - _old_create_header = tarfile.TarInfo._create_header - def _create_header(info, format, encoding, errors): - buf = _old_create_header(info, format, encoding, errors) - # replace devmajor/devminor with binary zeroes - buf = buf[:329] + bytes(16) + buf[345:] - # recompute checksum - chksum = tarfile.calc_chksums(buf)[0] - buf = buf[:-364] + bytes("%06o\0" % chksum, "ascii") + buf[-357:] - return buf - tarfile.TarInfo._create_header = staticmethod(_create_header) - @contextlib.contextmanager def cd(path): """Context manager that restores PWD even if an exception was raised.""" @@ -62,9 +47,6 @@ def run(): out_name = "Xcode-{xcode_version}-{xcode_build_id}-extracted-SDK-with-libcxx-headers".format(xcode_version=xcode_version, xcode_build_id=xcode_build_id) - xcode_libcxx_dir = xcode_app.joinpath("Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1") - assert xcode_libcxx_dir.is_dir() - if args.out_sdktgz: out_sdktgz_path = pathlib.Path(args.out_sdktgz_path) else: @@ -72,7 +54,7 @@ def run(): out_sdktgz_path = pathlib.Path("./{}.tar.gz".format(out_name)) def tarfp_add_with_base_change(tarfp, dir_to_add, alt_base_dir): - """Add all files in dir_to_add to tarfp, but prepent MEMBERPREFIX to the files' + """Add all files in dir_to_add to tarfp, but prepend alt_base_dir to the files' names e.g. if the only file under /root/bazdir is /root/bazdir/qux, invoking: @@ -107,8 +89,6 @@ def run(): with tarfile.open(mode="w", fileobj=gzf, format=tarfile.GNU_FORMAT) as tarfp: print("Adding MacOSX SDK {} files...".format(sdk_version)) tarfp_add_with_base_change(tarfp, sdk_dir, out_name) - print("Adding libc++ headers...") - tarfp_add_with_base_change(tarfp, xcode_libcxx_dir, "{}/usr/include/c++/v1".format(out_name)) print("Done! Find the resulting gzipped tarball at:") print(out_sdktgz_path.resolve()) diff --git a/contrib/macdeploy/macdeployqtplus b/contrib/macdeploy/macdeployqtplus index f8677ba7b8..ba532d7774 100755 --- a/contrib/macdeploy/macdeployqtplus +++ b/contrib/macdeploy/macdeployqtplus @@ -18,11 +18,9 @@ import sys, re, os, platform, shutil, stat, subprocess, os.path from argparse import ArgumentParser -from ds_store import DSStore -from mac_alias import Alias from pathlib import Path from subprocess import PIPE, run -from typing import List, Optional +from typing import Optional # This is ported from the original macdeployqt with modifications @@ -79,7 +77,7 @@ class FrameworkInfo(object): bundleBinaryDirectory = "Contents/MacOS" @classmethod - def fromOtoolLibraryLine(cls, line: str) -> Optional['FrameworkInfo']: + def fromLibraryLine(cls, line: str) -> Optional['FrameworkInfo']: # Note: line must be trimmed if line == "": return None @@ -90,7 +88,7 @@ class FrameworkInfo(object): m = cls.reOLine.match(line) if m is None: - raise RuntimeError(f"otool line could not be parsed: {line}") + raise RuntimeError(f"Line could not be parsed: {line}") path = m.group(1) @@ -122,7 +120,7 @@ class FrameworkInfo(object): break i += 1 if i == len(parts): - raise RuntimeError(f"Could not find .framework or .dylib in otool line: {line}") + raise RuntimeError(f"Could not find .framework or .dylib in line: {line}") info.frameworkName = parts[i] info.frameworkDirectory = "/".join(parts[:i]) @@ -159,20 +157,19 @@ class DeploymentInfo(object): self.qtPath = None self.pluginPath = None self.deployedFrameworks = [] - + def detectQtPath(self, frameworkDirectory: str): parentDir = os.path.dirname(frameworkDirectory) - if os.path.exists(os.path.join(parentDir, "translations")): - # Classic layout, e.g. "/usr/local/Trolltech/Qt-4.x.x" + if os.path.exists(os.path.join(parentDir, "share", "qt", "translations")): self.qtPath = parentDir else: self.qtPath = os.getenv("QTDIR", None) if self.qtPath is not None: - pluginPath = os.path.join(self.qtPath, "plugins") + pluginPath = os.path.join(self.qtPath, "share", "qt", "plugins") if os.path.exists(pluginPath): self.pluginPath = pluginPath - + def usesFramework(self, name: str) -> bool: for framework in self.deployedFrameworks: if framework.endswith(".framework"): @@ -183,31 +180,33 @@ class DeploymentInfo(object): return True return False -def getFrameworks(binaryPath: str, verbose: int) -> List[FrameworkInfo]: +def getFrameworks(binaryPath: str, verbose: int, rpath: str = '') -> list[FrameworkInfo]: + objdump = os.getenv("OBJDUMP", "objdump") if verbose: - print(f"Inspecting with otool: {binaryPath}") - otoolbin=os.getenv("OTOOL", "otool") - otool = run([otoolbin, "-L", binaryPath], stdout=PIPE, stderr=PIPE, text=True) - if otool.returncode != 0: - sys.stderr.write(otool.stderr) + print(f"Inspecting with {objdump}: {binaryPath}") + output = run([objdump, "--macho", "--dylibs-used", binaryPath], stdout=PIPE, stderr=PIPE, text=True) + if output.returncode != 0: + sys.stderr.write(output.stderr) sys.stderr.flush() - raise RuntimeError(f"otool failed with return code {otool.returncode}") + raise RuntimeError(f"{objdump} failed with return code {output.returncode}") - otoolLines = otool.stdout.split("\n") - otoolLines.pop(0) # First line is the inspected binary + lines = output.stdout.split("\n") + lines.pop(0) # First line is the inspected binary if ".framework" in binaryPath or binaryPath.endswith(".dylib"): - otoolLines.pop(0) # Frameworks and dylibs list themselves as a dependency. - + lines.pop(0) # Frameworks and dylibs list themselves as a dependency. + libraries = [] - for line in otoolLines: + for line in lines: line = line.replace("@loader_path", os.path.dirname(binaryPath)) - info = FrameworkInfo.fromOtoolLibraryLine(line.strip()) + if rpath: + line = line.replace("@rpath", rpath) + info = FrameworkInfo.fromLibraryLine(line.strip()) if info is not None: if verbose: print("Found framework:") print(info) libraries.append(info) - + return libraries def runInstallNameTool(action: str, *args): @@ -287,7 +286,7 @@ def copyFramework(framework: FrameworkInfo, path: str, verbose: int) -> Optional return toPath -def deployFrameworks(frameworks: List[FrameworkInfo], bundlePath: str, binaryPath: str, strip: bool, verbose: int, deploymentInfo: Optional[DeploymentInfo] = None) -> DeploymentInfo: +def deployFrameworks(frameworks: list[FrameworkInfo], bundlePath: str, binaryPath: str, strip: bool, verbose: int, deploymentInfo: Optional[DeploymentInfo] = None) -> DeploymentInfo: if deploymentInfo is None: deploymentInfo = DeploymentInfo() @@ -320,7 +319,7 @@ def deployFrameworks(frameworks: List[FrameworkInfo], bundlePath: str, binaryPat # install_name_tool it a new id. changeIdentification(framework.deployedInstallName, deployedBinaryPath, verbose) # Check for framework dependencies - dependencies = getFrameworks(deployedBinaryPath, verbose) + dependencies = getFrameworks(deployedBinaryPath, verbose, rpath=framework.frameworkDirectory) for dependency in dependencies: changeInstallName(dependency.installName, dependency.deployedInstallName, deployedBinaryPath, verbose) @@ -385,7 +384,7 @@ def deployPlugins(appBundleInfo: ApplicationBundleInfo, deploymentInfo: Deployme ap = ArgumentParser(description="""Improved version of macdeployqt. -Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .dmg file. +Outputs a ready-to-deploy app in a folder "dist" and optionally wraps it in a .zip file. Note, that the "dist" folder will be deleted before deploying on each run. Optionally, Qt translation files (.qm) can be added to the bundle.""") @@ -395,8 +394,8 @@ ap.add_argument("appname", nargs=1, metavar="appname", help="name of the app bei ap.add_argument("-verbose", nargs="?", const=True, help="Output additional debugging information") ap.add_argument("-no-plugins", dest="plugins", action="store_false", default=True, help="skip plugin deployment") ap.add_argument("-no-strip", dest="strip", action="store_false", default=True, help="don't run 'strip' on the binaries") -ap.add_argument("-dmg", nargs="?", const="", metavar="basename", help="create a .dmg disk image") ap.add_argument("-translations-dir", nargs=1, metavar="path", default=None, help="Path to Qt's translations. Base translations will automatically be added to the bundle's resources.") +ap.add_argument("-zip", nargs="?", const="", metavar="zip", help="create a .zip containing the app bundle") config = ap.parse_args() @@ -417,12 +416,9 @@ if os.path.exists("dist"): print("+ Removing existing dist folder +") shutil.rmtree("dist") -if os.path.exists(appname + ".dmg"): - print("+ Removing existing DMG +") - os.unlink(appname + ".dmg") - -if os.path.exists(appname + ".temp.dmg"): - os.unlink(appname + ".temp.dmg") +if os.path.exists(appname + ".zip"): + print("+ Removing existing .zip +") + os.unlink(appname + ".zip") # ------------------------------------------------ @@ -497,99 +493,13 @@ with open(os.path.join(applicationBundle.resourcesPath, "qt.conf"), "wb") as f: # ------------------------------------------------ -print("+ Generating .DS_Store +") - -output_file = os.path.join("dist", ".DS_Store") - -ds = DSStore.open(output_file, 'w+') - -ds['.']['bwsp'] = { - 'WindowBounds': '{{300, 280}, {500, 343}}', - 'PreviewPaneVisibility': False, -} - -icvp = { - 'gridOffsetX': 0.0, - 'textSize': 12.0, - 'viewOptionsVersion': 1, - 'backgroundImageAlias': b'\x00\x00\x00\x00\x02\x1e\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd1\x94\\\xb0H+\x00\x05\x00\x00\x00\x98\x0fbackground.tiff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x99\xd19\xb0\xf8\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\r\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0b.background\x00\x00\x10\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x11\x00\x08\x00\x00\xd19\xb0\xf8\x00\x00\x00\x01\x00\x04\x00\x00\x00\x98\x00\x0e\x00 \x00\x0f\x00b\x00a\x00c\x00k\x00g\x00r\x00o\x00u\x00n\x00d\x00.\x00t\x00i\x00f\x00f\x00\x0f\x00\x02\x00\x00\x00\x12\x00\x1c/.background/background.tiff\x00\x14\x01\x06\x00\x00\x00\x00\x01\x06\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xce\x97\xab\xc3H+\x00\x00\x01\x88[\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02u\xab\x8d\xd1\x94\\\xb0devrddsk\xff\xff\xff\xff\x00\x00\t \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07bitcoin\x00\x00\x10\x00\x08\x00\x00\xce\x97\xab\xc3\x00\x00\x00\x11\x00\x08\x00\x00\xd1\x94\\\xb0\x00\x00\x00\x01\x00\x14\x01\x88[\x88\x00\x16\xa9\t\x00\x08\xfaR\x00\x08\xfaQ\x00\x02d\x8e\x00\x0e\x00\x02\x00\x00\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x13\x00\x01/\x00\x00\x15\x00\x02\x00\x14\xff\xff\x00\x00\xff\xff\x00\x00', - 'backgroundColorBlue': 1.0, - 'iconSize': 96.0, - 'backgroundColorGreen': 1.0, - 'arrangeBy': 'none', - 'showIconPreview': True, - 'gridSpacing': 100.0, - 'gridOffsetY': 0.0, - 'showItemInfo': False, - 'labelOnBottom': True, - 'backgroundType': 2, - 'backgroundColorRed': 1.0 -} -alias = Alias().from_bytes(icvp['backgroundImageAlias']) -alias.volume.name = appname -alias.volume.posix_path = '/Volumes/' + appname -icvp['backgroundImageAlias'] = alias.to_bytes() -ds['.']['icvp'] = icvp - -ds['.']['vSrn'] = ('long', 1) - -ds['Applications']['Iloc'] = (370, 156) -ds['Bitcoin-Qt.app']['Iloc'] = (128, 156) - -ds.flush() -ds.close() - -# ------------------------------------------------ - if platform.system() == "Darwin": subprocess.check_call(f"codesign --deep --force --sign - {target}", shell=True) -print("+ Installing background.tiff +") - -bg_path = os.path.join('dist', '.background', 'background.tiff') -os.mkdir(os.path.dirname(bg_path)) - -tiff_path = os.path.join('contrib', 'macdeploy', 'background.tiff') -shutil.copy2(tiff_path, bg_path) - -# ------------------------------------------------ - -print("+ Generating symlink for /Applications +") - -os.symlink("/Applications", os.path.join('dist', "Applications")) - # ------------------------------------------------ -if config.dmg is not None: - - print("+ Preparing .dmg disk image +") - - if verbose: - print("Determining size of \"dist\"...") - size = 0 - for path, dirs, files in os.walk("dist"): - for file in files: - size += os.path.getsize(os.path.join(path, file)) - size += int(size * 0.15) - - if verbose: - print("Creating temp image for modification...") - - tempname: str = appname + ".temp.dmg" - - run(["hdiutil", "create", tempname, "-srcfolder", "dist", "-format", "UDRW", "-size", str(size), "-volname", appname], check=True, text=True) - - if verbose: - print("Attaching temp image...") - output = run(["hdiutil", "attach", tempname, "-readwrite"], check=True, text=True, stdout=PIPE).stdout - - print("+ Finalizing .dmg disk image +") - - run(["hdiutil", "detach", f"/Volumes/{appname}"], text=True) - - run(["hdiutil", "convert", tempname, "-format", "UDZO", "-o", appname, "-imagekey", "zlib-level=9"], check=True, text=True) - - os.unlink(tempname) +if config.zip is not None: + shutil.make_archive('{}'.format(appname), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app') # ------------------------------------------------ diff --git a/contrib/message-capture/message-capture-parser.py b/contrib/message-capture/message-capture-parser.py index d6ddc1c149..0f409717d4 100755 --- a/contrib/message-capture/message-capture-parser.py +++ b/contrib/message-capture/message-capture-parser.py @@ -11,7 +11,7 @@ from io import BytesIO import json from pathlib import Path -from typing import Any, List, Optional +from typing import Any, Optional sys.path.append(os.path.join(os.path.dirname(__file__), '../../test/functional')) @@ -92,7 +92,7 @@ def to_jsonable(obj: Any) -> Any: return obj -def process_file(path: str, messages: List[Any], recv: bool, progress_bar: Optional[ProgressBar]) -> None: +def process_file(path: str, messages: list[Any], recv: bool, progress_bar: Optional[ProgressBar]) -> None: with open(path, 'rb') as f_in: if progress_bar: bytes_read = 0 @@ -188,7 +188,7 @@ def main(): output = Path.cwd() / Path(args.output) if args.output else False use_progress_bar = (not args.no_progress_bar) and sys.stdout.isatty() - messages = [] # type: List[Any] + messages = [] # type: list[Any] if use_progress_bar: total_size = sum(capture.stat().st_size for capture in capturepaths) progress_bar = ProgressBar(total_size) diff --git a/contrib/seeds/.gitignore b/contrib/seeds/.gitignore index d9a2451f70..e62dd99de6 100644 --- a/contrib/seeds/.gitignore +++ b/contrib/seeds/.gitignore @@ -1,2 +1,5 @@ seeds_main.txt +seeds_signet.txt +seeds_test.txt +seeds_testnet4.txt asmap-filled.dat diff --git a/contrib/seeds/README.md b/contrib/seeds/README.md index 6db77cbbea..a1a2e34b5d 100644 --- a/contrib/seeds/README.md +++ b/contrib/seeds/README.md @@ -4,17 +4,28 @@ Utility to generate the seeds.txt list that is compiled into the client (see [src/chainparamsseeds.h](/src/chainparamsseeds.h) and other utilities in [contrib/seeds](/contrib/seeds)). Be sure to update `PATTERN_AGENT` in `makeseeds.py` to include the current version, -and remove old versions as necessary (at a minimum when GetDesirableServiceFlags +and remove old versions as necessary (at a minimum when SeedsServiceFlags() changes its default return value, as those are the services which seeds are added to addrman with). -The seeds compiled into the release are created from sipa's DNS seed and AS map -data. Run the following commands from the `/contrib/seeds` directory: +Update `MIN_BLOCKS` in `makeseeds.py` and the `-m`/`--minblocks` arguments below, as needed. + +The seeds compiled into the release are created from sipa's, achow101's and luke-jr's +DNS seed, virtu's crawler, and asmap community AS map data. Run the following commands +from the `/contrib/seeds` directory: ``` curl https://bitcoin.sipa.be/seeds.txt.gz | gzip -dc > seeds_main.txt -curl https://bitcoin.sipa.be/asmap-filled.dat > asmap-filled.dat +curl https://21.ninja/seeds.txt.gz | gzip -dc >> seeds_main.txt +curl https://luke.dashjr.org/programs/bitcoin/files/charts/seeds.txt >> seeds_main.txt +curl https://mainnet.achownodes.xyz/seeds.txt.gz | gzip -dc >> seeds_main.txt +curl https://signet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_signet.txt +curl https://testnet.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_test.txt +curl https://testnet4.achownodes.xyz/seeds.txt.gz | gzip -dc > seeds_testnet4.txt +curl https://raw.githubusercontent.com/asmap/asmap-data/main/latest_asmap.dat > asmap-filled.dat python3 makeseeds.py -a asmap-filled.dat -s seeds_main.txt > nodes_main.txt -cat nodes_main_manual.txt >> nodes_main.txt +python3 makeseeds.py -a asmap-filled.dat -s seeds_signet.txt -m 237800 > nodes_signet.txt +python3 makeseeds.py -a asmap-filled.dat -s seeds_test.txt > nodes_test.txt +python3 makeseeds.py -a asmap-filled.dat -s seeds_testnet4.txt -m 72600 > nodes_testnet4.txt python3 generate-seeds.py . > ../../src/chainparamsseeds.h ``` diff --git a/contrib/seeds/generate-seeds.py b/contrib/seeds/generate-seeds.py index e921757802..a3ce012251 100755 --- a/contrib/seeds/generate-seeds.py +++ b/contrib/seeds/generate-seeds.py @@ -5,11 +5,13 @@ ''' Script to generate list of seed nodes for kernel/chainparams.cpp. -This script expects two text files in the directory that is passed as an +This script expects three text files in the directory that is passed as an argument: nodes_main.txt + nodes_signet.txt nodes_test.txt + nodes_testnet4.txt These files must consist of lines in the format @@ -18,9 +20,9 @@ .onion: .b32.i2p: -The output will be two data structures with the peers in binary format: +The output will be several data structures with the peers in binary format: - static const uint8_t chainparams_seed_{main,test}[]={ + static const uint8_t chainparams_seed_{main,signet,test,testnet4}[]={ ... } @@ -29,7 +31,6 @@ from base64 import b32decode from enum import Enum -import struct import sys import os import re @@ -115,13 +116,13 @@ def parse_spec(s): def ser_compact_size(l): r = b"" if l < 253: - r = struct.pack("B", l) + r = l.to_bytes(1, "little") elif l < 0x10000: - r = struct.pack("H', spec[2]) + r += spec[2].to_bytes(2, "big") return r def process_nodes(g, f, structname): @@ -170,8 +171,14 @@ def main(): with open(os.path.join(indir,'nodes_main.txt'), 'r', encoding="utf8") as f: process_nodes(g, f, 'chainparams_seed_main') g.write('\n') + with open(os.path.join(indir,'nodes_signet.txt'), 'r', encoding="utf8") as f: + process_nodes(g, f, 'chainparams_seed_signet') + g.write('\n') with open(os.path.join(indir,'nodes_test.txt'), 'r', encoding="utf8") as f: process_nodes(g, f, 'chainparams_seed_test') + g.write('\n') + with open(os.path.join(indir,'nodes_testnet4.txt'), 'r', encoding="utf8") as f: + process_nodes(g, f, 'chainparams_seed_testnet4') g.write('#endif // BITCOIN_CHAINPARAMSSEEDS_H\n') if __name__ == '__main__': diff --git a/contrib/seeds/makeseeds.py b/contrib/seeds/makeseeds.py index af408c2df5..da6efe7087 100755 --- a/contrib/seeds/makeseeds.py +++ b/contrib/seeds/makeseeds.py @@ -9,11 +9,15 @@ import argparse import collections import ipaddress +from pathlib import Path +import random import re import sys -from typing import List, Dict, Union +from typing import Union -from asmap import ASMap, net_to_prefix +asmap_dir = Path(__file__).parent.parent / "asmap" +sys.path.append(str(asmap_dir)) +from asmap import ASMap, net_to_prefix # noqa: E402 NSEEDS=512 @@ -22,25 +26,29 @@ 'ipv6': 10, } -MIN_BLOCKS = 730000 +MIN_BLOCKS = 868000 -PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})):(\d+)$") -PATTERN_IPV6 = re.compile(r"^\[([0-9a-z:]+)\]:(\d+)$") +PATTERN_IPV4 = re.compile(r"^(([0-2]?\d{1,2})\.([0-2]?\d{1,2})\.([0-2]?\d{1,2})\.([0-2]?\d{1,2})):(\d{1,5})$") +PATTERN_IPV6 = re.compile(r"^\[([\da-f:]+)]:(\d{1,5})$", re.IGNORECASE) PATTERN_ONION = re.compile(r"^([a-z2-7]{56}\.onion):(\d+)$") +PATTERN_I2P = re.compile(r"^([a-z2-7]{52}\.b32\.i2p):(\d{1,5})$") PATTERN_AGENT = re.compile( r"^/Satoshi:(" - r"0.14.(0|1|2|3|99)|" - r"0.15.(0|1|2|99)|" - r"0.16.(0|1|2|3|99)|" - r"0.17.(0|0.1|1|2|99)|" - r"0.18.(0|1|99)|" - r"0.19.(0|1|2|99)|" - r"0.20.(0|1|2|99)|" - r"0.21.(0|1|2|99)|" - r"22.(0|1|99)|" - r"23.(0|1|99)|" - r"24.(0|1|99)|" - r"25.99" + r"0\.14\.(0|1|2|3|99)" + r"|0\.15\.(0|1|2|99)" + r"|0\.16\.(0|1|2|3|99)" + r"|0\.17\.(0|0\.1|1|2|99)" + r"|0\.18\.(0|1|99)" + r"|0\.19\.(0|1|2|99)" + r"|0\.20\.(0|1|2|99)" + r"|0\.21\.(0|1|2|99)" + r"|22\.(0|1|99)\.0" + r"|23\.(0|1|2|99)\.0" + r"|24\.(0|1|2|99)\.(0|1)" + r"|25\.(0|1|2|99)\.0" + r"|26\.(0|1|2|99)\.0" + r"|27\.(0|1|2|99)\.0" + r"|28\.(0|1|99)\.0" r")") def parseline(line: str) -> Union[dict, None]: @@ -65,7 +73,13 @@ def parseline(line: str) -> Union[dict, None]: if m is None: m = PATTERN_ONION.match(sline[0]) if m is None: - return None + m = PATTERN_I2P.match(sline[0]) + if m is None: + return None + else: + net = 'i2p' + ipstr = sortkey = m.group(1) + port = int(m.group(2)) else: net = 'onion' ipstr = sortkey = m.group(1) @@ -75,6 +89,8 @@ def parseline(line: str) -> Union[dict, None]: if m.group(1) in ['::']: # Not interested in localhost return None ipstr = m.group(1) + if ipstr.startswith("fc"): # cjdns looks like ipv6 but always begins with fc + net = "cjdns" sortkey = ipstr # XXX parse IPv6 into number, could use name_to_ipv6 from generate-seeds port = int(m.group(2)) else: @@ -117,14 +133,14 @@ def parseline(line: str) -> Union[dict, None]: 'sortkey': sortkey, } -def dedup(ips: List[Dict]) -> List[Dict]: +def dedup(ips: list[dict]) -> list[dict]: """ Remove duplicates from `ips` where multiple ips share address and port. """ d = {} for ip in ips: d[ip['ip'],ip['port']] = ip return list(d.values()) -def filtermultiport(ips: List[Dict]) -> List[Dict]: +def filtermultiport(ips: list[dict]) -> list[dict]: """ Filter out hosts with more nodes per IP""" hist = collections.defaultdict(list) for ip in ips: @@ -132,7 +148,7 @@ def filtermultiport(ips: List[Dict]) -> List[Dict]: return [value[0] for (key,value) in list(hist.items()) if len(value)==1] # Based on Greg Maxwell's seed_filter.py -def filterbyasn(asmap: ASMap, ips: List[Dict], max_per_asn: Dict, max_per_net: int) -> List[Dict]: +def filterbyasn(asmap: ASMap, ips: list[dict], max_per_asn: dict, max_per_net: int) -> list[dict]: """ Prunes `ips` by (a) trimming ips to have at most `max_per_net` ips from each net (e.g. ipv4, ipv6); and (b) trimming ips to have at most `max_per_asn` ips from each asn in each net. @@ -140,11 +156,13 @@ def filterbyasn(asmap: ASMap, ips: List[Dict], max_per_asn: Dict, max_per_net: i # Sift out ips by type ips_ipv46 = [ip for ip in ips if ip['net'] in ['ipv4', 'ipv6']] ips_onion = [ip for ip in ips if ip['net'] == 'onion'] + ips_i2p = [ip for ip in ips if ip['net'] == 'i2p'] + ips_cjdns = [ip for ip in ips if ip["net"] == "cjdns"] # Filter IPv46 by ASN, and limit to max_per_net per network result = [] - net_count: Dict[str, int] = collections.defaultdict(int) - asn_count: Dict[int, int] = collections.defaultdict(int) + net_count: dict[str, int] = collections.defaultdict(int) + asn_count: dict[int, int] = collections.defaultdict(int) for i, ip in enumerate(ips_ipv46): if net_count[ip['net']] == max_per_net: @@ -163,21 +181,24 @@ def filterbyasn(asmap: ASMap, ips: List[Dict], max_per_asn: Dict, max_per_net: i # Add back Onions (up to max_per_net) result.extend(ips_onion[0:max_per_net]) + result.extend(ips_i2p[0:max_per_net]) + result.extend(ips_cjdns[0:max_per_net]) return result -def ip_stats(ips: List[Dict]) -> str: +def ip_stats(ips: list[dict]) -> str: """ Format and return pretty string from `ips`. """ - hist: Dict[str, int] = collections.defaultdict(int) + hist: dict[str, int] = collections.defaultdict(int) for ip in ips: if ip is not None: hist[ip['net']] += 1 - return f"{hist['ipv4']:6d} {hist['ipv6']:6d} {hist['onion']:6d}" + return f"{hist['ipv4']:6d} {hist['ipv6']:6d} {hist['onion']:6d} {hist['i2p']:6d} {hist['cjdns']:6d}" def parse_args(): argparser = argparse.ArgumentParser(description='Generate a list of bitcoin node seed ip addresses.') argparser.add_argument("-a","--asmap", help='the location of the asmap asn database file (required)', required=True) argparser.add_argument("-s","--seeds", help='the location of the DNS seeds file (required)', required=True) + argparser.add_argument("-m", "--minblocks", help="The minimum number of blocks each node must have", default=MIN_BLOCKS, type=int) return argparser.parse_args() def main(): @@ -192,9 +213,10 @@ def main(): with open(args.seeds, 'r', encoding='utf8') as f: lines = f.readlines() ips = [parseline(line) for line in lines] + random.shuffle(ips) print('Done.', file=sys.stderr) - print('\x1b[7m IPv4 IPv6 Onion Pass \x1b[0m', file=sys.stderr) + print('\x1b[7m IPv4 IPv6 Onion I2P CJDNS Pass \x1b[0m', file=sys.stderr) print(f'{ip_stats(ips):s} Initial', file=sys.stderr) # Skip entries with invalid address. ips = [ip for ip in ips if ip is not None] @@ -203,16 +225,18 @@ def main(): ips = dedup(ips) print(f'{ip_stats(ips):s} After removing duplicates', file=sys.stderr) # Enforce minimal number of blocks. - ips = [ip for ip in ips if ip['blocks'] >= MIN_BLOCKS] + ips = [ip for ip in ips if ip['blocks'] >= args.minblocks] print(f'{ip_stats(ips):s} Enforce minimal number of blocks', file=sys.stderr) # Require service bit 1. ips = [ip for ip in ips if (ip['service'] & 1) == 1] print(f'{ip_stats(ips):s} Require service bit 1', file=sys.stderr) - # Require at least 50% 30-day uptime for clearnet, 10% for onion. + # Require at least 50% 30-day uptime for clearnet, onion and i2p; 10% for cjdns req_uptime = { 'ipv4': 50, 'ipv6': 50, - 'onion': 10, + 'onion': 50, + 'i2p': 50, + 'cjdns': 10, } ips = [ip for ip in ips if ip['uptime'] > req_uptime[ip['net']]] print(f'{ip_stats(ips):s} Require minimum uptime', file=sys.stderr) @@ -230,7 +254,7 @@ def main(): # Sort the results by IP address (for deterministic output). ips.sort(key=lambda x: (x['net'], x['sortkey'])) for ip in ips: - if ip['net'] == 'ipv6': + if ip['net'] == 'ipv6' or ip["net"] == "cjdns": print(f"[{ip['ip']}]:{ip['port']}", end="") else: print(f"{ip['ip']}:{ip['port']}", end="") diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 100fe09685..d839d3807d 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1,896 +1,2031 @@ -1.65.195.98:8333 # AS4760 -2.59.236.56:8333 # AS24904 -2.83.114.20:8333 # AS8657 -2.248.194.16:8333 # AS3301 -5.2.154.6:8333 # AS8708 -5.101.140.30:8333 # AS42831 -5.128.87.126:8333 # AS31200 -5.144.21.49:8333 # AS15600 -5.172.132.104:8333 # AS15600 -5.188.62.18:8333 # AS34665 -5.200.2.180:8333 # AS49544 -8.129.184.255:8333 # AS37963 -8.209.105.138:8333 # AS45102 -12.34.98.148:8333 # AS7018 -14.199.102.151:8333 # AS9269 -18.27.79.17:8333 # AS3 -18.27.124.231:8333 # AS3 -18.216.249.151:8333 # AS16509 -23.88.155.58:8333 # AS10242 -23.93.101.158:8333 # AS46375 -23.109.156.76:8333 # AS7979 -23.175.0.220:8333 # AS395502 -23.175.0.222:8333 # AS395502 -24.232.36.225:8333 # AS7303 -27.124.108.19:8333 # AS58511 -27.148.206.140:8333 # AS4134 -31.7.70.195:8333 # AS49666 -31.25.98.16:8333 # AS48635 -31.41.23.249:8333 # AS31287 -31.47.102.92:8333 # AS8251 +[fc10:efa7:ca6:1548:f8c:6bb9:1cc4:63ae]:8333 +[fc1f:22c3:95dc:a3af:4a93:8251:beb9:1858]:8333 +[fc32:2c16:d0d0:f1fb:3b27:c187:8cb5:9201]:8333 +[fc70:de9d:7fe2:b32:5828:1a3c:d0f:83ec]:8333 +[fc77:89c1:cb33:b770:f92c:1eff:a60a:b1cb]:8333 +[fc95:6edb:af65:9ea3:cd27:21ef:f5e2:29c6]:8333 +[fca0:151:79ac:8992:b51e:bdc4:6ed9:41be]:8333 +[fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce]:8333 +[fccb:248:11a6:1042:bca:1218:f7ce:7d3d]:8333 +[fcf1:22ff:3070:582f:a873:61bc:4bc1:81bf]:8333 +25rm76uae7qbj7dyrwxe5koi3eyp4pytzngnymgk2tm6m6ojzhma.b32.i2p:0 +2a4f3ac3rtweo5u5juqjdx63o4pytnpdr2ecnywjrdsd27pvvfwq.b32.i2p:0 +2cng4offkkneiw7xtfhvcgyu5rohy6ta4epowlrvnkbnuxfef3pq.b32.i2p:0 +2f6uzzetcurnwoioo65bgjjrhab3x5mgeacfojllwp77psjgwu7a.b32.i2p:0 +2hh75bmlo7nbwympmqjhtzoes7lxaxeph736i3vgrsq6uf3xkd3q.b32.i2p:0 +2ipe4z2l354zluvnxesjthdayd2n36qe4fuawqh64cetbufvagkq.b32.i2p:0 +2jgfxxzts6rfr5m2iwklltya2kmuejnkufpt4bavwjhi2j7fmyma.b32.i2p:0 +2k3lztzfal3k6dl7yrh2jykfa3xpmou2c7cm2ewo4qctkkvbhfvq.b32.i2p:0 +2lyuiflrruwnrvmlnsoxctsoez5bxsd7e7g766eamf4cw723wsxq.b32.i2p:0 +2muk57255tdm4g273fy7aitrmqnturut6krqojxz76jssrqm2rsa.b32.i2p:0 +2n23repkqxcbemx6vwl6wwkpel4xoezt6x6bissipxrz6dzijiaa.b32.i2p:0 +2ny6ifcupp7xx75a2anecwhih5kibumg2o3uqdk5j2ejn26jkv4q.b32.i2p:0 +2u6vnbkm3ofxqqzkxi5kynd55inreotaidt3dfca62fpgtxabdhq.b32.i2p:0 +2ucgg5wlvoxcas2o5lscp354ghcdwwpx5hadi3kcpr2p2pysk5ba.b32.i2p:0 +2v5nr3u3scbyxd3nkqxinw2pvqqe66y4hc3u6gotil2sgbyivruq.b32.i2p:0 +2wvq5am4tsc3ejeeunhhofp6tni244zkbqz7lbqjycjwcw7v6tva.b32.i2p:0 +2xygt6zbuiqvl2jdn2dlavjjzumqpwkgjawfosmhkaozwodcgl6a.b32.i2p:0 +3bghwmgjmsmpjevkvou3eldck2vvvvidykxvomn5kxfogmjwbxrq.b32.i2p:0 +3covklglzlod2sxmjtyq3rlzqd57kcfjricj27yyexg3rc2hroqa.b32.i2p:0 +3gfnwe3y6n55facql4jztmrg7slxif2vmbl3ygg44p2rno57yrwa.b32.i2p:0 +3lmii22nacqrs76rd2ixpgyudrchmyrkqqkigns2nk2gcffuv3da.b32.i2p:0 +3nbv3o7j6h3okg4orvk5zfhcjdjnwxuu3cdusqh2lqeeogv7uzsq.b32.i2p:0 +3q6nv6vg5aas7i5a457ckf46nfw4lyvipdagxlhujwczqzuvu77q.b32.i2p:0 +3rgwk2zwdo343z5gjxzddvig2ivr2htncvmqxmvkvlta27ceroca.b32.i2p:0 +3ru63xjzrqphkve5xw6ev3iharlzqs3rbp475yxnr5ma7bys6q7a.b32.i2p:0 +3slxqwc7rmmpnhv6dsk2spesbt77v2j25yoktwqztpnpnt2got4q.b32.i2p:0 +3t23wkj2tslzm7ytzoxzbdekf36yzno4wjllgil45j7qqlzv2dda.b32.i2p:0 +3y4oiw7cglzzshasapfmlte7ixbgpl4js7w2afsd4znemu4ddefa.b32.i2p:0 +44qgfpibsi7w7ulbg76yt5hyi33t6unleq7yifhbhdqdy5ihljyq.b32.i2p:0 +45eh6rxbfli4ju26cqaf63vfs5xx6zgt7hn3uzzz3nem45d4ps6q.b32.i2p:0 +46t7icqffks2db3utvtm7mbycopbcewpb2dihwfapdi2ukeke5pq.b32.i2p:0 +46xory66pc6qxd6glapmcrxujp6wc5swghhbnhybvewxffo37gaq.b32.i2p:0 +4ccr4ejpia2pn72d6xok5tubyb2gii7pjdqb4mwyl4c5wiwoysoq.b32.i2p:0 +4dde4fh6gybebhqtoiraoqjab2w3qn2ym4u36l6fdwmeb63ljm2q.b32.i2p:0 +4gdidscp3badfijfuesami5opqpz5ntjw2ephfdhb3i5bgrzzh2q.b32.i2p:0 +4imp5e6332cdcaoeqtuif7xymlwpmstgchotaoa5kuzgvc2wpqvq.b32.i2p:0 +4jh4w7ifveva6rh7l2nemqor4abako6qo7rdjq26lr6anfo6gbsa.b32.i2p:0 +4n2z2vlqzupmc46hh4eizoo2nhmcucmrggpiivdb3prswlnf3krq.b32.i2p:0 +4nxdyltgdwpfkautpralacdlolzlpwr43cj4ig4gozn5y43gk6nq.b32.i2p:0 +4ocs2dc2jkd2j3kedyjn6kmfvx7lkdrheu2n2wio5zv75sedzk6q.b32.i2p:0 +4ripix2seo5ac3bjb4a5louhtbycghyf3leysidy22wnbak7tzjq.b32.i2p:0 +4supe3vqjcq2pp55vdploz455wpwgmnjqgadlvtlteaxy6t437fq.b32.i2p:0 +4trblupsxprghxtsglv25zhy4ofxm3fwa4y7mmesso3x2fl2khwq.b32.i2p:0 +4unxgzwe2zlrfgivsl72b4z5he6jawedzuceu3usvlp7bcoj3c7q.b32.i2p:0 +4xpl5q7i5uu3yktqqaw7jaanmamwsgtxsdl23ds7nugh22lxsxjq.b32.i2p:0 +4z7l5ldbrcav7lv3u2a4hso7uaclug5yfcbeztqmmv5hyw6crdda.b32.i2p:0 +4zc3ku23mmbnkjvy6mcfgvgkxdoxzvioqnfvle3q6pmiuaixotfa.b32.i2p:0 +53utzmap3lyrl6m7ws5oo73rpc3y2dawcu43g7q7hkru5qx4djua.b32.i2p:0 +54h4pb62qkqott3do63jc3jflpt355n6gi5coad6fkkdvfir7jga.b32.i2p:0 +56xx7arua67o6gzmz7fisqsco3s5yx3mhz4g7dwp73nvjxx44idq.b32.i2p:0 +5dfgzcf3ccte7riwfodvefwhet3f4z6nubeln73q3qpyadbtekxa.b32.i2p:0 +5dx4sfe4huncxaflmwo5kzwgrbtvvptttu65fgjzquwl2vwizhtq.b32.i2p:0 +5kog73uwths255tdrwee7dc2pshq6xlukbxtpgn3bbwunm52jwdq.b32.i2p:0 +5on4kc5ev6pbv4ib53xcwhwve2d4agh5drzwuoqwvmrqv2czrjba.b32.i2p:0 +5pjaaexikmlyhl5dihzvqbykuec6uzkyujvvs5bjoi6htlb3oxzq.b32.i2p:0 +5puvvkyv6qr2kaqb2avbqxzhdyiquhk2767omhoa2s52gcnfcx4q.b32.i2p:0 +5pvqmsnbnldzogflte4nwyxpr6jn4x4rxmrbjcwjknwwz4255rkq.b32.i2p:0 +5qf5uwixbva3xzmrgl26k2bswq27ome6uurvhcea3i57rhz4lqgq.b32.i2p:0 +5qn7zzaxno6jogdskmjqlssi5k34ibkokcghts7vrfctb4vmc6uq.b32.i2p:0 +5xhyftag6e6hjwdosgffvkxk3fo5muk5vqbcxbithtjr6zg6vuwa.b32.i2p:0 +5yme5e7jmq73zsm4ap4agnkiwrupjagrybusvlyzemeek7lreswq.b32.i2p:0 +62cmrc6aio5blhc2rx5qgwai2urelcq2mtkl4jpprlyt6kihlbsa.b32.i2p:0 +62srw23f4rrxzs3253g7mb2lbop3pfpsu56g5iiptrao3qoasd4a.b32.i2p:0 +6cb5bbpnsnr4uxlkwtekxbg5qrwpvdqfpgncl46xndg3np4yfita.b32.i2p:0 +6dkvhlhwoiwpdjpebuemxq66soh6os6xa2sq42dwhfbp3d4sdzga.b32.i2p:0 +6mroga77egf2fzs7y46huhxwesppxx6k72jc7h2cznq2fmcaelsq.b32.i2p:0 +6rsbnc2njzfyppwcjlmpt4dxzndxe7scyc2vjzjvixlt6qebslwa.b32.i2p:0 +6ujb3xak7iformdm7xjpbzuyqzuu3tmdcngvhioqnzo4emcoxz3a.b32.i2p:0 +6v6jax64xiqf6dekptdqjwstuf63v2s5i6px3kn7camlji75ilzq.b32.i2p:0 +6vrjslktb4gtjx7uifoje5o4r5lsfasdcfbrnna6r56ruiaiowqa.b32.i2p:0 +6zsislqyaufihc6atpm3hnlo2uwewhnitnlzqzh7rsfgim3vt6gq.b32.i2p:0 +764xiwqk2izz4tylrba5urvqjo73q72yflkiubmruzpd2bib4pda.b32.i2p:0 +7djd7fbu66r6xwmisj6r2sfgcten7ovticj2zp4gvenhpbrokyiq.b32.i2p:0 +7fddpunmty7eruhumq2iqa2yw5ckcn6xpsw26pj6csnhnty3jcqa.b32.i2p:0 +7jwvx7eged34ctrgyrt5y6x5p7xzkfpidvwrxjplqywqa5dqlg3a.b32.i2p:0 +7lx7lr2taxmtbdx5sdqo2apwka3br7iig5mejzkxpw4ksvk524hq.b32.i2p:0 +7o3sndesp2d7mrkw3qlpfipknxddu4tz2l34hpymy3vexfyg27pq.b32.i2p:0 +7pmzb44ybjrq26wq24pdjz6tkktgwkyvvrpatmsbsx2xs3f6x43a.b32.i2p:0 +7rmw4miaffahgwpy42fnd324fhiq4dygn5denzxtik6gk3slhqra.b32.i2p:0 +7utc6ztzqaljtirabf3l5ynvf3akmzofayid4caia6nd6z6a2ebq.b32.i2p:0 +7vupqprsgbad6v2trw75e7kpk7vhmoyxqqlaxrkfwofg6qkfm3oa.b32.i2p:0 +7wgrywhskd24kqqjvodx6bxnjnv374xlnrwssy7zqd4wza5drqmq.b32.i2p:0 +7woh7qguyjfcmqu43k4hge6uehvfh5gdwel6ps2mjpdttml7iybq.b32.i2p:0 +7ykkgcm6pta4sywgl4klcvl4b6k4ucrxh3vw3s2umdpb7zejarjq.b32.i2p:0 +7zxl3ohprpqmnmsz72el5o2wqzs5ybc5ixie5i64ayvzhjbhe2bq.b32.i2p:0 +a2zioocy4z3jijn6qzl2grifqd7hvuk6kagjv5maoqrnxwoucdoq.b32.i2p:0 +a4ot6mtsfgtkciklj34r2zvkmxtbpg5ycint6zehehf7xtz2djka.b32.i2p:0 +a5gtxv444a52shcmjq5v4zkbmxfwn4o5ofqlyirhmr5goonrimvq.b32.i2p:0 +ab5xl3uj5rmagrwfwraocuinjthvb5f6wtstktlrjrlajnarteia.b32.i2p:0 +agd3ebr4tmkj5pnrukswh7luxk7bftdlngwvvntznc2rr5awkaqq.b32.i2p:0 +alwzfqb2uol3fu2tbmwy72kqxr243pwabg2g4mtaomvjetscckmq.b32.i2p:0 +ame7bnmodeayhxcsb4hh23ocakzaox4bm5mz6yfkpemhb26wpnuq.b32.i2p:0 +apiu52rucnbhji3q6qfxfbqdw35woslfpfm2kaca6mjobvrn4kpa.b32.i2p:0 +aqwcmdtqbg7g4b7kqpzpbkzoqhyy6epydjx276vgv2vg5kw2rywq.b32.i2p:0 +atyfkxoezxfmpmnbj4lmzhxtzaatiidv2exc7gzzm33brhapwwwa.b32.i2p:0 +awvhek2uj5fenn4scqhhdp5vuzg5vrrl7f3qasod7cy222iwb4iq.b32.i2p:0 +ayn7r3jdijhcl6t6gexmq45dw2tap2l67rn7xgoisaenkel74wha.b32.i2p:0 +azavco4tqpr375qqgan567lcmotlib6h7jjh3rboutrxax7u6haa.b32.i2p:0 +b36faeb2flnkg2tigqi7rxlnekwiljt25drgow2d4jvsruktqnaa.b32.i2p:0 +b3au442ynpqirynybrf22qowknc6leljlbq4xix5xjk2ehlkr2ha.b32.i2p:0 +bf2j2wma2oq2222heshaivpon6xud5fum3pzuuffgu3ddg7ss3ma.b32.i2p:0 +bipk7yyoxznzzs7tjyh2y7nieuph2gccf4x55vrci6w4aefbxlxa.b32.i2p:0 +bkmpto4dtnblvlqvyknp2fa2cfugse5u5oonoipd3qooizqdvbua.b32.i2p:0 +bnwgr4t47loftduanvx2rgcse7gls75b7zq5ydtlluesa6p3gxqq.b32.i2p:0 +bq56m3mk4w3q4fmh5vcrcxcusssmd7ygi4iyrazrhpbmjh4bnsja.b32.i2p:0 +bsiz6td65kdvoyx3d36w7ctinc6dkieasg6575dkotlpaxbplxzq.b32.i2p:0 +bsn5rlu4h3a4xpklhhymxorogxpdgudstloclzshghb4deiui3rq.b32.i2p:0 +bvqrib7iaoymm5oh3nkrfp2u6zfp3v3xgwp77jmvruj6hlulxi3a.b32.i2p:0 +bwq6y5u7jcx77ok4iqpjtiz5re4qagvhhlr3skhe3s4nphnrfhaa.b32.i2p:0 +bwsuwvghcfdegz2vg4vrrh4gqbs2yez6w6mzmct2gt6hyregfnga.b32.i2p:0 +byoucerid5rb2dducaqwepaytvkw4b4l2wmbfkbfgicflfcd4dta.b32.i2p:0 +c3xl7bimshx3o6oxwhq2jfmhmmmike2jbx5icugysmefwgs26n3a.b32.i2p:0 +c4rbwijavo6m4gj3sjo6jjwjdvmlmzml2mcagrbw6tqn3rixmdiq.b32.i2p:0 +c5az3bzjm47vsp7sps4yaltcifv2nvcolftvmnyiwrctrkwjjhma.b32.i2p:0 +c5ytdepbzhdrwn6ymkrk5a2ll3zkwpgk2la6ec7hs7ysvcxhf32a.b32.i2p:0 +c6sdbzckovbl7hd5bq5pfkkwc2xtdkx7b357bk3v4vdspzmy34cq.b32.i2p:0 +caqiocmm72yn5ymatzbeo3se25j7mhp33bd32xju463vr7ef2voa.b32.i2p:0 +carg765pk5ef25vhvpu7phus75yp2xmwf4juphulsksqrho5krsa.b32.i2p:0 +cazzdhgkd6ejtqu3hdh74cfnhq536ktrcnww7yq6lyjwd7ocs4iq.b32.i2p:0 +cgeb2ffbyjb56vhuder63aeswvhy6isvrhivwbxfaqcu4th5pj6a.b32.i2p:0 +chhqibkwshxl5afottq3f4qhtaw3esesunfc4xljqcjeqcht7d6q.b32.i2p:0 +cilepisotgs43xi6s7lwlahpxnp55qjti4dck7i2y3kicq7tmw7q.b32.i2p:0 +ciwvimts7zzoyrknhlowmzh35mzx4cluq7uycw3ffcckuov4tjjq.b32.i2p:0 +cjjktdv4wtr232f5jtw6rge6k2bmxbunelq236vqt2yte6jnqfkq.b32.i2p:0 +cjvo2dibbl2hapfbqnpqbcgfpzzwkpkojfac3zo4t7iiwuffjj4a.b32.i2p:0 +clqwslg6ijsxtydfzahhxymkx7oboofarzbzrzrla5mhtmpyvdvq.b32.i2p:0 +cmfgxulstg5trnmmssjvdrq5e7taqfta6jpuiqzakqujddhljs4a.b32.i2p:0 +cmnpbzyfif37aq2bncdtp2wankepsaxpvpexjpydwm6etufqseha.b32.i2p:0 +csq5rwmdv43eii7ohtywl4ou6kuewf5wb4nswifkfx2iri7fzdlq.b32.i2p:0 +cuktr7luziv3z44rh6ef75hl3atlfqcszodgjwqahgxsstaevvsa.b32.i2p:0 +cv4zl42obux6uk7ghxuujbwzl4kuaneruiq2gqmaksxqfcbnxjkq.b32.i2p:0 +cws3w5267jj34c4icoz2342dgbm66dr2gljqkeih7kh6e65r2z5a.b32.i2p:0 +cysjtseqmtwng3ty25dapg6gyzozmbzv43zqhg7abu3isjhmac4q.b32.i2p:0 +d3gmwp7tebwuagm6orga3hwhhuchp6kwsfcsdttittcssjhkshnq.b32.i2p:0 +d3udzfukxm3cm2ucd7oen3glvgtymah3r7wdndli7tl5e3xttswq.b32.i2p:0 +dclij7rdlmxclsasycgjtwczkksmjykzcqf5z4yvyhofichqyh5a.b32.i2p:0 +ddtuamdoynsa4r543psethu4ygfuwvcc7ftlb24ak2n35gnmekha.b32.i2p:0 +dfhkpobqzc4soif3kocu62sodohxekxmye5hybt7lr3agqu2k34a.b32.i2p:0 +dhci2k575bhvvi2pf45or4x3ts5csnm3yqzaff3t2tsx4mh2d76a.b32.i2p:0 +dioihjkfyyb4xgypkmfpdepzmrwoju5tc4v7bwmhcdrllnpg4hmq.b32.i2p:0 +diqahlv3xidi733dkqymddufa3ftlbxoxcgqmtvnrjs4kc5qzg7q.b32.i2p:0 +dllxsougtvwyyrhthsud4onw4q4jtpirzghofsuahpunr2pkfvya.b32.i2p:0 +dlz27nejbzcswguuwzgpv6efms3uaunximpnarc7djgjtqjlthlq.b32.i2p:0 +dmed6el2h56j5kno7xocalj6k7ehosyr2fbwcrk5yf62c3edcodq.b32.i2p:0 +do6y4lsrp2qzfenbmplla2shhysigcrdjuvb7b5rg2yuedjs2wra.b32.i2p:0 +dqr3ge73yw7ctie2vvfmowhwiywplwavkiozfttwop4sthhg6fcq.b32.i2p:0 +dqyiv5vbbxpvvzhg4z4s5d4ztjq3jeeafy7q53vuvv4gshfponoa.b32.i2p:0 +duawsbyorcgdipwpuvt3f3tmnyqs32xr7h2kzyjhct44vx5i67eq.b32.i2p:0 +dupayeh2uwvnmz2c3ti33x76zgnv2uf2rkp75kgdg3zjlyuv4xgq.b32.i2p:0 +dw7oovp44knhrikivfmt3hs2lz2trlpb7xout6dlinfnzxeac3sa.b32.i2p:0 +e6qoyaetj3zf5jmavn44avsjdynx6oc6lxdgxfsq2bq3zue4nyeq.b32.i2p:0 +ea57r6dh5gjumzc466khizfymzl4j6mxuq62t7kb7lnbp64lxpcq.b32.i2p:0 +ee75buofrqnhkjmvabyhfalbkz3sjg3p3wchl3wlaa4cz3ua4wka.b32.i2p:0 +eedgqvf6vrxdvporvfh3ihjizegyplk3buupvu6v3cbrmiplv6za.b32.i2p:0 +efopxval2cwm7fe2jxd2srg5bm23cf4q37bnydecszxdhflvcwpa.b32.i2p:0 +egweubjkn3bvp5ukk2qdtkvfuss6hmtc2pmtblmtyteu2ax4es2a.b32.i2p:0 +ejq34wotitjk7o5xmxdlx6zakrxchwwtk4vggpfpxx2abyacrh2q.b32.i2p:0 +emckeftl5wkd4mylivr3hrxphs775rpcq5s4jm4kxdaamc7luxlq.b32.i2p:0 +epzzk4ta5pn6ralqol4fp35j4gzjfvcjnmm2oefwazk2dki2246q.b32.i2p:0 +et5ndch6nw756ds2myh2ctvszhqek66j2y46xtnh3qz4m7nbmqea.b32.i2p:0 +etouz5h35ofnip445vwtffvtbl3qbvx4dfopf7ypscxhboeuy2yq.b32.i2p:0 +eubmbzk6rtpu3utz4crdwvm2jy564cywwwrw6dz7l2kfzvaiyuha.b32.i2p:0 +ev2ijxlza3gp26vxubheds4oxsimlvttrv2ezgnger44qpnpyoxa.b32.i2p:0 +f23v3vovpxxntn7xsm52uf6hzfngbmyhwbcdbtg2pqaoebag57tq.b32.i2p:0 +fae3tesbnlbnl4flz4hk7eud6axewuisklvw634nplv7ieeg457a.b32.i2p:0 +fbmglhmeasq3it5ziaow7pczmzlrbwavo726j7secd4wugakepmq.b32.i2p:0 +fd7npzmrpdkfsrsdytagsjpnzww6y5vgomxulnfpwbdiqup37yqa.b32.i2p:0 +fdraytuzmed622myazwpw2sg66xfq2pjhpplt2smi64dqv6qb3eq.b32.i2p:0 +fghecqp7tm3doc74vozr2qiddpo7j3kfzy2tu2nfckpoqss7qora.b32.i2p:0 +fh3yb7elyvnzmhxv2hap6ddqcym6lpfxafavkuhrrxk5sb3wshva.b32.i2p:0 +fnhesnhbix6ua26b5jpbieas7s5lglvusmruk3tciov3wyry4g2q.b32.i2p:0 +foc3ole3bfsxzz6sxufnwzhx72cijco6oefwggh6a7mx7kytbk3a.b32.i2p:0 +foyb2sneia3ygbbjozz4wszcaznztjbgkae4d52iskyxxzku2xra.b32.i2p:0 +fsdn2phijfbwo35ezvgtkzv4p7wp4ym3yfd72ucfcahnw524d22a.b32.i2p:0 +fwex73tw3ebsysv3sziu4pl3pmgkbdm32mc73uyiswlcx7btcf2q.b32.i2p:0 +fwiu4gd7i6da6gbslctxpetgkb7kz6bznemcsl7oy7f6aywmndvq.b32.i2p:0 +fzuoiirfzhnml7egyor6b3bzthptsioe6zuwe64mn4pktmi7c4la.b32.i2p:0 +g2ins5xhxtdd5m57rkopn2rm6mtr677ktmo26ymcrc2bz5v2igla.b32.i2p:0 +g2mv4wdsdd423imdpfq5dd4fsifa6evmvdmj2pccb2nqtfas7dza.b32.i2p:0 +g5ayhhbanipee5wyehvfsf5cuqn2djl6xvrcmuv2r7us6mrcl7da.b32.i2p:0 +g5eujubxvzwiovihiedokkb7uwheiqb674rfa2xijsyyr3sexiwq.b32.i2p:0 +g5yzfhaelbngq3zqfpufdrpntpqr5urnoteaxmnzqkcsfuqs5svq.b32.i2p:0 +g6cxz6yy54bbkkjrklbq65ujlwom6i65sh2wbhe6zebnrciwhzsq.b32.i2p:0 +g7oomoe6adb3qtwit5aztjx2lpnvkvopqgtb5xtdozara754miaq.b32.i2p:0 +g7samwpj5lyi5hkrrwizzmzez5a5r33dq2uwa7ufi6pdv236qyda.b32.i2p:0 +ga25oahtxga27pmece3snv2vlpcim4gitvzjl42mc3oxkhclxgja.b32.i2p:0 +gco2hwi2rcbbapcxkzy2m5kaaui7csxqst337pycftz6kwyeraqa.b32.i2p:0 +gd5r6jobykemsb3beip7kaham3tyfr23w7lrkjvo3zagrgbrgnjq.b32.i2p:0 +gd6pjdoj6nniith2nkvd6pdhoq5rugxbm5emz5exlhieyc3hnbna.b32.i2p:0 +ge7ppvshhfd2bf7eywnc3xepbeh5nzcqyqf5tdchoimt7nxhz2ca.b32.i2p:0 +gfartwr6pkbz4a356heez436fw5im4thimitetn6sdsq55prb74q.b32.i2p:0 +gh6mgvrqvx47hmgl2uhdn5623cdsrdbe3fwtgp2y72svvoi7gyua.b32.i2p:0 +ghrzttcyxr2ujobdxvl5pljjfywy3hfyq4i4mqiha3t3uuiqn2da.b32.i2p:0 +ghuf53y3dxdnxgjjxast56jcsjohoxffc45mbx5wvx23mt6q6nkq.b32.i2p:0 +ghvmoyhep4sayhgen7c2pcg575aiihrwlcngm7lxxqtbymbgmiha.b32.i2p:0 +gk3sjjgjcff2gxmxy3wejlxbgqbohxsnfxdmd2p5ybm5o3pgqj4a.b32.i2p:0 +gmdyky27756xd4dcky734kuqiojgwdbhavz6ou73dpkg2xhwjrsq.b32.i2p:0 +goe4yckghgepu2hsctbizoszs27r32hexxsovbbkqqi6t7n2k2wq.b32.i2p:0 +gqerl5bp6brqik4pxagwldb6d2sy5enbxav7y2a4ttgeczlk6dzq.b32.i2p:0 +gvlhwl5joqjjd7n76ve4tcbqn3rhzfy3ipmdwiql4cjfayyfiwyq.b32.i2p:0 +gxj4yw7xhezc2oodjmmsfxmiopfzxjmbhmfkipcal5fivqfc2gfq.b32.i2p:0 +gyccxcchiq47yfzcerb23dr57mqvqptip6pvnemasbd2vpbgs57q.b32.i2p:0 +h2hcwns4deljblz6xbkba6e7eltqb75lh2gjpelgkxvg4ey5hp2q.b32.i2p:0 +h3urnunwn6chzvbjvs5x7dvfauzwnozcxtj5vjjdyglnfmlzigzq.b32.i2p:0 +h4k3d34tuim4gi4tfie5ulslg6jg3yqhafujajno4pmhy62yecna.b32.i2p:0 +h7foalesr2keimfe7qv3fwygefwukvoojtr6mlgw5urw7jojjn6q.b32.i2p:0 +hcv5zizlrdemafcezwzchu7klydbrquutmdvr5vwaawdcpcwouyq.b32.i2p:0 +hfu5l2szzt7faqsbef2reqku7pdhxhfbi462pahejq4ykaeqgizq.b32.i2p:0 +hglrt74vwbajhbaykjwkbjrdtptjxgnpg3w2crfphv2jss6of5ia.b32.i2p:0 +hiewpc5jb63t2xlr37tbvzba4jywo74iei6hl4meadbj2jibow3a.b32.i2p:0 +hnmrabzioiwxj64ih237rxf2zbdttfndiepp7vikt2jko7ovvrkq.b32.i2p:0 +hnxxsx7stxzesijof4fgr4xxysunipnivnxc3lqj2lefs7k7dqfa.b32.i2p:0 +hoclepz72rcrwjxzsgl4o7uvxih5uzyqkin77iovccxwyek45eyq.b32.i2p:0 +hoislrpk3v4grtevg5mowggoi2zbltk3hfbgp23qht3zl4sn4eaa.b32.i2p:0 +hpaio6vghijyxd6fxboef4f7ogxhusqcyetjbp3ymmmbv6tzmg2q.b32.i2p:0 +hwd3yvybu435k2svvcowd4hgbk3yiemw34d5xauf3e6hr5t5wd3a.b32.i2p:0 +hxuyh2weoko3iof7hhvffcira3yt3ggmxb5prio6tywor4vut6ia.b32.i2p:0 +i2k32sb3fmkhemu2gzm7h4m24ubcgqdohhgq44qya7zbkrgw6mua.b32.i2p:0 +i2zleprgvnwstip4ehhny44y4cf6mp7gqbl7y62x3yndjx3s7nia.b32.i2p:0 +i6p5plk5yucb6klnedouoiubr47jpw5u6odvn3gwbtxqhmzwvvqq.b32.i2p:0 +ic4ybawsjcxr4gfnwvp5go2wsugw6govevz2lmmef25z2mfva7iq.b32.i2p:0 +iccnhyf2ma6m7vcbu23dp4erpz6vzf3emlrx22w5e2pie5hh2v3a.b32.i2p:0 +iddzvtvx5l4mpfv3lkutmf3nptl5qxtzv3qyxlhwbkptz2mphyva.b32.i2p:0 +idzlsjx4m6n3g4knql7h53bnnh2v62o2qt6monicpz7q56u2jwlq.b32.i2p:0 +ifajz75zdk6w63v5zq6tadlq2cycyd3tkstultnqot2fnglgxpia.b32.i2p:0 +ii7ra5loq7nw43kxjtr6tdhf6clvtnfqqatnaz2mtr6pf5hyelbq.b32.i2p:0 +iiai66vnuffmhnjiu6wllnx474hwkpw5eqowj5k7i26z2ea7dd2q.b32.i2p:0 +ij4nbzypgqlk6ztlevbjuly4m3uqantz36eyed57tciqhmlgxfqa.b32.i2p:0 +ik3asfioedfgrzjszelqicxlnban7qfnvlnng2prol5iut7ltc2a.b32.i2p:0 +iorno6nomjiens5qvzvdeav2mmizcxpp5wsbicdazpg3gvthqtaq.b32.i2p:0 +isefwae7twhnzwgrhcfrvk5oxymgxpzuokuc5cywmo55is5nb4cq.b32.i2p:0 +itrjkgswudaoyrrfmgpi4vtbowcwkpzs523lh44vbzwbmcz44rka.b32.i2p:0 +ixhgawpp5anrlwxxgfun4zl3m5xhlxassszncph4i4e6aymb5fqq.b32.i2p:0 +ixvv4njukuae6msnpatik45oucfaabpeisbauqxddhwnubu25ioa.b32.i2p:0 +izrk5tzrxm4lq23qbdiaoxbzzhygipuucoyapz6ib4dprxmfrvhq.b32.i2p:0 +j26gpaan5ablb56k4rtbeamv3ihd4vdzdv74dw4kkevxruapwarq.b32.i2p:0 +j3lqwybu6vptuo27tpnkckliz2weani3pnzzbziwfsj6nqcb43la.b32.i2p:0 +j4tjrfxnwcmbhkixmqlnotginhfxgfdvjahr6yn7j7rkbdqngh4a.b32.i2p:0 +j63slhfjsmvtoetikb364pztywrlrv3rpk452mf3dyjizm4fbdra.b32.i2p:0 +jbtdslz743oawsvgghp2traf2e67de67ec3dbigvyb6g5jotapoq.b32.i2p:0 +jd43pc2l73ek6hk2tp6hiyada7ed7vshqo2fvxbga2daylcghfyq.b32.i2p:0 +ji3bxuak6mmsvcppqrt2g27haiugobvqbyngt2n5cgtf4xmhyx6a.b32.i2p:0 +jibaw7ynbnxueqsy7k7jyvoj6ldzbuckppfx5wozt7mftihy5vcq.b32.i2p:0 +jiins2brur6m6dt35rr2rj7giaggvwcffz6lsvxcrcc5nfv2a56a.b32.i2p:0 +jpl5utzbcmszv6xjynf4buz6hn3kra27xvfowplvjalpogrsxjhq.b32.i2p:0 +jrvg22xvbmjyrkqg7mr622zhnda3ijtua65cqngwrven7sf5zd7q.b32.i2p:0 +js2nuhxqxp7ocg6wh7n7dflcjiexkyfauski5hc2w2hke42mygca.b32.i2p:0 +jspsip6bfqu55yxd45lf5kpbhn6bvtt6hgycixbzoyuwoabcenka.b32.i2p:0 +jtgpesmlbpsvhv2jxzrokydnmad7aqbsx5f6ptyqol4ypwkn3zyq.b32.i2p:0 +jxqyize2ct6mm3jvvzavm2zbccsoe5qd4ekqo7zgt75rzz3mni3q.b32.i2p:0 +jyugnnxqhe6alidik6xclgxb33mx7jqzqosznijr4i6zaqavogma.b32.i2p:0 +jzymnirkvpexwtbykienuhpcp6hf2r5hko7wjlvorhsfaojihf2q.b32.i2p:0 +k2m4cxmgn7wnv37tupfq66ycjcwcd3xubhzhgjkxluxn4hzym65a.b32.i2p:0 +k5oyn7higpqwarsh3ukdgmx3z6tvqcwju4xawrge6aaswrdnoo3a.b32.i2p:0 +k67qwu4dtuehpxm6d2nl6ik23fvdtn52rmmznoh5qitd7wylmm3q.b32.i2p:0 +kbq3zwwo46vvvhubrscfpwapbck2dx5lvyu3cs62s7ntjdyruh4q.b32.i2p:0 +kcj5ifya5tnsgeyqlgxjigdnwy3q7gdodqikmfotsz6vbbtkfbqq.b32.i2p:0 +kcqkothplemakipfpeajxmu4xsszpaxpprgtuv5tgfdaqejg2sqq.b32.i2p:0 +kdc2f7exxzig43scf7r5clipy3ywkwxhdevguymkadcmhxalyxzq.b32.i2p:0 +kehosmgk76fxnjywqjj6nqs4ohg4hsutljdzjo4sswhxlj5l5tca.b32.i2p:0 +keoewoantu2e4yah736fplwr5omvzqdryadofqogk3hbwaskn6jq.b32.i2p:0 +kh5svu6npgstymw2kuxamwnzalpu5jcmgx6gsliibsua23jds6rq.b32.i2p:0 +kizk5v5e3khywdh35vwvztsub274pruigqnmumorv36otvncbpea.b32.i2p:0 +kjdqyu7j6ojdhftlh6dd4do3ns6nhj544uzjt53p4cwhppg47mhq.b32.i2p:0 +klfp44ljmaxoxhpymmnuj33d744ai2wcbj7o5i2cv5mkjbmjc3fa.b32.i2p:0 +klsaj4g2jh7w7gxwctniktg3hqwspm7zlkwtsaxw4nu35jssjasq.b32.i2p:0 +kouxxivmwywiwv77bvpe5lgamnhlcypan6urupymt3s56lvrnftq.b32.i2p:0 +ks2nfolgkpdfg7pizwv6kueyqeqaixjru6ui5qktcycsyulppg7q.b32.i2p:0 +ktjqkbyl3soy4kscrs23n2bidiismoq2jvsx7d7p42sxizgf46rq.b32.i2p:0 +ktua3j43ijxhhhfeljsp32kdiuic5nlnfnkx3ealy7ojva4vwkoq.b32.i2p:0 +kuzu73gzvlnog4cdtdk7edbusxr4pigknvwg2bjo6l46ugsgmrtq.b32.i2p:0 +l6kwirv4m4vzzmg6lp4mpbu6k5jv2yjmdgsxxr67x6blm57i4dsq.b32.i2p:0 +l7j3gpfyicterbchswmaasozruckfohtrnqssqttsxggjomlccwq.b32.i2p:0 +l7lvurgolje5wjlbzjov5lwntoumxrlx6depd55memi6fy24bhba.b32.i2p:0 +lckuhkvnnkh5gs3s4v4tdpesmdjiruqhfifgkszyfsgy6vx2h4ga.b32.i2p:0 +ldl3a2gjjlj4sqmvbomn3gmj6xig344krwxy3gulhlcihyvqdsya.b32.i2p:0 +lfm6pz6nqqm4ofhlkja4y63myjjumgrvh7qul2ejiimrl4izdgwa.b32.i2p:0 +lfomaqlecc4ieyaldsm26o6affnlx6nsqup25wasmd3f26qeghpq.b32.i2p:0 +lfuvzzzceuik5u5pnd2i67amegel5ua2rrnncxkyyc7bhteq73aa.b32.i2p:0 +lg5h76b5n4r3ne7bwpf7be5byyncrapo7thhkuzaktblk63qvjsa.b32.i2p:0 +lhl55njfnmt2fzbklcnunvscq22jx4nxd5p4pureu74442mrjgwa.b32.i2p:0 +lprgmkc45te7skx7rffpz72ca5c3zdg3tabiksdboao5w4wceu5a.b32.i2p:0 +lrah7acdsgopybg43shadwwiv6igezaw64i6jb5muqdg7dmhj3la.b32.i2p:0 +m3rq24awypjmmimszz5cqsdwo7okpkjpilny4ss2vuxwq22fqdfq.b32.i2p:0 +m45c54fio6dij4ywvnjosbokblhqsynyds4ywagrrrkzhznoryfq.b32.i2p:0 +maqk6lnttwykae67lhms6car4py5p6w74ntyv7izskl7o5lr4x3q.b32.i2p:0 +mbz4wyfeqtllccary2crak2qfovnaq2366vdddro76ihxcaavfpq.b32.i2p:0 +mektdpdufe6p74i7ijumj5nw5ckjtphj3ic42fbpstgdlwpvqjaq.b32.i2p:0 +mf6tmlegp7uga66cdael5376uaz4qd3wacuh44yvepa3kbu4fk3a.b32.i2p:0 +mhgxec57s6h7eixgemsghlcuhmgh7m7p7phqd5kzmm4wovrp2pqq.b32.i2p:0 +mjpulaafdyuanouslfpjcsvumi4edtckfu3ffn3ipabkxj4sn35q.b32.i2p:0 +mrzn5dwt5suy7ywbc5rb3oqunxu4whkrarfdabh27rdzqu2lycoa.b32.i2p:0 +muz6dlwaldiabrmv4goironrkejtjiaivtp5s4wy4xiktwu3firq.b32.i2p:0 +mv7b44duaxqpzbdztnrdvnj6ypsp7yhs4z3dc2q64jov6pritmja.b32.i2p:0 +mwevh5r5dkzddlo2ol6bojpdds3kno4xqoy6p6ulid3paamgrtla.b32.i2p:0 +mwyjzdrgtypbwjyulw4ifetejz6xusqstvzylztsphpg2r2zf7ua.b32.i2p:0 +nbxnyibgbf3awxxneu75a6xhvs5foxrrkfzwjywk7vs2pp7dfupq.b32.i2p:0 +nghwktleeqp7j4zmii3u55hgxip3kd2xj2hm2hb7qrf5x3ym7cwq.b32.i2p:0 +nkj2zabj5b4vhold33nz3kgp2x3i3es2l3iz64rxx7em7rkgubaq.b32.i2p:0 +nluwsgpbk3cplcb2fpnfpjrhot2w7a6mtjggkqikudspysqlsceq.b32.i2p:0 +nt72dtparurtk3ccvasllacdzg2ubtvc7jp2kzx3hs4dzvrtayqa.b32.i2p:0 +ntxiyrlhss4r54zz762ugascfnpyucuzhvt2vdbjwysoyohlk7wq.b32.i2p:0 +nuj7cpelk27czgrj7vcyv47qazkdlqfhaz53huzxohv32fn4raya.b32.i2p:0 +nw5dd5rrmlmrkrf6ncqtivajhq2idmr5zluw5hv35tngsmngnprq.b32.i2p:0 +nwfdwlblhudom3oqe32yzzuuj2sb37tjvlmimiru4coazi5freeq.b32.i2p:0 +o2dfd5fx3mwyw6fig2qiesnl3foynovu2ifhixrni23uiw7gnaoa.b32.i2p:0 +o4mhr3ptokcgwopb36okxwhreo27pqq7m3wnuczm5rbku7yatuoq.b32.i2p:0 +o6vbupdnpd5bwvcx7ivaecgyo7x5vdu5em4va6cmx5iwcf5tyaca.b32.i2p:0 +odbgdisp7y4fj5xqycwzibau7cwzen5wpjph6betdvgsicxx6q5q.b32.i2p:0 +oefjimgz2vzsjixg7h56gukedb6n3gfw6m3e7mrxypzg7givl3cq.b32.i2p:0 +oig6mlccmguof4iar5y4kqotjllryhtse6j25ch4rgcerqinms2q.b32.i2p:0 +ojrr3gjhfhlshhnvrbvyqxw2wuonng4a2oq5ooph6bmdl3evhxtq.b32.i2p:0 +ok5i76xbjhfukzcsffxtjn4anq5lwgct2ktov2lnttht2ic2v3fa.b32.i2p:0 +ol4zsxh2mml3wmdl6ix3rtu4fontev4w437kp4rns47keidcz5dq.b32.i2p:0 +olctygj4urjaes36stgzuxnfvjsnub67g3qtasaxo5krmiqwwm4q.b32.i2p:0 +oqbvnqidy6wtal7amigktvq7iggyv3ghirvi5h3hxvwneb225u5q.b32.i2p:0 +orvshryqq24l24e4dvockx2ekj4hu42otqxsvyvy7tm7hhdjsz7a.b32.i2p:0 +osrwb56pz75vgfs5q3dtsgxoib2ijz7dzcjcktzbbklceg32ggea.b32.i2p:0 +ouk4enblrjm46yoycsybi4usgtysncd2eyli4pstqh3yunhrcpxa.b32.i2p:0 +ovb6oh2sliwf3q5ncjcpiyhatfb4zjsf3bg3npmlf54ry23mr55a.b32.i2p:0 +ovkjylbsfe2756cpphzx2zvhhmtbetr5ci6swmydqc5itajqxm7a.b32.i2p:0 +p37ckc2woa4tvpt7opht7btmks7ni7cdrj3a7tb5aqw5euthacwa.b32.i2p:0 +p3qxhtoxajkmt7tgc6stv55msievc5323rtrsiwstvtf37iwi4dq.b32.i2p:0 +pcdlqw2awppohbiued4rffgs6n3lv3thhon3r67jmx2652qx2khq.b32.i2p:0 +peh2c5jbvzupm3stkgkmrlkhzzlnn4lqlejlehe3xjartzm4t6dq.b32.i2p:0 +phixf45de5tbuqt3yla4cldxx4cckybafsbiu6mbuoru4b5wttwq.b32.i2p:0 +pivckwqf5htiicsoevadbi2qtkapd3fr52jbsijhlwr7ksc6i4eq.b32.i2p:0 +pl4dsxve665bl6y5dtldtnldp3mrzkuw7hs45juitlay2zj7xvva.b32.i2p:0 +pnhspu3rloczdbzsysa2iftsgoiy3zgcd22jodmk7zdjanhiemla.b32.i2p:0 +pnsmjjbigqktlxpuxwvuc7jb3bm7f3rtd5xfulrwbjxdqhzjjsaa.b32.i2p:0 +pomodyf3nnav7yeu2usrshzq7dvdqawrhoau3uxlimivhy46lmaq.b32.i2p:0 +ppe2jfsb2xrmgwugbq7agy44ucb6yq4qbufaf2sh76b4kwpa4jcq.b32.i2p:0 +ppez53yrs6lanyvyxuxblqxiuvhnqvvtafmwaid2kgp2dx2v5iaq.b32.i2p:0 +ppyl3c4tanrlkpwzi2zpctkmevfceo5a6mkemsyvgg7gpwl44k4a.b32.i2p:0 +prgq2fqhzc6lbtyzefqfx477sakkfumxv2i7psco6tdi7zr3yrma.b32.i2p:0 +pri376r6uuwgnbnevki7c363h4ryfwjza7pcbfswqqxk6hnrkhja.b32.i2p:0 +pscw5yzaj5js2fn7gzrzoj6teonlsohlbnvdco65ubdefpnpwhpa.b32.i2p:0 +pv6g7uin653rerdiivdgtoirjvokjowi4b3fwatszdlteyos3i2a.b32.i2p:0 +pw42656k2vbwxmvrc2qbsz3jslvcxahln7rehsbia5jdio2knh3q.b32.i2p:0 +q4o7bf37e6afx7evwdyovsqptjwo6td3c6qtjh4rtdngp3trwi3a.b32.i2p:0 +qaqvxmyvq2m4wombmtaz3our3qmp7eet3qle5flnrs3a5wgfhxba.b32.i2p:0 +qawed5ou5vb42ugi42goxr2s6cqzpyh3s5atkhvfvyhyc6anxyaa.b32.i2p:0 +qelsaseevnmz2unpovh4nbpjpshjg45iudiaf5zbngealwwuxe2a.b32.i2p:0 +qf3fj25vq2dbp6bvvmcroixohcsk4qfvx3t33kztomgmyu5vdkza.b32.i2p:0 +qfnafktekhndrriu6mkd3dxao5lpm5hdgezot2ngvtu4jxjh6fmq.b32.i2p:0 +qg76yse42g7rjhy52hhyo34jcpdmqfp3jh3dqeg4yxsk2bzsp4tq.b32.i2p:0 +qgemqcxwh34xaotjlik26ygvu7hgjzp3zp4fqzs3gy3stcgzdqpq.b32.i2p:0 +qgeudiusyeltzl5ghvhjhdhs5cqa5jjspjlcshdsqk6kkk7t727a.b32.i2p:0 +qh6w3hgua5ftynnmg4bqpposs2qwgfmxk2smxirne56lbbetspda.b32.i2p:0 +qj26ldkxdaa5pgvmifp6uvwlk2rbg2l5vnew3vewevhivjzazzhq.b32.i2p:0 +qllztpshewimlfgxfv7gyqu76akuutu77a3qo24ubz44kk7cnffa.b32.i2p:0 +qlvxgvl6kmfuclivjj2hdliuhqp6cu6tl2gqbp4sxxlw254a7xcq.b32.i2p:0 +qm6vfq4pfvjg3r4g22xkg47xc4d2y5c7qlsoqyhfppsvh3grjfka.b32.i2p:0 +qnqojlthym7z4gwizcblhpd2thy7v4a6ifme57bzyl3nxzkj6ica.b32.i2p:0 +qorzdjceszf432obxa73tnwhqb7ltxrxlfkkqmw2flmfjhoyv36a.b32.i2p:0 +qpe55twml5tsuow2sfxac56a67hhf7gm4ogtsv5wqkfkrmpd4d2a.b32.i2p:0 +qslxyiesbbegxr6ksmh2lfk66pogbubvvbkglvowikkpgvdppbwa.b32.i2p:0 +qsqtfbta27nnygmsiimzu6exhc2jgps4aicfmw4dgmmj222siuaa.b32.i2p:0 +qtb5fd5yaytg4n5xviyaqpljdprj76bzektgyet7grlogm6gwwaa.b32.i2p:0 +qtubqd2rbzzftyje6r6zzcao35knliq2df5v5kzs77y7t5gaxwja.b32.i2p:0 +quzkrgzb5pmn4465647ke5lsfbseqnorr6ljvfsxcagj7rzl7hcq.b32.i2p:0 +qvuzgrsquvskvxpac3fyrh6ssho7jx3mcdrdgprdbel76o6yxcvq.b32.i2p:0 +qwdrunaogud3v34aod63v4upwcoawqs6hshrye3quktuxziorw5a.b32.i2p:0 +qwhvlprhk3ntswr5xntnc2hhgmvd3bbgzgkbombiibhrsj7k6gyq.b32.i2p:0 +qwtpmh6ssnkeowocnvl7uveuhfodht3hsgwwydhy3v4xmwqbwveq.b32.i2p:0 +rb7x26lmepfbcd7wtxu42pf4tdxbe5p5zsf3cwuukd4fs4zhxtba.b32.i2p:0 +rcsddyxkabmkkjrjf4rbf6cimlmcxxmvdbczq3bczlmyn5q3tqfa.b32.i2p:0 +rglf7mv553yknevqejaf3xleqofmm3cyjacbhv4jzosylrkrp5gq.b32.i2p:0 +rho4s4jbcb3dvzgxxzijbhqxic2manxm244zy6suw7irja5h2mqq.b32.i2p:0 +rlivtzxori6lpewmlr2jdm42iwxt3ex5sodwzhi2f6vjc7lur54a.b32.i2p:0 +rlvwiiu6emvj46hjukstww4dfknmsqf7xphmdy5tdsftyem5kpva.b32.i2p:0 +rnfc6sekfhk4hyyoa3ro74pg7kx7dgh6y5qs2huwz76bh7ymnk4a.b32.i2p:0 +rolicqq4ebyfgjgpl7xjokglkfwq7vy2b56aloe5bdhzpfzbt2uq.b32.i2p:0 +rqzsypuk7ewsyh2xtihabkp2iyshxgdatgrhghpnhhlythszoykq.b32.i2p:0 +rrm2pems425buhonptp7lbtbprmwwjhbftey4ujvk25nclx7rerq.b32.i2p:0 +rtwm6njef5tifwv5ols3b4nsboniig5kdw32ik5qbv3wmhoo3pba.b32.i2p:0 +ruccvtj2tlvj5s4yqexhgosk43xyyqdcfql5osxpufqn4u65wz4q.b32.i2p:0 +s2sa4qnikyaaiyv5s63l64w6qvb7dkq7elorsuen4ksnw4mu7xsa.b32.i2p:0 +s2x2k3gw2y4vtesxrezvpubo3qubpr5qckxolc47z7rbshjjhvpq.b32.i2p:0 +s3ct7nrzj3w3jpjvnsp4tdlyn4enl7rbf773kiklrdfrh3oj3g2a.b32.i2p:0 +s3sh2zyyphzyzvznhe7s3lbv7eeqwk6kmayqcoekdyggaza543yq.b32.i2p:0 +s7mu7i6gygygixd2ccrfex4doywbx34umcj2ba24atn6qbo34szq.b32.i2p:0 +sawmppomw6zlu3ruaobnlc5y7kg54tvgvfmhimwdfmorzmdmc7aa.b32.i2p:0 +sbalp2doxyedtr52kj57va2rmbi5npspv4drk4vxnujag72gtpiq.b32.i2p:0 +sedndhv5vpcgdmykyi5st4yqhdxl3hpdtglta4do435wupahhx6q.b32.i2p:0 +segnvtkjqqhzo52njxma3jgerwblnpvqrojjyeuqgzav7dwjlzoa.b32.i2p:0 +sjd2fpbiqucslisyynpxvsmxg2jydqpddyaodnkuptuwkiz3cjbq.b32.i2p:0 +sjpqyf3rq7ojcalldlybvyyh5lqiq5j3ade5w6txe3473ybhk3sa.b32.i2p:0 +sle3cbbdom6rknc3drqtawctpy635ica5d5gerjjdahfymkok4ma.b32.i2p:0 +slg46wsae25tx4mjbncrrhbs4rjfzxcwmm5jc425cnipruoo22ha.b32.i2p:0 +smrvlfmq4j4ddtlcpzwixyvlunhvh56omu2k5tyjkbdy3itqgadq.b32.i2p:0 +sszwxree3mlpsnpcjhgqjh2kxltan3xua5pyp3xob6sonphyxgka.b32.i2p:0 +swqpk36n4oyqc3e234eml63pn5hblxai6epryfuo23pdgfemsl2q.b32.i2p:0 +sxb7p33xjjinvolexb4y3k5kx7uwlzsnzvbv46i3lyorm7gsv6iq.b32.i2p:0 +sykset75mlxa4igxqgmfu6o5qyvlr5wtcsqkehf53fguuyt5rkla.b32.i2p:0 +tat2veaz5nwsv7g3czy2mxr4opg7bkeegegdfqjgaxlt6qvk2dma.b32.i2p:0 +tcx3ftsdl36ukysuuewydapdzuu4alewyg22squei2wda4a74tba.b32.i2p:0 +tdvomapjxmxg6ktoedyrndhrjtk3ex4rll5ijkmdcvakzamubslq.b32.i2p:0 +tiomg3tuu3uza3nmdztsode67rn7v6yv4f2npb57l6gnwoenfdza.b32.i2p:0 +tjfdp6mel3wzdpxkhbyhrmfrha7gekv3gghalnxezrmvnhy2ncra.b32.i2p:0 +tk63xbzug7def6esivofwq2h2c53ar3ot7hsezdq3amxqqaoyr5a.b32.i2p:0 +tl3xkknuukvyinyhvt7saz3tvz24ptgyqtzy3igygyfapcf2o3lq.b32.i2p:0 +tnvg4ol42joykttvxs66yoyrvdidhy3vr7mrjf7ona5sf4h36txq.b32.i2p:0 +tsdpkr6llyohtsarxgepqehdauo3vpdcqdml6evevu5mhuu4bsyq.b32.i2p:0 +tsrlbxayhihugr723z6rkyafglnhcyzi2zhojzsyfdjsqkkd53bq.b32.i2p:0 +tsxwmahei6rt2vwgygdvzh6dyp3boh3ixpwq6l5yw43eq5sfgy2q.b32.i2p:0 +tvbutrv73xhwqbtosmbp3cesdyc5bbtslay4gjsf7rzdx4ztgzaq.b32.i2p:0 +twu4qyvf3sttu6vsjwujjqbd37wlkthndbi5so6undt2abj72bqa.b32.i2p:0 +twwjmbvrcfkl7s3hh473jwmxdys2zxo2ozlfivsjvbh2kobl3vsq.b32.i2p:0 +tyvsuqy36cx2yvf7jhnkd5ojc52g6vxl2rw5qshqwpk63ptovdda.b32.i2p:0 +u465w7hete2bpjhsn655oan4ryxbrb2muvc6abhv7wy2hw54vcwq.b32.i2p:0 +u4enqhila7pkwbwuyfbfd36qllbyv7y3p4nelxekrf3fizp4htza.b32.i2p:0 +uc52rzz4xu5ikx6hl6r6sqxfmiyyxsffpcu5frrtepczidwjwuha.b32.i2p:0 +ufepan7c77blkedldhiygt7363boe3xwi3oy5es6eapfdd2nivka.b32.i2p:0 +uhkfrosqc2uqczwcktbb7ups5b5t2up7yhmicryrzqknkj334rnq.b32.i2p:0 +uiz5w66ez6dyncfivv6ihsnccx6jigyjbnfv7voztugyuqrnt3xq.b32.i2p:0 +ujfge4rusfh4bcnuuenva5cch5eji6rxwox7e337dy23om4sci2q.b32.i2p:0 +ujzgzob27kxdc3gtj46qgaewdfhex7q34njlzcm22pq2suyubr7q.b32.i2p:0 +ul6hbnoyd6gdhm32dw2la46ik34b2hhjc5wo4rqilw6wbvbqbvoq.b32.i2p:0 +uls757zxmryrazn36okmcdkzolfohv5ftetsclteibv2dwnuxm7a.b32.i2p:0 +umlbkwpm35dpp66ggxt23tdzsqh3t2ancdyrga5nxidn2lnkdgxq.b32.i2p:0 +uncalsdoypwylzugunja667sdynbf56f6makgjkygyanuklb7lda.b32.i2p:0 +uohuxnjd27cftarbf6kh4czmotwvstpon2sgs2vpffqkgmg7guxa.b32.i2p:0 +usgqijrwhtwgoekjcr26yqcgpncwpsescrr3eek35e3rhkrtptoa.b32.i2p:0 +usvobohlqeb6hre3dkqjqgzul54cn2s2htppk36bsxjcz6ngajba.b32.i2p:0 +uu2nvtd5jeppiovo7wksv7lrgl56kog3e5js4cxpgik3wwqj3w3a.b32.i2p:0 +uxq6sz3jptldm3r3o3ogwqbxqhpqg3hrroyiy4lpvjjqf4i5pata.b32.i2p:0 +uyy4dbfyx2i2x3goobc6uxj4nb7ktzsu72zlksypjfisgka3xnta.b32.i2p:0 +uz4fa7nlzuqgmwfukqm4jkkng5pwfolyrbd4qtsorv7qa7cxcmsq.b32.i2p:0 +v3ob2c7arrot324zel5w7ibmfmud6lyhkqyyldiwnxphdhm2e7xq.b32.i2p:0 +vavpoevto45dv5spd4csk3ut3afe5cldtzvoceuiix4ingmfhxla.b32.i2p:0 +vicxbb4ts6jmqj52hhx32mxnwpur5covzxotaiy6zhaansldlodq.b32.i2p:0 +vlmixyf7yg5xqe54r4htfrjdrsci7k2broic5n7vugry46m5xuoa.b32.i2p:0 +vo22o2zy6gb4nsmcteelpyoa4khh3hogoe3jsgis6yglyrtxzloq.b32.i2p:0 +vrrkgdrlov6obcqqyu6rbcsu37heehxetutnacl6qgr3clm7aeza.b32.i2p:0 +vuqk76jvxfk55bkovqcmmkvycmndee7j3tuv7ezdb2slrfpjyvoa.b32.i2p:0 +vwbls7ihzlzwu3uapbnzfsudy75dp3ih2fp2psffli3ir4iuezgq.b32.i2p:0 +vxjkydkgnpl4j7pt4qrf3ec3ds4ks3ucb347k5xae5jg6f5offga.b32.i2p:0 +vxs2es6f7uw2uuneslb7ipvmg6kqh6ytpjezoj2ptwx7od4jqmxa.b32.i2p:0 +vycnqqqrlbexyr37ytulbzesazy3voozq5sz7j3o6vedxic7ionq.b32.i2p:0 +w3iu6clea65cckmimaclxdvuxsudbghfytphejcsp5ufyfgfppra.b32.i2p:0 +w4moc55z2f47lfyumqap4td2zfcjrjd34ung3vircwrpp3ts7oiq.b32.i2p:0 +w6jl2gubyscdpubizes5bp6s42cito4k27xwcjwh76rvuik2prha.b32.i2p:0 +w7fsijz4juktjzpksc2iec2ljtdykgxere3m3dwfnqztl2fto2ca.b32.i2p:0 +wacfewi6ehmfxvftxqmracfh7se2t7ozl62u4hsuyd4c5xfzuajq.b32.i2p:0 +wagprvzeuinlzec7hxrggjxpex66uikbvh32lhdv44ez2z5vgxfq.b32.i2p:0 +wfrvnaeqad6zevflyme66n3p77b4axymni33fu42bhsaei6cmrpa.b32.i2p:0 +wll2w3rtszujy6lmfrvexgyv46czhfx4ym7fiyf3mdwl3mnbzcgq.b32.i2p:0 +woyjnznau675j4mazibi5cjkr3ts4sqtp6ufidi7zozanczdyicq.b32.i2p:0 +wpnewole7fofvwvrvkkgf45sgcverlodocu7fstm2axp5jfykraq.b32.i2p:0 +wrqu543ssub7kiwzfug4o7m6lc5ibmaamdc3o4uo6a7ntxiqzd4q.b32.i2p:0 +wshmvsvqjnzlvsajbqr34vr5hlqxdywees24eubv5swignloww2a.b32.i2p:0 +wsulywnyo6kuppkz7lcaecca3kvqjpynbd2ysvvuj6dylnd3vf2a.b32.i2p:0 +wtdyush2aybxg2ga46txd7oiv2nmulrhv3bfzilzg7rbzf4mbu3a.b32.i2p:0 +wtfebbwmsxoywu6nw5cowlxqhtokxrxftve2zee6flvrpqg4j6ma.b32.i2p:0 +wwbw7nqr3ahkqv62cuqfwgtneekvvpnuc4i4f6yo7tpoqjswvcwa.b32.i2p:0 +wx7cpx6i263dmx7vkhveuzyazdjy5pfrrt4f2y6fhiev24v26gtq.b32.i2p:0 +wy2udklgydh7iknnffbzvldoiwsct6dy3o7fjcsjcdjoq4b65vha.b32.i2p:0 +x3mabmgx32hljbx46xqjobh6l3tvrridnxgrla4q7s2bgkk63aqa.b32.i2p:0 +x4tbcqodj4dbatrsjjznx6srdycgmcfknqkoo6asb7aisc4wtmxa.b32.i2p:0 +x6vn35i2xv7lwpeasn3eihdii56v5wllemaallxlwq56j42du34q.b32.i2p:0 +xateuy7lebnitxx634irwytrprp3s6o7agee62pm4oytvffbk2ea.b32.i2p:0 +xcjjg4k6fss4b3lpihknh5ws2esug7i6j5gehjta6ejxawxlotma.b32.i2p:0 +xcoq7v26jvysna4zqwbfswfqqb5hjmdqys46j7oczzu4g3craegq.b32.i2p:0 +xdmcmjahaeyue2mknpavqkflccaznfdosl4jxltzo2suqdyc3mla.b32.i2p:0 +xfrlfngubzadfa4bvqdirlkzlo5uunvcvlwppvxbz5vgf64tm54q.b32.i2p:0 +xfyzfugo3qtfpq3s5zccbbqrxfkgy3ttlqhz6t6ovmtgrsuyce7q.b32.i2p:0 +xgbz5vpek6vaeej2zejxrjloqg2sqb67gim72qqpodqfq62rflvq.b32.i2p:0 +xm5nole53h2rwys6uiz6qc65yw4dkqkfxuobgxrmvo5fwqgxeohq.b32.i2p:0 +xn2wekjcxrhkm66vnvea2lx7yxsu3yx5cbmkjbcdct66wlj2jfta.b32.i2p:0 +xn5dz3dzloj5g6nr2qzw5ldz6rlcainm7ddpstjfopyirctw2hkq.b32.i2p:0 +xnvsgbonlja7cmeokr2msvdelqlasbkwgqndqg7eakw43t3m465q.b32.i2p:0 +xrwuqylcgkr2ovsf4pziosd27ywd7pfaohnreoyzm72qlnvoktrq.b32.i2p:0 +xvlj55kzoy7qtdqfs4o4dqyuajw6bkmydiymdi6nbrpr33toj2xa.b32.i2p:0 +xwlkpubkvsdsyaeylqfmxfk43juk6sz3hxnmwe4zencjq77aznea.b32.i2p:0 +xxxqbqzrtilchxwuqyqrfmuhwbpia2kurv5ho7g5q6a7bvsvd3gq.b32.i2p:0 +xylrnmpubtdsdhab37syiiaj7shmg4bmhgss4vkdyvsogp45fdrq.b32.i2p:0 +xzo2nvkiin53drbnir65zxq42sfkybnbgx4ozmeayszvjjrppfpa.b32.i2p:0 +y3kqvifjucu52hg3f27f572vc4lburush7s7q4kuepbxmnlroolq.b32.i2p:0 +y3occl5rqc2mz64esu5mqzoyfzlbxop7tttf2b3gyxjust57txfq.b32.i2p:0 +y5wr2bw3rt4rvw7hqqj7qtlf7vdds6zk6cs3mu3myyduasieqoka.b32.i2p:0 +ybbmx7a3zau7c7ax3glgj75mza5e5dpibzy5j4p5qduttgo4xgbq.b32.i2p:0 +ybdhpsgmtw4eewreo7kswclgexdztzk32a5x4pbr5ws6nm42gpoq.b32.i2p:0 +ybx3kj4hfjcpxtifqy4ziztx3pqyijindks7zdacq3vk3cjzyztq.b32.i2p:0 +ygtc5m4mh3qhi7tct44gxqbenhkasp2y4ydjn5qua4l5vh35osdq.b32.i2p:0 +yodn52qhw4v5aoaoqfsunvfecbbl6cyk5j4aq2pfm4otu63qlp6a.b32.i2p:0 +yphmy6w3myyy3am5awdksfyhbmmleqmblru3pfoajhjdilktwdca.b32.i2p:0 +yradzf5ip7f3qq6kdyqm6qqafygk7a5spov6a2miha2dk2u4me3q.b32.i2p:0 +yrpsrh7tn3qfgnu5djdubjca6oodvxaheanpcmwh2cwkekqrtida.b32.i2p:0 +ysenhmvz3jo56h57zzzvr45y3t57rvt7vi37p2kdiz6fpfrbmucq.b32.i2p:0 +ywlcceffoptf6vynbgut777k4w4agc7tvhvvlnlwtdzq35v5mvga.b32.i2p:0 +yzsnqd236vyo77afhxnbmrnie5fepnuuvpwqyz5lvmqeihx6z4ia.b32.i2p:0 +z4zjvj27uxkzwmltkyd4jslrkqpeqtkztfql2nlsunetkkkl7vma.b32.i2p:0 +z6g6lmwuhnldiazyf72zlsvtwbql5mfvpmyaipuvjfwnb6slel6a.b32.i2p:0 +z6mlyrxcjddpcaoumxnw5peulnkvj56hgwqmnc5adoutp7piujaa.b32.i2p:0 +zaq7uso4bgzhv5beqjrwlciyevzv3g3kyalvtftombe3m43myesq.b32.i2p:0 +zas4vpvbzsno3hmqu3tlw4mkalvu5xiollxveapgsolub2mcimuq.b32.i2p:0 +zbymohtlahzy2ygf4pw3kcxg5mzu6mjhzonucfks6txhv54f2uoa.b32.i2p:0 +zckxrkzbo66y5k442djsd3cgffvp5t2us2ewv2i6f6dwpaxxaxpa.b32.i2p:0 +zcrenbrluidv3wbzdsvw6jvkhymp7yric76zcd4dfdcrr2n4kpga.b32.i2p:0 +zcwgqw7hlw7437a7au6n6obljdb4arnshoibdqo6voree4xiznoq.b32.i2p:0 +zd7xacyuee22h2qjmf4e77vr7zylardqnehldv7j4uxu7urfljka.b32.i2p:0 +zh34uj3cwyr7zs2uc4aeyrhffgumxd5uzpfpbmbuyetqkd3xy4ia.b32.i2p:0 +zhqbovteqcfmhg77wcrpre4njrguxkc3au42sf4wmzeb6mjyggfa.b32.i2p:0 +ziijxo742secxdbebrvaxf4pbbr7hip53lgnexnswvaoaxap64ua.b32.i2p:0 +znt6mdvmstxcdaqeiuo67k2ug4e422gjftrnm7ov2izaeuh73d5q.b32.i2p:0 +zs3a5qtz7ruxlp6gppcqw5wneafdwbn66j757xg4adpjyt3ec5ja.b32.i2p:0 +ztr3c7qz6v4hrnegmkzjsr52wyi4u6ery4m74sk3m77oup2ws4ka.b32.i2p:0 +zvgkzfbaqzkxfhc7bnwim3srvcmgwq6ndihhv2zpbymtwkloxm2a.b32.i2p:0 +zvs53qyzauufv33zdsd76tf337kyimj5edep3xqjimhc5t7rfv4q.b32.i2p:0 +zzpgfcs2vuybf4t337fpeidybrsfqkuetvkg353ja3juhjimlmqa.b32.i2p:0 +zzx4goazsdha3hvdzmppxp4sxenhzz6g2mlz3inanbzaw76s7coq.b32.i2p:0 +1.1.189.28:8333 # AS23969 +1.34.178.212:8333 # AS3462 +2.13.146.228:8333 # AS3215 +2.56.245.204:8333 # AS213250 +2.86.50.136:8333 # AS6799 +3.123.190.28:8333 # AS16509 +5.35.15.93:8333 # AS50340 +5.78.108.233:8333 # AS212317 +5.79.71.147:8333 # AS60781 +5.149.248.152:8333 # AS59711 +5.186.60.13:8333 # AS44869 +8.209.97.98:8333 # AS45102 +12.221.144.189:8333 # AS398337 +14.203.57.50:8333 # AS7545 +18.169.180.38:8333 # AS8987 +20.74.80.10:8333 # AS8075 +23.111.172.18:8333 # AS29802 +23.142.145.238:8333 # AS210000 +23.175.0.202:8333 # AS395502 +23.242.4.83:8333 # AS20001 +24.0.172.162:8333 # AS33659 +24.49.240.218:8333 # AS11290 +24.90.140.41:8333 # AS12271 +24.118.34.69:8333 # AS13367 +24.125.96.34:8333 # AS7725 +24.146.33.13:8333 # AS7992 +24.152.147.11:8333 # AS10242 +24.164.176.84:8333 # AS12271 +24.210.23.136:8333 # AS10796 +24.220.72.43:8333 # AS11232 +31.18.200.28:8333 # AS3209 31.47.202.112:8333 # AS34385 -31.165.78.146:8333 # AS6730 -31.165.228.138:8333 # AS6730 -34.64.101.4:8333 # AS139070 -34.105.19.97:8333 # AS15169 -34.126.107.179:8333 # AS396982 -34.126.115.35:8333 # AS396982 -35.245.186.117:8333 # AS15169 -37.15.60.144:8333 # AS12479 -37.16.105.63:8333 # AS20904 -37.120.155.34:8333 # AS9009 -37.120.179.29:8333 # AS47147 -37.139.102.73:8333 # AS35816 -37.193.227.16:8333 # AS31200 -37.220.135.151:8333 # AS41206 -38.53.129.67:8333 # AS40237 -38.54.14.89:8333 # AS138915 -38.141.134.140:8333 # AS174 -38.145.151.150:8333 # AS40545 -41.72.154.66:8333 # AS37153 -43.143.203.198:8333 # AS45090 -45.15.124.117:8333 # AS35913 -45.43.97.103:8333 # AS26827 -45.44.213.116:8333 # AS54198 -45.58.187.101:8333 # AS46844 -45.79.192.236:8333 # AS63949 -45.81.241.97:8333 # AS30823 +31.164.229.252:8333 # AS6730 +31.189.53.251:8333 # AS24608 +31.207.53.11:8333 # AS8758 +32.220.61.208:8333 # AS46690 +34.40.131.0:8333 # AS396982 +35.204.253.254:8333 # AS396982 +35.214.111.72:8333 # AS15169 +35.217.18.242:8333 # AS15169 +37.179.155.30:8333 # AS30722 +37.204.171.82:8333 # AS42610 +37.209.87.163:8333 # AS3209 +37.251.41.41:8333 # AS1136 +38.40.110.66:8333 # AS398721 +38.41.59.162:8333 # AS397422 +38.42.237.194:8333 # AS395354 +38.75.215.250:8333 # AS397377 +38.172.75.57:8333 # AS13693 +38.180.242.6:8333 # AS58061 +43.156.93.235:8333 # AS132203 +45.45.27.233:8333 # AS5769 +45.79.223.168:8333 # AS63949 45.83.220.102:8333 # AS39351 -45.83.241.46:8333 # AS206238 -45.87.106.57:8333 # AS39238 -45.129.38.5:8333 # AS49666 -45.130.20.177:8333 # AS3214 -45.134.142.40:8333 # AS60068 -45.135.4.143:8333 # AS25596 -45.135.92.127:8333 # AS12555 -45.145.188.112:8333 # AS206805 -46.23.87.218:8333 # AS51088 -46.32.50.98:8333 # AS39642 -46.32.78.17:8333 # AS48416 -46.59.40.91:8333 # AS8473 -46.138.246.77:8333 # AS8359 -46.166.142.2:8333 # AS43350 -46.166.162.59:8333 # AS16125 -46.175.178.3:8333 # AS28725 -46.188.15.6:8333 # AS39153 -46.188.30.118:8333 # AS39153 -46.223.223.216:8333 # AS51185 +45.88.106.107:8333 # AS204601 +45.150.66.10:8333 # AS215402 +45.154.252.162:8333 # AS41281 +45.159.230.118:8333 # AS51167 +45.190.192.174:8333 # AS269868 +46.10.215.188:8333 # AS8866 +46.23.87.218:8333 # AS60131 +46.39.187.205:8333 # AS31246 +46.59.13.35:8333 # AS8473 +46.136.116.252:8333 # AS12430 +46.146.231.187:8333 # AS12768 +46.148.235.36:8333 # AS49505 +46.150.161.43:8333 # AS49106 46.226.18.135:8333 # AS52176 -47.88.86.79:8333 # AS45102 -47.148.7.69:8333 # AS5650 -47.198.223.60:8333 # AS5650 -50.2.13.164:8333 # AS62904 -50.4.135.84:8333 # AS12083 -50.53.39.237:8333 # AS20055 -50.53.250.162:8333 # AS20055 -50.68.121.44:8333 # AS6327 -50.117.132.178:8333 # AS577 -51.154.62.103:8333 # AS15796 -51.158.150.155:8333 # AS12876 -51.250.46.215:8333 # AS200350 -54.176.63.16:8333 # AS16509 -58.158.0.86:8333 # AS2519 -60.205.205.119:8333 # AS37963 -61.74.99.193:8333 # AS4766 -61.92.59.104:8333 # AS9269 -62.122.173.171:8333 # AS50245 -62.171.129.32:8333 # AS51167 -62.178.27.239:8333 # AS8412 -62.209.210.3:8333 # AS6855 -62.215.127.73:8333 # AS21050 -62.238.148.104:8333 # AS15435 -62.245.153.8:8333 # AS8767 -64.146.136.45:8333 # AS16713 -65.21.134.184:8333 # AS24940 -66.18.13.146:8333 # AS13767 -66.23.233.43:8333 # AS19318 -66.27.98.216:8333 # AS20001 -66.29.129.218:8333 # AS22612 -66.38.94.13:8333 # AS11979 -66.45.141.46:8333 # AS11232 -66.58.243.215:8333 # AS8047 -66.114.33.49:8333 # AS23175 -66.198.211.167:8333 # AS10835 -66.208.64.128:8333 # AS10352 -66.219.196.170:8333 # AS29933 -67.210.228.203:8333 # AS7819 -68.183.75.251:8333 # AS14061 -68.194.125.140:8333 # AS6128 -68.199.120.17:8333 # AS6128 -69.4.94.226:8333 # AS36352 -69.8.175.201:8333 # AS21766 -69.59.18.22:8333 # AS397444 -69.196.152.33:8333 # AS5645 -69.228.219.124:8333 # AS7018 -70.64.27.12:8333 # AS6327 -70.160.240.132:8333 # AS22773 -71.79.109.128:8333 # AS7843 -71.184.193.75:8333 # AS701 -72.15.59.173:8333 # AS21949 -72.48.253.168:8333 # AS7459 -72.207.171.210:8333 # AS22773 -73.117.132.138:8333 # AS7922 -73.212.226.59:8333 # AS7922 -74.76.151.110:8333 # AS7843 -74.91.115.229:8333 # AS14586 -74.118.137.119:8333 # AS20326 -74.213.175.108:8333 # AS21949 -74.213.251.239:8333 # AS14978 -74.220.255.190:8333 # AS23175 -74.221.189.109:8333 # AS26827 -75.83.203.225:8333 # AS20001 -75.172.52.186:8333 # AS209 -76.24.143.22:8333 # AS1351 -76.69.202.247:8333 # AS577 -76.73.198.242:8333 # AS12083 -76.119.248.240:8333 # AS1351 -77.20.48.144:8333 # AS3209 -77.22.152.239:8333 # AS204028 -77.37.224.222:8333 # AS42610 -77.48.196.234:8333 # AS16019 -77.70.16.245:8333 # AS8717 -77.162.190.90:8333 # AS1136 -78.20.227.249:8333 # AS6848 -78.21.167.8:8333 # AS6848 -78.35.147.203:8333 # AS8422 -78.108.108.25:8333 # AS8251 -78.154.237.60:8333 # AS9155 -79.11.31.76:8333 # AS3269 -79.87.88.235:8333 # AS15557 -79.101.1.25:8333 # AS8400 -79.124.7.241:8333 # AS203380 -79.124.7.253:8333 # AS203380 -79.150.68.42:8333 # AS3352 -79.249.10.53:8333 # AS3320 -80.82.21.77:8333 # AS42927 -80.82.76.59:8333 # AS202425 -80.88.172.227:8333 # AS31263 -80.93.213.246:8333 # AS42910 -80.111.142.213:8333 # AS6830 -80.208.227.134:8333 # AS62282 -80.208.228.9:8333 # AS62282 -80.209.64.86:8333 # AS31027 -80.229.28.60:8333 # AS2856 -81.7.16.182:8333 # AS35366 -81.19.10.2:8333 # AS24641 +46.229.238.187:8333 # AS29405 +46.254.212.21:8333 # AS204779 +47.144.231.35:8333 # AS5650 +47.147.169.80:8333 # AS5650 +47.254.178.44:8333 # AS45102 +50.20.212.8:8333 # AS20432 +50.37.113.212:8333 # AS27017 +50.43.49.155:8333 # AS27017 +50.99.219.56:8333 # AS852 +50.125.114.46:8333 # AS20055 +51.159.223.13:8333 # AS12876 +51.194.13.25:8333 # AS5607 +51.255.94.190:8333 # AS16276 +52.165.88.21:8333 # AS8075 +52.205.29.182:8333 # AS14618 +54.170.73.194:8333 # AS16509 +54.211.187.0:8333 # AS14618 +58.96.73.95:8333 # AS10143 +61.7.163.41:8333 # AS131090 +62.12.168.100:8333 # AS15623 +62.57.94.187:8333 # AS6739 +64.31.61.150:8333 # AS46475 +64.67.80.177:8333 # AS3737 +64.156.192.61:8333 # AS21581 +64.187.168.198:8333 # AS11404 +64.226.146.203:8333 # AS26831 +65.183.252.105:8333 # AS15267 +65.190.216.137:8333 # AS11426 +66.29.147.20:8333 # AS22612 +66.30.198.179:8333 # AS7015 +66.35.84.14:8333 # AS2734 +66.37.25.18:8333 # AS19237 +66.37.25.30:8333 # AS19237 +66.94.126.184:8333 # AS40021 +66.228.28.63:8333 # AS11233 +67.80.209.16:8333 # AS6128 +67.144.32.64:8333 # AS19901 +67.145.204.18:8333 # AS19901 +67.240.148.148:8333 # AS11351 +68.37.43.81:8333 # AS33668 +68.41.204.141:8333 # AS33668 +68.54.100.248:8333 # AS13367 +68.172.45.230:8333 # AS11351 +69.59.18.35:8333 # AS397444 +69.64.51.41:8333 # AS30083 +69.67.150.71:8333 # AS262287 +69.172.131.118:8333 # AS3580 +69.246.248.54:8333 # AS33491 +70.121.50.147:8333 # AS11427 +70.122.134.79:8333 # AS11427 +70.127.40.118:8333 # AS33363 +71.29.150.207:8333 # AS7029 +71.52.48.60:8333 # AS209 +71.86.10.194:8333 # AS20115 +71.196.181.115:8333 # AS33652 +72.46.131.18:8333 # AS36114 +72.104.31.113:8333 # AS6167 +73.52.208.234:8333 # AS7016 +73.113.14.233:8333 # AS22909 +73.117.132.138:8333 # AS7016 +73.128.36.145:8333 # AS33657 +73.129.38.38:8333 # AS33657 +73.131.84.183:8333 # AS33489 +73.140.121.110:8333 # AS33650 +73.166.131.61:8333 # AS33662 +73.185.74.222:8333 # AS33667 +73.241.228.74:8333 # AS33651 +74.15.8.154:8333 # AS577 +74.88.231.79:8333 # AS6128 +74.112.115.219:8333 # AS11525 +74.207.168.63:8333 # AS14543 +76.25.208.232:8333 # AS33652 +76.140.90.174:8333 # AS33660 +76.145.236.222:8333 # AS7725 +77.48.31.240:8333 # AS16019 +77.78.126.46:8333 # AS15685 +77.95.229.224:8333 # AS62370 +77.101.237.159:8333 # AS5089 +77.105.164.118:8333 # AS214422 +77.237.238.26:8333 # AS51167 +77.239.42.73:8333 # AS15600 +77.240.190.41:8333 # AS24641 +77.247.178.158:8333 # AS43350 +78.44.219.42:8333 # AS16019 +78.140.183.229:8333 # AS35415 +79.77.133.30:8333 # AS19905 +79.116.189.111:8333 # AS57269 +79.127.230.250:8333 # AS60068 +79.135.106.88:8333 # AS62371 +79.148.50.92:8333 # AS3352 +79.154.247.191:8333 # AS3352 +79.201.52.144:8333 # AS3320 +80.64.211.102:8333 # AS200295 +80.90.4.178:8333 # AS20546 +80.188.97.250:8333 # AS5610 +80.203.83.135:8333 # AS29695 +80.209.231.126:8333 # AS62282 +80.221.244.201:8333 # AS1759 +80.254.174.149:8333 # AS1836 +81.83.214.134:8333 # AS6848 81.162.196.43:8333 # AS34955 -81.171.22.143:8333 # AS60781 -81.172.221.4:8333 # AS12430 -81.224.44.164:8333 # AS3301 -81.245.96.36:8333 # AS5432 -82.1.68.54:8333 # AS5089 -82.66.10.11:8333 # AS12322 -82.66.211.31:8333 # AS12322 -82.71.4.154:8333 # AS13037 +81.172.214.101:8333 # AS15435 +81.174.2.16:8333 # AS35612 +81.197.182.195:8333 # AS719 +81.229.234.87:8333 # AS3301 +82.4.47.42:8333 # AS5089 +82.64.89.125:8333 # AS12322 +82.64.133.129:8333 # AS12322 82.96.96.40:8333 # AS29686 -82.116.50.101:8333 # AS30936 82.136.98.249:8333 # AS8821 -82.195.237.253:8333 # AS1836 -83.137.41.10:8333 # AS31394 -83.171.175.5:8333 # AS8767 -83.208.193.242:8333 # AS5610 -83.233.76.165:8333 # AS29518 -83.240.89.196:8333 # AS31246 -84.38.3.249:8333 # AS196691 -84.54.23.48:8333 # AS35913 -84.126.216.77:8333 # AS12430 -84.211.187.211:8333 # AS41164 -84.246.200.122:8333 # AS42455 -84.255.244.61:8333 # AS34779 -85.165.42.115:8333 # AS2119 -85.194.238.134:8333 # AS47605 -85.208.69.21:8333 # AS25091 -85.208.71.36:8333 # AS42275 -85.209.240.91:8333 # AS205581 -85.214.118.71:8333 # AS6724 +83.69.176.70:8333 # AS42767 +83.168.65.186:8333 # AS31304 +83.253.62.50:8333 # AS1257 +84.20.63.156:8333 # AS21040 +84.32.32.132:8333 # AS204770 +84.32.186.158:8333 # AS59642 +84.75.26.217:8333 # AS6730 +84.115.128.225:8333 # AS8412 +84.217.134.213:8333 # AS2119 +84.255.238.120:8333 # AS34779 +85.7.24.206:8333 # AS3303 +85.14.79.26:8333 # AS31242 +85.147.2.227:8333 # AS33915 +85.159.237.71:8333 # AS43350 +85.163.23.103:8333 # AS28725 +85.195.201.131:8333 # AS13030 +85.195.244.202:8333 # AS13030 +85.198.116.246:8333 # AS29182 +85.208.69.13:8333 # AS42275 +85.208.117.14:8333 # AS18978 85.214.161.252:8333 # AS6724 -85.236.190.252:8333 # AS35032 -85.243.115.136:8333 # AS8657 -86.22.20.13:8333 # AS5089 -86.49.34.92:8333 # AS16019 -86.95.8.249:8333 # AS1136 -86.104.228.10:8333 # AS31638 -86.104.228.23:8333 # AS31638 -87.79.94.221:8333 # AS8422 -88.10.89.23:8333 # AS3352 -88.84.223.30:8333 # AS21453 -88.86.125.50:8333 # AS39392 -88.90.77.100:8333 # AS2119 -88.97.40.50:8333 # AS13037 +85.215.75.210:8333 # AS8560 +86.84.198.19:8333 # AS1136 +86.97.84.57:8333 # AS5384 +86.104.228.10:8333 # AS45021 +86.104.228.20:8333 # AS45021 +86.111.48.71:8333 # AS50304 +86.136.1.60:8333 # AS2856 +86.157.171.157:8333 # AS2856 +87.211.224.212:8333 # AS13127 +87.228.184.201:8333 # AS6866 +88.85.88.133:8333 # AS35415 +88.99.167.178:8333 # AS24940 +88.101.101.227:8333 # AS5610 +88.119.128.36:8333 # AS8764 88.137.109.62:8333 # AS15557 -88.147.244.250:8333 # AS12389 -88.208.115.70:8333 # AS29208 -88.212.53.246:8333 # AS42841 -89.35.142.168:8333 # AS34977 -89.78.111.197:8333 # AS6830 -89.117.59.129:8333 # AS1239 -89.147.108.200:8333 # AS44735 -89.163.132.180:8333 # AS24961 -89.165.232.242:8333 # AS48161 -89.216.21.96:8333 # AS31042 -90.50.172.182:8333 # AS3215 -90.146.130.214:8333 # AS12605 -90.146.208.162:8333 # AS12605 -90.156.26.148:8333 # AS12741 -90.163.172.139:8333 # AS12479 -90.177.163.77:8333 # AS5610 -91.67.145.110:8333 # AS3209 -91.93.194.154:8333 # AS34984 +88.201.175.250:8333 # AS35807 +89.24.174.30:8333 # AS13036 +89.39.141.90:8333 # AS56478 +89.58.70.141:8333 # AS44656 +89.129.78.173:8333 # AS12479 +89.207.131.19:8333 # AS62370 +89.247.224.28:8333 # AS8881 +89.250.73.38:8333 # AS41420 +90.89.251.147:8333 # AS3215 +90.156.26.148:8333 # AS43939 +90.250.10.165:8333 # AS5378 +91.92.152.118:8333 # AS61098 +91.110.16.244:8333 # AS12576 91.123.182.164:8333 # AS51648 -91.123.183.219:8333 # AS51792 -91.135.0.187:8333 # AS12496 -91.147.232.98:8333 # AS5483 -91.184.168.249:8333 # AS9063 -91.193.237.116:8333 # AS42916 -91.199.41.45:8333 # AS6866 -91.204.149.5:8333 # AS42765 -91.215.91.254:8333 # AS48078 -91.219.25.232:8333 # AS50448 -91.237.88.218:8333 # AS56813 -92.27.150.46:8333 # AS13285 -92.27.150.47:8333 # AS13285 -92.221.20.232:8333 # AS29695 -92.221.126.65:8333 # AS29695 -93.33.192.204:8333 # AS12874 -93.41.237.78:8333 # AS12874 -93.95.88.13:8333 # AS35434 -93.95.227.125:8333 # AS44735 -93.103.13.1:8333 # AS34779 -93.115.86.239:8333 # AS3223 +91.132.42.25:8333 # AS206238 +91.183.207.58:8333 # AS5432 +91.194.12.244:8333 # AS42995 +91.202.4.65:8333 # AS43641 +91.231.182.94:8333 # AS214379 +91.235.255.7:8333 # AS198509 +91.236.251.137:8333 # AS57944 +92.96.219.197:8333 # AS5384 +92.101.99.58:8333 # AS12389 +92.186.67.107:8333 # AS12479 +92.205.232.47:8333 # AS21499 +92.206.105.31:8333 # AS16202 +92.240.185.182:8333 # AS16246 +93.28.33.141:8333 # AS198949 +93.55.255.176:8333 # AS12874 93.123.180.164:8333 # AS35539 -93.186.201.173:8333 # AS24961 -93.190.117.26:8333 # AS196881 -94.19.7.55:8333 # AS35807 -94.23.21.80:8333 # AS16276 -94.23.205.110:8333 # AS16276 -94.131.0.73:8333 # AS29632 -94.142.237.4:8333 # AS48926 +93.160.66.70:8333 # AS3292 +93.174.188.110:8333 # AS47506 +93.177.188.74:8333 # AS16010 +93.189.25.250:8333 # AS44133 +93.190.143.76:8333 # AS49981 +94.19.128.204:8333 # AS35807 +94.54.154.209:8333 # AS47524 +94.60.103.81:8333 # AS12353 +94.74.105.231:8333 # AS136907 +94.79.55.28:8333 # AS48614 +94.136.185.80:8333 # AS141995 94.154.159.99:8333 # AS62240 -94.202.50.200:8333 # AS15802 -94.231.253.18:8333 # AS35224 -95.42.140.142:8333 # AS8866 -95.67.18.100:8333 # AS34867 -95.70.238.176:8333 # AS12735 -95.83.73.31:8333 # AS8359 -95.90.128.3:8333 # AS204028 -95.110.234.93:8333 # AS31034 -95.161.12.45:8333 # AS39598 -95.172.62.167:8333 # AS201826 -95.179.128.87:8333 # AS20473 -95.191.130.100:8333 # AS12389 -95.214.53.154:8333 # AS201814 -96.3.53.254:8333 # AS11232 -97.75.145.12:8333 # AS22709 -97.81.198.180:8333 # AS20115 -97.87.216.110:8333 # AS20115 -99.229.210.111:8333 # AS812 -99.246.87.2:8333 # AS812 -101.43.124.195:8333 # AS45090 -102.132.192.141:8333 # AS37680 -103.21.3.89:8333 # AS38195 -103.35.121.72:8333 # AS9498 -103.99.168.100:8333 # AS6939 -103.99.168.140:8333 # AS6939 -103.99.170.210:8333 # AS54415 -103.99.170.220:8333 # AS54415 -103.105.202.50:8333 # AS137764 -104.238.220.199:8333 # AS23470 -104.243.33.165:8333 # AS23470 -104.244.73.6:8333 # AS53667 -108.26.125.214:8333 # AS701 -109.86.60.33:8333 # AS13188 -109.99.63.159:8333 # AS9050 -109.120.194.136:8333 # AS34569 -109.123.233.138:8333 # AS15685 -109.123.240.53:8333 # AS15685 -109.153.94.35:8333 # AS2856 -109.173.126.157:8333 # AS42610 -109.193.76.200:8333 # AS51185 -109.221.229.197:8333 # AS3215 -109.236.90.117:8333 # AS49981 -109.248.206.13:8333 # AS203493 -111.90.140.23:8333 # AS45839 -111.90.140.46:8333 # AS45839 -111.90.145.37:8333 # AS18106 -114.173.159.209:8333 # AS4713 +94.157.34.0:8333 # AS50266 +94.210.254.143:8333 # AS33915 +95.82.130.223:8333 # AS31246 +95.83.73.31:8333 # AS35728 +95.98.239.70:8333 # AS50266 +95.105.192.217:8333 # AS15962 +95.168.169.227:8333 # AS60781 +95.169.196.247:8333 # AS201133 +95.179.216.148:8333 # AS20473 +95.213.145.218:8333 # AS49505 +95.214.235.86:8333 # AS30860 +96.41.133.58:8333 # AS20115 +96.43.142.163:8333 # AS19969 +96.53.92.166:8333 # AS6327 +96.77.181.25:8333 # AS33660 +96.81.219.106:8333 # AS33491 +96.238.29.2:8333 # AS701 +97.75.144.9:8333 # AS22709 +97.119.208.128:8333 # AS209 +98.56.168.78:8333 # AS33667 +98.143.182.206:8333 # AS23481 +98.168.198.50:8333 # AS22773 +98.169.1.164:8333 # AS22773 +98.195.93.125:8333 # AS33662 +99.184.57.234:8333 # AS7018 +99.229.184.94:8333 # AS812 +99.248.151.172:8333 # AS812 +101.47.131.207:8333 # AS150436 +101.99.88.33:8333 # AS19324 +101.100.139.249:8333 # AS9790 +101.173.27.162:8333 # AS1221 +103.74.116.139:8333 # AS63759 +103.99.169.110:8333 # AS54415 +103.99.171.171:8333 # AS54415 +103.231.42.36:8333 # AS18229 +103.233.83.28:8333 # AS4213 +103.246.186.143:8333 # AS401199 +103.246.186.234:8333 # AS401199 +104.143.2.195:8333 # AS26863 +104.200.67.161:8333 # AS8100 +104.243.38.148:8333 # AS23470 +106.246.195.13:8333 # AS3786 +107.13.105.120:8333 # AS11426 +107.173.244.87:8333 # AS36352 +107.178.115.244:8333 # AS3223 +108.20.173.160:8333 # AS701 +108.170.133.169:8333 # AS40788 +108.175.176.253:8333 # AS21565 +108.181.55.173:8333 # AS40676 +109.130.50.200:8333 # AS5432 +109.190.58.34:8333 # AS35540 +109.190.140.89:8333 # AS35540 +111.90.158.46:8333 # AS19324 +114.4.204.184:8333 # AS4761 +115.85.88.107:8333 # AS23953 116.58.171.67:8333 # AS2514 -119.31.179.202:8333 # AS17408 -119.42.55.203:8333 # AS133159 -122.222.160.190:8333 # AS2519 -123.60.213.192:8333 # AS55990 -124.197.54.113:8333 # AS9790 -125.168.140.108:8333 # AS4826 -128.0.190.26:8333 # AS30764 -128.65.194.136:8333 # AS29222 -129.13.189.212:8333 # AS34878 +118.67.199.102:8333 # AS64073 +121.98.22.147:8333 # AS9790 +122.32.38.201:8333 # AS17858 +122.37.248.225:8333 # AS17858 +122.155.9.25:8333 # AS9335 +124.241.11.196:8333 # AS17961 +125.77.173.152:8333 # AS133776 +128.0.98.214:8333 # AS42652 129.13.189.215:8333 # AS34878 -129.226.216.148:8333 # AS132203 -131.188.40.191:8333 # AS680 -134.65.9.63:8333 # AS19653 -134.122.200.160:8333 # AS64050 -134.195.185.52:8333 # AS13536 -135.19.253.101:8333 # AS5769 -136.29.109.58:8333 # AS19165 -136.32.238.6:8333 # AS16591 -136.49.201.24:8333 # AS16591 -137.226.34.46:8333 # AS680 -138.207.211.189:8333 # AS11776 -139.130.41.82:8333 # AS1221 -140.238.220.99:8333 # AS31898 -142.54.181.218:8333 # AS32097 -142.166.19.23:8333 # AS855 -142.254.87.115:8333 # AS46375 -143.177.229.149:8333 # AS50266 -144.2.101.21:8333 # AS3303 -144.24.236.64:8333 # AS31898 -145.40.51.52:8333 # AS49808 -146.71.69.103:8333 # AS7782 -146.120.241.173:8333 # AS208515 -147.50.238.53:8333 # AS45265 -148.103.101.132:8333 # AS28118 -149.75.48.92:8333 # AS6079 -152.44.137.83:8333 # AS11404 -154.0.3.194:8333 # AS37680 -154.26.137.105:8333 # AS174 -154.26.154.73:8333 # AS1299 -154.57.5.11:8333 # AS200736 -155.4.55.21:8333 # AS8473 -156.146.137.142:8333 # AS1448 -156.146.177.221:8333 # AS1448 -157.22.72.175:8333 # AS397379 -157.97.0.118:8333 # AS43571 -158.140.141.69:8333 # AS132132 -158.181.132.84:8333 # AS41750 -159.2.215.98:8333 # AS855 -159.196.3.239:8333 # AS4764 -159.224.189.250:8333 # AS13188 -160.80.12.16:8333 # AS137 -161.230.38.160:8333 # AS12353 -161.246.11.230:8333 # AS9486 -162.0.210.152:8333 # AS22612 -162.62.18.226:8333 # AS132203 -162.254.118.20:8333 # AS6130 -163.158.168.181:8333 # AS15435 -165.173.19.33:8333 # AS132132 -165.228.174.117:8333 # AS1221 -165.255.241.184:8333 # AS327693 -167.88.11.203:8333 # AS20278 -167.179.147.155:8333 # AS4764 -170.17.151.235:8333 # AS3303 -170.64.174.230:8333 # AS15108 -172.92.102.115:8333 # AS11404 -172.105.21.216:8333 # AS63949 -172.111.176.244:8333 # AS46562 -172.255.98.108:8333 # AS7979 -173.82.5.202:8333 # AS35916 -173.181.35.50:8333 # AS395570 -173.212.253.137:8333 # AS51167 -173.235.73.87:8333 # AS11272 -174.30.29.85:8333 # AS209 -174.141.209.40:8333 # AS6461 -176.9.17.121:8333 # AS24940 -176.12.16.135:8333 # AS8717 -176.74.136.237:8333 # AS35613 -176.74.139.120:8333 # AS35613 -176.122.122.134:8333 # AS50581 -176.126.167.10:8333 # AS8449 -176.151.244.130:8333 # AS5410 -176.186.19.106:8333 # AS5410 -176.212.185.153:8333 # AS9049 -177.142.146.193:8333 # AS4230 -178.21.118.178:8333 # AS49544 -178.61.141.198:8333 # AS21050 -178.124.162.209:8333 # AS6697 -178.143.25.194:8333 # AS15962 -178.154.233.197:8333 # AS200350 -178.159.98.133:8333 # AS202390 -178.232.186.191:8333 # AS41164 -178.236.137.63:8333 # AS44843 -179.60.149.4:8333 # AS395839 -184.160.110.104:8333 # AS5769 -184.174.37.139:8333 # AS1239 -185.8.104.179:8333 # AS16125 -185.14.30.25:8333 # AS21100 -185.25.48.184:8333 # AS61272 -185.52.93.45:8333 # AS39449 -185.64.116.15:8333 # AS31736 -185.69.105.117:8333 # AS6855 -185.98.54.20:8333 # AS39572 -185.107.83.55:8333 # AS43350 -185.132.109.122:8333 # AS38919 -185.135.81.50:8333 # AS57494 -185.140.253.169:8333 # AS200735 -185.148.3.227:8333 # AS47605 -185.154.2.3:8333 # AS29119 -185.162.92.36:8333 # AS41722 -185.163.44.36:8333 # AS39798 -185.165.170.19:8333 # AS3223 -185.167.113.59:8333 # AS207054 -185.185.59.12:8333 # AS48614 -185.203.41.148:8333 # AS9009 -185.209.12.76:8333 # AS212323 -185.209.70.17:8333 # AS204568 -185.210.125.33:8333 # AS205671 -185.233.189.210:8333 # AS61303 -185.238.131.19:8333 # AS206238 -185.239.220.210:8333 # AS61282 -185.239.221.5:8333 # AS61282 -185.250.90.246:8333 # AS61955 -186.249.217.25:8333 # AS7195 -186.250.95.132:8333 # AS262967 -188.35.167.14:8333 # AS34123 -188.68.53.44:8333 # AS47147 -188.120.255.115:8333 # AS29182 -189.6.195.111:8333 # AS28573 -190.2.130.44:8333 # AS49981 -190.13.122.89:8333 # AS33576 -190.123.27.11:8333 # AS52468 -190.145.127.254:8333 # AS14080 -191.220.156.64:8333 # AS8167 -192.31.136.90:8333 # AS54098 -192.69.53.43:8333 # AS11142 -192.146.137.44:8333 # AS25376 -192.174.121.33:8333 # AS11492 -192.222.147.175:8333 # AS1403 -193.198.34.24:8333 # AS2108 -193.222.130.14:8333 # AS29208 -194.35.185.167:8333 # AS9063 -194.54.83.234:8333 # AS41018 -194.233.84.100:8333 # AS141995 -195.2.73.88:8333 # AS48282 -195.48.12.8:8333 # AS1836 -195.154.200.157:8333 # AS12876 -197.211.133.15:8333 # AS51265 -198.84.146.8:8333 # AS5645 -198.98.55.86:8333 # AS53667 -199.247.7.208:8333 # AS20473 -200.116.154.131:8333 # AS13489 -201.191.6.103:8333 # AS11830 -201.221.234.200:8333 # AS27928 -202.47.225.242:8333 # AS9931 -202.107.219.130:8333 # AS4134 -202.108.211.135:8333 # AS4837 -202.138.13.122:8333 # AS4826 -203.86.195.32:8333 # AS23655 -203.184.52.247:8333 # AS9790 -204.111.163.114:8333 # AS4922 -205.178.41.124:8333 # AS11039 -206.192.203.0:8333 # AS7029 -207.229.46.80:8333 # AS852 -207.244.248.81:8333 # AS40021 -207.255.193.47:8333 # AS11776 -208.59.133.63:8333 # AS11039 -209.58.145.157:8333 # AS394380 -209.97.189.249:8333 # AS14061 -209.177.138.245:8333 # AS7832 -209.237.133.54:8333 # AS53859 -210.54.37.190:8333 # AS4648 -210.54.39.238:8333 # AS4648 -212.34.225.118:8333 # AS44395 -212.41.9.30:8333 # AS49505 -212.51.132.176:8333 # AS13030 -212.69.60.77:8333 # AS12496 -212.86.32.106:8333 # AS15366 -213.47.64.105:8333 # AS8412 -213.141.154.201:8333 # AS12714 -213.142.148.169:8333 # AS6762 -213.184.244.24:8333 # AS60280 -213.227.147.244:8333 # AS60781 -213.250.21.112:8333 # AS5603 -216.146.251.8:8333 # AS54579 -216.232.157.104:8333 # AS395570 +129.151.196.119:8333 # AS31898 +129.213.158.163:8333 # AS31898 +130.44.176.111:8333 # AS6079 +131.153.232.61:8333 # AS19437 +131.153.242.129:8333 # AS19437 +132.147.192.5:8333 # AS10750 +135.23.202.6:8333 # AS5645 +135.129.105.93:8333 # AS394195 +135.181.180.80:8333 # AS24940 +136.28.1.41:8333 # AS19165 +136.56.56.93:8333 # AS16591 +136.62.243.153:8333 # AS16591 +139.84.193.137:8333 # AS20473 +141.98.81.120:8333 # AS209588 +141.98.219.12:8333 # AS20326 +142.117.176.19:8333 # AS577 +143.110.231.111:8333 # AS14061 +144.2.72.68:8333 # AS57370 +144.2.104.35:8333 # AS57370 +144.6.192.154:8333 # AS4764 +144.126.147.55:8333 # AS40021 +146.0.74.196:8333 # AS57043 +146.70.49.38:8333 # AS9009 +146.71.69.103:8333 # AS396006 +147.28.163.54:8333 # AS54825 +147.28.185.150:8333 # AS54825 +147.32.95.62:8333 # AS2852 +148.113.159.109:8333 # AS16276 +148.163.68.23:8333 # AS3223 +149.7.16.137:8333 # AS63023 +149.143.32.144:8333 # AS15435 +151.115.74.102:8333 # AS12876 +151.236.34.245:8333 # AS29550 +151.248.167.250:8333 # AS8821 +152.42.229.252:8333 # AS14061 +152.53.18.161:8333 # AS197540 +152.53.37.21:8333 # AS42473 +154.57.6.171:8333 # AS200736 +156.57.38.205:8333 # AS855 +157.131.74.56:8333 # AS1299 +159.138.87.18:8333 # AS136907 +159.246.25.53:8333 # AS30491 +161.29.221.26:8333 # AS140220 +162.120.69.182:8333 # AS62240 +162.156.205.178:8333 # AS852 +162.207.122.215:8333 # AS7018 +163.123.215.229:8333 # AS63152 +164.152.167.208:8333 # AS59253 +165.173.18.251:8333 # AS56300 +166.70.65.79:8333 # AS6315 +167.224.189.201:8333 # AS395662 +167.248.185.196:8333 # AS398721 +169.150.206.200:8333 # AS60068 +170.39.103.163:8333 # AS33724 +170.205.178.76:8333 # AS22646 +172.92.108.184:8333 # AS11404 +172.96.142.246:8333 # AS23470 +172.234.29.229:8333 # AS63949 +172.241.70.236:8333 # AS7979 +173.23.232.48:8333 # AS30036 +173.164.210.49:8333 # AS33651 +173.169.42.150:8333 # AS33363 +173.208.166.82:8333 # AS32097 +173.208.236.58:8333 # AS32097 +173.236.10.158:8333 # AS32475 +173.241.227.243:8333 # AS19009 +174.2.93.93:8333 # AS6327 +174.177.29.211:8333 # AS22909 +175.41.191.135:8333 # AS8987 +176.57.213.53:8333 # AS9123 +176.99.2.90:8333 # AS197695 +176.113.167.35:8333 # AS56835 +176.166.34.226:8333 # AS5410 +176.172.173.205:8333 # AS5410 +177.39.12.242:8333 # AS52790 +178.115.246.157:8333 # AS25255 +178.143.180.249:8333 # AS15962 +178.192.9.193:8333 # AS3303 +178.232.204.112:8333 # AS25400 +178.250.232.111:8333 # AS31197 +179.43.172.23:8333 # AS51852 +179.214.122.129:8333 # AS28573 +180.150.46.187:8333 # AS4764 +184.56.122.69:8333 # AS10796 +184.83.140.189:8333 # AS11232 +184.105.131.181:8333 # AS6939 +184.162.91.24:8333 # AS5769 +185.8.106.179:8333 # AS204770 +185.31.136.172:8333 # AS60414 +185.63.97.216:8333 # AS50825 +185.68.249.91:8333 # AS51184 +185.70.43.192:8333 # AS62371 +185.87.191.80:8333 # AS199736 +185.92.72.157:8333 # AS200904 +185.95.37.16:8333 # AS200799 +185.119.118.68:8333 # AS44133 +185.133.42.54:8333 # AS57494 +185.143.48.4:8333 # AS20742 +185.148.146.24:8333 # AS44901 +185.150.160.208:8333 # AS34197 +185.156.37.30:8333 # AS202605 +185.161.6.75:8333 # AS43915 +185.181.230.117:8333 # AS60602 +185.194.93.135:8333 # AS197869 +185.197.160.61:8333 # AS60144 +185.251.88.100:8333 # AS35278 +186.75.66.162:8333 # AS11556 +188.68.54.170:8333 # AS197540 +188.120.222.69:8333 # AS49985 +188.138.88.47:8333 # AS8972 +188.212.113.16:8333 # AS206238 +188.214.129.26:8333 # AS16125 +188.214.129.217:8333 # AS16125 +188.237.167.51:8333 # AS8926 +190.64.134.52:8333 # AS6057 +192.3.11.20:8333 # AS36352 +192.119.148.210:8333 # AS393892 +192.145.127.190:8333 # AS9009 +192.187.121.46:8333 # AS33387 +192.227.73.9:8333 # AS13886 +192.243.215.102:8333 # AS63297 +193.22.128.10:8333 # AS56469 +193.22.128.12:8333 # AS56469 +193.72.32.187:8333 # AS33965 +193.238.16.12:8333 # AS39907 +194.1.163.112:8333 # AS8298 +194.14.247.35:8333 # AS50066 +194.106.127.43:8333 # AS3249 +194.233.69.180:8333 # AS141995 +195.62.52.19:8333 # AS44812 +195.133.68.203:8333 # AS48614 +195.139.85.46:8333 # AS2116 +195.189.97.38:8333 # AS59642 +195.216.214.27:8333 # AS25057 +197.87.144.126:8333 # AS3741 +197.155.6.43:8333 # AS37199 +198.16.178.88:8333 # AS1403 +199.85.210.133:8333 # AS22612 +199.230.127.169:8333 # AS398844 +201.131.200.50:8333 # AS28387 +202.177.24.140:8333 # AS7479 +203.123.97.227:8333 # AS38195 +203.132.94.196:8333 # AS38195 +204.15.11.35:8333 # AS13331 +204.16.245.163:8333 # AS20326 +204.83.161.154:8333 # AS803 +204.107.27.48:8333 # AS54303 +204.194.220.39:8333 # AS20055 +205.209.118.254:8333 # AS19318 +206.204.104.6:8333 # AS212947 +206.204.106.8:8333 # AS212947 +207.47.156.175:8333 # AS803 +207.158.15.96:8333 # AS21581 +207.178.119.175:8333 # AS27425 +207.182.146.85:8333 # AS10297 +208.53.32.26:8333 # AS13767 +209.59.150.4:8333 # AS32244 +209.71.50.11:8333 # AS20259 +209.141.37.57:8333 # AS53667 +209.205.204.210:8333 # AS55081 +209.227.228.193:8333 # AS31034 +209.253.210.114:8333 # AS7029 +210.179.103.74:8333 # AS4766 +211.58.126.101:8333 # AS9318 +212.24.104.116:8333 # AS62282 +212.39.67.41:8333 # AS8866 +212.86.55.47:8333 # AS15366 +212.90.85.145:8333 # AS16086 +212.112.65.254:8333 # AS48815 +212.159.75.247:8333 # AS6871 +212.227.211.87:8333 # AS8560 +212.241.94.177:8333 # AS1299 +212.251.164.10:8333 # AS2119 +213.14.190.184:8333 # AS34984 +213.139.207.219:8333 # AS395092 +213.183.46.51:8333 # AS56630 +216.41.130.41:8333 # AS396287 +216.53.190.99:8333 # AS14288 +216.172.82.150:8333 # AS53818 +216.219.91.82:8333 # AS19318 +216.226.128.189:8333 # AS13706 217.15.178.11:8333 # AS25534 -217.26.32.10:8333 # AS197312 -217.64.47.200:8333 # AS39324 -217.76.51.25:8333 # AS39597 -217.92.55.246:8333 # AS3320 -217.170.124.170:8333 # AS35401 -217.180.221.162:8333 # AS30600 -217.180.238.137:8333 # AS30600 -220.84.232.46:8333 # AS4766 -220.133.39.61:8333 # AS3462 -220.233.91.182:8333 # AS38195 -[2001:19f0:1000:1db3:5400:4ff:fe56:5a8d]:8333 # AS20473 -[2001:19f0:5:24da:3eec:efff:feb9:f36e]:8333 # AS20473 -[2001:19f0:5:24da::]:8333 # AS20473 -[2001:19f0:5:4535:3eec:efff:feb9:87e4]:8333 # AS20473 -[2001:19f0:5:4535::]:8333 # AS20473 +217.20.131.64:8333 # AS5483 +217.23.3.251:8333 # AS49981 +217.79.247.130:8333 # AS29802 +217.94.254.57:8333 # AS3320 +217.173.236.25:8333 # AS20634 +217.180.216.148:8333 # AS30600 +218.39.61.122:8333 # AS9318 +218.102.232.50:8333 # AS4760 +220.86.25.1:8333 # AS4766 +[2001:13d8:1c01:21:215:17ff:fe63:2a7e]:8333 # AS3790 +[2001:1620:542c:210::100]:8333 # AS13030 +[2001:1620:5566:100::62c]:8333 # AS13030 +[2001:18b8:0:100:0:b00b:420:69]:8333 # AS29789 +[2001:1970:5a22:4500::4f9c]:8333 # AS7992 +[2001:19f0:4401:e8a:5400:4ff:fe8e:d398]:8333 # AS20473 +[2001:19f0:5000:1a80:5400:4ff:fe71:aac5]:8333 # AS20473 +[2001:19f0:5:2b12:5400:4ff:fe6e:3afe]:8333 # AS20473 +[2001:19f0:5:5b81:5e6f:69ff:fe57:94d0]:8333 # AS20473 +[2001:19f0:6801:6ec:2::1]:8333 # AS20473 +[2001:19f0:c800:2ce5:5400:4ff:fed7:663d]:8333 # AS20473 +[2001:19f0:c:6da:5e6f:69ff:fe56:a650]:8333 # AS20473 [2001:1bc0:c1::2000]:8333 # AS29686 -[2001:1c04:4008:6300:8a5f:2678:114b:a660]:8333 # AS6830 -[2001:41d0:203:3739::]:8333 # AS16276 -[2001:41d0:203:8f49::]:8333 # AS16276 -[2001:41d0:203:bb0a::]:8333 # AS16276 -[2001:41d0:2:bf8f::]:8333 # AS16276 -[2001:41d0:303:de8b::]:8333 # AS16276 -[2001:41d0:403:3d61::]:8333 # AS16276 -[2001:41d0:405:9600::]:8333 # AS16276 -[2001:41d0:8:ed7f::1]:8333 # AS16276 -[2001:41d0:a:69a2::1]:8333 # AS16276 -[2001:41f0::62:6974:636f:696e]:8333 # AS6830 -[2001:470:1b62::]:8333 # AS6939 -[2001:470:1f05:43b:2831:8530:7179:5864]:8333 # AS6939 -[2001:470:1f09:b14::11]:8333 # AS6939 -[2001:470:1f15:106:e2d5:5eff:fe42:7ae5]:8333 # AS6939 -[2001:470:1f1b:365:aa20:66ff:fe3f:1909]:8333 # AS6939 -[2001:470:1f1b:5a6:216:3eff:fe24:1162]:8333 # AS6939 -[2001:470:6a7c::]:8333 # AS6939 -[2001:470:75e9:1::10]:8333 # AS6939 -[2001:470:8ca0:2:4e72:b9ff:fe56:f8b8]:8333 # AS6939 -[2001:470:dbc7:0:1010::100]:8333 # AS6939 -[2001:4ba0:cafe:14cc::1]:8333 # AS24961 -[2001:4ba0:ffff:24::1]:8333 # AS24961 +[2001:2043:180e:400::47]:8333 # AS3301 +[2001:250:1001:1621:401a:5c40:322f:9ea3]:8333 # AS24353 +[2001:4060:4419:8001::42]:8333 # AS6772 +[2001:41d0:2:7b3d::1]:8333 # AS16276 +[2001:41d0:2:7ba8::]:8333 # AS16276 +[2001:41d0:602:34f0::1]:8333 # AS16276 +[2001:41d0:800:10c0::]:8333 # AS16276 +[2001:41d0:800:364d::]:8333 # AS16276 +[2001:448a:2071:150d:1c3f:135e:6675:a69b]:8333 # AS7713 +[2001:470:1a34:2:a804:86ff:fec2:863a]:8333 # AS6939 +[2001:470:1f0a:89a::2]:8333 # AS6939 +[2001:470:28:b17::2]:8333 # AS6939 +[2001:470:7984::1337]:8333 # AS6939 +[2001:470:88ff:2e::1]:8333 # AS6939 +[2001:470:8a71:2::200]:8333 # AS6939 +[2001:470:8ca0:2:7646:a0ff:fe9b:e662]:8333 # AS6939 +[2001:470:a:c13::2]:8333 # AS6939 +[2001:470:da72::2:3]:8333 # AS6939 +[2001:470:dee0:1::3]:8333 # AS6939 [2001:4dd0:3564:0:30b7:1d7b:6fec:4c5c]:8333 # AS8422 [2001:4dd0:3564:0:88e:b4ff:2ad0:699b]:8333 # AS8422 [2001:4dd0:3564:0:9c1c:cc31:9fe8:5505]:8333 # AS8422 [2001:4dd0:3564:0:a0c4:d41f:4c4:1bb0]:8333 # AS8422 +[2001:4dd0:3564:0:fd76:c1d3:1854:5bd9]:8333 # AS8422 [2001:4dd0:3564:1::7676:8090]:8333 # AS8422 [2001:4dd0:3564:1:b977:bd71:4612:8e40]:8333 # AS8422 +[2001:4dd0:af0e:3564:0:69:90:8333]:8333 # AS8422 [2001:4dd0:af0e:3564::69:1]:8333 # AS8422 [2001:4dd0:af0e:3564::69:90]:8333 # AS8422 -[2001:560:441f:1::4]:8333 # AS18530 -[2001:638:a000:4140::ffff:191]:8333 # AS680 -[2001:67c:25dc:91::2]:8333 # AS41018 -[2001:67c:26b4:ff00::44]:8333 # AS25376 -[2001:67c:2db8:6::36]:8333 # AS39798 +[2001:550:af00:7:0:1:aff9:18]:8333 # AS174 +[2001:569:5079:abd2::c9]:8333 # AS852 +[2001:569:713f:4800:e9af:dd81:7b94:f105]:8333 # AS852 +[2001:569:bed3:3100:ac3e:c5d8:c4e:56fe]:8333 # AS852 +[2001:5a8:40db:2000:8668:a702:c89:bdd4]:8333 # AS7065 +[2001:5a8:40db:2000:867b:8aa6:2010:879a]:8333 # AS7065 +[2001:5a8:4164:7a00::506]:8333 # AS7065 +[2001:5a8:60c0:d500::7840]:8333 # AS7065 +[2001:648:2800:131:4b1f:f6fc:20f7:f99f]:8333 # AS5470 +[2001:678:68c:fffb::195]:8333 # AS13259 +[2001:678:d78:22d0:5065:c1ff:fef2:3f65]:8333 # AS8298 +[2001:67c:1220:808::93e5:81f]:8333 # AS197451 +[2001:67c:1254:d2:6b9c::1]:8333 # AS4455 +[2001:67c:26b4:ff00::44]:8333 # AS57672 +[2001:67c:440:688:91:236:251:137]:8333 # AS57944 +[2001:67c:440:f887:194:147:140:37]:8333 # AS57944 [2001:7c0:2310:0:f816:3eff:fe6c:4f58]:8333 # AS34878 -[2001:861:3242:8420::40]:8333 # AS5410 -[2001:8b0:1301:1000::60]:8333 # AS20712 +[2001:8003:d117:3500:bfc5:7e90:9da5:a8c0]:8333 # AS1221 +[2001:818:df59:5800:f8a4:ceff:fefd:d63a]:8333 # AS12353 +[2001:818:e9f4:5400:e65f:1ff:fecd:69ad]:8333 # AS12353 +[2001:861:3200:64a0:92b1:1cff:fe91:137f]:8333 # AS5410 +[2001:8b0:ba7b:c965::8:85]:8333 # AS20712 +[2001:8f8:1b69:13ef:48ab:74ff:fe36:2313]:8333 # AS8966 +[2001:a61:101b:b201:dea6:32ff:fefb:f7da]:8333 # AS8767 +[2001:b011:7008:31b7:9624:d01c:8f94:e6f7]:8333 # AS3462 [2001:b030:2422::208d]:8333 # AS3462 -[2001:b07:2ef:6e4a:3d:974e:784a:684b]:8333 # AS12874 -[2001:b07:5d32:b142:8f77:3c7d:a2fd:ed2e]:8333 # AS12874 +[2001:b07:5d2e:3604:1125:c712:2aac:5c0]:8333 # AS12874 +[2001:b07:6440:3a98:a280:5d86:d5a3:3fc4]:8333 # AS12874 +[2001:b07:644c:1b5a:566f:23e4:9a34:a619]:8333 # AS12874 [2001:b07:6461:7811:489:d2da:e07:1af7]:8333 # AS12874 -[2001:b07:646b:8074:32e8:9243:a337:e60a]:8333 # AS12874 -[2001:b07:646b:8074:4cc6:79a5:3af7:7132]:8333 # AS12874 -[2001:b07:ad4:ca4b:7dd5:8471:50c3:5363]:8333 # AS12874 +[2001:b07:646d:caf:3c06:693f:73a9:e71b]:8333 # AS12874 +[2001:b07:6474:51d8:6156:84e7:397a:a847]:8333 # AS12874 +[2001:b07:6474:51d8:c27e:427e:fe37:6356]:8333 # AS12874 +[2001:b07:6474:51d8:f31f:fdc:1c90:67ac]:8333 # AS12874 +[2001:b07:ae6:3b99:7270:fcff:fe02:33c0]:8333 # AS12874 +[2001:bc8:1201:701:ca1f:66ff:fec9:221c]:8333 # AS12876 +[2001:bc8:1201:715:ca1f:66ff:fec9:5ff0]:8333 # AS12876 [2001:bc8:1201:71a:2e59:e5ff:fe42:52f4]:8333 # AS12876 +[2001:bc8:1201:900:46a8:42ff:fe26:9501]:8333 # AS12876 [2001:bc8:1600:0:208:a2ff:fe0c:8a2e]:8333 # AS12876 -[2001:bc8:323c:ff:a634:384f:1849:f4bc]:8333 # AS12876 -[2001:bc8:323c:ff:d217:c2ff:fe07:2cd9]:8333 # AS12876 -[2001:bc8:700:2b14::1]:8333 # AS12876 -[2001:bc8:700:8d16::1]:8333 # AS12876 -[2001:e68:5400:58d0:bd15:ea8c:5b20:7523]:8333 # AS4788 -[2400:2411:a3e1:4900:7298:f550:67e7:b99b]:8333 # AS17676 -[2400:8901::f03c:93ff:fe2b:5c0b]:8333 # AS63949 -[2400:8901::f03c:93ff:fe5a:685c]:8333 # AS63949 -[2401:b140:1::100:210]:8333 # AS54415 +[2001:bc8:3e54:6b02::1]:8333 # AS12876 +[2001:bc8:610:9:46a8:42ff:fe0c:d385]:8333 # AS12876 +[2001:bc8:701:409:b683:51ff:fe06:75f4]:8333 # AS12876 +[2001:bc8:701:40d:ae16:2dff:fea6:e868]:8333 # AS12876 +[2001:e68:541b:9472:c86:6c6b:8f1e:eb8d]:8333 # AS4788 +[2001:f40:94e:426:7270:fcff:fe05:3cd]:8333 # AS9930 +[2003:c0:6f34:d600:201:2eff:fe6b:c20c]:8333 # AS3320 +[2003:ca:e74b:ea58:dea6:32ff:fe26:b6fb]:8333 # AS3320 +[2003:d6:270a:ea00:5a47:caff:fe73:450c]:8333 # AS3320 +[2003:e6:3742:b00:9209:d0ff:fe0f:9ea7]:8333 # AS3320 +[2003:f0:df07:c202:aaa1:59ff:fe57:7779]:8333 # AS3320 +[2003:f6:3f48:7000:4c9f:7620:8324:d4a7]:8333 # AS3320 +[2400:3b00:20:c:bacb:29ff:feab:8886]:8333 # AS18229 +[2400:4053:1203:3f00:1:1:1:134]:8333 # AS4713 +[2400:6180:0:d2::78b7:6000]:8333 # AS14061 +[2400:6180:0:d2::fd91:9000]:8333 # AS14061 +[2400:8901::f03c:92ff:fe3e:e1d6]:8333 # AS63949 +[2400:8901::f03c:92ff:fe4e:95f3]:8333 # AS63949 +[2400:8902::f03c:94ff:fe53:568]:8333 # AS63949 +[2400:8905::f03c:94ff:fecc:1466]:8333 # AS48337 +[2400:8907::f03c:94ff:fed9:9696]:8333 # AS63949 +[2400:a848:4045:1:be24:11ff:fe88:7852]:8333 # AS134090 +[2400:adc1:18e:7c00:8243:2452:89af:6cbb]:8333 # AS9541 +[2400:d321:2231:5973::1]:8333 # AS141995 [2401:b140:1::100:220]:8333 # AS54415 +[2401:b140:3::44:110]:8333 # AS54415 +[2401:b140:3::44:120]:8333 # AS54415 +[2401:d002:2103:400:211:32ff:fe9e:7ae3]:8333 # AS38195 [2401:d002:3902:700:d72c:5e22:4e95:389d]:8333 # AS38195 -[2404:4408:63a4:a01::250]:8333 # AS9790 -[2406:3400:216:8b00:211:32ff:feca:336b]:8333 # AS10143 -[2406:8c00:0:3422:133:18:228:108]:8333 # AS24282 -[2406:da11:169:b03:32b5:f901:9f7c:3e4b]:8333 # AS16509 -[2406:da18:9f1:f301:7d2e:c256:c112:f2be]:8333 # AS16509 -[2406:da18:9f1:f303:c1c9:c569:b799:2057]:8333 # AS16509 -[2406:da1e:a4e:8a00:20db:dd8d:3670:28f0]:8333 # AS16509 -[2406:da1e:a4e:8a03:2aad:496b:768d:e497]:8333 # AS16509 +[2402:1f00:8000:21a::]:8333 # AS16276 +[2402:a7c0:8100:a015::6f2:79a5]:8333 # AS59253 +[2403:580c:c505:0:6955:67d3:6229:88e7]:8333 # AS4764 +[2403:71c0:2000:b3e0::101]:8333 # AS23959 +[2403:71c0:2000:b3e0::7693]:8333 # AS23959 +[2404:4400:411a:6000::7d73]:8333 # AS9790 +[2404:4400:416c:f400:4a21:bff:fe32:571]:8333 # AS9790 +[2404:4408:6397:8201::250]:8333 # AS9790 +[2404:7a81:17a0:f000:e4b1:aef3:2a2e:d54]:8333 # AS2518 +[2405:6582:de0:4400:8ce:2b80:2960:7b4e]:8333 # AS4685 +[2405:6582:de0:4400:f:854d:5057:4fc9]:8333 # AS4685 +[2406:3400:31f:61d0:b7f5:6b3e:2241:bc44]:8333 # AS10143 +[2406:3400:31f:61d0:f25b:ae67:d9ed:b31c]:8333 # AS10143 +[2406:3400:912:4940:1e45:e8cc:2d24:8250]:8333 # AS10143 +[2406:da14:335:b600:38cc:a776:1818:1285]:8333 # AS16509 [2407:3640:2107:1278::1]:8333 # AS141995 -[2407:3640:3010:4012::1]:8333 # AS141995 -[2407:8800:bc61:2202:d63d:7eff:fe6c:dc36]:8333 # AS7545 -[2600:1700:5c5b:b0:aaa1:59ff:fe5f:615a]:8333 # AS7018 +[2407:8800:bc61:2220:3cf5:57ac:851b:2b1e]:8333 # AS7545 +[2407:8800:bc61:2220:555b:7e78:78a0:eb32]:8333 # AS7545 +[2408:820c:a93a:8f00:101b:7dc4:98f9:e065]:8333 # AS17621 +[2408:824c:3618:e8f1:d43c:7c0f:6300:dd39]:8333 # AS4837 +[2409:8a44:9116:2740:63b0:124d:1ce7:8836]:8333 # AS24445 +[240b:11:5501:5e00:10f2:46c7:c6f6:6e25]:8333 # AS2516 +[240b:250:2221:b100:f0fb:1424:b379:5c1]:8333 # AS2516 +[2600:1015:a032:1ca1:8c04:c837:a14:b1da]:8333 # AS6167 +[2600:1700:488:10::421]:8333 # AS7018 +[2600:1700:488:10::614]:8333 # AS7018 +[2600:1700:5453:69e::109]:8333 # AS7018 +[2600:1700:5af3:2c10:46a8:42ff:fe08:5835]:8333 # AS7018 +[2600:1700:6f20:abc4::c65]:8333 # AS7018 +[2600:1700:944c:e00f:2a27:f664:1801:599f]:8333 # AS7018 +[2600:1700:e41:2040:9ab7:85ff:fe20:621]:8333 # AS7018 [2600:1700:ec7b:5730::48]:8333 # AS7018 -[2600:1900:4000:4cc4:0:1::]:8333 # AS15169 -[2600:1900:4000:4cc4:0:2::]:8333 # AS15169 -[2600:1900:4000:4cc4:0:3::]:8333 # AS15169 -[2600:1900:4000:4cc4::]:8333 # AS15169 -[2600:1900:4030:a25e::]:8333 # AS15169 -[2600:1f14:40e:e301:afdd:ad00:e568:d220]:8333 # AS16509 -[2600:1f1c:2d3:2400:f15e:2f2a:760d:a33d]:8333 # AS16509 +[2600:1702:57f0:11c0::19d8]:8333 # AS7018 +[2600:1702:6d33:ec10::22]:8333 # AS7018 +[2600:1900:4000:7be1::]:8333 # AS396982 +[2600:1900:4020:65f:0:1::]:8333 # AS396982 +[2600:1900:4060:40b::]:8333 # AS396982 +[2600:1900:4090:5db:0:1::]:8333 # AS396982 +[2600:1900:40b0:3af2::]:8333 # AS396982 +[2600:1900:40c0:5470:0:1::]:8333 # AS396982 +[2600:1900:40e0:3cdc::]:8333 # AS396982 +[2600:1900:40f0:964b::]:8333 # AS396982 +[2600:1900:4170:ca4e::]:8333 # AS396982 +[2600:1901:8170:4bb:0:1::]:8333 # AS396982 +[2600:1f14:40e:e300:c97e:fc1c:c0db:fe83]:8333 # AS16509 +[2600:1f14:40e:e300:cf69:2dac:5fa1:19fa]:8333 # AS16509 +[2600:1f18:64d9:1603:4436:871e:2bfe:7403]:8333 # AS14618 +[2600:1f18:66fc:d700:214c:9628:5325:67fc]:8333 # AS14618 +[2600:1f18:66fc:d700:3ea6:7dc2:83c6:cd91]:8333 # AS14618 +[2600:1f18:66fc:d700:be6f:27a6:7449:b1c3]:8333 # AS14618 +[2600:1f18:66fc:d700:fb0f:3b9d:a7c9:84cd]:8333 # AS14618 +[2600:1f18:719a:e302:2758:8042:929f:a384]:8333 # AS14618 +[2600:1f18:719a:e302:4c90:e1e6:2a59:82c4]:8333 # AS14618 +[2600:1f18:719a:e302:e6c0:8878:401c:27c2]:8333 # AS14618 +[2600:1f18:719a:e302:ef0c:40ab:f8f:6d6c]:8333 # AS14618 [2600:2104:1003:c5ab:dc5e:90ff:fe18:1d08]:8333 # AS11404 -[2600:3c00::f03c:92ff:fe92:2745]:8333 # AS63949 -[2600:3c00::f03c:92ff:fecf:61b6]:8333 # AS63949 -[2600:3c00:e002:2e32::1:14]:8333 # AS63949 -[2600:3c01::f03c:93ff:fe2a:5266]:8333 # AS63949 -[2600:3c01::f03c:93ff:fe74:5f59]:8333 # AS63949 -[2600:3c01::f03c:93ff:fee6:2146]:8333 # AS63949 +[2600:3c00::f03c:94ff:fe7c:86e2]:8333 # AS63949 +[2600:3c00::f03c:94ff:feb7:4dd7]:8333 # AS63949 [2600:3c02::f03c:92ff:fe5d:9fb]:8333 # AS63949 -[2600:4040:2004:3201:459f:8fe8:444d:baf1]:8333 # AS13786 -[2600:4040:4541:4900:4e1:b58a:8438:450e]:8333 # AS13786 +[2600:3c02::f03c:93ff:fe14:a4f2]:8333 # AS63949 +[2600:3c0e::f03c:94ff:fe63:2e90]:8333 # AS63949 +[2600:3c0e::f03c:94ff:fe72:bfe0]:8333 # AS63949 +[2600:6c4e:a00:cd0:428d:5cff:fe58:4884]:8333 # AS20115 [2600:6c54:7100:1ad1:c92e:36d:651:bd18]:8333 # AS20115 -[2600:8801:2f80:477::141c]:8333 # AS22773 -[2600:8801:8d00:3eb0:20c:29ff:fec3:d799]:8333 # AS22773 -[2600:8805:2400:14e:12dd:b1ff:fef2:3013]:8333 # AS22773 -[2601:184:300:156c:ba4c:30:9da:6c06]:8333 # AS7922 -[2601:346:d7f:fff7:18c6:4856:ef75:744c]:8333 # AS7922 -[2601:405:4a00:876:c8d3:f081:2ce8:ba8e]:8333 # AS7922 -[2602:24c:b8f:cd90::7840]:8333 # AS46375 +[2600:6c67:2100:670:b179:be4c:8cca:e8f0]:8333 # AS33588 +[2600:8801:2f80:ac::173e]:8333 # AS22773 +[2600:8806:2101:9a80:c2f5:5e1:445a:bb74]:8333 # AS22773 +[2601:147:4c80:c97:3eec:efff:fe79:3b74]:8333 # AS33657 +[2601:185:8301:d9d0:61a2:a7e4:bfc9:f771]:8333 # AS7015 +[2601:246:4d7f:83e9:d74b:87c9:b119:cf8b]:8333 # AS33491 +[2601:280:5c00:43d:4aba:4eff:fef8:6e5d]:8333 # AS33652 +[2601:41:c200:bf0b:92b1:1cff:fe96:b198]:8333 # AS33287 +[2601:41:c300:f109:2e44:fdff:fe0e:68ca]:8333 # AS33287 +[2601:602:d200:19f8:86a6:59a9:2976:2dfd]:8333 # AS33650 +[2601:603:5300:83b7:0:ff:fe00:4209]:8333 # AS33650 +[2601:645:c680:5be:e0a4:381d:a60:b498]:8333 # AS33651 +[2602:47:d441:5e01:52eb:f6ff:fe7f:f0db]:8333 # AS209 +[2602:61:7800:9300::1]:8333 # AS209 +[2602:f996:4:4000:be24:11ff:fee0:6f6a]:8333 # AS13717 +[2602:fa59:6:f6::1]:8333 # AS14956 +[2602:fc16:3:65::62b5]:8333 # AS203380 +[2602:fd23:3:1::1:213]:8333 # AS33185 +[2602:fd72:20e:9c00:213:efff:fef5:f172]:8333 # AS2740 [2602:fec3:0:1::69]:8333 # AS62563 -[2602:ff16:1:0:1:412:0:1]:8333 # AS29802 -[2603:3001:2618:c000:2ec1:df1f:a463:9119]:8333 # AS7922 -[2603:3003:11b:e100:20c:29ff:fe38:bbc0]:8333 # AS7922 -[2603:3004:6a1:3800:851f:584d:7aba:affb]:8333 # AS7922 -[2603:3004:6a1:3800::7bba]:8333 # AS7922 -[2603:3004:6a1:3800::f667]:8333 # AS7922 -[2603:3024:1606:1400::29ec]:8333 # AS7922 -[2603:3024:18ee:8000:20e:c4ff:fed1:ef15]:8333 # AS7922 -[2603:6000:a400:9300::2000]:8333 # AS7843 -[2603:6010:7001:4830::2:1]:8333 # AS7843 -[2603:8080:1f07:6fdd:7de2:d969:78c9:b7ea]:8333 # AS7843 -[2603:8080:d600:1800:7ce1:74a2:6a8a:4643]:8333 # AS7843 -[2603:8081:6c00:306e:215:5dff:fe02:150a]:8333 # AS7843 -[2604:3d09:7182:8700:bba9:cde6:5b37:a8df]:8333 # AS6327 -[2604:4080:1036:80b1::3be]:8333 # AS11404 -[2604:a00:3:1223:216:3eff:fe27:76e0]:8333 # AS19318 -[2604:a880:400:d0::261f:6001]:8333 # AS14061 -[2604:a880:4:1d0::13e:f000]:8333 # AS14061 -[2604:a880:4:1d0::17a:7000]:8333 # AS14061 -[2604:a880:4:1d0::c1:3000]:8333 # AS14061 -[2604:a880:4:1d0::e5:b000]:8333 # AS14061 -[2605:4a80:a302:7940:7254:1ed4:90d7:4f39]:8333 # AS11232 -[2605:4a80:a302:7940::2]:8333 # AS11232 +[2602:fec3:101:1::5:73]:8333 # AS62563 +[2602:ffb6:4:739e:f816:3eff:fe00:c2b3]:8333 # AS174 +[2602:ffb6:4:7b8e:f816:3eff:fe9d:9dc2]:8333 # AS174 +[2602:ffc5:200:1e01:241d:e589:9650:c773]:8333 # AS20473 +[2603:3003:11b:e100:20c:29ff:fe38:bbc0]:8333 # AS33657 +[2603:3003:4eac:100:4e5f:e7a6:2059:91d8]:8333 # AS33657 +[2603:3005:418e:8100:3af7:cdff:feca:1af8]:8333 # AS7015 +[2603:3005:418e:8100::9a8a]:8333 # AS7015 +[2603:3005:549d:2201:20b5:71ff:fedc:bc9a]:8333 # AS7015 +[2603:300a:912:627a:be24:11ff:fe7b:39c3]:8333 # AS33491 +[2603:3020:708:6e00:4f6:a091:350c:cbcb]:8333 # AS20214 +[2603:3024:1828:1ac1::83]:8333 # AS33651 +[2603:3024:18ee:8000:20e:c4ff:fed1:ef15]:8333 # AS33651 +[2603:3024:2005:8000:85f4:879d:4710:1110]:8333 # AS33651 +[2603:800c:700:6a43:5b80:9ce0:a54:8b95]:8333 # AS20001 +[2603:8080:1f07:6fdd:7de2:d969:78c9:b7ea]:8333 # AS11427 +[2603:8081:6c00:4bbc:215:5dff:fe02:1555]:8333 # AS11427 +[2603:80a0:700:1886::39]:8333 # AS11427 +[2603:9001:3600:1902::b]:8333 # AS33363 +[2604:2dc0:100:24ce::]:8333 # AS16276 +[2604:4500:6:285::18]:8333 # AS29802 +[2604:55c0:100:222::2]:8333 # AS4138 +[2604:86c0:3001:5::12:73]:8333 # AS63023 +[2604:a00:50:39:c514:becd:bece:ad3a]:8333 # AS19318 +[2604:a880:2:d1::63:4001]:8333 # AS14061 +[2604:a880:400:d1::849:6001]:8333 # AS14061 +[2604:a880:800:c1::233:1]:8333 # AS14061 +[2604:a880:cad:d0::75b2:3001]:8333 # AS14061 +[2604:a880:cad:d0::75b2:3002]:8333 # AS14061 +[2605:1080:0:f00::70]:8333 # AS23367 +[2605:21c0:2000:11:204:194:220:40]:8333 # AS20055 +[2605:3380:422e:1::50]:8333 # AS397444 +[2605:59c8:2666:1a00::113c]:8333 # AS14593 +[2605:59c8:325:b800:2efd:a1ff:fedc:f8d4]:8333 # AS14593 +[2605:59c8:788:5000:5054:ff:feb8:380]:8333 # AS14593 [2605:6400:30:f220::]:8333 # AS53667 -[2605:a140:3010:4014::1]:8333 # AS40021 +[2605:6440:d000:252:ae1f:6bff:fef5:2d86]:8333 # AS396356 +[2605:6f80:0:7:fc1b:ccff:fe8a:d822]:8333 # AS36114 +[2605:a140:2228:8423::1]:8333 # AS51167 +[2605:a143:2162:7067::1]:8333 # AS51167 [2605:ae00:203::203]:8333 # AS7819 -[2605:b40:14d0:5b00:7988:eb8:6bb6:66e2]:8333 # AS174 -[2605:c000:2a0a:1::102]:8333 # AS7393 -[2607:5300:61:854::1]:8333 # AS16276 +[2606:6d00:194:f03:3d2:f06a:c2e8:a54]:8333 # AS1403 +[2607:4480:2:1:38:102:69:70]:8333 # AS40470 +[2607:5300:203:293e::1]:8333 # AS16276 +[2607:5300:60:614::1]:8333 # AS16276 +[2607:5300:60:7477::]:8333 # AS16276 [2607:9280:b:73b:250:56ff:fe14:25b5]:8333 # AS395502 [2607:9280:b:73b:250:56ff:fe21:9c2f]:8333 # AS395502 [2607:9280:b:73b:250:56ff:fe21:bf32]:8333 # AS395502 [2607:9280:b:73b:250:56ff:fe33:4d1b]:8333 # AS395502 [2607:9280:b:73b:250:56ff:fe3d:401]:8333 # AS395502 +[2607:f2c0:e7b1:fac0::444b]:8333 # AS5645 +[2607:f2c0:f00e:300::54]:8333 # AS5645 +[2607:fe90:4:b6:a001:3fff:fef2:8770]:8333 # AS19237 +[2607:fea8:601e:7d01:be24:11ff:fe89:27f3]:8333 # AS812 +[2620:11c:5001:1118:d267:e5ff:fee9:e673]:8333 # AS13331 +[2620:11c:5001:2199:d267:e5ff:fee9:e673]:8333 # AS13331 +[2620:6:2003:105:67c:16ff:fe51:58bf]:8333 # AS395460 [2620:6e:a000:1:42:42:42:42]:8333 # AS397444 -[2620:a6:2000:1:1:0:5:1601]:8333 # AS27566 -[2620:a6:2000:1:2:0:9:900b]:8333 # AS27566 -[2620:a6:2000:1:2:0:b:300e]:8333 # AS27566 -[2800:150:11d:d2f:bdac:7807:2f5:4aa0]:8333 # AS22047 -[2803:9800:a007:82ba:650b:82b8:8377:d0]:8333 # AS19037 -[2804:14c:155:45e0:1e86:15a3:efd9:7287]:8333 # AS28573 -[2804:14c:657d:4030:28b4:eff:fe9b:8894]:8333 # AS28573 -[2804:14d:1087:9434::1002]:8333 # AS4230 -[2804:954:24:2:b390:d83b:358a:db53]:8333 # AS263073 -[2804:d57:554d:de00:3e7c:3fff:fe7b:80aa]:8333 # AS8167 -[2a00:1028:838c:563a:fd25:87b6:5a54:811]:8333 # AS5610 +[2620:a6:2000:1:1:0:d:7f1d]:8333 # AS27566 +[2800:150:11d:1093:c9e3:1ef4:bc4:250d]:8333 # AS22047 +[2800:40:17:ccb:abfd:6021:2e22:e11e]:8333 # AS16814 +[2800:40:38:cfef:a236:bcff:fe58:b6ec]:8333 # AS16814 +[2800:40:74:4b8b:f673:db63:6f6f:2310]:8333 # AS16814 +[2800:40:79:fa39:930c:ace4:77fa:a15f]:8333 # AS16814 +[2800:cd0:7b14:b400:c090:e030:50ea:5fee]:8333 # AS6568 +[2803:9800:9003:babc:1188:44f0:b55d:79e4]:8333 # AS11664 +[2803:9800:9447:84bb:325a:3aff:fe6b:f795]:8333 # AS11664 +[2803:9800:a007:8391:1fd7:c263:a55b:b9fb]:8333 # AS11664 +[2804:14c:87e0:8e2e:6aca:9e19:8c0d:bfd7]:8333 # AS28573 +[2804:431:e038:cd01:aaa1:59ff:fe0d:44b8]:8333 # AS27699 +[2804:d45:b01c:be00:797b:b8d2:fb39:45]:8333 # AS7738 +[2804:d4b:7d55:5800:32b9:6a01:dea3:7a4]:8333 # AS7738 +[2804:d56:e88:7300:fcf5:a432:eb7:c2d4]:8333 # AS8167 +[2806:267:148a:1d10:5e4:fde0:8744:8c17]:8333 # AS13999 +[2806:2f0:5680:fd99:1088:b524:75e3:49d5]:8333 # AS17072 +[2a00:1169:114:dc00::]:8333 # AS21499 +[2a00:1190:c013::be:1337]:8333 # AS16302 [2a00:1298:8001::6542]:8333 # AS5578 -[2a00:1398:4:2a03:215:5dff:fed6:1033]:8333 # AS34878 +[2a00:12d8:7005::1e]:8333 # AS12586 +[2a00:12e0:101:99:20c:29ff:fe29:d03f]:8333 # AS6798 +[2a00:1398:4:2a03:3eec:efff:fe05:d93e]:8333 # AS34878 [2a00:1398:4:2a03::bc03]:8333 # AS34878 +[2a00:13a0:3015:1:85:14:79:26]:8333 # AS31242 [2a00:1768:2001:27::ef6a]:8333 # AS43350 +[2a00:1a08:ffff:5::11]:8333 # AS25534 [2a00:1f40:5001:108:5d17:7703:b0f5:4133]:8333 # AS42864 [2a00:23c5:fe80:7301:d6ae:52ff:fed5:56a5]:8333 # AS2856 -[2a00:6020:13dc:bc00:5559:258:27d:b52b]:8333 # AS60294 -[2a00:6020:4503:3700:20c:29ff:fe61:4a4c]:8333 # AS60294 -[2a00:6020:b434:eb00:dea6:32ff:fe0d:a5c0]:8333 # AS60294 -[2a00:6020:b489:2000:5054:ff:fefc:5ed8]:8333 # AS60294 -[2a00:7c80:0:10c::2]:8333 # AS49981 -[2a00:7c80:0:25::e37a]:8333 # AS49981 -[2a00:8a60:e012:a00::21]:8333 # AS680 -[2a00:bbe0:cc:0:5a11:22ff:feb4:8f5c]:8333 # AS47605 -[2a00:bbe0:cc:0:62a4:4cff:fe23:7510]:8333 # AS47605 -[2a00:ca8:a15:9a5b:8b42:a886:7d48:7a21]:8333 # AS30764 -[2a00:ca8:a1f:f9b7:cb55:5766:524b:acaa]:8333 # AS30764 -[2a00:d4e0:ff:fc02:5e55:4a7c:b83b:e5a1]:8333 # AS15600 -[2a00:d520:9:9300:420b:544e:8019:6d3a]:8333 # AS15600 +[2a00:4d80::1]:8333 # AS43150 +[2a00:5980:93::135]:8333 # AS197869 +[2a00:6020:4722:8920:5054:ff:fe06:56cf]:8333 # AS60294 +[2a00:6020:4722:8920::1b05]:8333 # AS60294 +[2a00:6020:4914:5700:db31:ca50:797:c468]:8333 # AS60294 +[2a00:6020:4a80:6978::10]:8333 # AS60294 +[2a00:6020:509e:a400:211:32ff:fe5c:369c]:8333 # AS60294 +[2a00:6020:a79f:8700:52eb:f6ff:feef:6e1f]:8333 # AS60294 +[2a00:6020:b406:e00:79e:9ad6:9181:ebb8]:8333 # AS60294 +[2a00:6020:b489:2000:42:c0ff:fea8:b209]:8333 # AS60294 +[2a00:7c80:0:4e::2]:8333 # AS49981 +[2a00:7c80:0:4e:b7c0::2001]:8333 # AS49981 +[2a00:8a60:e012:a00::9001]:8333 # AS47610 +[2a00:bbe0:0:221f::246]:8333 # AS60414 +[2a00:c6c0:0:142:1::1]:8333 # AS47172 +[2a00:d420:8:5d00:69c2:164b:29d7:fa9e]:8333 # AS15600 +[2a00:d4e0:ff:fc02:7af2:9eff:fe90:31e0]:8333 # AS15600 [2a00:d880:5:c2::d329]:8333 # AS198203 -[2a00:ee2:1200:1900:8d3:d2ff:feb1:bc58]:8333 # AS5603 -[2a01:4f8:173:230a::2]:8333 # AS24940 -[2a01:4f8:200:7222::2]:8333 # AS24940 -[2a01:4f8:202:3e6::2]:8333 # AS24940 -[2a01:4f8:221:44d7::2]:8333 # AS24940 -[2a01:4f8:231:915::2]:8333 # AS24940 -[2a01:4f8:261:2bcd::2]:8333 # AS24940 -[2a01:4f8:261:3cae::2]:8333 # AS24940 -[2a01:4f8:261:420c::2]:8333 # AS24940 -[2a01:4f9:2b:29a::2]:8333 # AS24940 -[2a01:4f9:3a:2dd2::2]:8333 # AS24940 -[2a01:7a7:2:2804:ae1f:6bff:fe9d:6c94]:8333 # AS20773 +[2a01:238:425f:4600:bbb8:16d6:e907:cb6f]:8333 # AS6724 +[2a01:261:218:3f00:8d0f:2105:c657:4ae7]:8333 # AS34779 +[2a01:4b00:807c:3100:262f:d0ff:fef9:fdd9]:8333 # AS56478 +[2a01:4b00:8256:1110:d2bf:9cff:fe45:9a60]:8333 # AS56478 +[2a01:4b00:bf1b:7200:d826:7d6f:b13:276c]:8333 # AS56478 +[2a01:4f8:160:60aa:fee::1]:8333 # AS24940 +[2a01:4f8:171:210f::2]:8333 # AS24940 +[2a01:4f8:172:109b::2]:8333 # AS24940 +[2a01:4f8:172:2695::2]:8333 # AS24940 +[2a01:4f8:173:2742::2]:8333 # AS24940 +[2a01:4f8:1c0c:b00d::1]:8333 # AS24940 +[2a01:4f8:202:4205::2]:8333 # AS24940 +[2a01:4f8:c2c:7f8e::1]:8333 # AS24940 +[2a01:4f9:3080:1447::2]:8333 # AS24940 +[2a01:4f9:3b:1edc::2]:8333 # AS24940 +[2a01:4ff:1f0:8517::1]:8333 # AS212317 +[2a01:4ff:1f0:c3c1::1]:8333 # AS212317 +[2a01:4ff:f0:e4e9::1]:8333 # AS213230 +[2a01:5a8:302:ff6e::1]:8333 # AS8866 +[2a01:7a7:2:2804:ae1f:6bff:fe9d:6c94]:8333 # AS29066 +[2a01:7a7:2:3d3a:ae1f:6bff:fef2:e12]:8333 # AS29066 +[2a01:7c8:aaac:89:5054:ff:feb7:f5cb]:8333 # AS20857 [2a01:7c8:aac2:180:5054:ff:fe56:8d10]:8333 # AS20857 -[2a01:7c8:aac9:c9:5054:ff:fedf:ff95]:8333 # AS20857 -[2a01:7e01::f03c:93ff:fe49:2f5b]:8333 # AS63949 -[2a01:8740:1:753::e5cb]:8333 # AS57344 -[2a01:8740:1:ffc5::8c6a]:8333 # AS57344 -[2a01:cb00:b63:c000:227:eff:fe28:c565]:8333 # AS3215 -[2a01:cb19:688:e900:aa60:b6ff:fe29:bbae]:8333 # AS3215 -[2a01:e0a:163:c0b0:9da5:1690:a12b:bede]:8333 # AS12322 -[2a01:e0a:282:67b0:b4f4:aaff:fe7c:44a6]:8333 # AS12322 -[2a01:e0a:301:7010:b87d:e14b:cea9:b998]:8333 # AS12322 -[2a01:e0a:320:39a0:325a:3aff:fe02:3180]:8333 # AS12322 -[2a01:e0a:351:9fb0:6bf2:95d6:b7bd:b846]:8333 # AS12322 -[2a01:e0a:5fa:a0a0:ca1f:66ff:fece:b8a2]:8333 # AS12322 -[2a01:e0a:83d:dd30:3676:5d8e:8a6f:115a]:8333 # AS12322 -[2a01:e0a:9e9:c240:7b44:f32a:6ec0:a8af]:8333 # AS12322 -[2a01:e0a:b5:7f50:c257:a55b:4846:97e1]:8333 # AS12322 -[2a01:e11:100c:70:cbc8:9e31:4b77:1626]:8333 # AS12322 -[2a02:1210:2cdf:4600:2bc:e03e:43e8:4718]:8333 # AS3303 -[2a02:1210:86bf:f100:a9ac:d041:1f8e:6925]:8333 # AS3303 -[2a02:1210:94c3:3400:d8c3:743c:90f6:a48a]:8333 # AS3303 -[2a02:168:2000:96::12]:8333 # AS13030 +[2a01:8740:1:753::e5cb]:8333 # AS203380 +[2a01:cb00:1428:ea00:56bf:64ff:fe1e:3403]:8333 # AS3215 +[2a01:e0a:165:5d70:92e6:baff:fe9f:98b]:8333 # AS12322 +[2a01:e0a:316:d560:be24:11ff:fe28:5390]:8333 # AS12322 +[2a01:e0a:366:5920:e6b9:7aff:feea:d6c5]:8333 # AS12322 +[2a01:e0a:3bf:6aa0:1e69:7aff:fe06:a27c]:8333 # AS12322 +[2a01:e0a:57b:a0:7039:12e3:6547:2849]:8333 # AS12322 +[2a01:e0a:83d:dd30:246a:4af7:53f4:8d65]:8333 # AS12322 +[2a01:e0a:9a1:f240:f223:e414:342a:3263]:8333 # AS12322 +[2a01:e0a:b73:bcf0:803a:3a03:8f6b:a726]:8333 # AS12322 +[2a01:e0a:d:1840:59ee:9933:1350:59df]:8333 # AS12322 +[2a01:e0a:df:b9a0:b62e:99ff:fece:1395]:8333 # AS12322 +[2a01:e11:100c:70:39f3:e3c9:832f:37a]:8333 # AS29447 +[2a01:e11:1404:7870:d2:303d:bafd:c6e]:8333 # AS29447 +[2a02:1210:4aba:e800:21ec:346:a29f:90be]:8333 # AS3303 +[2a02:1210:60e0:800:8d6e:134d:a0ca:ef24]:8333 # AS3303 +[2a02:13b8:f000:101::a]:8333 # AS15614 +[2a02:168:2000:97::26]:8333 # AS13030 +[2a02:168:420b:7::7]:8333 # AS13030 [2a02:168:420b:a::20]:8333 # AS13030 -[2a02:168:676e:0:e65f:1ff:fe09:3591]:8333 # AS13030 -[2a02:1748:f39f:5872:216:3eff:fe21:266]:8333 # AS51184 -[2a02:180:1:1::517:10b6]:8333 # AS35366 -[2a02:2780:9000:70::7]:8333 # AS35434 +[2a02:168:62a7::b1c]:8333 # AS13030 +[2a02:168:66c1:0:3f6b:3380:5c04:41f5]:8333 # AS13030 +[2a02:168:b5cf:4::]:8333 # AS13030 +[2a02:1748:f7df:95b1:96c6:91ff:fe1d:e0b6]:8333 # AS51184 +[2a02:1748:fafe:d081:add:f1d7:6345:374c]:8333 # AS51184 +[2a02:180:6:1::3e]:8333 # AS35366 +[2a02:21b4:2089:9100:c7f8:bc95:5df1:cc2f]:8333 # AS57370 +[2a02:22a0:bbb3:dc10:50e1:57ff:fe70:9492]:8333 # AS28685 +[2a02:247a:215:3e00::1]:8333 # AS8560 +[2a02:247a:22d:c000:1::1]:8333 # AS8560 +[2a02:247a:243:7b00::1]:8333 # AS8560 [2a02:2780:9000:70::f]:8333 # AS35434 [2a02:2780::e01a]:8333 # AS35434 -[2a02:2f05:6008:ce00::1]:8333 # AS48571 +[2a02:2f0a:1022:4c00:d112:9624:fbb1:6e38]:8333 # AS8708 +[2a02:3102:4d5c:f000:dea6:32ff:febb:b9cb]:8333 # AS6805 [2a02:390:9000:0:aaa1:59ff:fe43:b57b]:8333 # AS12496 -[2a02:578:85ce:1600:1e1b:dff:fee3:774b]:8333 # AS9031 +[2a02:6ea0:d14a::a921:e257]:8333 # AS60068 [2a02:768:f92b:db46:5e46:772b:71d:29b7]:8333 # AS44489 -[2a02:7a01::91:228:45:130]:8333 # AS16019 -[2a02:7b40:50d0:e386::1]:8333 # AS62282 -[2a02:7b40:50d1:e35b::1]:8333 # AS62282 -[2a02:7b40:5928:89::1]:8333 # AS62282 -[2a02:7b40:b945:344d::1]:8333 # AS62282 +[2a02:7a01::91:228:45:130]:8333 # AS197895 +[2a02:7b40:50d1:e77e::1]:8333 # AS62282 +[2a02:7b40:b0df:8f88::1]:8333 # AS62282 +[2a02:7b40:b945:3599::1]:8333 # AS62282 [2a02:7b40:d418:6d9a::1]:8333 # AS62282 -[2a02:8070:b84:6ae0:f9c6:fbb9:1c41:81aa]:8333 # AS51185 -[2a02:8070:f186:38e0::d5a6]:8333 # AS51185 -[2a02:8084:103:6810:1e69:7aff:fea2:1acc]:8333 # AS6830 -[2a02:8308:8081:f300:3b8:7ec0:2837:1b57]:8333 # AS16019 +[2a02:7b40:d418:6dfe::1]:8333 # AS62282 +[2a02:8108:8126:4f00::2000]:8333 # AS3209 +[2a02:8108:8a8a:8a00:42:acff:fe10:6402]:8333 # AS3209 +[2a02:8108:8ab2:400:d250:99ff:fe9e:792a]:8333 # AS3209 +[2a02:810b:1800:3400:1616:fdd9:da09:e7fb]:8333 # AS3209 +[2a02:8308:8188:5100:ab4b:4802:166:fa84]:8333 # AS16019 [2a02:8388:e302:7980:6f85:a0b3:4b4d:8b0f]:8333 # AS8412 [2a02:8388:e5c3:4a80:201:2eff:fe82:b3cc]:8333 # AS8412 -[2a02:842a:1df:8a01:1e1b:dff:fe0b:236d]:8333 # AS15557 -[2a02:a210:28be:5f80::111]:8333 # AS6830 -[2a02:a44b:5cf9:1:b62e:99ff:fe49:d492]:8333 # AS1136 -[2a02:a44d:14d6:1:2c0:8ff:fe8f:b3b2]:8333 # AS1136 +[2a02:908:1a76:7900:7a01:da0c:ee2f:f04b]:8333 # AS3209 +[2a02:908:c200:6d00:caad:5e32:35e7:3157]:8333 # AS3209 +[2a02:a213:273d:8b00:596e:701f:1a74:6857]:8333 # AS33915 +[2a02:a313:21db:6780::5c25]:8333 # AS6830 [2a02:a45a:94cd:f00d::1]:8333 # AS1136 -[2a02:a45f:3b9d:31::199]:8333 # AS1136 -[2a02:a464:3d6b::1:2]:8333 # AS1136 -[2a02:a46c:7f8e:1:35bf:3aeb:137c:1d35]:8333 # AS1136 -[2a02:a46d:36f:1:20d:b9ff:fe4e:6398]:8333 # AS1136 -[2a02:c205:2021:4216::1]:8333 # AS51167 +[2a02:a461:40f8:2:cb28:93e5:28ab:6c55]:8333 # AS1136 +[2a02:a465:80f4:1:f369:4ef5:aa12:7566]:8333 # AS1136 +[2a02:a469:3eda:1:7e83:34ff:feb6:13f2]:8333 # AS1136 +[2a02:ab88:20b:ce00:223:24ff:fe56:6202]:8333 # AS21334 +[2a02:ab8:201:403::126]:8333 # AS48943 +[2a02:ab8:201:403:b87a:46a1:aece:21ed]:8333 # AS48943 [2a02:c206:2044:9826::1]:8333 # AS51167 -[2a02:c206:2075:3351::1]:8333 # AS51167 -[2a02:c207:0:3829::1]:8333 # AS51167 -[2a02:c207:2014:4199::1]:8333 # AS51167 -[2a02:c207:2014:8757::1]:8333 # AS51167 -[2a02:c207:2026:6682::1]:8333 # AS51167 -[2a02:c207:2034:7358::1]:8333 # AS51167 -[2a02:c207:3002:7468::1]:8333 # AS51167 -[2a02:c207:3008:4592::1]:8333 # AS51167 -[2a02:cb43:4000::178]:8333 # AS33891 +[2a02:c206:2129:6277::1]:8333 # AS51167 +[2a02:c206:2172:2852::1]:8333 # AS51167 +[2a02:c206:2179:6690::1]:8333 # AS51167 +[2a02:c206:2222:6547::1]:8333 # AS51167 +[2a02:c206:3013:5531::1]:8333 # AS51167 +[2a02:c206:3015:9030::1]:8333 # AS51167 +[2a02:c207:2043:5542::1]:8333 # AS51167 +[2a02:cb43:4000::178]:8333 # AS20546 [2a02:e5e:1:10::27]:8333 # AS25057 [2a02:e98:20:1504::1]:8333 # AS24641 -[2a03:4000:28:68:7411:53ff:fe4c:21d]:8333 # AS47147 -[2a03:4000:65:fdc:3462:66ff:fe05:ec5c]:8333 # AS47147 -[2a03:6000:870:0:46:23:87:218]:8333 # AS51088 +[2a03:1ac0:2e92:e7bb:4fa4:3148:829e:ca00]:8333 # AS12768 +[2a03:4000:21:251:28cf:6cff:fe9a:8efb]:8333 # AS197540 +[2a03:4000:2a:9f:a474:d5ff:feb2:3f72]:8333 # AS197540 +[2a03:4000:4d:f1:b4a7:38ff:fe8e:fd75]:8333 # AS197540 +[2a03:4000:5f:cfc:14c3:eff:feb5:1c1a]:8333 # AS197540 +[2a03:4000:63:dc7:d418:2dff:fef3:94d9]:8333 # AS197540 +[2a03:4000:6:3044:481:f8ff:fe11:f7fa]:8333 # AS197540 +[2a03:4000:6:e161:d844:adff:fe11:3f2]:8333 # AS197540 +[2a03:4000:6a:2b3:d88a:d2ff:fe23:ac21]:8333 # AS197540 +[2a03:4000:6b:c6:24e9:1dff:fefc:87d4]:8333 # AS197540 +[2a03:4000:9:7d9:c88f:1dff:fe4e:44d]:8333 # AS197540 +[2a03:6000:870:0:46:23:87:218]:8333 # AS60131 +[2a03:6f01:1:2::8c2e]:8333 # AS9123 [2a03:94e0:ffff:185:243:218:0:19]:8333 # AS56655 -[2a03:b0c0:1:e0::397:6001]:8333 # AS14061 -[2a03:b0c0:1:e0::794:9001]:8333 # AS14061 -[2a03:b0c0:2:f0::288:c001]:8333 # AS14061 -[2a03:b0c0:2:f0::30c:1]:8333 # AS14061 -[2a03:b0c0:3:d0::e3b:5001]:8333 # AS14061 -[2a03:cfc0:8000:7::5fd6:3557]:8333 # AS201814 -[2a04:2180:dc05:2::3b]:8333 # AS61272 -[2a04:2180:ffff:fffe::d]:8333 # AS61272 -[2a04:52c0:103:c455::1]:8333 # AS60404 -[2a04:bc40:1dc3:8d::2:1001]:8333 # AS35277 -[2a05:3580:dc0b:1600:def4:5a62:de42:324a]:8333 # AS20764 -[2a05:d014:a55:4000:8dde:69f:4ac7:b26]:8333 # AS16509 -[2a05:d016:98f:5201:6be0:a4de:80c7:32d5]:8333 # AS16509 -[2a05:d018:a75:6c03:75b:2c73:8caa:414b]:8333 # AS16509 -[2a05:f480:1800:697:5400:2ff:feb6:c36d]:8333 # AS20473 -[2a06:e040:7603:2918:c6ef:464e:9fe5:73ec]:8333 # AS198507 -[2a07:abc4::89:234:180:194]:8333 # AS62000 -[2a07:d884::127e]:8333 # AS6762 -[2a09:2681:1010:10::5]:8333 # AS61282 -[2a09:2681:102::210]:8333 # AS61282 +[2a03:b0c0:2:d0::df0:d001]:8333 # AS14061 +[2a03:b0c0:2:f0::1bed:9001]:8333 # AS14061 +[2a03:b0c0:3:f0::2cc5:3001]:8333 # AS14061 +[2a03:cfc0:8000:2a::9532:650b]:8333 # AS201814 +[2a03:cfc0:8000:2a::9532:6514]:8333 # AS201814 +[2a03:cfc0:8000:2a::9532:6521]:8333 # AS201814 +[2a03:cfc0:8000:2a::9532:6523]:8333 # AS201814 +[2a03:e2c0:4f9d:5555:29d6:7012:676d:1de]:8333 # AS205125 +[2a03:ec0:0:928::701:701]:8333 # AS199669 +[2a04:52c0:102:2219::1]:8333 # AS60404 +[2a04:52c0:102:49af::1]:8333 # AS60404 +[2a04:52c0:104:160c::1]:8333 # AS60404 +[2a04:9740:115:6e00:3e87:b950:5382:7ec]:8333 # AS196954 +[2a05:3580:d101:3700::]:8333 # AS35807 +[2a05:3580:dc0b:1600:9a5:3d0e:ed14:79ce]:8333 # AS35807 +[2a05:4cc0:0:321::2]:8333 # AS8772 +[2a05:6d40:b94e:d100:230:48ff:fedf:1432]:8333 # AS202128 +[2a05:d014:a55:4000:7705:3a9c:bd4f:aa38]:8333 # AS16509 +[2a05:d016:98f:5200:2110:bfc6:f5c:5009]:8333 # AS16509 +[2a05:d016:98f:5200:6ea8:d9cb:7cc8:17e6]:8333 # AS16509 +[2a05:d016:98f:5200:c7d5:4f51:fd31:d4f4]:8333 # AS16509 +[2a05:d01a:b7b:3c00:659c:239d:953b:23a8]:8333 # AS16509 +[2a05:d01a:b7b:3c00:766c:dbd4:f5be:2d61]:8333 # AS16509 +[2a05:d01c:672:9200:b4e5:d5f6:f633:a59a]:8333 # AS16509 +[2a05:f480:2c00:100c:5400:4ff:fed7:dead]:8333 # AS20473 +[2a05:f480:3000:2b4e:5400:4ff:fed7:4206]:8333 # AS20473 +[2a06:dd00:10:0:225:90ff:fe33:56e8]:8333 # AS56694 +[2a06:dd01::36:0:0:1]:8333 # AS42474 +[2a06:e881:3408:2::2]:8333 # AS205165 +[2a07:7200:ffff:0:3016:d5ff:fe5e:1114]:8333 # AS34197 +[2a07:7200:ffff:0:60d1:eff:fe09:3886]:8333 # AS34197 +[2a07:7200:ffff:0:c43e:80ff:fe3c:e0cd]:8333 # AS34197 +[2a07:7200:ffff:0:f4d3:aff:febe:ad99]:8333 # AS34197 +[2a07:9a07:3::2:1]:8333 # AS202605 +[2a07:b242:1000:1300:f250:8f0a:cdba:4d76]:8333 # AS202618 +[2a07:d884::127e]:8333 # AS23959 +[2a09:2681:1001::23]:8333 # AS61282 +[2a0a:4580:101d::1]:8333 # AS29670 +[2a0a:4cc0:0:21b1:400:e0ff:fe79:9797]:8333 # AS42473 +[2a0a:4cc0:1:1174:98f6:3cff:fe03:c19c]:8333 # AS42473 +[2a0a:a504:117:bf00:661a:85b2:5f5d:8738]:8333 # AS210619 +[2a0a:ef40:e51:d001:9d3d:f687:b0dd:3131]:8333 # AS5378 +[2a0b:3202:a:108::142]:8333 # AS201080 +[2a0b:4880::266e:96ff:fedb:7cdc]:8333 # AS48614 [2a0b:f300:2:6::2]:8333 # AS62240 -[2a0d:8340:24::2]:8333 # AS50113 -[2a0e:8f02:21d1:144::101]:8333 # AS20473 -[2a0e:b780::55d1:f05b]:8333 # AS205581 +[2a0b:f4c0:c1:920e:b25a:daff:fe87:77b4]:8333 # AS205100 +[2a0c:5a87:9206:2e00:6ebf:b5ff:fe02:cb4f]:8333 # AS57269 +[2a0c:b641:6f0:193::]:8333 # AS214379 +[2a0d:3002:2100:a001:4::]:8333 # AS205544 +[2a0d:3344:1d2:9100:428d:5cff:fe5f:902d]:8333 # AS14593 +[2a0e:8086:0:3ce:6972:c5a6:f5ab:c78d]:8333 # AS50340 +[2a0e:8f02:21d1:144::101]:8333 # AS203528 +[2a0e:cb01:63:d5ad:69:69:69:69]:8333 # AS60377 +[2a0e:e701:103e::4]:8333 # AS2027 +[2a0f:b780:300:1::2]:8333 # AS49095 [2a10:3781:2c19::1]:8333 # AS206238 -[2a10:d200:1:33:a6bf:1ff:fe6a:46a9]:8333 # AS212323 -[2a12:8e40:5668:e40a::1]:8333 # AS34465 -[2a12:8e40:5668:e40b::1]:8333 # AS34465 -[2a12:8e40:5668:e40c::1]:8333 # AS34465 -[2a12:8e40:5668:e40d::1]:8333 # AS34465 -[2a12:8e40:5668:e40e::1]:8333 # AS34465 -[2a12:8e40:5668:e40f::1]:8333 # AS34465 -[2a12:8e40:5668:e410::1]:8333 # AS34465 -[2a12:8e40:5668:e411::1]:8333 # AS34465 -[2a12:8e40:5668:e412::1]:8333 # AS34465 -[2a12:8e40:5668:e417::1]:8333 # AS34465 -[2c0f:f8f0:da51:0:3a45:fc57:5e30:2593]:8333 # AS30844 - -# manually updated 2023-04 for minimal torv3 bootstrap support - -2bqghnldu6mcug4pikzprwhtjjnsyederctvci6klcwzepnjd46ikjyd.onion:8333 -4lr3w2iyyl5u5l6tosizclykf5v3smqroqdn2i4h3kq6pfbbjb2xytad.onion:8333 -5g72ppm3krkorsfopcm2bi7wlv4ohhs4u4mlseymasn7g7zhdcyjpfid.onion:8333 -5sbmcl4m5api5tqafi4gcckrn3y52sz5mskxf3t6iw4bp7erwiptrgqd.onion:8333 -776aegl7tfhg6oiqqy76jnwrwbvcytsx2qegcgh2mjqujll4376ohlid.onion:8333 -77mdte42srl42shdh2mhtjr7nf7dmedqrw6bkcdekhdvmnld6ojyyiad.onion:8333 -azbpsh4arqlm6442wfimy7qr65bmha2zhgjg7wbaji6vvaug53hur2qd.onion:8333 -b64xcbleqmwgq2u46bh4hegnlrzzvxntyzbmucn3zt7cssm7y4ubv3id.onion:8333 -bsqbtcparrfihlwolt4xgjbf4cgqckvrvsfyvy6vhiqrnh4w6ghixoid.onion:8333 -bsqbtctulf2g4jtjsdfgl2ed7qs6zz5wqx27qnyiik7laockryvszqqd.onion:8333 -cwi3ekrwhig47dhhzfenr5hbvckj7fzaojygvazi2lucsenwbzwoyiqd.onion:8333 -devinbtcmwkuitvxl3tfi5of4zau46ymeannkjv6fpnylkgf3q5fa3id.onion:8333 -devinbtctu7uctl7hly2juu3thbgeivfnvw3ckj3phy6nyvpnx66yeyd.onion:8333 -devinbtcyk643iruzfpaxw3on2jket7rbjmwygm42dmdyub3ietrbmid.onion:8333 -dtql5vci4iaml4anmueftqr7bfgzqlauzfy4rc2tfgulldd3ekyijjyd.onion:8333 -emzybtc25oddoa2prol2znpz2axnrg6k77xwgirmhv7igoiucddsxiad.onion:8333 -emzybtc3ewh7zihpkdvuwlgxrhzcxy2p5fvjggp7ngjbxcytxvt4rjid.onion:8333 -emzybtc454ewbviqnmgtgx3rgublsgkk23r4onbhidcv36wremue4kqd.onion:8333 -emzybtc5bnpb2o6gh54oquiox54o4r7yn4a2wiiwzrjonlouaibm2zid.onion:8333 -fpz6r5ppsakkwypjcglz6gcnwt7ytfhxskkfhzu62tnylcknh3eq6pad.onion:8333 -hanvo3hzqbhcqm5vahhi5a3czxxdwc7vt56p5gr7bifcvelaqurv6iid.onion:8333 -hz7oqntvj4adrwtqappcgaxfribg5u4rvfkpwlo3xup5fcuyvylkxlqd.onion:8333 -ityrxhidvjnjnf6imzyuqqnkkwridjnebkbokx25so3suq3fzezmksid.onion:8333 -jto2jfbsxhb6yvhcrrjddrgbakte6tgsy3c3z3prss64gndgvovvosyd.onion:8333 -k7nb3r7hxi5exvr4xmvnilhfw6hei7sw4rwz2t6onh4py6wbora6tuyd.onion:8333 -kpgvmscirrdqpekbqjsvw5teanhatztpp2gl6eee4zkowvwfxwenqaid.onion:8333 -l7kw3vjs4cf5mnuejjgqcxrw6wwsjmabllq3h3amy4f5q33d6cgo2kyd.onion:8333 -m7cbpjolo662uel7rpaid46as2otcj44vvwg3gccodnvaeuwbm3anbyd.onion:8333 -mowb2qwpjgs2a6q3yj3xa7nxklfssul4w7ynonyycw3uyopfu3x6ujad.onion:8333 -mwmfluek4au6mxxpw6fy7sjhkm65bdfc7izc7lpz3trewfdghyrzsbid.onion:8333 -rfqmn3qe36uaptkxhdvi74p4hyrzhir6vhmzb2hqryxodig4gue2zbyd.onion:8333 -rsgwtnousfc7zyg4qsm3gvczjx7cihh2njyjbjl3qvcj3xg7wmvhddqd.onion:8333 -s2d52bbttuwcl3pdrwzhxpmhtxn3jg23havjqg5eygwhtiw6lgyelpqd.onion:8333 -upvthy74hgvgbqi6w3zd2mlchoi5tvvw7b5hpmmhcddd5fnnwrixneid.onion:8333 -who3qs4eqlqzoxhqqgan4mg54ua5uz3mk4lj33ag53ei4orvnznrjbad.onion:8333 -wizbit5555bsslwv4ctronnsgk5vh2w2pdx7v7eyuivlyuoteejk7lid.onion:8333 -yrmedr35tt4wqfnwgilltxh5bnukeukxjpgg3jzmmsyld5lgsn5amvyd.onion:8333 - -# manually updated 2023-04 for minimal i2p bootstrap support -255fhcp6ajvftnyo7bwz3an3t4a4brhopm3bamyh2iu5r3gnr2rq.b32.i2p:0 -27yrtht5b5bzom2w5ajb27najuqvuydtzb7bavlak25wkufec5mq.b32.i2p:0 -3gocb7wc4zvbmmebktet7gujccuux4ifk3kqilnxnj5wpdpqx2hq.b32.i2p:0 -4fcc23wt3hyjk3csfzcdyjz5pcwg5dzhdqgma6bch2qyiakcbboa.b32.i2p:0 -4osyqeknhx5qf3a73jeimexwclmt42cju6xdp7icja4ixxguu2hq.b32.i2p:0 -4umsi4nlmgyp4rckosg4vegd2ysljvid47zu7pqsollkaszcbpqq.b32.i2p:0 -6j2ezegd3e2e2x3o3pox335f5vxfthrrigkdrbgfbdjchm5h4awa.b32.i2p:0 -6n36ljyr55szci5ygidmxqer64qr24f4qmnymnbvgehz7qinxnla.b32.i2p:0 -72yjs6mvlby3ky6mgpvvlemmwq5pfcznrzd34jkhclgrishqdxva.b32.i2p:0 -a5qsnv3maw77mlmmzlcglu6twje6ttctd3fhpbfwcbpmewx6fczq.b32.i2p:0 -aovep2pco7v2k4rheofrgytbgk23eg22dczpsjqgqtxcqqvmxk6a.b32.i2p:0 -bitcoi656nll5hu6u7ddzrmzysdtwtnzcnrjd4rfdqbeey7dmn5a.b32.i2p:0 -brifkruhlkgrj65hffybrjrjqcgdgqs2r7siizb5b2232nruik3a.b32.i2p:0 -c4gfnttsuwqomiygupdqqqyy5y5emnk5c73hrfvatri67prd7vyq.b32.i2p:0 -day3hgxyrtwjslt54sikevbhxxs4qzo7d6vi72ipmscqtq3qmijq.b32.i2p:0 -du5kydummi23bjfp6bd7owsvrijgt7zhvxmz5h5f5spcioeoetwq.b32.i2p:0 -e55k6wu46rzp4pg5pk5npgbr3zz45bc3ihtzu2xcye5vwnzdy7pq.b32.i2p:0 -eciohu5nq7vsvwjjc52epskuk75d24iccgzmhbzrwonw6lx4gdva.b32.i2p:0 -ejlnngarmhqvune74ko7kk55xtgbz5i5ncs4vmnvjpy3l7y63xaa.b32.i2p:0 -fhzlp3xroabohnmjonu5iqazwhlbbwh5cpujvw2azcu3srqdceja.b32.i2p:0 -fx6np3oheacr3t7gluftrqo2qxldbbatgw4hepp7ulb4j5ry57ca.b32.i2p:0 -gehtac45oaghz54ypyopim64mql7oad2bqclla74l6tfeolzmodq.b32.i2p:0 -hhfi4yqkg2twqiwezrfksftjjofbyx3ojkmlnfmcwntgnrjjhkya.b32.i2p:0 -jz3s4eurm5vzjresf4mwo7oni4bk36daolwxh4iqtewakylgkxmq.b32.i2p:0 -liu75cvktv4icbctg72w7nxbk4eibt7wamizfdii4omz7gcke5vq.b32.i2p:0 -lrah7acdsgopybg43shadwwiv6igezaw64i6jb5muqdg7dmhj3la.b32.i2p:0 -lzuu6mjtu7vd55d2biphicihufipoa7vyym6xfnkmmlra3tiziia.b32.i2p:0 -m6bpynxkv2ktwxkg6p2gyudjfhdupb6kuzabeqdnckkdkf4kxjla.b32.i2p:0 -m6v454xd6p3bt5swujgmveklsp7lzbkqlqqfc2p36cjlwv5dbucq.b32.i2p:0 -mlgeizrroynuhpxbzeosajt5u4ddcvynxfmcbm6kwjpaufilxigq.b32.i2p:0 -o6t4fr5ayfadzieutstgwcllvwxeuzjlxmzsmpj3hpkvefhzfaea.b32.i2p:0 -ofubxr2ir7u2guzjwyrvujicivzmvinwa36nuzlrg7tnsmebal7a.b32.i2p:0 -oz2ia3flpm3du2tyusulrn7h7e2eo3juzkrmn34bvnrlcrugv7ia.b32.i2p:0 -pohfcrfc7prn4bvn4xstw6nt3e7hjmb7kuj4djtsfqsskwhmhnna.b32.i2p:0 -qd6jlsevsexww3wefpqs7iglxb3f63y4e6ydulfzrvwflpicmdqa.b32.i2p:0 -rfjkzdzv4cwpxo6hzuncicvuyui76wxqx3a23lynq72ktwqs7aja.b32.i2p:0 -rizfinyses2r3or4iubs5wx66gdy6mpf73w7uobfacm2l5cral3q.b32.i2p:0 -sedndhv5vpcgdmykyi5st4yqhdxl3hpdtglta4do435wupahhx6q.b32.i2p:0 -tugq6wa2ls2bv27pr2iy3da3k5ow3fzefbcvjcr22uc7w5vmevja.b32.i2p:0 -usztavbib756k5vqggzgkyswoj6mttihjvp3c2pa642t2mb4pvsa.b32.i2p:0 -vgu6llqbyjphml25umd5ztvyxrxuplz2g74fzbx75g3kkaetoyiq.b32.i2p:0 -wjrul5jwwb4vqdmkkrjbmly7osj6amecdpsac5xvaoqrti4nb3ha.b32.i2p:0 -wwbw7nqr3ahkqv62cuqfwgtneekvvpnuc4i4f6yo7tpoqjswvcwa.b32.i2p:0 -xfkarmvk43vfkfvhkehy7ioj2b6wtfdlezvmlakblz3q4r7mccfq.b32.i2p:0 -yc4xwin5ujenvcr6ynwkz7lnmmq3nmzxvfguele6ovqqpxgjvonq.b32.i2p:0 -zdoabsg7ugzothyawodjhq54nvlofa746rxfkxpnjzj6nukmha6a.b32.i2p:0 -zsxwyo6qcn3chqzwxnseusqgsnuw3maqnztkiypyfxtya4snkoka.b32.i2p:0 -zysrlpii5ftrzivfcyhdrwpeyyqddbrdefnfu5q6otk5gtugmh2a.b32.i2p:0 - -# manually updated 2023-04 for minimal cjdns bootstrap support -[fc32:17ea:e415:c3bf:9808:149d:b5a2:c9aa]:8333 -[fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce]:8333 -[fcdc:73ae:b1a9:1bf8:d4c2:811:a4c7:c34e]:8333 +[2a10:3781:3a73:25::25]:8333 # AS206238 +[2a10:3781:3a73:25:a177:ad25:b14a:176a]:8333 # AS206238 +[2a10:3781:3fff::1]:8333 # AS206238 +[2a10:3781:84b:1:8002:99d3:191f:c738]:8333 # AS206238 +[2a10:c941:100:24::2:1001]:8333 # AS35277 +[2a11:d540:531:b00b::5]:8333 # AS207586 +[2a12:8e40:5668:e40a::1]:8333 # AS45021 +[2a12:8e40:5668:e40b::1]:8333 # AS45021 +[2a12:8e40:5668:e40f::1]:8333 # AS45021 +[2a12:8e40:5668:e410::1]:8333 # AS45021 +[2a12:8e40:5668:e412::1]:8333 # AS45021 +[2a12:8e40:5668:e418::1]:8333 # AS45021 +[2a12:8e40:5668:e41a::1]:8333 # AS45021 +[2a12:8e40:5668:e41d::1]:8333 # AS45021 +[2a12:8e40:5668:e41e::1]:8333 # AS45021 +[2a12:8e40:5668:e420::1]:8333 # AS45021 +[2c0f:2a80:2540:1ac4:73f0:cfa4:1821:d1bd]:8333 # AS14593 +[2c0f:fb18:402:5::3]:8333 # AS37199 +2aiycr24bdfx5s6yj4i2n2xbnha6rjn3pc23i4rbrwo5ays653xzygad.onion:8333 +2bj3dc3e6dh4f7fd5uta3qp32bbqxzyqjs7ixy4lwdkx3n5jisfc7uid.onion:8333 +2bpccmeaduwlo4t52pangngxdxp235teqe2cflkdwjcwjvyl5f63m4id.onion:8333 +2byffyqnely7vwuncdvodoo3ip6jdi2b32bxjtnlwcdurjipsxdktqid.onion:8333 +2d7uxq7ylxssdgonks6burn4lwcyiogrp4qkaxk5djbs52l3bvgxzuid.onion:8333 +2f2rq7wy2sm77re4diudcsrfzb7bje3rl52zkhkpr7k22je542r5mcid.onion:8333 +2ga7wdrdxpmuto3qprdabf7urx4rzr2ivwku3ee5ufit56qsqoi5vjid.onion:8333 +2hbr4fvgnvmesbsevctosba2fu5mx5ckbibhjphi4oxjlgowmcsqz6yd.onion:8333 +2jclw2ujx5qt6miolhjxfrxbrltr7vcw5zyctuhyofc366upqksvxhqd.onion:8333 +2kpblheyfrv5hxt7ird4r6fi7albfmyopcwk2eljmyzhqp3rfoodtwqd.onion:8333 +2tvfkr74olmbaqjsngyp442bvqgi6iqu6mmikrgf7bu6mmedkxdiveqd.onion:8333 +2v6izgcdz4lmmbw3wj6jzn7srwjlbxsf5czwew53qm677kc3rwilexqd.onion:8333 +36ps7lbzekepdlhmmyzfuajltjxljjaltkcdkwr44a7df5sl2sxokjad.onion:8333 +3747dbbz7ewdraacetcxl65fk5lqvcsf2ix4wndstbmx4k7rnfxidoad.onion:8333 +37gfddnf4zfnvfpbgebqq4i2v76lrtw3kf7xba5dymcwtxqunx36eqid.onion:8333 +37tyqqa4m4lkilvtcl6d2sedpxthemknrkriivmig47uv3ojql37nqyd.onion:8333 +3agbdvmp4iyo4rpdygeedidpbon5txv4efo2xxvqbzr22puwtjywtqid.onion:8333 +3alygctgneenzovtwcxz7ykn2i735yqro6d2sflkijdvnanots6vz5ad.onion:8333 +3daur2nkfusuli6utbrizb3gwcimduu4wch5iozzoros7wcvypjledqd.onion:8333 +3dp4nrdk4vvivichtplza4d6gtt5v3c5phwxihyh5gcqzhxlqa3jsxqd.onion:8333 +3efpmp6aeatzis3vyrw32fv6nwffcql43e4wkquifgt3eldw4qer6gid.onion:8333 +3erp3rwr5psstk5ruc7oau4boat6ey4vtqyrpy5dbagg7wnzqszgfkid.onion:8333 +3fivvsg6ccrbjx5nopgy7ryqvdvjjn6eqen4qosd6ghvj743camgemid.onion:8333 +3hu7ofcwhxx2rinbq2bprefd2fejed53ehqa4bm3daxd2qmlfugsyjyd.onion:8333 +3jyb2gfpv4mhbzhohvyig6bi3xqlvqurzzr7xqyv5epnxeru7a4ohbqd.onion:8333 +3lqycokbjq76rx4vmhhde2lz2awrnt3c5zu5t2av3nda5amxwinu2cyd.onion:8333 +3q7iq64qokniakeumucz5pgmrndtqixvdx5uto7svkcguabxbku56mid.onion:8333 +3v7wckih3yvx7monqrg7udkrqxrsvzpd3wry7kq66zgedezph2iozbqd.onion:8333 +3vcobxubomismocgkyhjl34nu5mt3ruzy2byrtf3q7pdn5zlommgwiid.onion:8333 +3walt7bg6swhhewgtd56lv3beglutkfkp7gxq7nj74emzu4wr7bxsyyd.onion:8333 +3xu65qtcywnuz63viyi2wuih3o7fb27bwo3uu2klaoj5b56prmegyvid.onion:8333 +3zfpnxo5n636stb22b7xaxb7qtmvjldqcnjdr5hemh3aljm4amlal2qd.onion:8333 +43syalmelgy76zzyoiamtmagfq2woaicmqyon42fno4lhm4vopja7qid.onion:8333 +44lptd6pipnpn3xfmzj54kyqvzuwv45fhiaiywijpshrtk3hlgedieyd.onion:8333 +45py5s2panediepr3aftali4tjsyfyu6y7ykzkadl2sqwtptxtkml6id.onion:8333 +46h53i2fa4ysbtngmxk2oegqfpool3a7glcps5ef5o4webpuq4ukmgid.onion:8333 +46xek5lgozwwt4ij7ymvbogulimsd6kan6yd23fwgd65kor7jio7cdad.onion:8333 +4a3vkisqwv6v46xsbv6rnr34zfph2tfvvtgmlzbymtru2ijv666augid.onion:8333 +4bxdjq6ixzcey3io6jhuapkwlfbcpfeesfmtcy4qb3bf7dlwbzktnxad.onion:8333 +4c5rrmtci7bg7ydyfh5shzvufy3c7prx5ryezc7cnx2jy7vsbhevnsyd.onion:8333 +4flszdgtvl7jlu2jioofb7wgmtbxwhqcmkhu522wphsdvr64yz67umyd.onion:8333 +4gggjxzg6do2ija6mjflubduvv3iqfmkdy4b7vw6tl3k7g7oa5msdlid.onion:8333 +4juzngo2n5fbxlqcfpcnstl3pexuzwtxocfutn3vtyhxtaztaa7axbyd.onion:8333 +4kle6afrjdhu6mranj33n2xw4aj3iqnysqmsc5letdhkthxyf5n35jyd.onion:8333 +4niu7lryc4pqoqvosaxt3bzmq7ulku2vevqxizzkstyisi772apsvjqd.onion:8333 +4nlcxxoygmvjbuqge3y2yhvk5c2525qwdnswhgpxrercggcb2pxy3cid.onion:8333 +4np5xojfk2ventfumyep7azy4rzu3inmpsre7vabfi66n2mgspcinxad.onion:8333 +4p5uvmwkpwu6wf373x4mg6zgwodrzytkd5nbsawc27gf6bhbtsh4b5qd.onion:8333 +4phsfbspp7cr7kzd7wapmgz3zxzobih46rw2a5v6qa4m6rdlphl4wrad.onion:8333 +4s3utndbk43f3npxvvgvekns25c5r3f6v5cfe7vhjso2qo2ru5wcmqqd.onion:8333 +4sijy5qfaw3sq5jku5qsufvxxconuzvdrixh64za6qzlv4l3kikaedyd.onion:8333 +4u3nymzyg52nzi2xaqws6abqgfwk6myc3pj3jr7aqtuac7cko7nr7fid.onion:8333 +4w3qj7as7qhnfuu2peyiiosgiudjc7rnptic6ynq6xp65onnbhrpd3id.onion:8333 +4x3lpzj7ptne45h5rdm5vnpyu4ch4m3u6ljd6dfialtne4cvnbhgjgyd.onion:8333 +574lyz5mrtwoewaejdzzase6iwapmvyfvrdbwn7iupcmf6wcxdorylqd.onion:8333 +5f2w5mff4ij5inqjjjmzwgrkegis4lknkbti7xrh3qg5xfps7q2lvnad.onion:8333 +5gxylibgass6p562vvpzx6zzbaxlru4r5en7ahvcu5nfigr57ytkaeyd.onion:8333 +5hdcmynihsr4r55a3gtxhz6ifmsg7quozgo4wx2bp7agcegwkj4ataid.onion:8333 +5j7z5fovfahxe3gwqt2lthhyxvotcveopld375l2k4rvqccc36lexbad.onion:8333 +5k7zlyo5qeqtbzl7khepw3pblxodcfyzvgdh25hh27bxgvauegnqq3qd.onion:8333 +5ktcl4ysombbuq7g7q6hwahdeafh6nootlpwj5yyt3bvfnizwmhrigyd.onion:8333 +5lijk4k3tzozjo62uj3heeh3nprtl5cibi3xdfp2xm4bahlboh7zjvid.onion:8333 +5mcxoegbgp7vwocusjxshwjncdcnzntzry5fwfk7v5xqylxqlpube2qd.onion:8333 +5nptruq2k5654ajq5h7f5ty3adkhs6gglkrbp6l2x2xlykpkj4cdjzyd.onion:8333 +5ntg7na72bods6fuegoymzboiufgebd4cbaztavi5xcqanohtx6kw6yd.onion:8333 +5p54wr7ppdfwjnapdylo6cysrrzd6shkzgk72y42rwt66fhbhypixjqd.onion:8333 +5piafwsopd7qywfp6gobskqtmxr4c7ndovsefuktml2xih7nnjsukzad.onion:8333 +5pn3tgpv2ldcmtrisda6okg2c3owgaoq776fzn74htqwbfcdzp23wpqd.onion:8333 +5pynehkenulugwn3dvzx7bwqfg7qplnu3vtye5mvlmxxhvkoenznk4ad.onion:8333 +5q7px73cw6egdz622ly524udqwiewdajvpkklrd2gji2uvyrccujvjid.onion:8333 +63en4ruxj3tfgm3ooyrli5ujhai4eygr5mncq7jvbqf7c5vqusrywayd.onion:8333 +65qyyjh7muzlq3poxjwxb43dvuxoulpo57z7rcpx57h7gfzq6gqghlad.onion:8333 +66m72tq6lbsm2y3yn3bwj2uk5ihjqvqkymf2t4pqevtnymqujwmynmid.onion:8333 +6es5e5uprvbtqiv7dxhvfaqb2zvzvvtv2h2ildvqbnikqg57py3nmkqd.onion:8333 +6f3d2ak44y6celpfy3pj22ak4ioitm4k3xfegej5mmeonm6xwg4dnvqd.onion:8333 +6f4mtuv4n5pwturdta3qruhqhuvwlzxyfxtfukydane7y6yuxklo23ad.onion:8333 +6fhojzpkw76kepjqogqf5ldmhs5avbmhrnjj4lnead3b447cgkzysbid.onion:8333 +6gpl5psk63ktxafvhi6guueyy2cgz2zuqwxckvzpi47pr2t5r7p4aqid.onion:8333 +6hg7kc6lmodjyrgq2557dauxibugbejgfynxlptacrmo2lzbcf2ylaad.onion:8333 +6jwjohqnlmk2dbz37dk2nqp3nelnd6xwrx6hjvsw72ujdcdqxsv5k3id.onion:8333 +6nwabl7vks2jieb74akgjmariirzchzeionxdwthsgjsenbfr3qgqzad.onion:8333 +6t3yyuem6d4a4cc5pparbksrjh426jpejo5jal32tcbx7zgz4achr6ad.onion:8333 +6t555fluey3jj3scizdz5fuiaseyqok4fkpm7hznvp2s4j7qjnbrzcad.onion:8333 +6t5nbr3td6jmr3aami2nrljlfpfvg25m3gbg6qcsana7r5cyug7553qd.onion:8333 +6udpyvm7hj2zgdbuga6r3cden2nwb2rokzejihn3sdpzolh3w4xwujyd.onion:8333 +6vncy3bxmb6wyiio7kxqvuoz34yityyullty2l7grqqv6qhfkkyg7mqd.onion:8333 +6vu6tncy3n4btqlizlgen67oktqwpu2qd452dvcgadbis2v7wwdrhcqd.onion:8333 +6wutlymogzxat6ltpht5wvdvujdpa5zqxpfkjfofaaesm7gfjxoabmqd.onion:8333 +6zkyfpp6el5e2ip2hlrdgzerwknqcpslkpdttiwfljcmcrtwqeticbyd.onion:8333 +6zvl2xxq5qejxblrr75jsqpvv7amdn6trvlqzapqn5nexl5x2ojefuqd.onion:8333 +766lviokylelmp3on5an3im2arnqakdj3jvw7mso6zfx47oi35l4ogid.onion:8333 +77bylqq6gq267jt4g4olprft3akdlpvztlgp7vfiw4xffrthm35x7byd.onion:8333 +7bjwdnx5umef3bchtn4coz4qawx2st4752ckrmwqr27ueg45w6mouaid.onion:8333 +7crojipnref3cqh2nguvcu6icypzpnqs7ijuybar6e454rphegmu4cyd.onion:8333 +7ecbffupljjuxl6lymosq5dv644nkxonwsnlkcglczpucp5rj5fhueqd.onion:8333 +7fbqlafzdcj3r4swjgzdi6wy23fm5iyenwgo52gz34ktg2whtremm7ad.onion:8333 +7gfywfzshst2fmwdmtjuooac4dsow5pj6rxrxohw7isklec4k75pksad.onion:8333 +7izddvivyjvdlcbccnkspcczvbupybsr72jnfcnu6saaehc6ltvtqcqd.onion:8333 +7jvf4xx3m4xxxvwwtei2abomezat4n6k7el7jq5ncot3jb6mdjvbdtid.onion:8333 +7mdm6ofk6kvgbceokc5ri53peq7o4rjgq2cv5ivzuemqgxfptzgtltyd.onion:8333 +7nitakbrzn53lgiju5eekd2b7a3txr7a4jb5c2wv3bi2rndsshoxrvid.onion:8333 +7ogrf4k24permd3plwfaeblheozyynk4rlxy4tpqvg3cvwibghppvoqd.onion:8333 +7p64efzhcxtpkbr3ji2cvhud74fremdrhgrgwkgnucn5a5mpcxxv7bad.onion:8333 +7rpbm65elgnrsavh77nhczathp2vwuik2cyrma5qby2fxft5jk77l4qd.onion:8333 +7rxvg4xgt6q6zyojbfpqecvkfpb76myiqnzndsive7uooxkk7m6jmcyd.onion:8333 +7stzoywo4sn5antnxihprap4phpsiplx4j576yneqy3nqejt62hrbhqd.onion:8333 +a63cg6bmbefpb7jckgijq3tlzzj5nvy6px2jyyvsy52gkyadwqfu5cad.onion:8333 +afgn5w7cpcb2p35a5boqbcv5c2lvxu3634tli5e5fnca3z3ay5yxtoad.onion:8333 +agpipxpyeyk2fboa6m6nvvt3m65p33hymmd3p5q3so5rccavidg4h3id.onion:8333 +aigknmwtshitht4oo7ohyixhbkvnxkwokrkz4ud76bgsipfb2tgmx5ad.onion:8333 +akufshjn2rz23kdcxeexxf7obw7vrlc6cwcobyjnelkdgyjtrcazetid.onion:8333 +ao3tuhoe7ay6cjqsibxk5jamg33ckjyutq5uspot24bdimajgkq7scid.onion:8333 +arlrtxrmw4npffxopvthsz37z3mbefc65svjk7mflxzzuprs4hc5jgqd.onion:8333 +atib3y336joeumqewfgeam6a7di3e3r6kmkmyh6ajcaktb6u7umlsaid.onion:8333 +au5ujsa3xd3tt7xttev5e7bandnio46gbdfzg7n4ad3hv7j5jkc2foad.onion:8333 +av5ezwtzojuzylip3gjhjxyzg3c5g46u7fx4dhp5o2s2j7wfwa2en2ad.onion:8333 +azpysq5tc3lnbx2rawenpjdyghi4prcvlhjdhyh6zlsrpuwlxwacktad.onion:8333 +b2fw3a52vmuu74evg5dezgfhpr4v6tnjzn7pm2ffoxpeyikceqefmiad.onion:8333 +b43cgetszokuo7sbbzwpevpeharvravm3fud7rbarm2sivll3upyekad.onion:8333 +be7bw6vrdr6ko6fbjb7a2buzibqx6thqxrv3mhqtlw3jqe7uhxrundqd.onion:8333 +bhhy5mgq57onfqtopw4kizm5rowugm37jrtfujs5avkcfafltay5huad.onion:8333 +bitcoin6twde6mauc5flogkenljfxk3bemqobjse73bf2bnfjaxnfgyd.onion:8333 +bjaqsd4v6376d2pp7ho3dmijblwipuzxbcac6aaxb7qnqxuzlsxbppyd.onion:8333 +bokoy72uqqlmltkiicvcukpi5wxeubl52aumyf4dhnacyghz53bepoqd.onion:8333 +bpi6oysws4nidjwmpadn7mtzma5jahbnhjgffcwdsjym2qq3zwhdjkad.onion:8333 +btx5ae2sxbezq6deplr74qlk7rjwu3cqnvw352huf2voqhtkqkav4jyd.onion:8333 +bumlvs3fdli4cagjnksntyxkrqz42c6tejeppz3k33yfeyw7z6m7u2id.onion:8333 +buz3ocrzjyiecbwtfpmoydn3c773jorlr37bw4kjoq6f6wpt6qn76aid.onion:8333 +bvikscuyoorgo57ifwh5jbdx3mmeyoumxtnyvjicjosce3egqegdefid.onion:8333 +bxpiyizma4j6xwg5lf7z7td3xbv7ffi4x3bntyftio3mszogl2a5v7qd.onion:8333 +byqslyvvxybu62i7w3yjh4aoim4go22g7gwdhbpcbnvyhhajrff5ktqd.onion:8333 +bz5v3ztsfl24gqxhc22x763icdrp6hbgqllx4oblnx7eduas7cdxubad.onion:8333 +bzhf6w2sajkk4lsty3hz64kygen4ty2lk4swo6fz3wzsr2uofsannpid.onion:8333 +c5gkqgv7br7xirqcpfbupyxyesx7fbif4gqr4hogirlngre46oewk4yd.onion:8333 +c6tktxgcu54pvdfw52bd6udbpydesdivyxlaveubanon3oay452r4lqd.onion:8333 +c6upbdl5ro7l4r6hqnzxy4spsye3wu2myop4ntzcw57zwjlrhzppihid.onion:8333 +c7hwtt7psq6rtcl4yfiuzkphrrjusicge7kfzs7i6bpdgpbf2as3egid.onion:8333 +chltdbogcrolm4wwhop3qizo4cxrn22wkhvgb5pcervzs3bzx7u2f7id.onion:8333 +cjm24gef2dpbnwznbv6ad5lrod4gvet4f4dm2su5vm6wpdpt2bnajryd.onion:8333 +cjzcwym4hv2ie6yhgqp5ex3hvwueoqvt2aqucvv5glodixw4ldbmtqyd.onion:8333 +cmm4777ii7j7y5ufu3k4izuhx54ldrq2lehaoaowim66tkbtkeolyhyd.onion:8333 +cmxivv7cbrdqneyxaii5bls6yvknpa7zbrridnyk3ztpwnxkjkoi5uyd.onion:8333 +cqm26nhpdlmfzpooozujsyuokqtuixjt2bdr26rdsilebntnighjliid.onion:8333 +crfh3vjreblr3tepu6lkpwkqagfom6k5gc3c2bn74atw5xiuxv53sdid.onion:8333 +cs2uedzkwwlhihdi2mm7popaiydm4wp6uwakut4or6mwjfbmrxjjrmid.onion:8333 +csjxou6mxjf2yljlg6zkqezsntvm5xzpgsg3ymnd4xhpj5zffmfip5id.onion:8333 +ctl5rsuuaakuz5zlcjpzj2y3wuba2apoasggznnrg63bqfdhjyeueoid.onion:8333 +d2klz5ggkyc6657hwi4xoyq7jbv5wj7vtlb5uqv6huihhw264esi6xqd.onion:8333 +d2lbtmbrdozfd3wsq5vbw632k6n6jjo3h45v5qigx2qcqfuclzifh6qd.onion:8333 +d4xkamq3szbc3tznyzjcdtvfbiaaq32dekaudma6dkzp2l5ogpy4uaid.onion:8333 +d6vg4wbrl2inoe6tfqf5fo4xivqoavxbzgd6qmduoap7k34hgomekiqd.onion:8333 +ddhrkj3l527e45tdqmfmm7olmisgrkisgx7243x2klax7h4jytmsjlqd.onion:8333 +dku2lusultkhvdh2nbnty7blcv3fdwqh3qblmzhydprdsnjjiwp7wpqd.onion:8333 +dnmb4ifydabk2n7dwy73xyc75mrksl6rnhidr2p7xsxgk64vcvghwxyd.onion:8333 +dnwbaxecn4xxupvtqvigoopzeys5cstvqv6u5zpfj2u37uqmq6s77kqd.onion:8333 +dwz5ycilgykv3npjcn55t5nqf6nkabtwmxqthvs3spsael2dlfrksoqd.onion:8333 +e47xwhzcnz3nakum3wbouqm2uhb6try5dn4hcdzfz65ie5kw3mnu3jqd.onion:8333 +e4khd6hsooslfwexrcwlpwba5uinfpvziv6sgigvkzymrlfzposj64id.onion:8333 +e5c2dam2twutxqsv6j2lhq5y7o7t3hcsiyfgqfe3qe73t3nhrqapddid.onion:8333 +e5ju4gc3jd2p56syoyci7etmyjg7tfbd4722nbtxr3rqhfm7eew7icyd.onion:8333 +eaertx5wvxzhlfjd3rskz2f6a3unblufagmadrtpycj3dpfrwopvs7qd.onion:8333 +eaix3x3rlogmpdnvwpwgsyj5fiuiwnsfpgxtmztacp7van64l7d4ebad.onion:8333 +eaui3zjivtoohv2hd2nupoe5ujpeksl4zvbgqxtvb3d6tbpin4tzhrid.onion:8333 +eebfo5fk3xzipldarvwyjsn2jchpl6calkine3gnvbrfyqkqndlnzhqd.onion:8333 +efvwrivcbtr7dk2vr7ofqpjerusgfxritkq4agqnsceh6qcpgjmp6cyd.onion:8333 +ehxiikephektrexse6hl3otmqgrfletdkkuop4ifufhe6sby2okkq5id.onion:8333 +eikoeq43vloeieb37nm4znqwll6kbmvuzmtdch4y2a7fw5icrrloeaid.onion:8333 +ej5sof7pylkojmz3fvmouzgzmrjkyhvvpy6lns7737djzuf77y3theyd.onion:8333 +ej6xgq5vapglcqtzf7gae6tmenhu4ve3twg4hdanbftii7k4f2x2k2ad.onion:8333 +ejmir5e6doj2k5upakum4koucthtw5dq3uledahecsdjq4bo75z3jsyd.onion:8333 +enchh7j5453cay2ygonpuot5bcikdc6flqy6mfd2wsw3z7sxv2ehouad.onion:8333 +enhp5lczc4mjig5t6hdcxkokdtzngejapxiuyw72soggajggyefn25ad.onion:8333 +eph75gzxeibberoljtyftb5jmawm7rxkvfqx2saxbu7z6eimo3xcn5ad.onion:8333 +er7exr6r5w77r4c3i5wb5r64d6wzwo2a7ndzze7ob5sgl3a5fgvlzoqd.onion:8333 +erzm3rr663nb5rjcwm4vejxhgbwt7ahkw5yywl7h7y52uyfk6p6gdqid.onion:8333 +eu5feoa7bdme6pfvcyp3rj6u4plarlpvsuzv5ux7sbd5cduygsdsyzqd.onion:8333 +evircgqqrc6vhdivhjpuathfpzmek5qp62gsf2ohoaiyeynffssdpgad.onion:8333 +evrts3xnjcmijzaokev3eiocbvqkberud7ugk5e3vgaotww2ihlxl2id.onion:8333 +f3kh5b3boak5zkwnpwyostmfxo63wna5rvmsh6r7mfdbaogeimtv2eyd.onion:8333 +fbh63e5uysamticqogfkd3f7yoo33pip2yloun7wc62zvexzoabltnad.onion:8333 +fckjnfmhw37jpevtexlcxr5v3lm43pdotlz42ajpmpu3zio6etv2qiid.onion:8333 +fdcthm6b3ltzjz7d6cvccltcwxvyoxaol3awjzghhbpotskzouuv2kqd.onion:8333 +ffycrr4d6pwyq5x4r5onwtyxtvd3iqj2mlf33srxdu6opezzpfofa2id.onion:8333 +fhh2tfv2rbqytnqprobxqp5fy6wlmfoge6punxj47k2dddpc2qgq2cqd.onion:8333 +fj4wuboarofhshcrkwqd7iponopb6wb3dn2fsmvj6finmgl6hicwpeqd.onion:8333 +fjgyfvbloy5aqcxmdtjq6qwngs42dzml7hodo5uivm4r2gji2grqpqyd.onion:8333 +fk6vmbqusfbphq6prkeugchlgssviohw6p2zki3osoc2c3jqhfx3rwad.onion:8333 +fkxtgwkswxdbmb5kmdblw4gautm7zh6mds4xyvzd3cyeygh33ggiooyd.onion:8333 +fmbxkhm3ykpjod4nnxrbk3jk4pn5bcv6ysmfaam36sepcb3vqwybfnqd.onion:8333 +fonc2zpwyprpa5i4wvcayeyezizvxom3jnbibdhs7vjg6xti7fohjkad.onion:8333 +fpt7t244pgquaqciv6s2kpm3dmifp6hajwlaenaotwpi3smuutxsaaqd.onion:8333 +fqczapitclhatilusvmsw5qkvg2nksjoju464dvrltvyqq5zy2kftsyd.onion:8333 +fqd7k2geb3klth3n3hzaywl2pc4akwkzo64vjofs5egqvq3okbrxlgid.onion:8333 +fqgtcdbevgyc2qs5lkxkxtdjkdbwbg5fpodlkx25peulsgzn7nqlxgyd.onion:8333 +frtcgu6iecmpkx5vsh3togf475oiwjlxpuh3rreetjkryh3ghahkjyid.onion:8333 +fugsghemfzgdgc7kgbs3nc5pysyicn2mqlnc6ah2uxfbls7rac3k5hid.onion:8333 +fvq4fy4ilsn2y6sktykb7qjdhpvylg2cayuhngxnyorprr4lcs7vgkqd.onion:8333 +g2b7vvsv5xf6jewazsoommk5zqbv7rlnu4m7wtvmhc76mpn7ho2ydsyd.onion:8333 +g4hhckbn3we7nkdprpb5vzdzgvrrrg7b3ubkf4t3g4c35yx5rqwrroyd.onion:8333 +g53laknf2qomk2npziez55ekrgutveojja4cdxx7bx4fqpjd5o4oahyd.onion:8333 +g65soedj325yp4y276egzf7tgexjom4diygzbmtxmlpqkunltpkb4hqd.onion:8333 +g73ujt2n2l3zbpwvcb757nalpfb5tkprqgh2m2sk3rpl7g6hjp4zu3ad.onion:8333 +gaeaun5gf5tc5dhhwp2uzs5r7zumr55jptp5gxxmcmwapnqv6rvkw2yd.onion:8333 +gbv2yflw7wyo4ivwcf5vtgjhdikewxahwpuw6zy2rykigsn4fq5shxqd.onion:8333 +gfo24oosqklizwom7nlok5i5ioi5yriqpp5vtgut3rtukndix22lsbad.onion:8333 +gfq2z63ggmeszsqpdzg5cfhsou6st3qhkj256beege6yyfodhmbc2iad.onion:8333 +gjyyjdpa6tryaikzun52iiyalsmeop7n6t5ss6aglo24it4ufbejeaqd.onion:8333 +gkxu3524ncgpml53cwdyhrxfpdyflrh2elwqmu765lccc4ckuobvmbid.onion:8333 +glhm6srmyanw4f5yjq4z5kultmpea6syepzgxtqechrn25lc3anpvlid.onion:8333 +glijfi4brh3zq2xvnzy5gaqkifoceuiyzyeyecojdlqe75nwoetcwpad.onion:8333 +gm2b3s5mqvccelokh47aypsu7wduyg3lkety6czu6k4phzfxczcoswqd.onion:8333 +gmjyc3qivk2bme4wimykhewlanx5z3sxli23nizo4kiuerptcytqsxid.onion:8333 +gmnoid5e7uhsjxw2uuwanm7k7tbyutbcpiacuxyqztqqy4onbofzuxyd.onion:8333 +goxkenocpqn3ibvslm5eccprmkcszelvpsrgrtd3fd43qr2xzl2la6id.onion:8333 +grbpww77jgvl52eyzjhrnx5dc2fqnb3dgxcm7fr6jjigc7aihvay2yqd.onion:8333 +gruccg4k5yq7wnkytjqndfbhc4pbdfiwuzlbsjwyjwzg3nfitb273lad.onion:8333 +h2jikhew7toufyhusvt33engo6bdvjdv4fvxsk7k5z7yfr6sjcb4giad.onion:8333 +h6mzk6q4mlf22npreupmfvuhukbrgsjlvrzilnuigyujmtfmi5ltiqyd.onion:8333 +h7nka6o3t7dn7mkvnhg62jfftvtsoi4f755xjheuxslklmei23fos4qd.onion:8333 +h7xyscykodwdzvyzluapacbe2dmpelmes6xjhqmbrwrza65utpyn2zid.onion:8333 +hbjqnzqygl4fdkjwyaxcizzwrnwl24dtjppy3vxqqii6ilpl3ysbtlyd.onion:8333 +hbqkqjt5y4c3sgwmg6mir2qv6z6anxrxr2riqj6x7r6jayc22gvbriid.onion:8333 +hc3ebdu3sgrqfz47yhh7gfupzgesxmdrmfcfaqr436nodujhysajapqd.onion:8333 +hc6a3ccuvdmtvgndynhzfuje2aqgpiyqzbm3s52rekbxmron6w7ckbqd.onion:8333 +hcqtdywbzpgp7hwbelbws5s3ykks6i34yu5gznitupfcli2t6og6qnad.onion:8333 +hd5rdhy2gjkjmqlxayeoqd2notpzsbf4zp3y5ndzpvimudia2zrqoqid.onion:8333 +hgk34cet3cktfevkakzwwlz4zzqcmpo75crlfmyddfr7ikg77iftmsad.onion:8333 +hj6feb7d6ovgutaflry4337kyyczirc6y67js4gn5lsdfqfbqeiodnid.onion:8333 +hjxcacppbndvot7klgy75xglwtfu2elxfwtt2esquzwsdxukklvl53yd.onion:8333 +hlcoisik6mlwnat3wbwfntkeh32yhymhq52tgo23bivrkuq2lmaqmxad.onion:8333 +hmr55kh2n4l65yrxpmje7yn6oyu3pdtutgvk6tgllkhodqxazlrmp6qd.onion:8333 +hryul5rtv327up2esowuvlip644udinwxr3f6tvo3vahffggkk3ogmqd.onion:8333 +hsce76s6kpkzlnechwpoiudlyygbr4s2ct3hcxi4icgiwk7kehwz6bad.onion:8333 +hujowynr3flk2zadfx2jbka42is7rsguxmp5npiaqpngpabvrakthrid.onion:8333 +hvwiqbxy5rfxvmq65dd4baitrt7e62a72so4myiacur2tirwavk4eaad.onion:8333 +hyddoxcoyckwa6lloendglu7rvlvwph4gf4xxgteb2hbmbfvk7zlabid.onion:8333 +hyiqykrejh2m5mchbuox7qcjpnctfa4t6t33xs3gt27gn2zdauub2qqd.onion:8333 +hzbrybvl7253k4ilw64bmow6xf6kcfjpluoyxcyxnzjhvkcwazm3dtid.onion:8333 +i6gsjwkdrj2jfyzd2vkb3auajfsj3kfopngtouipisk5n3ztpyj7iead.onion:8333 +ic7xuyb3vjewgcivsod5fylon2uefdrtbujm53aqeeiwsr66bn2qriyd.onion:8333 +ielfpoctimb6d76zfwe247ivufhlqixcmto3ajycx6jhc32au7nnjnqd.onion:8333 +iljvoqv6gthbhneadvnnngt75cmchef4e56emu2q2rkvyd6yvene3byd.onion:8333 +iqr6sqjcywscdns25gsizkaqngc3p4zjxmnsyj76aewnujp5yl47t6yd.onion:8333 +irstdqvwsgdbac2suvkdrv76yut3ronokffskydore6va2ucgqwqpcqd.onion:8333 +ivdhohrfnmupqpv2fdsrgocivsrfxeraxjl373v2ucprnf6nm4mj5ayd.onion:8333 +ixrkhtcfbads4dakl6dl4nlsv4f67ld7huogpp3crelpuufcpcwbusad.onion:8333 +ixxeuquydo5vzhs4t26svdpuogj57n3n4c2txtudumqcl72y7ppwwoqd.onion:8333 +j4j46tzv4rqkssjyz74ojbwr2er7gpsuwbplylt2yiuphla5jmg2wcyd.onion:8333 +j5bnioq3mo7au2hzknw7c4nlagtrovncwmanei46okq2e753dshti2qd.onion:8333 +j6klkyq5gqepr5fr366us5g6rprcq2k4wkszia4a5w4r5nkotajetvad.onion:8333 +jbfdgru6e2xkp6cs2vqcjin2rtlm3hdwfzc54iupupyugtbijurqc7yd.onion:8333 +jdzoeerhme3wt3msiabxho3aokqksecqtrbau7yldmmrcdl53vh4ntyd.onion:8333 +jjsfftvm3szpjr2clthujnniwmm7xpzn4eacipdsmne2nw7cotxejeqd.onion:8333 +jljo2fgeo3en24rfjsu5bhcuvgqc2kt3q6qpbdhcrmns56pepvrrdkyd.onion:8333 +jnvqw3jyfragx7vf2gvedjuqarblwmgzi2nvzncnqygxqkq3l3psi5yd.onion:8333 +jo436cjqpu5kho6jvnf53snalahyno2pkrezdiecrblzk2ndiicnulqd.onion:8333 +jxry2vsra3roinmemrv2t6r2gxgkr6r47dsyni6hda6pulutgp5gsryd.onion:8333 +jxwalubi4vmffetqrm62crkz2lyuwbq3m5jdanremtkift3ncmfmupad.onion:8333 +k42ycrbazmkne2eerker3pwvsrumjdc3nbocoppixhcslbtin6szxmyd.onion:8333 +k6xqminlvsasqfltb4pqccoodaye4dlpdcof2v7g5bhcc6z2hkqbo2id.onion:8333 +k7xabakio354gnlnfop4nb3hvwnonncjkiar55yqr5m6t55johp3ebid.onion:8333 +kbnqritxjzxijflvhybdyew3zfrd56qyhfv3j6kkujd6ageeg64h2qad.onion:8333 +kdyhkqz7hcnbq4yg262l7qscyhwm62klcomy7wim4ohd5gxp745yxgqd.onion:8333 +khi4dspqnbjqr6kuzo3vr4os3i4ucp3iqztjuvy6hmvc3pvenbkvpvqd.onion:8333 +khxoiv2fs6b5q6z7cdc2emq75xrxyv2k72qb7qiccx2ecqikkoevhkyd.onion:8333 +kj4ifgsla7bufutpr5pgfim3ukzc6odrqmxyaih3yht7bwolrvg7psqd.onion:8333 +kmamezicky3ssry3lnxwrsqo5edkx52vgklnvaxozk5sdpnjtohenjad.onion:8333 +koopg7cpbkyzt2xeii3blytcwzzbegdjulf2k27tkd6qpgtfa2ckqhyd.onion:8333 +kp4sx6yum3trevgiyftnr52z3v5tkoemjp3ja6ugbsp5fefyyv3jgxqd.onion:8333 +kpawddtnppkta5ldam3pkwsapk7bkpkv7euxgkh255kw7gcmuavlkvqd.onion:8333 +kqvdvecikfk3bvg2qt2supapuzci6yj3sz3jlremzydu34ty57imlbqd.onion:8333 +krthkvdasakdnocof45vpiybugof2ju2rqpvtwbns6udjlbodyluulyd.onion:8333 +kycmxoatbewdk2vfdd7gr6iyzpkqv4sua2i4p2qqfpepsna4bum3y7ad.onion:8333 +l4dlgqyla7dobxaa7hhrhe5mwbqw3stmwq4qqcsbly32qfc4stetq6ad.onion:8333 +lieapdss4vndhmtlb7t6afjwsrf52mdkxstrkfq6as65zxqlufa3aqyd.onion:8333 +ljlclqmyl5usdo546twyb3m4zfjwebfsx6suuibhkorcwhy4ufukycqd.onion:8333 +lllr3l5y3tlsbmlzlyr4g5znrer6g3riolkuxvwtajxqerm7yju3aeqd.onion:8333 +lptjkpwvnj4syw4zcv4v7wvzvkzi7nlnakfxag5uvfzdwud77ltn2pid.onion:8333 +lpzalkzwl7e7y7arsjspc6brbl4pxfhrkvo5vh3u2ioxiezuzkrnkvyd.onion:8333 +lqsqk3waohi3rmknfmed27lm6ofva33zngehz6oodil45zmtdnzhqxqd.onion:8333 +lwsayeaakdsfyw3lsycpc3d5lrcf6jbpkn43y23zr6nxjiwwstnefaad.onion:8333 +lx3c3ljioj2cgecp6de5kgxjayhd3wgm2er6xtrdxj3ndudvu3jyz3yd.onion:8333 +ly43npqw74bztp37tgkx6gqk3bs53lso5zmg6uwnuzlaqdlraecz5tqd.onion:8333 +lzyhfdkmvsutea4twa6zooefirubmalci7fu6h4wmo2nmztnntpslrad.onion:8333 +m22ni2zjfwlq5pfzbfothsk6fn2wthkbst6gpje6uqyz4nsjywm5fwqd.onion:8333 +m2j25j6quucpfwxlh57kdnv6ntsp5yr6s5ueimkdu3w2tvqko6ne2sid.onion:8333 +m2lkzmtdkabgckmn42pfncswyud7jqmxk2s3vxfnnnwqxclhxcbiccid.onion:8333 +m665l2x4zmaphdm4gd2qa72eerw2du2msfzxs6ia2znkyndy33elktyd.onion:8333 +mdb7aqlwyt4jqjuxgzmupfuxwktypj2tkrdfkds3d4wgviary7oykkid.onion:8333 +mgwp4j6bhbf4ez7753yy7o6keil6pmc2ie42dtdfm5zz4ky5jb5sldid.onion:8333 +mmooebax2ks5ucswdzilx4gaoff37a2qtvi2tfe36clnjtdgggundbad.onion:8333 +msrmkyfkgcztmcsi4ei4tsyeadaw4byzf7vcffrd45l5kxnyjycpixad.onion:8333 +mtdf23ghhwwtliy5cj2gyv5wb7gkpbwjyh45nqppnnb6jxncht5w5uqd.onion:8333 +mzu7hum45gvgbnqhfbkls4sgoo2pfildd6cev4wfkowwvu5gapr2xyid.onion:8333 +n3dcluaorh7u6ilie2dqpmtqf5gplvpuoxjo65655mlw2hqbn7mxqxqd.onion:8333 +n57bfzhlq23h3mx4zfhytwyrpgxy2vyw3qd766lb4ysvmbdmanrahhyd.onion:8333 +n6e3inyt7quzwk5sam7v27sw5kuc5zeleomzbfjmygkoitxsej4nusad.onion:8333 +n7fxhdsmopuvrweux6ms5bg35cmpmbhxwbk5ralq7mhjdml2s77genyd.onion:8333 +n7p7ed2ejwz2zr224azq2nov3zyqnvhosorpvhmu24pqwacshahpn7yd.onion:8333 +nb4a43pfqy7guc27ksfu524bznmkgsqsfpmwzhru6iqu4pulbgaigdyd.onion:8333 +nbjbv6epmsktqfsiw76mvpyonnkom5xvnogzeyyjgxnm3s2mjfgncnid.onion:8333 +nkpl5epgo47qiqya6ijwtohpnuyueym7ux3dt2ccnfbgvy3gqeyhy2id.onion:8333 +nqy3yoi3xuse2rxibk4vo5drjmeuuwnecaewbyxnt3ffg6gsebmarjqd.onion:8333 +nsgdxf3pwioxj5onc7kb3cwp5icbifc2x4obj65bekw7dnn534vjeoad.onion:8333 +nv4weo4xp3r37texgd4mxzknblovxnhcs2laswtump7vhjllgf3mvlqd.onion:8333 +o3nctwf7tmsoylnlreuwwrwpzpofwqurzpsk4cnotyg5uwyngce6nqid.onion:8333 +o4l6ihjktvg73rzkoiz3amxkszmpp5thfhr7otpvwqx72ii6tmuwqxyd.onion:8333 +o4vb2emnbbzob4yuwiiz533fd3dbnbhz2wjnmfqu3cp4gjo6d46sh4qd.onion:8333 +obhiondywyso46m5egizaum7fsqnwgi24tpd6phcizoytsjhro7bbpad.onion:8333 +oe4xlteqwjffy7ljpbrij5inbrrkni5v6fkr2efswqtnd5l6cw7ix2yd.onion:8333 +oex25ysc3h73aqxvp6rmh37s6v5ko7oybdeq6wf5zfvx4tuvgbno5fyd.onion:8333 +ogydkr7744s6yth76pphjha5jcsj7k64rdrhaqtqugqp56jpb2hn6ayd.onion:8333 +oklrf5acndz5gtpmtgnfvc6yo6kyadp3yjouehjgxhljwjtpmxqyjwid.onion:8333 +oms65ve4z7hcvlxnubwvfe33hhn5jwjzjtv4gmolqjeolzv2aq6a4xqd.onion:8333 +ooobxdrhewee5xn2mypadgsq7pysih2l4g4cfvf7ch6lp5qbzt7eipyd.onion:8333 +os54ay3mffzaf3ednkgyeuirayo4bothbmcvm275h6af3luszoxcd5qd.onion:8333 +os6eoqu4sjkya7xvedx4jrwlt72frbzw6p5w2rsswpw2dxmkfkxsibqd.onion:8333 +osfazvr657jukhdyj7rostfg57lzy6c7gvaxbh7ul3jakppktisckbyd.onion:8333 +ot4n2e4xwnxpvpva46swsxwxiiaumy7gohasuow7v2qvefdc4txej6yd.onion:8333 +ovazpzdtupsqfygs73we3wq4lpodegsh5eggomazb2kxigd4mjpyakad.onion:8333 +ovtx3d4svetdt7kav6jghbasol3fhq6zwuud4njngyrnhvkdwetko6qd.onion:8333 +oyavbcj33zt6abvjfwtjel7ac4jqaz5pjdu2xmcknudr4ul5fyjc5wad.onion:8333 +oyb7xtoiteb32pku7fwgl76pwe4gsc7gsk4hk4yi2fgyxissck2vxtad.onion:8333 +oyxipyliagkpfvhlgegfzye2oxmsdt7xjcy7dpq2xhp6j4ljld3xglid.onion:8333 +ozq7iyucv6squep2d2jn5zmozyy7yxbdmw72lv6i2jb2weq2vtn3czid.onion:8333 +p5lrtmxtzlrg66t763gjeosmwulxhniss7ct73nsqymujozepxpzo7ad.onion:8333 +p7xhbz4hkgc3h4t3sgqixxyaal76no42faet57znpmaorwafwi42ofqd.onion:8333 +pbhxzwdx7v5wtduqpmfoc72mxhwlyxg4unak3zyhfnuusfmizffvrbad.onion:8333 +pd7euoerq3yycf2bwpape5f2aubhqxxzu7a5dnrpukrzycs4zkr6goad.onion:8333 +pddjxch6t3f62isaxkrmtzblrlszlr3vpttplhwexfvcnxxx5u7wtbqd.onion:8333 +pdjfo2ehm7t2mkssadyneia6ftdb2tfuebeuxaqmnlkmvqv3urnj3yid.onion:8333 +peynxnxmdwdiqmmolcttpjyrlqorwexyv5hhkfclobetp6shtu37pcad.onion:8333 +pf2y6twnz6seo2pn3zzawyndgkqaibllnv4pzchvox3j7krcbathhpad.onion:8333 +pf4esnp4qy654vedxpfcxumznjasdqa3c2cnzdda6uqpcuxtd2o7fuyd.onion:8333 +pjbvklsqecs4gcfvq7wqicoeb5ir6ch3jwwavjth3xwg5ag7rem7sxqd.onion:8333 +pjte4dnxasrmst4nduwbcgm7mnd2qdrlnd7vq3c7mkxxmt47d6omf4qd.onion:8333 +pmb7nsm66jp6ewkjro6udhshkwcoc5tna67td7g2gx46bmuvtttkxkqd.onion:8333 +pookub6jfnna5nzonaruqzkjfekutzfunrppjuziqvnyfk3645ttrmqd.onion:8333 +prjdltjghrherdhw6ieu6lg5zgzzyx4ykc6ad57z5pz6uxmt7kop7jad.onion:8333 +pt2rsnb42lx4zlr54oomzj54dlbdeuiwmk6tac3ovkk4g734hawjyaqd.onion:8333 +pttgdou3m24yywbnky23b5qf63inr3ebi2fejjvjmltsd5l5f4hxtfqd.onion:8333 +pwiob4nt2tmpngmvdb6gzhaku5d44fjv55f76o7c4dudwofzr7ww5lid.onion:8333 +q3hnj7stbm5kdbekxy4vgmhalj5n67kftcrh6r3xz7o5lsxgwgqtbxqd.onion:8333 +q4dfybgsjoiqcngc2xbol7tohvppag6jqkkuu2rsp2a7idlobh35bqad.onion:8333 +qcb6bwlr27whuehk365cu6cjcjj7oww3vhosav3xx5ftnbhgoqrcfcqd.onion:8333 +qck7qr76h6yuc64zfn43toxkry7k3ts4jlhjssnkutzzxlc6v5qfuiqd.onion:8333 +qdgtqkxl4cxt4aqhh7vvwnxseyk3mvrwqanecfd2nxblqi3pfskiq5id.onion:8333 +qfpzcma5oslkrab4jelcudhpvllsnsiqpgxh4gctomslru34x72pl7yd.onion:8333 +qfxtc2jo4mx5r7ietkjekszkhobe3cqdcacynopjxykdvolsxhohpeyd.onion:8333 +qgin7f47k3qpomijhrtonrm5p4aliqfc7itbbc4pe52orxtqaqetmvid.onion:8333 +qhj64xgjcv54jdqerpjojhr3jcm5gluq7hqfgb37t3ycrmpwjhyx3uqd.onion:8333 +qk3fp73k77e6rj6t7wrpxigvfsgdqdwdbeglslviqdcrzp7ige4cuyyd.onion:8333 +qkx25lac74ejv3v7p2g3zabca5y2g2rxzo72wx5qhtmlom2ly4bdl2qd.onion:8333 +qlw4ciqorajhp27vglas4x3phn7nvpr7amqmqmfnvn2uhnm72k4pb7yd.onion:8333 +qmab7yqvjqsr5dc4rwthpufbfmmnrldq2efcysxom7677wusy2jg3hid.onion:8333 +qmi6hz2v4ivx4w5qtn4u5ud5mh4nayhautvfvynyebtpjyahr6pp43yd.onion:8333 +qpgdab6fgosymur4pmambbdpczizjp3zm65o7n7kdndgfqefigt5vpid.onion:8333 +qpjsvyu5odt6yib3bpu7pogt77frjzzmn5bdeik5qqgof2onf3ebg2id.onion:8333 +qsxyclpzutl4anwfkhthhmbd5oui6ec753vnzvncowabjuiu5r33myad.onion:8333 +qtma3kofgmj4x52kyejgh26n2defiziwgrc3pjumaewwu7sxh7xyvfyd.onion:8333 +qujnwayjsdllqelffiy67n23mb6u23mih3wbd2zdvjeoyo35mdzi3eid.onion:8333 +ra32r3e3tse5ogch6fxld66nu5am3kqmhw7b5c7yo2popvf2opl3wlad.onion:8333 +rbnzskapgz3zn6z3dpgbj6rxlrnml56cyrx22vw2exh4n5apx7rmhgid.onion:8333 +rjqrut64oo3tgpnsrmy4wrujlsufxifslx2bw6vqzfk3mhqsnchqimad.onion:8333 +rl35ajhf44k7jd2j3vajy7cnbmnylcvn7lx62avhhvdk2zvmhchfu2qd.onion:8333 +rlncglnpdcrywcjqj6wxkn63uzwzxl3gtgbzqvfcetzbwg2me54ediqd.onion:8333 +rludpttjgyegce6isc6nzkso5ysyhtlxni2p5j4uae5knbgs2xfakryd.onion:8333 +rlx42j3ymomkf4wq5lgenopcjkp76xpymlqg5kao7m4cecekcvx2akad.onion:8333 +rmkubfilpxxvf7w7csnpmx63hjz7hpvmodhu53cbliyqhun53jzl6wyd.onion:8333 +rpux6zj6wokq3kp27mc34gkdb6vk3kxly6imgqzukmzlhe2sc3l5kfyd.onion:8333 +rr3nr2ooywwa5r5k4eafo7lxkkee3piebceqlriciumwetdsrgoc7jid.onion:8333 +rrdo76cf6ctl6qgxzacogwabh7rohapfhg7z6wllyt2okw664wxytcqd.onion:8333 +rtfyx3pxozf36lan77kz4x2w6ixm7wvyqmvtnlmy3wosd7koe6xvttqd.onion:8333 +rzq2ys5wtk6qku23jbhplm5kp5wzebcfxv65uvk3zqtytrj3fa3t2cid.onion:8333 +s3ig5iv5eldufmzblnvfcfnqq7kgg7mlexwrawn3mk7it2bpgxfdcbqd.onion:8333 +s3ojmryuqyyxdbl3hygkboxz6lpnageat6zcz2leywrzsm3jr7w65wyd.onion:8333 +s46rmgxjd5stdldxdlb4sssdgmqrgoeksnybkfxugaw7vhrsdr2mzfyd.onion:8333 +s762tz3hwhnz7ock2wap76rndat3mckse24e2gaag75ko4wi3w7tjzid.onion:8333 +s7btvxgflc7cakgqar6dmknlqcqr5am3ebdtovei43bz4w3dkakk53yd.onion:8333 +sa4etkehfhzbksvlxwyf2iko52zgrhl6h66e27u2mhw2ayu3o5z6urid.onion:8333 +sacohs43bokospkyarsb5fclzpdsf3o2nrqqejcig3l56remrzz2dyad.onion:8333 +sancv2jnekemexmfxga4ktmt25yje2cb7ai4ywb5xxjthbzbonyephyd.onion:8333 +sf6qzwfh5aau2zt3iinynzwww6ika26tdj4spxws3jscdvssuohd4qqd.onion:8333 +simvzuopsv2h2xnwefu7jxbtghhnqtz73d4nsxcr4xdq2nxnt7tcksqd.onion:8333 +smle73emjpctbblug5gf3hkny77wyff4y6cvc2swnqrlsihjsgh46xqd.onion:8333 +sniximp2psj5i464i3d36nlmo73762h4jckszwqqx7kkuxppophnfeqd.onion:8333 +spevwedct5byy727a76ug3n3fjmod6we7tfqoecchbw2l47roitrncyd.onion:8333 +sxcohqssgaccsjfktizwrjgrv55eqx4zv6h6yqr6smnszllrli44utqd.onion:8333 +t25lvcr7nihqe7w653xtdnjumkg2ya3gpgvenqsbwxy4hs2tqyah7syd.onion:8333 +t2e3qzuaft25zolwmojp6r3p5g5nak4pxixh54tft4khvhheczfr6xid.onion:8333 +t3knwe6h4rrkbumb2foe4qszqf3prw7dqkm2i6zuyzbke7qin3ysjkid.onion:8333 +t45gsyqahwexyg7yjpv5xq3cgjdnk4ob633ly64kxo66h2oh2zq3coad.onion:8333 +t4t7otcbxphyz2mfb77h3zjpeo4av7xx6y4ryjigylec5nlhaof5hlid.onion:8333 +t65bcyf2eni3vxlqsdg57g3yjxtk2ruy57a2r542mwjnqdvxdaop32yd.onion:8333 +t74jhdmey6isfgyuyvdfmhxrbzhzs2fhj3mdvpox3da2nslkisazjkyd.onion:8333 +t7owetuja5t4cdb3fhznmiezndkc6ldvpbquszkf6gcipvo3sy5vkjqd.onion:8333 +tax3bgihfuogisukzr5ztu645xcxhnfjyqhvd7kurnmt7faelkutf7qd.onion:8333 +tckqucjlhho76dgrpc4iyuhmjzwddt46dzcergxaie5fxf7g4nrnj7ad.onion:8333 +tdhcehjcvo3yubiseyhtseu4mqomrpfyedbd2rmf3trcmxxr2iktvhyd.onion:8333 +tgupedfsi5g52wftxdefnnbzagzqgom7u54atpamqze3pcz52nu2raid.onion:8333 +thure4gzkkxo7f3gp4fcf2ay6mikepx6mcwql5xrotxanzxuro5dcfyd.onion:8333 +ti4yzr5lqyldgyu67nkii5pk2i6hi2qvq6p5qsjqkxly6imxu56o3cyd.onion:8333 +tjkqn2tsn5tvaazdxbfsgqna2ve5kx5ip46j3acmqqh45t4j3ikseiad.onion:8333 +tndqqjft7p7ouqvv7lz6y4sqcncero3lffrukzugkuoztgwubqfcbwid.onion:8333 +tseke6n4lykhvdezwkf3kwmxitgmrjjbyma6nol5eh2qnbk3ocvhnfyd.onion:8333 +twuhobnvoi27o6zk2uwyhc26vdnpvpqq6qgceioxc6sbtm36wo55udyd.onion:8333 +tyfxlylakchnkvbks7bypu2jq4bzexvxybzabxrenxgra6di3fjywgqd.onion:8333 +u2hd6xck2bpmuvaatgo5nmioejk2voaa6lmv3msbuvpo4xbirernxwad.onion:8333 +u3edrtzedv5tmzizamlj6n4kmpfrn4ekvxfjpzauxoy4jps3orzftiyd.onion:8333 +u4sovrilfl5zwq6vzekes7slvyzws2phc6r5dvibj5fnbqxdmmuci4yd.onion:8333 +u7phavksrlzphv5upw3nty3kh6rzmkxlg3uaa7hqadt7dhjgffkc2uqd.onion:8333 +u7wxfxdpptoj2dacj4h7ykahvturudanyirjpj3qpk2r726x6skj3sqd.onion:8333 +ufehxvatqb3pyfrdvcdibgfdribzmwvaf5xsxymeaq6l5a6nqukr4wad.onion:8333 +ufm43yp3x46sq7io44mi5sn5kizl4fcpnuxhwafgr4h3jn7hhjjf6byd.onion:8333 +uiobofaykuraqarsedt6ookshgmuxt7sefgiloixn5zgambnt4kfrdyd.onion:8333 +ujf2zphfaywzy36o5brby4ioberpv2tbu6ezyoi4qyojbfaio5pwrpad.onion:8333 +umesgylwjb6x57zhqnk7jozvblkbq3sovmffxxppfufg27kconydnwid.onion:8333 +uslbkjk7xdiug4zga56ybayvxttxttvnvj43yuomn36sn2iviattrmid.onion:8333 +uw5gml332m5mns3y63phwuj5trn5ojkrtb2shptzkas2ckdopzbbbzid.onion:8333 +uwavujkkmgl4kcyvyvfreuatkpfxh7giifug4pn6r2nuuoergp7vuoid.onion:8333 +uxahghkwzt2lty762rfbf3vn5xlehfhhjrawdrwkmuyw2o6yep4nxeid.onion:8333 +uygew6jxykss3v4byk2m54bdtqnftcpw7xdrtdudlvxjag66hgsrm5id.onion:8333 +v2ke6hp47qxkgkpifftjdr6qb3o7n7d2sribivrerskifefik3iar4id.onion:8333 +v4crdrenwd7tqirnxqcbf5w4r3cg6xaf3hfz3sgp5zej7haygxeiciad.onion:8333 +v4uf3ssnetuqduflgjroutwk6cvscqbhbsxdmhx733xcekudyovuxnid.onion:8333 +v67jkpeiaekszv4vyvt4r25xzh6dm2q2cl2bkrac74ltibuxabc7xmyd.onion:8333 +vbfx6jffhiynj7pmt5bwfmzzql5hkw3pfzlgg27l5j2mxu5e2oabbzid.onion:8333 +vd6azdeefrxp5crdqptbxcawff4w64mmtokmu6iwdwquscwlde5htaid.onion:8333 +vdjby26wyqioxkp5vrkb3ohsx7qp4kyavgq2ejjdakicvvff4bkyunyd.onion:8333 +veqxagt2ag5xv7tnogcueswb3e2likgy546ckjl5zzp6t37ibklkuoid.onion:8333 +vjbvzvngmdzxk4v5tohrtth7eragfoiuhkhpgifndap45qlhdiuprjqd.onion:8333 +vkjhzgxumv24pje46y6jcl6xul5v62nuwutgzhwqx3orm4fh62mzjdqd.onion:8333 +voaubwpvly2eghhrr7u23ylyele74t4u6r6x2tykhcoeo4ie4bflpcyd.onion:8333 +vobatph2s4eqchnexixgqsec7tg7enomdlqc33qlsx6futliyue6n4qd.onion:8333 +vqvipjsibngsr3jsuwhqr5zk6hv5ggfhshwxioefbg54j3y2vdpqo4ad.onion:8333 +vsfc6o36vi4dbctysdomxqs36mncamm7udtkvlxjyzplifpnqtrwlaad.onion:8333 +vsfexay3chere7t5rdr2hmv3lp3kyggurzorr63ustjog2zzgvozuryd.onion:8333 +vsgwevkqyxtcjqov4ybj76airaedrvenrcbjkhjpddoddhd52a7fysqd.onion:8333 +vvcnpfykwjgmtjxirwwacbiwzcdraatmwu4le3fy6ycyz6ud7eamtxad.onion:8333 +vw3gmeqdsxbluya3nnc4rivdrgdm56fuavkzyrnjcpeqic2wlcgr25qd.onion:8333 +w2blxbcvpl2jlq4rtk6qvvckzmqwyei3j4foe57up4cmfyeofupabpqd.onion:8333 +w4xrzo64lhnrjdojd3ae4fko3kqkwazo3yhb5yxymnuel7k6hafviaad.onion:8333 +w7lfx5wfof2w73umxulyffg4t7e7vr72zuej4i2ws7i4bhdxfmkbljad.onion:8333 +wadatcpr2zkcvbh4lgkn4rtfuufnz5qozftvgk35mqiojjjeqgjrapyd.onion:8333 +wf7pumlk4w2lm7rr5fp3b47yljuwraz3fl66mw2iozm4lmhkopoq24ad.onion:8333 +wflg2vztk4y73m44olz5qnbhzsvvjfi5tz3wmdnps7rf7tntlj2vpbyd.onion:8333 +wgy6iwuhf3kltbxoftaf3s4s5or3ewwzdla2ukfgecgqwjm6xtfva4qd.onion:8333 +wkmf7wnecgkz7giunadfmyslotwtry42y6hw42wxlc6qhpa46qoui5ad.onion:8333 +wlmymukrfjh2isrwats2ozbmoiavqklavfycq2ziht4fckpkodktasqd.onion:8333 +woiilwjxzciokmzx4rq4dbg36nhnocnapinq3v4pgpgmkpbxtugfv3qd.onion:8333 +woz3p5rshuz6zccjjjqn4bt6m6ri4pbh557pzdvbo247jmhejr5wmqad.onion:8333 +wpgzpf7mnaj7pqhvwyfjarekp2ojoc3hc3hudgii6dyhka7p3xqxf3id.onion:8333 +wrounxy4wxcj3ptznwfoainrjbiukff6vbxse3lvrgzg5cjfncfctnid.onion:8333 +wrs65mjvgzo5q5en7zz4fluwx4qjdn7pwm3twfrrviinqgzhs3vambyd.onion:8333 +wt5an3mgpzd6karuvzkiigm5h5rlla7gx4sfawzsx47aou5tghovc3yd.onion:8333 +wz5kfeeen5vnzoxknfu5p5ymrhid7gi4v5uloumo2kuiwj6q5legi7ad.onion:8333 +x6hsaqopoftbekwibf62a3y6ooy34i7dilkdgrbiwtu2fmnfhibr4tad.onion:8333 +xasfd2ui4djkzrblpj4dbf5senrren7jtqwcqwtda7kzx3cgud2pzeqd.onion:8333 +xekjpcli3gqh6anqr7txupvvavxmyghodw4vy6p4dnieu2kidqe56pad.onion:8333 +xf5rfb3ockyfcdklqrlqxdxsqhjn32gygiwtncqcsef7ve4e7h6exjad.onion:8333 +xgvwwaezo6tzt2fzshhrhis2e7qnkxegvljs3di4lxfim6l6imgpu7yd.onion:8333 +xk6keofl55jt6cwnjjntsdlt7gr3isfekponsblz2e66xujeuv5ew3yd.onion:8333 +xkkaspfulmvoz25vvsvuwwlzhbq252cvxeghqy6qxa4frf5pvn3ehfad.onion:8333 +xlghuegqlq4fzckjwizb2e5lxlsk76neok7rnxsutazqkkiakdk7riad.onion:8333 +xli6i7xjcx66s3lfq7u3zmewxydpo62bezeocplcsn6gd6zx43qi5zad.onion:8333 +xme4lbeqtbdepl7ghpzuelqqtutuw6lxlbu4vwhxeos7qdv5h7at7zad.onion:8333 +xohcyhfyr5yyljypqgz2ho64ban36pwy53hybsvwbtuadfoak3knqjyd.onion:8333 +xpqyiwgmabsxdmgtgiah7zceeseleklnnanb7g2ajgzktls75faz4iyd.onion:8333 +xuenjyogv6irymjv7muohv2455nncrkjv4mkopfs5dqgwk4q4rpfezid.onion:8333 +xunegc456hyc72rcfvrmmulqak3dgj64wcdjrjv5o7h3nvbsfs3vvuid.onion:8333 +xz463kgdshepjf7gtnsxibjaomtbuksh2wc447xgawmrl4bbfbzg4dyd.onion:8333 +y2ths7kf2pifp4ajoe5ii2ftk3wixcfqmsnmrphlh53jj3342c4hksid.onion:8333 +y36aipkodbtcjiyf5w3h6oo5dvfa7lptl2sbp2xwqlyqcojs7kypejyd.onion:8333 +y3v4djoqsoocvivs463yyif657s6mjcd2n4eztrkqrtte3i2aydi6uid.onion:8333 +y42vk3myp77lncrn6uvrixabdnvppb6ccwtkh3yxhqim7zrjrdo3saad.onion:8333 +y5ibjg4ub542wp6pwozwchkkfqfpu5kup3v6454pumverlvpfff467yd.onion:8333 +yftuiua74fspnqanvait246qn6vmab4aoympjd3omppu46jkq777axid.onion:8333 +yfzxfi6ceyx7ufvrket65o7klryiqsscrd4b7mjteb2yulv37bewumad.onion:8333 +ygv3engdifduzejgjy2qkx6wub2r73h3h3niuqv3chdlk2zm22qb5vqd.onion:8333 +yh5bggjwpbau6wtdvlbkyomtxrh3xf5y5cwd7fqi7ptzazw5c4lbglad.onion:8333 +yh5us7dk25ttxkt6miers3bazlm3jiums5nwz6mzd4i6kn5oizjccuqd.onion:8333 +yjc7fnkd3b4v4vkrdncyts3koskuetqhcgpzupbywwxea4bhhx3qmpid.onion:8333 +yjtnadoumitivwzl53lb5453t4ko24flrpfvtsiyd5dnf7jaqdgwjdid.onion:8333 +yksivr6h6qreccdtpe7uwji2hmgqy5acbqd7zrsdlixrbfijdmqxrgyd.onion:8333 +yojzhgbtxvnrzuqawvyfnpkjnxre6rzuih4etfe6dd2la3jrupc7qzad.onion:8333 +yorpx7sgfswvju3g2whr25s4mkbqihfqxxicuyrfavtjpp3holjopkid.onion:8333 +ypsy5kvuctqnjnvlels7dozlbpxltbtlczicswpz3fwstxupb4e2piid.onion:8333 +yq4bqleayx2ilaxhdxjhvidx3tdrr4m23g2oegfmnpog4b2libezwfad.onion:8333 +yrv6u2spxa5kyj224bu2leoswmqi2woocntt5stnab4e3ab5xai4kdad.onion:8333 +yxf7inhfo435bjotzmzaelgt7cnerf5eq67h4sb4ynurspl75ed6upad.onion:8333 +z2g55fvlczxsnuijx7e4p3bgxph2udp6x4kn6xjmqzrkpdne35tkoead.onion:8333 +z3ebnsxe6awfedmwqd5btg2zrdtjm6izaqsiodbo36tpxluujg45dsid.onion:8333 +z3gm6oghblimyiubqkiven73wgoytsq2jklwtz4sswukaeekihx4htyd.onion:8333 +zahrvinucuxpxu56h6nkiiw7cvutxrua65l4jynvwkzt2bzmeuvdpuqd.onion:8333 +zdnr3dc7b5lx4pph3cj73nmojgqy6h2kgcrf3xw7za2qdnh4ychb23yd.onion:8333 +zej7mizjlb26qecppzvgyswervt7ov6f4x6fwrot7obvab23xsv5jjid.onion:8333 +zgfkpi57f3hybfhh6vltjklxyqvfu2nzkpipqyiyurfccmkdwlatuqqd.onion:8333 +zgj5kqoqgccoccgysrygfeydfsn4z2qx42xjp6mdlbqfzqthj5z4vead.onion:8333 +zgrpshddeijmdp34xfyw2kz22la4jxgwce42pupjp3bo6xtchsorrxqd.onion:8333 +zifp76tjeur73gokktvwyy5lwh5vgjerokbv32carsizgfki3pbfuuad.onion:8333 +zkvdpnuo5gv3hvvlkit3vyyjoeq3vkg27ihqmbif32beoqf6ftcnf6id.onion:8333 +zlpztcqey4osd3omtpsm7micrh6jrxuqzeeendpngk25iyfhleieekqd.onion:8333 +zm2ox7js5spqbslqqgjags3mn53jalknoi3zlva3iihdvykmbjzcbpad.onion:8333 +zmerkoegw6pxcgimoezzhykpyhe62l4xurglh3lnqwknaciyos2qg5yd.onion:8333 +znb6fuo3hgbfmscgkyjvexukok2diyankdfzdt7pde5jnze5hhrdf5yd.onion:8333 +zujw742s3kqa3cqjkg5s624rfjpodtbnuguw2wyhdp7mnqngeeeqiaad.onion:8333 +zv63heoa7jstwhq3wg2nibip36bw4icd7jphccy3li3nut7gp2gojqqd.onion:8333 +zvnhw2gbxdyxhrjjmyxotvxaibgo34k2i5sw72ogtydi6sqsns5te5qd.onion:8333 +zwyshlkggvehzqs26clcvuskdxen2ry5zbl5axe36x4brzsk7b55ypyd.onion:8333 +zyetfkanxicfp6tt5tegkxlkoz5rl2i3zsc6hyyqizahywbktezfuwid.onion:8333 +zyku4bk6pdifla26hympigytlwsx4htajcn43hhobdbrv4tfojv3snqd.onion:8333 +zyphknlr4ogrknj5t64qya246kdaasgirn4iercvesggqplzzxsisbid.onion:8333 diff --git a/contrib/seeds/nodes_main_manual.txt b/contrib/seeds/nodes_main_manual.txt deleted file mode 100644 index 91a64c6e51..0000000000 --- a/contrib/seeds/nodes_main_manual.txt +++ /dev/null @@ -1,95 +0,0 @@ - -# manually updated 2023-04 for minimal torv3 bootstrap support - -2bqghnldu6mcug4pikzprwhtjjnsyederctvci6klcwzepnjd46ikjyd.onion:8333 -4lr3w2iyyl5u5l6tosizclykf5v3smqroqdn2i4h3kq6pfbbjb2xytad.onion:8333 -5g72ppm3krkorsfopcm2bi7wlv4ohhs4u4mlseymasn7g7zhdcyjpfid.onion:8333 -5sbmcl4m5api5tqafi4gcckrn3y52sz5mskxf3t6iw4bp7erwiptrgqd.onion:8333 -776aegl7tfhg6oiqqy76jnwrwbvcytsx2qegcgh2mjqujll4376ohlid.onion:8333 -77mdte42srl42shdh2mhtjr7nf7dmedqrw6bkcdekhdvmnld6ojyyiad.onion:8333 -azbpsh4arqlm6442wfimy7qr65bmha2zhgjg7wbaji6vvaug53hur2qd.onion:8333 -b64xcbleqmwgq2u46bh4hegnlrzzvxntyzbmucn3zt7cssm7y4ubv3id.onion:8333 -bsqbtcparrfihlwolt4xgjbf4cgqckvrvsfyvy6vhiqrnh4w6ghixoid.onion:8333 -bsqbtctulf2g4jtjsdfgl2ed7qs6zz5wqx27qnyiik7laockryvszqqd.onion:8333 -cwi3ekrwhig47dhhzfenr5hbvckj7fzaojygvazi2lucsenwbzwoyiqd.onion:8333 -devinbtcmwkuitvxl3tfi5of4zau46ymeannkjv6fpnylkgf3q5fa3id.onion:8333 -devinbtctu7uctl7hly2juu3thbgeivfnvw3ckj3phy6nyvpnx66yeyd.onion:8333 -devinbtcyk643iruzfpaxw3on2jket7rbjmwygm42dmdyub3ietrbmid.onion:8333 -dtql5vci4iaml4anmueftqr7bfgzqlauzfy4rc2tfgulldd3ekyijjyd.onion:8333 -emzybtc25oddoa2prol2znpz2axnrg6k77xwgirmhv7igoiucddsxiad.onion:8333 -emzybtc3ewh7zihpkdvuwlgxrhzcxy2p5fvjggp7ngjbxcytxvt4rjid.onion:8333 -emzybtc454ewbviqnmgtgx3rgublsgkk23r4onbhidcv36wremue4kqd.onion:8333 -emzybtc5bnpb2o6gh54oquiox54o4r7yn4a2wiiwzrjonlouaibm2zid.onion:8333 -fpz6r5ppsakkwypjcglz6gcnwt7ytfhxskkfhzu62tnylcknh3eq6pad.onion:8333 -hanvo3hzqbhcqm5vahhi5a3czxxdwc7vt56p5gr7bifcvelaqurv6iid.onion:8333 -hz7oqntvj4adrwtqappcgaxfribg5u4rvfkpwlo3xup5fcuyvylkxlqd.onion:8333 -ityrxhidvjnjnf6imzyuqqnkkwridjnebkbokx25so3suq3fzezmksid.onion:8333 -jto2jfbsxhb6yvhcrrjddrgbakte6tgsy3c3z3prss64gndgvovvosyd.onion:8333 -k7nb3r7hxi5exvr4xmvnilhfw6hei7sw4rwz2t6onh4py6wbora6tuyd.onion:8333 -kpgvmscirrdqpekbqjsvw5teanhatztpp2gl6eee4zkowvwfxwenqaid.onion:8333 -l7kw3vjs4cf5mnuejjgqcxrw6wwsjmabllq3h3amy4f5q33d6cgo2kyd.onion:8333 -m7cbpjolo662uel7rpaid46as2otcj44vvwg3gccodnvaeuwbm3anbyd.onion:8333 -mowb2qwpjgs2a6q3yj3xa7nxklfssul4w7ynonyycw3uyopfu3x6ujad.onion:8333 -mwmfluek4au6mxxpw6fy7sjhkm65bdfc7izc7lpz3trewfdghyrzsbid.onion:8333 -rfqmn3qe36uaptkxhdvi74p4hyrzhir6vhmzb2hqryxodig4gue2zbyd.onion:8333 -rsgwtnousfc7zyg4qsm3gvczjx7cihh2njyjbjl3qvcj3xg7wmvhddqd.onion:8333 -s2d52bbttuwcl3pdrwzhxpmhtxn3jg23havjqg5eygwhtiw6lgyelpqd.onion:8333 -upvthy74hgvgbqi6w3zd2mlchoi5tvvw7b5hpmmhcddd5fnnwrixneid.onion:8333 -who3qs4eqlqzoxhqqgan4mg54ua5uz3mk4lj33ag53ei4orvnznrjbad.onion:8333 -wizbit5555bsslwv4ctronnsgk5vh2w2pdx7v7eyuivlyuoteejk7lid.onion:8333 -yrmedr35tt4wqfnwgilltxh5bnukeukxjpgg3jzmmsyld5lgsn5amvyd.onion:8333 - -# manually updated 2023-04 for minimal i2p bootstrap support -255fhcp6ajvftnyo7bwz3an3t4a4brhopm3bamyh2iu5r3gnr2rq.b32.i2p:0 -27yrtht5b5bzom2w5ajb27najuqvuydtzb7bavlak25wkufec5mq.b32.i2p:0 -3gocb7wc4zvbmmebktet7gujccuux4ifk3kqilnxnj5wpdpqx2hq.b32.i2p:0 -4fcc23wt3hyjk3csfzcdyjz5pcwg5dzhdqgma6bch2qyiakcbboa.b32.i2p:0 -4osyqeknhx5qf3a73jeimexwclmt42cju6xdp7icja4ixxguu2hq.b32.i2p:0 -4umsi4nlmgyp4rckosg4vegd2ysljvid47zu7pqsollkaszcbpqq.b32.i2p:0 -6j2ezegd3e2e2x3o3pox335f5vxfthrrigkdrbgfbdjchm5h4awa.b32.i2p:0 -6n36ljyr55szci5ygidmxqer64qr24f4qmnymnbvgehz7qinxnla.b32.i2p:0 -72yjs6mvlby3ky6mgpvvlemmwq5pfcznrzd34jkhclgrishqdxva.b32.i2p:0 -a5qsnv3maw77mlmmzlcglu6twje6ttctd3fhpbfwcbpmewx6fczq.b32.i2p:0 -aovep2pco7v2k4rheofrgytbgk23eg22dczpsjqgqtxcqqvmxk6a.b32.i2p:0 -bitcoi656nll5hu6u7ddzrmzysdtwtnzcnrjd4rfdqbeey7dmn5a.b32.i2p:0 -brifkruhlkgrj65hffybrjrjqcgdgqs2r7siizb5b2232nruik3a.b32.i2p:0 -c4gfnttsuwqomiygupdqqqyy5y5emnk5c73hrfvatri67prd7vyq.b32.i2p:0 -day3hgxyrtwjslt54sikevbhxxs4qzo7d6vi72ipmscqtq3qmijq.b32.i2p:0 -du5kydummi23bjfp6bd7owsvrijgt7zhvxmz5h5f5spcioeoetwq.b32.i2p:0 -e55k6wu46rzp4pg5pk5npgbr3zz45bc3ihtzu2xcye5vwnzdy7pq.b32.i2p:0 -eciohu5nq7vsvwjjc52epskuk75d24iccgzmhbzrwonw6lx4gdva.b32.i2p:0 -ejlnngarmhqvune74ko7kk55xtgbz5i5ncs4vmnvjpy3l7y63xaa.b32.i2p:0 -fhzlp3xroabohnmjonu5iqazwhlbbwh5cpujvw2azcu3srqdceja.b32.i2p:0 -fx6np3oheacr3t7gluftrqo2qxldbbatgw4hepp7ulb4j5ry57ca.b32.i2p:0 -gehtac45oaghz54ypyopim64mql7oad2bqclla74l6tfeolzmodq.b32.i2p:0 -hhfi4yqkg2twqiwezrfksftjjofbyx3ojkmlnfmcwntgnrjjhkya.b32.i2p:0 -jz3s4eurm5vzjresf4mwo7oni4bk36daolwxh4iqtewakylgkxmq.b32.i2p:0 -liu75cvktv4icbctg72w7nxbk4eibt7wamizfdii4omz7gcke5vq.b32.i2p:0 -lrah7acdsgopybg43shadwwiv6igezaw64i6jb5muqdg7dmhj3la.b32.i2p:0 -lzuu6mjtu7vd55d2biphicihufipoa7vyym6xfnkmmlra3tiziia.b32.i2p:0 -m6bpynxkv2ktwxkg6p2gyudjfhdupb6kuzabeqdnckkdkf4kxjla.b32.i2p:0 -m6v454xd6p3bt5swujgmveklsp7lzbkqlqqfc2p36cjlwv5dbucq.b32.i2p:0 -mlgeizrroynuhpxbzeosajt5u4ddcvynxfmcbm6kwjpaufilxigq.b32.i2p:0 -o6t4fr5ayfadzieutstgwcllvwxeuzjlxmzsmpj3hpkvefhzfaea.b32.i2p:0 -ofubxr2ir7u2guzjwyrvujicivzmvinwa36nuzlrg7tnsmebal7a.b32.i2p:0 -oz2ia3flpm3du2tyusulrn7h7e2eo3juzkrmn34bvnrlcrugv7ia.b32.i2p:0 -pohfcrfc7prn4bvn4xstw6nt3e7hjmb7kuj4djtsfqsskwhmhnna.b32.i2p:0 -qd6jlsevsexww3wefpqs7iglxb3f63y4e6ydulfzrvwflpicmdqa.b32.i2p:0 -rfjkzdzv4cwpxo6hzuncicvuyui76wxqx3a23lynq72ktwqs7aja.b32.i2p:0 -rizfinyses2r3or4iubs5wx66gdy6mpf73w7uobfacm2l5cral3q.b32.i2p:0 -sedndhv5vpcgdmykyi5st4yqhdxl3hpdtglta4do435wupahhx6q.b32.i2p:0 -tugq6wa2ls2bv27pr2iy3da3k5ow3fzefbcvjcr22uc7w5vmevja.b32.i2p:0 -usztavbib756k5vqggzgkyswoj6mttihjvp3c2pa642t2mb4pvsa.b32.i2p:0 -vgu6llqbyjphml25umd5ztvyxrxuplz2g74fzbx75g3kkaetoyiq.b32.i2p:0 -wjrul5jwwb4vqdmkkrjbmly7osj6amecdpsac5xvaoqrti4nb3ha.b32.i2p:0 -wwbw7nqr3ahkqv62cuqfwgtneekvvpnuc4i4f6yo7tpoqjswvcwa.b32.i2p:0 -xfkarmvk43vfkfvhkehy7ioj2b6wtfdlezvmlakblz3q4r7mccfq.b32.i2p:0 -yc4xwin5ujenvcr6ynwkz7lnmmq3nmzxvfguele6ovqqpxgjvonq.b32.i2p:0 -zdoabsg7ugzothyawodjhq54nvlofa746rxfkxpnjzj6nukmha6a.b32.i2p:0 -zsxwyo6qcn3chqzwxnseusqgsnuw3maqnztkiypyfxtya4snkoka.b32.i2p:0 -zysrlpii5ftrzivfcyhdrwpeyyqddbrdefnfu5q6otk5gtugmh2a.b32.i2p:0 - -# manually updated 2023-04 for minimal cjdns bootstrap support -[fc32:17ea:e415:c3bf:9808:149d:b5a2:c9aa]:8333 -[fcc7:be49:ccd1:dc91:3125:f0da:457d:8ce]:8333 -[fcdc:73ae:b1a9:1bf8:d4c2:811:a4c7:c34e]:8333 diff --git a/contrib/seeds/nodes_signet.txt b/contrib/seeds/nodes_signet.txt new file mode 100644 index 0000000000..e84fbcf6a5 --- /dev/null +++ b/contrib/seeds/nodes_signet.txt @@ -0,0 +1,140 @@ +[fc10:efa7:ca6:1548:f8c:6bb9:1cc4:63ae]:38333 +[fc1f:22c3:95dc:a3af:4a93:8251:beb9:1858]:38333 +[fc32:2c16:d0d0:f1fb:3b27:c187:8cb5:9201]:38333 +[fccb:248:11a6:1042:bca:1218:f7ce:7d3d]:38333 +3cxteqanevzjd5iufktxxh3l5abj6fs6udqg3bomphzofqjl4aqa.b32.i2p:0 +kmmq64ijxhaalfpatq7q6yyrf3rdfvjk3tsb5xc2rrmkgdqf3vwq.b32.i2p:0 +nmmoytmmcwq4aclmtrxk3askrv7mgy6l27uw67ozvyolwca2dr6a.b32.i2p:0 +qhlt7irano6s2pjfn2v4qrtynjj4peo7tfsnv2x6bm4e4vowptaq.b32.i2p:0 +qn7uwi6nx6tuakxvzhjnjeuxwpcq6wcv4diecrv63ugain2tdopa.b32.i2p:0 +regl2o33xgkhnuu5ywr7tw72dio46j6tylz7zpdl6pfaqsktboea.b32.i2p:0 +rkf5lugxqdjrxva2n5wl43okxrqmm6prlf7arci4bgg4md55oo2a.b32.i2p:0 +5.189.136.209:38333 # AS51167 +15.235.55.158:38333 # AS16276 +18.141.143.94:38333 # AS16509 +18.216.1.71:38333 # AS8987 +23.137.57.100:38333 # AS1002 +23.226.164.192:38333 # AS3801 +34.16.103.64:38333 # AS396982 +35.217.29.66:38333 # AS15169 +37.27.45.224:38333 # AS24940 +38.88.125.238:38333 # AS394256 +44.210.109.64:38333 # AS14618 +45.32.127.199:38333 # AS20473 +51.79.29.216:38333 # AS16276 +54.255.186.152:38333 # AS16509 +63.34.82.20:38333 # AS8987 +65.109.54.101:38333 # AS24940 +67.209.52.138:38333 # AS20326 +85.190.242.80:38333 # AS51167 +89.155.238.72:38333 # AS2860 +103.16.128.63:38333 # AS133159 +104.248.42.204:38333 # AS14061 +116.163.20.113:38333 # AS4837 +121.78.241.71:38333 # AS9286 +124.156.198.249:38333 # AS132203 +131.153.11.131:38333 # AS20454 +135.180.99.74:38333 # AS1299 +136.144.237.250:38333 # AS20857 +143.42.65.56:38333 # AS63949 +144.24.238.157:38333 # AS31898 +144.24.241.206:38333 # AS31898 +148.51.196.40:38333 # AS12025 +152.53.3.192:38333 # AS47147 +153.126.143.201:38333 # AS7684 +159.203.133.144:38333 # AS14061 +172.105.179.233:38333 # AS63949 +174.50.212.60:38333 # AS22909 +175.110.114.74:38333 # AS49981 +178.250.189.42:38333 # AS214379 +185.148.37.170:38333 # AS48347 +202.182.105.108:38333 # AS20473 +205.209.114.30:38333 # AS19318 +208.68.4.71:38333 # AS397444 +[2001:19f0:4400:63c7:5400:4ff:fecc:fc1e]:38333 # AS20473 +[2001:19f0:7001:48b2:5400:4ff:fecf:6e5]:38333 # AS20473 +[2001:41d0:304:400::d0a]:38333 # AS16276 +[2001:41d0:306:4505::]:38333 # AS16276 +[2001:41d0:347:e00::]:38333 # AS16276 +[2001:41d0:403:4ecb::]:38333 # AS16276 +[2001:41d0:800:330f::]:38333 # AS16276 +[2001:5a8:4164:7a00::506]:38333 # AS7065 +[2400:8907::f03c:92ff:fe6f:ee2b]:38333 # AS63949 +[2401:2500:102:3007:153:126:143:201]:38333 # AS7684 +[2604:a880:4:1d0::352:6000]:38333 # AS14061 +[2604:a880:800:14::3880:3000]:38333 # AS14061 +[2605:3380:422e:1::50]:38333 # AS397444 +[2607:5300:203:7467::]:38333 # AS16276 +[2607:5300:203:a29e::]:38333 # AS16276 +[2607:5300:205:300::1b0]:38333 # AS16276 +[2607:fdc0:1c1:5:632:1ff:fe54:ba56]:38333 # AS20326 +[2620:6e:a0a0:1::71]:38333 # AS397444 +[2a01:4f8:121:4072::2]:38333 # AS24940 +[2a01:4f8:13a:c56::2]:38333 # AS24940 +[2a01:4f8:2190:1692::2]:38333 # AS24940 +[2a01:4f8:2220:1a70::2]:38333 # AS24940 +[2a01:4f8:231:3d6f::2]:38333 # AS24940 +[2a01:4f8:c17:bff8::1]:38333 # AS24940 +[2a01:4f9:3080:3496::2]:38333 # AS24940 +[2a01:4f9:3a:2496::2]:38333 # AS24940 +[2a01:4f9:6b:301a::2]:38333 # AS24940 +[2a01:4f9:6b:47ce::2]:38333 # AS24940 +[2a01:7c8:d008:e9::3]:38333 # AS20857 +[2a0c:b641:6f1:6::2]:38333 # AS214379 +2ycyu2aba3xsqjr35beqporp5f64ntqs2sau2amn5ztq4j5q76amhqyd.onion:38333 +3qeedpzgciv65tdy2tsdmjxswhyep4aj65jtboznf5nnwcyo2lbmiyqd.onion:38333 +3xvum5nnvcchvfxwlbc2it7nbfxhml6ovt7xehjw2potempk2om4eoqd.onion:38333 +4n2rlrrnxcpnfrft4ivlsvsjiahk5ffxizcyfr5amjcqfwt4biitjpid.onion:38333 +5ofovtlx424wnxyoohnsxqjktwqd4i2kiqawox3srsdttsp2pdrx6yyd.onion:38333 +6fy45vxzgc6siecr7en4k6oft4k4ix47jvkxqyzopalzwyphqc3hv2ad.onion:38333 +6ivh4quupqu3w3glr2puyi5bitjapbbl6ehvbjsvleopyy2yzjgp4oqd.onion:38333 +7mgfpo4urwysuafbo6sb3u6vh5f7pkvgddrqohcobhbkblqrrozhn7ad.onion:38333 +a7mvea5xgpknsqaifyvfstdn2utjvph564i6ti3nbdr2cksby5jhykid.onion:38333 +b3sbqhjstq34ae7lsrw3syhxcjdu2ssuf3f3kvbnyrvbp7cvuuopmbqd.onion:38333 +ba3rwqombmuji3wxpmydrk7vcxfpq7pnn5bfw74wvvqyo6rrhwqrt6id.onion:38333 +bodh6zsjtn6kvdk36ukx6fns5hqiiw3zhkqmcmj54nrtkz5tdtb6yayd.onion:38333 +bux5jwkwzccba57zthctdgsuwp5mi3wocxndtuf6jg2qqab3vpnqnqqd.onion:38333 +ckbugjazj2iotosxah7odbxfozxivuk6zu5npf3iwfphvoh5brdjfqad.onion:38333 +cq3td34eu5xjymlxl7aq4rsskxjt4ag267i6mzhdqhdpfzcqctus6aid.onion:38333 +d27tvdmi6wjjlffjyhm5mogwsw3433jxkaiwhti32eagvljdzseilqqd.onion:38333 +dpzlvj7kmbifhbttfe7vwl6fgpy5os62iiznel6eocsaarssudtdzoyd.onion:38333 +e6xhvtrt2ppjfxckbinu7a4jxmy7usjnvjx6st2cipmvlnnhxg7krbid.onion:38333 +ecx2z3x4nwbzjh6dh6vyccljkhnxya2o2o2tz3pzvetxfjjmujxhctid.onion:38333 +ehnxcigc6t34smlk5lftfyb7rntcsbwhlu3pe7ltft76gl6y262ekdqd.onion:38333 +ejgeimjypsfuijpxzy5xpwmmjmkr4izwze6od5pw74csjglflib6nsid.onion:38333 +eqhrqtvxkyjcggbkmzgocynaskblynl2bqeuel4lqs4w3f3rgpfpnkad.onion:38333 +f7xfq5hijqptsdak6qjx3komxrff2hw3xa46d7cs3d7igvm5tylotbid.onion:38333 +fo7cekwzd3ibyoxuo53mfqoxffgfaupg5ydxbl3rofvwxtzbvgy3ciqd.onion:38333 +hztyx76iaz4h3emavmzbuizqfg3q37ehfwr2k3afadtcmcepjsxhmeqd.onion:38333 +immdwqfyz2hhcmxmyypstz7syq2cygaklr43mqjmqefnmtcyuspwkbad.onion:38333 +jahtu4veqnvjldtbyxjiibdrltqiiighauai7hmvknwxhptsb4xat4qd.onion:38333 +k4d6h4eyeqjn35b3x46f4s3g3eykn4bms52paxuxenkre6nmhfvy6bqd.onion:38333 +kklfzzodnlinc3toltn7dlft4vzjf2ckmdw2n3dn4lx3pzw5di2womyd.onion:38333 +litqgemqmpesu6gi2ctd4ubrpxdn4mcm2t6p7xhkfxnkk7lzpdx75vyd.onion:38333 +lkgnafoa5nfd34pzyxpz5gnmpwkbdk5a5h6h7hk3rs53soh6nkb3snqd.onion:38333 +lwiqghlmljzlarwn4gwdrvskd3nibtw63o5ok7ugx4nwuvh7b422ifad.onion:38333 +lxied2447sbmnoi64xbrdtcekdfyneoo3xb3m6vscj452orvdi2cjsqd.onion:38333 +n6tf5dfz25i4pprczevdkyo5bkpgfa3xigenn6skpjqqynbxpxzilfid.onion:38333 +o2fumu43ugk6xayo2nvadn7ohqlxharakt4flqh3hjgxdbwzrwignmyd.onion:38333 +oowqbk36g76cs37sk7myfoq62e7ly42etcfugol3p7haw6ewyn5qhiqd.onion:38333 +ouohm2bcplkfvzgg4f5ltvtqt2obzyvaadb3jep7bb4gasdusqkkupad.onion:38333 +oz5puzgtybzjisyw5kimddtmsnc32zwflkj5r43clfddawunk7wtsiad.onion:38333 +pkpiv6cqqba3mb5cpccdvz5v5p3u5acrjv2zj2u4auzznceqculjrkid.onion:38333 +pmjm644pzkp2khwixyis2c7mnfbte33bnmwxdx5lk6t6owvtmapdbhqd.onion:38333 +q3z526imdoo2pdujkfp5vslshni2niewlbxfokejfkddkezxutagezyd.onion:38333 +qpgnrxuwxc6474hvy3j5uk2hbm3ry4ikwrenoit6zjeqqqythsvjdvid.onion:38333 +qzf5vm2exowrli5ksuowrhshtnef43exhtha76qdxz357hdqfq65zhid.onion:38333 +r4y5pqyvdzq3bzg2fqu46ql4a32fadkftwejtxzckeyohd7wvqnnwtqd.onion:38333 +tev7cdwka3av6ektydsjfpofmcam3r6qcw7sxbpkohckjvihtzp7hgyd.onion:38333 +tgqpfwoxjidlwd5rgpj5zfuhctxrevsfueqndih4vx5hgxpmyg34jqyd.onion:38333 +tsq7clffbfe636zfszymheqgy6tyzbsjogad2qet7qeijua5c53ye6ad.onion:38333 +w7d4rwjt5igozi5v7z2m3in2wm3zsf2lhsizqqohkyrokbbie5equoad.onion:38333 +wevmujl2p6mckcwaxnmtusweros7bu3bxf2g3lzutnfdkjl5gwbu36yd.onion:38333 +ww4jycomjwnf7jtrrrngeahokqkcl32iufmjzvvk272svieavabjyiqd.onion:38333 +xbulvl2bb4wvnlafmq3j3fzrjhsmnfz7ubyvl6yy3syeded4tqiubkad.onion:38333 +xm4kxluodmeolmaugmaxnexnefrg3vsxnqo2ezu7rqmdct7i7xevcxad.onion:38333 +y5f4rtma4uneqrkzkoghoiec2sy3mee44xs466hhsi74w5roccqxlzqd.onion:38333 +yjhagyj65xcxu6b5yktu6ntkwsyd5rhjlrsb7sexq5lzchatdqmoqnqd.onion:38333 +ypi6qgnmabcqlmjfkcnqzpjdjihwmebxkd32tjwt6mrhgm2strfml6ad.onion:38333 +yrzulzu5xxcd2vio34ciyj5h7bpnevikslbunm6yb4tjkty62fxl7uid.onion:38333 +zgkvv542e4ewviremw3qp4bi52f2sxt4g4mrjrbwonbnfb5oujd44lid.onion:38333 diff --git a/contrib/seeds/nodes_test.txt b/contrib/seeds/nodes_test.txt index 5b04791d60..2d6a0e1dbc 100644 --- a/contrib/seeds/nodes_test.txt +++ b/contrib/seeds/nodes_test.txt @@ -1,89 +1,219 @@ -# List of fixed seed nodes for testnet - -# Onion nodes, last verified 2022-08 for minimal torv3 bootstrap support -24j74ahq6ed4wmfrghdwroyfzimlkhnrb7zh4zw3vl2allzxbjrhaqid.onion:18333 -2fy74te65gm3c3gv3u5mhwdudvbdfh6k5fdz4gduimrltjjrxftbxrqd.onion:18333 +[fc10:efa7:ca6:1548:f8c:6bb9:1cc4:63ae]:18333 +[fc1f:22c3:95dc:a3af:4a93:8251:beb9:1858]:18333 +[fc2b:f62e:6a76:cdb5:dceb:2fdd:a0f8:3d88]:18333 +[fc32:2c16:d0d0:f1fb:3b27:c187:8cb5:9201]:18333 +[fccb:248:11a6:1042:bca:1218:f7ce:7d3d]:18333 +66lkz2cfzyrz3tde6gflrty63jqr4knyy6uv4dvldrsecpnfx4dq.b32.i2p:0 +hedmbfis4h4inqrwo2uzmku5xu6xaq74tg7sofnetqikdvndtvja.b32.i2p:0 +i7vrfdmgolc6dqfmsak5fvwgmn46y4ghtan44uhn2aw66cbk5nfa.b32.i2p:0 +nhla3xzibmhvav7meemluh2d2jxdrlwicq636a2sohwqhrfgqi4a.b32.i2p:0 +o6j3b33bv26vthoqzjy3h7a3qsuqbtbe3ulajmjzsl43vaqyieyq.b32.i2p:0 +ocqipbbxx4paopgkkbnj234ie7opzrtca5gtiwr6oda3h32rzgsa.b32.i2p:0 +xgctj4seo3ofstiymoyeuzq74bvddrbr6jtia6erodlf5va3cz5a.b32.i2p:0 +xy6ytjxel5ku4naqumj4f6hn4agrzh3w44gqcs6xkkzwm5s3jdgq.b32.i2p:0 +zklt7hncdrl2hupfwnlbt3qaayhjayjhvwvj2m3fok3z36tlnxhq.b32.i2p:0 +2.59.133.20:18333 # AS58212 +2.86.50.136:18333 # AS6799 +4.246.195.240:18333 # AS8075 +5.39.218.162:18333 # AS57043 +5.255.97.91:18333 # AS60404 +5.255.97.92:18333 # AS60404 +8.217.160.32:18333 # AS45102 +18.168.119.254:18333 # AS8987 +18.209.9.240:18333 # AS8987 +23.227.223.209:18333 # AS44486 +27.148.206.140:18333 # AS133774 +34.65.45.157:18333 # AS396982 +34.69.221.24:18333 # AS396982 +34.254.97.244:18333 # AS16509 +43.133.47.138:18333 # AS132203 +43.247.184.50:18333 # AS23724 +44.208.161.158:18333 # AS14618 +45.77.25.14:18333 # AS20473 +51.79.82.75:18333 # AS16276 +52.193.79.181:18333 # AS16509 +54.236.59.55:18333 # AS14618 +59.186.7.131:18333 # AS3786 +62.210.207.63:18333 # AS12876 +66.94.114.229:18333 # AS40021 +67.4.82.9:18333 # AS209 +69.61.32.242:18333 # AS141518 +69.197.185.106:18333 # AS32097 +70.114.196.140:18333 # AS11427 +72.211.1.222:18333 # AS22773 +73.22.9.231:18333 # AS33491 +74.118.136.46:18333 # AS20326 +85.203.53.149:18333 # AS39351 +85.208.69.12:18333 # AS42275 +85.208.69.13:18333 # AS42275 +89.58.9.219:18333 # AS197540 +89.155.238.72:18333 # AS2860 +90.79.184.226:18333 # AS3215 +91.109.204.214:18333 # AS199669 +91.123.182.164:18333 # AS51648 +92.115.99.159:18333 # AS8926 +122.208.117.197:18333 # AS17506 +124.236.16.91:18333 # AS134760 +129.153.149.46:18333 # AS31898 +129.213.114.91:18333 # AS31898 +129.226.198.211:18333 # AS132203 +134.195.89.130:18333 # AS63473 +135.180.99.74:18333 # AS1299 +137.184.2.124:18333 # AS14061 +141.98.219.199:18333 # AS20326 +147.182.251.92:18333 # AS14061 +148.51.196.40:18333 # AS12025 +148.251.4.19:18333 # AS24940 +149.202.79.199:18333 # AS16276 +161.97.119.128:18333 # AS51167 +162.55.243.11:18333 # AS24940 +169.155.171.252:18333 # AS44486 +176.108.193.97:18333 # AS47914 +185.28.96.16:18333 # AS59845 +185.44.206.111:18333 # AS44051 +185.107.68.135:18333 # AS43350 +185.130.224.146:18333 # AS57043 +185.186.208.124:18333 # AS206428 +185.210.125.33:18333 # AS205671 +186.154.207.228:18333 # AS19429 +188.117.132.82:18333 # AS31242 +188.213.90.149:18333 # AS206238 +193.30.123.70:18333 # AS197540 +194.9.6.11:18333 # AS58212 +194.95.66.129:18333 # AS680 +194.110.169.133:18333 # AS203576 +195.154.241.13:18333 # AS12876 +200.143.224.99:18333 # AS1916 +203.132.94.196:18333 # AS38195 +205.209.120.167:18333 # AS19318 +206.204.104.7:18333 # AS212947 +208.68.4.71:18333 # AS397444 +213.199.42.73:18333 # AS51167 +216.219.91.82:18333 # AS19318 +219.117.221.162:18333 # AS2514 +[2001:41d0:303:146e::]:18333 # AS16276 +[2001:41d0:306:4505::]:18333 # AS16276 +[2001:41d0:306:a3a::]:18333 # AS16276 +[2001:41d0:700:544c::]:18333 # AS16276 +[2001:41d0:800:1d55::]:18333 # AS16276 +[2001:41d0:800:3e7f::]:18333 # AS16276 +[2001:470:1f05:4e5::2020]:18333 # AS6939 +[2001:5a8:4164:7a00::506]:18333 # AS7065 +[2401:c080:1000:4cb2:3eec:efff:feb9:8604]:18333 # AS20473 +[2401:d002:3902:700:8708:37c4:e231:d3d8]:18333 # AS38195 +[2402:1f00:8101:713::]:18333 # AS16276 +[2604:1380:4531:1700::5]:18333 # AS54825 +[2604:a00:50:58:216:3eff:fe2c:8371]:18333 # AS19318 +[2605:3380:422e:1::50]:18333 # AS397444 +[2605:4840:3:2c23::1]:18333 # AS63473 +[2605:a141:2239:7674::1]:18333 # AS51167 +[2607:5300:205:300::1b0]:18333 # AS16276 +[2607:5300:60:85a9::]:18333 # AS16276 +[2607:5300:60:8702::]:18333 # AS16276 +[2620:6e:a000:1:43:43:43:43]:18333 # AS397444 +[2620:6e:a0a0:1::71]:18333 # AS397444 +[2804:431:e038:cd01:aaa1:59ff:fe0d:44b8]:18333 # AS27699 +[2a01:4f8:121:4072::2]:18333 # AS24940 +[2a01:4f8:160:1083::2]:18333 # AS24940 +[2a01:4f8:173:1ed8::2]:18333 # AS24940 +[2a01:4f8:173:230a::2]:18333 # AS24940 +[2a01:4f8:190:4026::2]:18333 # AS24940 +[2a01:4f9:2a:309d::2]:18333 # AS24940 +[2a01:4f9:3070:26e2::2]:18333 # AS24940 +[2a01:4f9:3071:2154::2]:18333 # AS24940 +[2a01:4f9:3071:219d::2]:18333 # AS24940 +[2a01:4f9:6b:2768::2]:18333 # AS24940 +[2a02:c202:2238:2255::1]:18333 # AS51167 +[2a02:c206:2239:7671::1]:18333 # AS51167 +[2a02:c206:2240:1506::1]:18333 # AS51167 +[2a03:4000:2a:514::]:18333 # AS197540 +[2a04:52c0:102:2219::1]:18333 # AS60404 +[2a04:52c0:102:49af::1]:18333 # AS60404 +[2a04:52c0:104:160c::1]:18333 # AS60404 2lsncqdflwk272dhydrxf7ikfy23ppnmm54dnynyxiym6lqf3wowrmqd.onion:18333 -33o6qaidta7s2pmltet6vynd337vamgcifhh44rehwwxqpflcjt2njid.onion:18333 -3oo6bsc5mvf6a6ypmoaikilta6ka7mbdhdwhrnqhuhjlbaxyedvfvaqd.onion:18333 -3pe3fyklipy4sppkkgnhc22kcxtt57uler5kv72t676bbrwmcseo5qad.onion:18333 -4u4mcz2sfvxs7pwcwncswgmmcdzqtzjx7ztfo332jv4pqucb22ikdhad.onion:18333 -5v3i2kfqiqwp75gznjoptss7qgrcgseceqxpzpqkd34qeqzrg726i7id.onion:18333 -5zlrxk6q24t4vz5k4ie7gtuasdjavhoelhinzimxbfhc77u7vafipsid.onion:18333 -67s3af64ehw7xnxv422axm7tns4d6kutrftc6bjq375n74q3kj4pp7ad.onion:18333 -6a4ony53julvnufo632ktgmwvhupz63wbdwx7n7qudjy32qyq6gm3bqd.onion:18333 -6ftyg3nhc6tn2hyzls6zfdsfbroczhkxtdqumqb5q4yafhy5rdpapbid.onion:18333 -7554uw5djruh34j5ddx3iprzgqgzypcjtptwoldymfbgoywqcw2wiwyd.onion:18333 -766lozlabxaqjpbqsvt6sn3c65n6gkwwhoxyvggj7nfwnmw4cpaoccad.onion:18333 -7blv5abnytdf47yvbhxmykprmvjryqob65i2jmdwq3rrajcn2iiysbqd.onion:18333 -7v2ja4igx4v5y2jr6jrr6gaxohjhlzhvgwe4avlraxchozf7ea3kruqd.onion:18333 -7zgbmtzxow2oevd5aaqtsormw7ujv4zprl3oi2355immhq4gk7cyw5ad.onion:18333 -adstabjz7ec2y3jt4w2dvummowzv7g6m2f3kajeejffuaz7ojwj6epqd.onion:18333 +2mvycpm7ni6ix2pr4lkkfkqlivgo77mt4jx3s3dmhdlg3ogq46s6qbyd.onion:18333 +36fwktckggarkclbpu2pumsdpck46ahe6cwpozd2gm6q7kgdqljclmad.onion:18333 +3dt6kgfrilc3nwliwy5wbmc6oa2b5y3t33nkxlrxrkunr2hoaj56kgyd.onion:18333 +3vnbi5o3hyzk4cm3hhnyo3h7tclr6pybmhmqwkbyclslfhqtg72pq2id.onion:18333 +44sgcv5dvpplt32enlneddyl4gd4z3tbezl2scedwccndyzrrp6lcgyd.onion:18333 +4w3f2mxe4ftodocermsazs3qlpo37igkdgne6ka2p6wnnrgwpzqw65yd.onion:18333 +5axx4qyub7qtgssrvbbqudu6uqjbuknbvbld2wdscv5p6kh2hsfzjxqd.onion:18333 +5qdgulsryjejkjinocpvknazwtnbqtuf4f4pui2at4jpedwwpg427qyd.onion:18333 +67l6l2k7mqbl2btyvo5h5lki3kxcrgbunlk7brcloyaoaftbs5mnsuad.onion:18333 +6bhop3n32rreiynu35epznhc2exxkhuleromdhnida2hgmu2bhczgmqd.onion:18333 +6fdbuqf2kgeweeoeikmwfezauys657lzezzus4nxmekkumouptg5ezad.onion:18333 +6rnqpqqcpllqhjoa4gwrtq5yi6fdch6uqzapdee2gq67gxgsl73v4uqd.onion:18333 +7ph7mrc24te57mvppajfkfj4mk7zuz4teukymt3wgpdpw6vpndeivtyd.onion:18333 +7poqajl6svz4vr3aqi7vdtar2t56crbrtj6yi75ydrt3ighyx7q6qvyd.onion:18333 +7zlqrihb5do5ebbmjwgspxigqfdmkfslkqtg2ngdc6ypsunzb4iootqd.onion:18333 aesy6tfufadkut6flu2bsqgnw2422ur2ynjalguxlzuzuktg3zehttqd.onion:18333 -alxo32b5edi3bn2e224qrgytgxxpic4knyipvpdvctfsrvcaiq5lgeyd.onion:18333 -aoeart34umoonvd2kbqr3bc4sweu6a4msh2gp4skyqvei3shzcxbgmyd.onion:18333 -aprzvj7hgctsde4mkj3ewq35gvykspjvkqiygg7bpnw5tkvse2n7rhid.onion:18333 -awpk6z3xghx6ozouhodcydaqtr6uzzbnw4creuix7mkupxoxlmhhspad.onion:18333 -ayynqazucyh2jd5rehcfggmhunqpdwzlbhzbqgy6lj4ctz2ocj7chpid.onion:18333 -b2ika53aqckv4gs7wmog3byrea2vfzm5p7ye33digcsmvvnpbyqmzoyd.onion:18333 -be7zx3hh6dlahorlvsrrgqm4oahfrgqm2tbwnbd4u53ntu5f765n6hyd.onion:18333 -bluk62wj24bsvdwh47muo54hhwsatkftiqxevt5kba7hstjoex6ueeyd.onion:18333 -bubm6fiopfzkxqrfx6vqpioe5ahlhyubz57ogsqqy4ha5pnngiqlh6id.onion:18333 -d3czabzjj57lgrsr5gawkjd7v3gznrqa7zyizqmk4lryascavmipnyad.onion:18333 -ddj4cuvb32ve5chtp6jattcdnnmxmpoofjthzi7thgxxht7yqoetj3yd.onion:18333 -dqhhlssfwmh3g6zhwxpcfbw64xz5rfikcglinbhoxv5ajv4qzicjyeid.onion:18333 -drthcyb4x4rdfekw5g7xjogxi7aqoluilgulbgwvsme3nw3oibvchbad.onion:18333 -dwb47cmqa2tjpmvjaear7gdcars2lez6niefhi4qf22qehtyta6577qd.onion:18333 -e7tkrf54ng3q5vcn5gn77zwjwm74lkfav4mwdux3pvon6yvqg3tf46qd.onion:18333 -etuymy47s3quepvdaoo72i5e5mc7uovrzu5m4jf5q6mwlwizoxy4xgid.onion:18333 +axaaplqtf4z22xfj2j2xn6fhtj6ksv74bs7vae6rfw67qofdnqoacbid.onion:18333 +ayx35r2mhwydczzoqu7b6dl3sup4oht74sgnlrjkxybzh2hmfnaix3qd.onion:18333 +bizdwmm7naqq5pehkbfggznqtena5eodz3kprvsbj4nkkax4fvxx53id.onion:18333 +bjqttlyt5kxcn7sitpiavf2cuhdf6rlwigericlh7um7gzkqyyefqnqd.onion:18333 +bkzo7mpxuar7rhsbiwdaxqcymixarcbdmb3sdaqtv6yb2svqttz2s6ad.onion:18333 +bzn63lsmsuvzlg4uqadyylxaggdcrzkb56muw2b43ft5qkynvzfopbyd.onion:18333 +c7zrq2yqt6rtn5dxkczp5bv62k2jncv3mscoo24c24rljbplr2dvhsid.onion:18333 +dskf46hfkefyr6nio5gtqp7em7rh6aqwrugdegfooaoxcux5ym6bkuqd.onion:18333 +euvmh5f637qwqgktjs5zwauvayybfdkiopnflnh5yjt7ouqat3427pqd.onion:18333 +f472j4pynbgltb63mr2lhyvhecfqdjdcfmr2s2id4rreemyn32xtjuid.onion:18333 fbimesnyhzubbzqc3uaufzkbyfmnkxvypoxaveaub7rzpzh2foxrn2yd.onion:18333 -fzbrwmgwmko7quelrhfuskt3ijabac76zx7g52dfrevmhdkj6ivh7qyd.onion:18333 +gggan3nuzxpd655lafnsunqfxgy56bvsxuuzucgmaowyvq3d7a7o7jad.onion:18333 +gsw6sn27quwf6u3swgra6o7lrp5qau6kt3ymuyoxgkth6wntzm2bjwyd.onion:18333 +guudgx24aokistytvm3hj7u5cbvdkr2b643r5t33pa536ekfn2lfykid.onion:18333 +gwtx5qluopwaxjhedlifnr6pptw2eihojzhq3stnv2gfbvqbgqdhi5qd.onion:18333 gy6nih4pmp5esyvvnhlj6qvk7zkbjuoswkxffyiip3dbkvsfxwz5zcqd.onion:18333 -ha62ziqzqdogd75zg7lfh4fqrg3bim3cpqzyupo43w5pw4fen6nr2pyd.onion:18333 -hacjjgj2mbqqrthzimmi6anvin7dljjhfl3ik6ebg3w3nmgsvr3ymmqd.onion:18333 -hbkp5xwpqo4qm75kpglfrclyiuuvdgv7mtiqfys7oqks4dmpqgpeoeid.onion:18333 -hqgoy62hoqjmz37brdfvoeov3cix5fixbqjoert4ydr6herg5oc3iwyd.onion:18333 +hj2txlxajdlh7jsfwqxtp3cltlptsr33ctjkbxhbzbyirkmcpfhsnyad.onion:18333 +hjwzovgwou3py6ncemgmzpvcihay5cuzuxvqdn74axndmll25p4mwjqd.onion:18333 +hqkdgpzzsv2qvafhdkdocszquj7o2ittxfmm5fc2arxqw7ikottozoid.onion:18333 +htkiqaqoql7pjstenmw6v4blm6l57d6hl6mewxkmfi3qumozflx3gzyd.onion:18333 hvbmmzvqrpgps2x5u4ip4ksf3e5m2fneac754gtnhjn2rsevni6cz3ad.onion:18333 -hw3vzp32w4h6giplue6ix445oi6wt7gmeksrznb7tdfwhkgit7gnbbad.onion:18333 -iddr66ewkhenivapgianudjkwqcp6dxtssg7ixrdot5az6uh7m5tmjqd.onion:18333 -imya36iexiiiqrkwuxxcehnv4kg5shtirwd2vg4cnjy6lfjlph3fusqd.onion:18333 -iuhhuocns7entrzlxsxktyz2ibs7hqgiggv6sauzqkzka6laslwz7oqd.onion:18333 -ji5wmshokuc63eiulzlwj2zdvnligvrwfvvc76bice3tu43wfzvpmkyd.onion:18333 -jjfuyj7krgzkmpxvn3b2j2hwlzkmze3ezy3ifwk7dnswwawgmzqhjrqd.onion:18333 -jn2p4sgfphkxpow7kjrubrbqat77kkibzqkvuwhxyalcrazwmcqeaqyd.onion:18333 -jrveyz4us6sog6e6czsvr5mvvhgzjgv4idbe4idrolmqeudvt5a2dgid.onion:18333 +hvtxymvdb55u7lhdw6775akqy46inunl3uup27gnsxm2bqmv55wbacqd.onion:18333 +i5fjp7ggx62zlfkibzn7s6glpjp3h2ypfom3lmqixig7qbdgej35wfyd.onion:18333 +i5gphw2d224tniqkjebxdwz5ygbbo5gcushoyevv7x7o454b6qlrzeid.onion:18333 +iysx2dl4tpojiclh32iyhel6z7h227c7o7buzk5wuqw6qhuytvsu66yd.onion:18333 +j53y5paeb7xcrptntut7epccjglduquldjlzjlho4lj2msabnygrljqd.onion:18333 jsc4frvvnl2d3bhzyofsc72xpztgm23nl4fnb4dwkzsxr6fhij2q5iyd.onion:18333 -klymxdvje7kccv3tznabo3udopsftkmjemkbi2urqxjm4hefaudejjyd.onion:18333 +jtvqgaccxbtzshtulk5xlsb4wkoil3psmpn5avqyp2i5vm4hqh5cicyd.onion:18333 +jun6gdmbgasr57bhr4zs3dfhc6pzpaw27nqb4dadbai7yrbq55zskeid.onion:18333 +kamanho5clcpn5l3sc6ih3vb4skmfhgxw3h2mgs7e5idfezu5dw5oxyd.onion:18333 kwjxlauwjtecjfsiwopbl5pvn5n6z5rz76uk6osmlurd3uyuymcw7aid.onion:18333 -lc7upz2srw2yhpcvwg4afy64ylcoo6mfwlttqj5ovuglqnhnohpi5iqd.onion:18333 -lf3mpxfyjuovcqdvinl52pvdmmda6xqyfeiarlfamdjpgy3ouzmmlbyd.onion:18333 -mc7k47ndjvvhcgs54wmjzxvate4rtuybbjoryikdssjhcxlx27psbyqd.onion:18333 -mjbg3ggeuelmc7ixty3zjccyo2urg2uyherfqe7ytkm2ejkwlec7h6ad.onion:18333 -nkyqozv6kdwi423s7s2mezzguf5bafot2a3hv4ed2dbvtblisdmad4qd.onion:18333 -nvvqo4xxiwgb3y246jmcbuuveurfdq2zs3a5y7veqkeqv5jfhang7gyd.onion:18333 -o6vfovqxz3oxszfppczpjejwouobztjrgvfojc3emvhan3bkyskzhuad.onion:18333 -oaiw2lnhzgp5ry7ivzneuufmh7lfploquu2rjv5rozmlbefedsnxe5qd.onion:18333 -oln7ybci53wk4g5n42nipyixvyjxbludsbrfsmhnirb6tk7ovlikd5id.onion:18333 -otmfnhc6wrrbf2tpdy6zkisqc3r3urnsuowsnmatoto6yixaocnkseid.onion:18333 -ovc6sajbqfcbwv3wrq7ylklu6q6prvisz4jr4lyycn4kgukzjfe4mjad.onion:18333 -pm57didyzg5ljuvn5ufr5uun2iencuk3af2gzqc5zvgfh452c3rxtjyd.onion:18333 -pmismhpwug34gnqzbutranvx2wjwbshyqj4un2dyzyuvak2eh55psfyd.onion:18333 -polarisultijjhaku6z6u7jyboho5epdsg44ttebfaxmgau2z5sqolad.onion:18333 -qe2jbe447he6panfvpyqhyntf7346gmuf55bxrmdzggmgwyjsyknhxyd.onion:18333 -qz6yd5lsgdajcteoareeptwnipxsezyx5kks6ukpk5tvqinffzunqmyd.onion:18333 -rp6pn3b3oesyr2giolbysbjhqeugxntsu7crnkth4y33ok4zvcl7yrqd.onion:18333 -ujdchuw3hz5gkbouiv4p6pwbfdn7v4k6gluwvd4wiukqc7y7ow754uad.onion:18333 +lka74booetkbmat2q64haawcytbwx7mnctvo63ww4jgi4yuqnl6p3kad.onion:18333 +lwfecq35ocqjfbdq4h2qmcwl3cfcyiyycxtvrz36ihdbuczehi3bmrad.onion:18333 +n23anw4zb7f3paroac626oc2sqy3yn5kjfpcqvb3lvdyx7dzzpovd3id.onion:18333 +n4e6fp6xoyo2glsafjwbaq3wirhldpjw4mskn5lzkm4o5lhh5n5k7uqd.onion:18333 +nmazvezejolohnbza4rmqrwvjcprhi7w22fqvlbxp5sw3c25xy3dunqd.onion:18333 +nyrekcbm2ici6wv2umogtmwg7o2ivu4vm7bpcge5fayos5l377zldlqd.onion:18333 +o4zdqfdoe4jfvn35twqtjkzmptmk3bsg45sp46wuxanceg3euqtwdjqd.onion:18333 +ohqcfz5kk6ufouxmhtq7nxyo2lyui4vjlhr2kftvra2ewgzxu3hsrxad.onion:18333 +oobwtn5csi4auevb2ns2b5rrjnxmhlzdmay4zxtzvkj7tayrgwfddiqd.onion:18333 +ppe2pepzphox3swftj5lbyi7ckigspbih5qnyuhrb3r6bn3g7k7bp4qd.onion:18333 +pqkhkpkvqmjcql5jccyxg5nahow6vixnjrvtsc6clnk7dab4weknvpqd.onion:18333 +q5qox756id5nfdu6ht4dghc35jezls4bgjcdnrds3pwndvdx32zmwlad.onion:18333 +qiep4hvuovedbbc36hl7nwslwi6ah6uw4nnseyjdtc73cc5rfdauvnad.onion:18333 +qzx5f2ig2rk2ssrbopz2zlljq5mkeh3izhhx3t3cepse5qnhvpo2tzid.onion:18333 +rfi2hdpjhhknalltbwdvyuhskh5yjs66rqzpy6ley7xtu4kvbeob6fqd.onion:18333 +rw6reu6rdetz6rnpzoyn2hfy7sxpbja4v5ktmaicqqgszi2eata5lhqd.onion:18333 +s3bxrurro4bmvsmntw74qf4vw3xl25xtnvqegayvlwj3b6t7d76kkwid.onion:18333 +slpigm5ep4zan3a65bybne67phjiyesbuk5s3bodefuhnx2cfdtit6qd.onion:18333 +sxm6kwrdp6f2ggaozhrl47xuy3es3sgm3ivppmh4xm3hfmetvwbyrcad.onion:18333 +t6hfkkujktjyzpepmphskoaivflu6fieyuxrshxfzwriwvoa2uccvvqd.onion:18333 +ueyykmnyqk2bnmbgvmqrb4jfbjvpgeew6cuq4gaqe7v2oiyxaubkx4qd.onion:18333 +urhagmjceyqbzhjitpa7j7mygivxw3wlwqzkibw6zezrxeantkikgcyd.onion:18333 vctlwaqgmu53eutz2hewuakcipfgtyljsd7czut4dd62xr3rp6fqezad.onion:18333 -vf5ur53tzmdtotvkndcgochklnuav7quqjvkc6mctqfvef6wnmn26mid.onion:18333 -wnxgjgjgplv5iu4mssyuunycvku4qnqr5t4q6cfdt47k7uwrfifuirad.onion:18333 -wpkbkdr7clw7zk3jkwiult6bf422j54u77ml4rgig2xq7icogyrcspid.onion:18333 -wzpdt24tdark26eugredddorik3tqwcj5ialtt2yim4ceiuiq7phkyqd.onion:18333 -xgapnikkbldoggjh5ewxkyauhuwnvf3xkspxroe3ojvfrk4lswkyx5yd.onion:18333 -xkvzdhcirontixbq6pjhru57bf4sgtqylvphk25csfrsy5p5ay3oc3yd.onion:18333 -xnipauenw5wnjb2zbx6v6umgvbb3g6xhf5kjo7pnyn5tdzvzaxtzicid.onion:18333 +vi3z4khdvopuiljdjdhpetnxztuzsct2aacuzcm5ba27h4j3cfwsvjad.onion:18333 +vqnkdmpmecc5kondj32jwbemmruhmd5gkmfngkscetibzozryp4elkad.onion:18333 +wgc4wp25gtnb54vd7x5h2xtetzrdoiizeyyh6fv3vxzp3bbalejbd3ad.onion:18333 +wpsahjbejxehpz772kzxonj777pejol2akcicduqov2r7ktm2b6l5pid.onion:18333 +wui5m2y5b7cms36ai6shzyqsg6qteejwmxsf26nyms6vcykxbvmh4uad.onion:18333 +xafcyh6mxwebvcsgw4wcbuw7n4v7vbqhcznhwqcpqcu6dww2mjuw4nad.onion:18333 +y5h652jz6sgmb4bkcfnfxnj24gnczqf7lhd5lqbvdhf5mpll4gye5kid.onion:18333 +ya6s7ov7myixz3ql23u45hty7moxo3r4d26qainw55z656vtau676xid.onion:18333 yda7kwpii33j2qpq32ftf6lp22znknswipjwaccvsqj7l337jvfesnid.onion:18333 -z3j5foswuhpmtrg3kb56stkzmuoaesvd5jz3eztq46c4cidapglcyuad.onion:18333 -zcep44k7unwjm2wxty4ijh2e4fv5zgbrvwlctzyaqnrqhltjfzrtodad.onion:18333 +zcsn3j6aswnrf56xj2n5jn4tlwmyoq4benjn5ujcgz46co2y5tm642id.onion:18333 +zefnna2a3ga4ez2nutvypma7my35prw3ycinbqwva7v4pf3aurqhjcyd.onion:18333 +zhiju2obxifqpjbcm6xtlgjdbof7jhoctvw3x57vhiftstb5hi3gmsqd.onion:18333 +zkqddzui5pkrqvjj2zwsf5kln7stlbmw5pmn6ut46fobvzyv2sn2ryid.onion:18333 zmvizz7fd5hdue6wt3lwqumd6qwt4ijymmmotfzh75curq3mzjm53hyd.onion:18333 -zoaa3x7quyuijggii5zl4uyeioodudsgtr2uyv2qtdsslac5ukiwlxid.onion:18333 -zovauxlorl5eswumbsoxv2m5y3sm3qlk7657dcpr2uld7xf35en46sqd.onion:18333 +zmxlrzoxg4fmso6l2xuq5tdxmlyakdqellzujh3a23iuzg4zlatnogqd.onion:18333 +zsmxmusdzrcqusk5h6syfq6a3ph6lwx3wpiltun4dmkrt3pa2fp7qaid.onion:18333 diff --git a/contrib/seeds/nodes_testnet4.txt b/contrib/seeds/nodes_testnet4.txt new file mode 100644 index 0000000000..98608b29d5 --- /dev/null +++ b/contrib/seeds/nodes_testnet4.txt @@ -0,0 +1,151 @@ +[fc10:efa7:ca6:1548:f8c:6bb9:1cc4:63ae]:48333 +[fc1f:22c3:95dc:a3af:4a93:8251:beb9:1858]:48333 +[fc32:2c16:d0d0:f1fb:3b27:c187:8cb5:9201]:48333 +[fccb:248:11a6:1042:bca:1218:f7ce:7d3d]:48333 +7rn2pojst5aurdaes2qcwiigis55ewzjjhxfbxnua5calwuigxdq.b32.i2p:0 +a7jpzmbtvn5qgvnxez2zc4nvabso4xmllbrqmuoavxz537ttbdtq.b32.i2p:0 +augssnqnvo2w66vbrfzctc5rnhaxe3io7wnkvr5xp6wwkxmrggra.b32.i2p:0 +axxwcwzqlw42hjbpzupvffvdsjvniyt5apyt53sdxijqy6y6pdha.b32.i2p:0 +nl2qej33ywfqllz3exxce5jxmz35cnovhh6qobwvfc7igm2vdz2q.b32.i2p:0 +q376dmbdqpt4qgwf6za2ai7c4fs3va5tdmtb3ag6awk6wnv4mqcq.b32.i2p:0 +rdpe5wgl565yvgeialkhlf53akawdm7npy6bl7asl2ncntoyn7la.b32.i2p:0 +2.59.134.244:48333 # AS58212 +3.235.188.91:48333 # AS14618 +3.250.145.197:48333 # AS16509 +5.182.4.106:48333 # AS49505 +18.175.220.215:48333 # AS8987 +18.189.156.102:48333 # AS8987 +34.232.31.111:48333 # AS14618 +38.242.219.220:48333 # AS51167 +45.94.168.5:48333 # AS400810 +45.142.17.140:48333 # AS206238 +50.126.96.22:48333 # AS27017 +51.79.29.216:48333 # AS16276 +51.81.245.218:48333 # AS16276 +54.78.90.72:48333 # AS16509 +65.108.39.171:48333 # AS24940 +66.94.123.141:48333 # AS40021 +77.247.127.71:48333 # AS62240 +78.24.181.215:48333 # AS49505 +82.67.102.15:48333 # AS12322 +89.117.152.94:48333 # AS46475 +103.99.168.207:48333 # AS54415 +103.99.168.211:48333 # AS54415 +103.165.192.203:48333 # AS142052 +103.165.192.206:48333 # AS142052 +134.195.88.56:48333 # AS63473 +135.180.99.74:48333 # AS1299 +138.197.188.212:48333 # AS14061 +148.51.196.40:48333 # AS12025 +158.220.90.103:48333 # AS51167 +168.119.150.247:48333 # AS24940 +172.234.197.251:48333 # AS63949 +175.45.182.145:48333 # AS133159 +185.232.70.226:48333 # AS197540 +185.254.97.76:48333 # AS58212 +192.145.44.30:48333 # AS197540 +192.241.131.95:48333 # AS14061 +193.107.109.220:48333 # AS214379 +199.119.138.36:48333 # AS216382 +199.195.248.11:48333 # AS53667 +203.132.94.196:48333 # AS38195 +208.68.4.71:48333 # AS397444 +209.146.51.202:48333 # AS174 +209.146.51.203:48333 # AS174 +[2001:41d0:a:555c::1]:48333 # AS16276 +[2001:5a8:4164:7a00::506]:48333 # AS7065 +[2001:df6:7280::92:202]:48333 # AS142052 +[2001:df6:7280::92:203]:48333 # AS142052 +[2001:df6:7280::92:204]:48333 # AS142052 +[2001:df6:7280::92:205]:48333 # AS142052 +[2001:df6:7280::92:207]:48333 # AS142052 +[2001:df6:7280::92:208]:48333 # AS142052 +[2001:df6:7280::92:209]:48333 # AS142052 +[2001:df6:7280::92:210]:48333 # AS142052 +[2001:df6:7280::92:211]:48333 # AS142052 +[2001:df6:7280::92:212]:48333 # AS142052 +[2401:b140:4::92:202]:48333 # AS54415 +[2401:b140:4::92:204]:48333 # AS54415 +[2401:b140:4::92:205]:48333 # AS54415 +[2401:b140:4::92:206]:48333 # AS54415 +[2401:b140:4::92:207]:48333 # AS54415 +[2401:b140:4::92:208]:48333 # AS54415 +[2401:b140:4::92:209]:48333 # AS54415 +[2401:b140:4::92:210]:48333 # AS54415 +[2401:b140:4::92:211]:48333 # AS54415 +[2401:b140::92:204]:48333 # AS54415 +[2405:1204:c235:9700:605f:5035:d51b:b05b]:48333 # AS9824 +[2405:1204:c235:9700:9141:402c:de91:81c0]:48333 # AS9824 +[2405:1204:c235:9700::6c]:48333 # AS9824 +[2600:3c00::f03c:91ff:fe5b:4cf3]:48333 # AS63949 +[2602:ffb6:4:8185:f816:3eff:fe4a:acbf]:48333 # AS174 +[2602:ffb6:4:8185:f816:3eff:fe4d:6dae]:48333 # AS174 +[2602:ffb6:4:8185:f816:3eff:fe50:b078]:48333 # AS174 +[2602:ffb6:4:8185:f816:3eff:fe8a:3155]:48333 # AS174 +[2604:2dc0:200:13da::]:48333 # AS16276 +[2605:3380:422e:1::50]:48333 # AS397444 +[2605:a141:2240:4224::1]:48333 # AS51167 +[2607:5300:205:300::1b0]:48333 # AS16276 +[2607:5300:60:7f72::1]:48333 # AS16276 +[2620:6e:a0a0:1::71]:48333 # AS397444 +[2a01:4f8:172:33c1::2]:48333 # AS24940 +[2a01:4f8:2190:1692::2]:48333 # AS24940 +[2a01:4f8:262:139f::2]:48333 # AS24940 +[2a01:4f9:3080:3496::2]:48333 # AS24940 +[2a01:e0a:e6e:6bb0:2e0:4cff:fe68:232]:48333 # AS12322 +[2a02:c202:2234:7688::1]:48333 # AS51167 +[2a03:4000:42:22f:816:bbff:fe4c:d4a1]:48333 # AS197540 +[2a0a:8dc0:a000:40::2]:48333 # AS62240 +[2a0a:8dc0:a041::a]:48333 # AS62240 +[2a0c:b641:6f1:8c::2]:48333 # AS214379 +2sltzrq7ts5t4il5nimp75og2jksbwdjmgbdykz5ljeoqrxemzlakeyd.onion:48333 +4uzerod2wrqtjuaea6vr43uddq2sg3cgfuk4khqotqsqdsxpwdmcphqd.onion:48333 +57k43lgf2ciorl7gfz6qu3yo27zdkojd7lbzrwzcbksq3uujts5h6uid.onion:48333 +5fkz5ijh76cgfwvxz4pyl4br4hekqflijz7d467ldey3xme2trqrgjad.onion:48333 +5p6eqvrins6vj7q3tpdljhtomu6nqameilbuz5sjnu2i333ve2zpnhqd.onion:48333 +5sdzs2qu3ygb44jwo45y2kmbnqc6ijzpndaqn43zgngsiwq7mx6b7yyd.onion:48333 +6g6dwtby74ic2ggnzkbfqy7saslopho7or6z4uad737c2tq24fj3ltyd.onion:48333 +6po3e27t4nxgls3mwnostpy47crhtc3ae6fcsn4yyfh5dfcaq3q3q3yd.onion:48333 +7gcsfynynr26cya4uf2u74bx47jmzaidikh6lqo7nu5uwy7bra3roqyd.onion:48333 +7jd422hqevrz334ax3fh77wzww7clnr4kpyos25oe64nifg623bjqfqd.onion:48333 +7kwh7rg3a4e5lgjvybesixzhwzxvf6dqo3gc4h7k5vilwmdjvtzidtid.onion:48333 +7slxjz7hmpu6rpybl62egedth5c4zo6mwzm4sdbvqtwc5zikvx4e53id.onion:48333 +7xr2k6gg47calskl3emvqav42jf6l4dtgiwevy2vx7gej6d2osh4oiyd.onion:48333 +a6yijgwn4vtmmhl7uybtbuyvtl7mtj7arld5f4csqsx4syeii4gt3vqd.onion:48333 +aqabn424rm7qq5faw2ecckkzxfdw57oncivjrurrrn5wgjdqjqxvxjad.onion:48333 +c2u7kz2pv7vyufovwndoureyqijbd7kwpy7anulf4fxt3d3buf2yk2yd.onion:48333 +clqr2to2r6fn4jo6f7xy3dppxgn4ewvnmwbxsdrrhnesyacmw5noaeqd.onion:48333 +dnshzxr6osjf2l5gjsbattjtoefgkzmd3p3fdyatr5ltz243zspsilyd.onion:48333 +ebhtfcmjhilcqtuls437pxu65dznqkpt5qv3yeq6zipnqd7ichz5htyd.onion:48333 +ej4ozb3o5pzvvtvgaars5obzwvhrfs3chkmvb5pxmedykd4bgh6cpgyd.onion:48333 +ezbq3ydfxmgvgbbn7mrx5jzyig6tz2zjkaqdtkx7avnijrt5riv4j5yd.onion:48333 +fsijrllgzgeg4pa5ebq4qy3swmplxkzvuvji5swt36quy42dznq3t3ad.onion:48333 +fvbppnodd4dlxulzlvhikg2ijtnxemcjjpfhcg2rropun45aqhp5noid.onion:48333 +fwsrcrhnggi3qy5rsfiad3cwep3bf7uovcupgockbntjcfvoqxzr75id.onion:48333 +gc66muikqqzxwj2tdvvap6gpcbitthjvscawgkclim4vgmajrccjtmqd.onion:48333 +gujxforhwszry5falvnarfcyajjxxsuvqevx6gk6meou5ordrxw3mdad.onion:48333 +havkohvjhg5tglbdecf4ufhz5es3f33ctj3b6loebj4pi6qrtjemfbyd.onion:48333 +hb44egze5hjbi3n2rc6w4pwahr6zltc4ilfzin3kkdi2rmozvxlo65qd.onion:48333 +i22efh4itlcfthvaavcz2rvigu4x6jqvlwuksz44bukslhg76bsgrxqd.onion:48333 +i63l2yfy5e4kvm5c6la67qxpq6zn4xbdx6cdm474milv4dameu3z35qd.onion:48333 +irwyrdkcrcdgwtsltcrqexqylwc3ezjhhra7u4i3gkwktezcut36buqd.onion:48333 +jfyjcgithmk6fmndgg5kljttu5ctlokcvqjvsrxrxvnevhwx57xhpsqd.onion:48333 +kf6q2wza2ebo7cxln5ejcjjwvrew4vb2hf4vd5wo4nyzbnjv3yccduqd.onion:48333 +ko55e2ityiaqeckthmnnbcv6bbwll7rtdiv527muoqdpg4hye2it2pyd.onion:48333 +mavvwxts5f3axuz4cyjqpz75veijkdkdueavekb5hia67zk257eg7tqd.onion:48333 +mdiwdijucocysdvx5dk2iyo5wsav3ehyiggegzfk3ezfcce6nstp4nid.onion:48333 +nbq63hx63psrcqv26uadmcxkeap76un2xaombe4ivojkt3ysbgountid.onion:48333 +ns56enpcbigc2dovrj3agdbgudebmwtg43d27wtpvm5nwomectn2kmad.onion:48333 +ol5rcztxxugtup5mswhkt6hdf4pvcidimy3du6owufnja5lr3czk2zyd.onion:48333 +prilx36yi6wiz4ll77tapskzwzh5onphrnn6w5d56zrzdat4kjo3q3yd.onion:48333 +qmd5qvyhnanqj6wyf4klrvfqoypuz6xjajhx2n272vr5il7nlwyoosqd.onion:48333 +qmw73e4zh2i6pvmlgx5642vwtynibghgvjdoox574hjxxv7fvd2oxyid.onion:48333 +rah46hr3opyfbikrkub6g23idrml2ugmealjt4bcxlj6nonoxdqp4jqd.onion:48333 +riyvgzynuzj2vx2az6a7kvca5bythmj6rgb4asrecdw6vfmvt33uxqid.onion:48333 +rv7l5gtjqr5n5nlersakfuzwhfflyfizv5cmtiizlsn544qumvuekwqd.onion:48333 +vfqxysj7olxstghkohezoembjnsyvpp2ph7kc4jaatvszyx2ajz627ad.onion:48333 +we5rsalvz6fhp3345jydracg6wytxw5smsxzgusljvgcojadyfv2bzyd.onion:48333 +wkvaxtftpwmmvrptqavx6mwhrcwiecbodtshuenvot3cjgxsycuurcid.onion:48333 +x66at4pel4ody42wujl4upr2tbulbpn54nzvrk7gomzv4dwkhazfjdqd.onion:48333 +zjttaesjhj7ail437ag4emdufr775h5rtgoohlbca5rwc4re6dr5k7ad.onion:48333 +zmd4eq6svwn3qgm56dyodktagzi3xo4smxebgjdk2jbjkbmvn7gjm5qd.onion:48333 diff --git a/contrib/signet/README.md b/contrib/signet/README.md index 706b296c54..4994798571 100644 --- a/contrib/signet/README.md +++ b/contrib/signet/README.md @@ -23,9 +23,8 @@ miner You will first need to pick a difficulty target. Since signet chains are primarily protected by a signature rather than proof of work, there is no need to spend as much energy as possible mining, however you may wish to choose to spend more time than the absolute minimum. The calibrate subcommand can be used to pick a target appropriate for your hardware, eg: - cd src/ - MINER="../contrib/signet/miner" - GRIND="./bitcoin-util grind" + MINER="./contrib/signet/miner" + GRIND="./build/bin/bitcoin-util grind" $MINER calibrate --grind-cmd="$GRIND" nbits=1e00f403 for 25s average mining time @@ -33,7 +32,7 @@ It defaults to estimating an nbits value resulting in 25s average time to find a To mine the first block in your custom chain, you can run: - CLI="./bitcoin-cli -conf=mysignet.conf" + CLI="./build/bin/bitcoin-cli -conf=mysignet.conf" ADDR=$($CLI -signet getnewaddress) NBITS=1e00f403 $MINER --cli="$CLI" generate --grind-cmd="$GRIND" --address="$ADDR" --nbits=$NBITS @@ -81,3 +80,4 @@ These steps can instead be done explicitly: This is intended to allow you to replace part of the pipeline for further experimentation (eg, to sign the block with a hardware wallet). +For custom signets with a trivial challenge such as `OP_TRUE` and `OP_2` the walletprocesspsbt step can be skipped. diff --git a/contrib/signet/getcoins.py b/contrib/signet/getcoins.py index 19751ae269..75430e5b1a 100755 --- a/contrib/signet/getcoins.py +++ b/contrib/signet/getcoins.py @@ -152,7 +152,7 @@ def bitcoin_cli(rpc_command_and_params): elif res.status_code == 404: print('The specified faucet URL does not exist. Please check for any server issues/typo.') elif res.status_code == 429: - print('The script does not allow for repeated transactions as the global faucet is rate-limitied to 1 request/IP/day. You can access the faucet website to get more coins manually') + print('The script does not allow for repeated transactions as the global faucet is rate-limited to 1 request/IP/day. You can access the faucet website to get more coins manually') else: print(f'Returned Error Code {res.status_code}\n{res.text}\n') print('Please check the provided arguments for their validity and/or any possible typo.') diff --git a/contrib/signet/miner b/contrib/signet/miner index 61d9f62be7..b9a01080f1 100755 --- a/contrib/signet/miner +++ b/contrib/signet/miner @@ -9,7 +9,7 @@ import logging import math import os import re -import struct +import shlex import sys import time import subprocess @@ -18,25 +18,18 @@ PATH_BASE_CONTRIB_SIGNET = os.path.abspath(os.path.dirname(os.path.realpath(__fi PATH_BASE_TEST_FUNCTIONAL = os.path.abspath(os.path.join(PATH_BASE_CONTRIB_SIGNET, "..", "..", "test", "functional")) sys.path.insert(0, PATH_BASE_TEST_FUNCTIONAL) -from test_framework.blocktools import get_witness_script, script_BIP34_coinbase_height # noqa: E402 -from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, from_binary, from_hex, ser_string, ser_uint256, tx_from_hex # noqa: E402 +from test_framework.blocktools import get_witness_script, script_BIP34_coinbase_height, SIGNET_HEADER # noqa: E402 +from test_framework.messages import CBlock, CBlockHeader, COutPoint, CTransaction, CTxIn, CTxInWitness, CTxOut, from_binary, from_hex, ser_string, ser_uint256, tx_from_hex, MAX_SEQUENCE_NONFINAL # noqa: E402 from test_framework.psbt import PSBT, PSBTMap, PSBT_GLOBAL_UNSIGNED_TX, PSBT_IN_FINAL_SCRIPTSIG, PSBT_IN_FINAL_SCRIPTWITNESS, PSBT_IN_NON_WITNESS_UTXO, PSBT_IN_SIGHASH_TYPE # noqa: E402 -from test_framework.script import CScriptOp # noqa: E402 +from test_framework.script import CScript, CScriptOp # noqa: E402 logging.basicConfig( format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO, datefmt='%Y-%m-%d %H:%M:%S') -SIGNET_HEADER = b"\xec\xc7\xda\xa2" PSBT_SIGNET_BLOCK = b"\xfc\x06signetb" # proprietary PSBT global field holding the block being signed -RE_MULTIMINER = re.compile("^(\d+)(-(\d+))?/(\d+)$") - -def create_coinbase(height, value, spk): - cb = CTransaction() - cb.vin = [CTxIn(COutPoint(0, 0xffffffff), script_BIP34_coinbase_height(height), 0xffffffff)] - cb.vout = [CTxOut(value, spk)] - return cb +RE_MULTIMINER = re.compile(r"^(\d+)(-(\d+))?/(\d+)$") def signet_txs(block, challenge): # assumes signet solution has not been added yet so does not need @@ -52,69 +45,71 @@ def signet_txs(block, challenge): mroot = block.get_merkle_root(hashes) sd = b"" - sd += struct.pack(" 0: + self.action_time += self.standby_delay + elif is_first_block: + # for non-standby, always mine immediately on startup, + # even if the next block shouldn't be ours + self.action_time = now + + # don't want fractional times so round down + self.mine_time = int(self.mine_time) + self.action_time = int(self.action_time) - this_interval = avg_interval * this_interval_variance - this_interval = max(1, min(this_interval, max_interval)) + # can't mine a block 2h in the future; 1h55m for some safety + self.action_time = max(self.action_time, self.mine_time - 6900) - return this_interval + def gbt(self, bcli, bestblockhash, now): + tmpl = json.loads(bcli("getblocktemplate", '{"rules":["signet","segwit"]}')) + if tmpl["previousblockhash"] != bestblockhash: + logging.warning("GBT based off unexpected block (%s not %s), retrying", tmpl["previousblockhash"], bci["bestblockhash"]) + time.sleep(1) + return None -def next_block_is_mine(last_hash, my_blocks): - det_rand = int(last_hash[-16:-8], 16) - return my_blocks[0] <= (det_rand % my_blocks[2]) < my_blocks[1] + if tmpl["mintime"] > self.mine_time: + logging.info("Updating block time from %d to %d", self.mine_time, tmpl["mintime"]) + self.mine_time = tmpl["mintime"] + if self.mine_time > now: + logging.error("GBT mintime is in the future: %d is %d seconds later than %d", self.mine_time, (self.mine_time-now), now) + return None + + return tmpl + + def mine(self, bcli, grind_cmd, tmpl, reward_spk): + block = new_block(tmpl, reward_spk, blocktime=self.mine_time, poolid=self.poolid) + + signet_spk = tmpl["signet_challenge"] + if trivial_challenge(signet_spk): + signet_solution = None + else: + psbt = generate_psbt(block, signet_spk) + input_stream = os.linesep.join([psbt, "true", "ALL"]).encode('utf8') + psbt_signed = json.loads(bcli("-stdin", "walletprocesspsbt", input=input_stream)) + if not psbt_signed.get("complete",False): + logging.debug("Generated PSBT: %s" % (psbt,)) + sys.stderr.write("PSBT signing failed\n") + return None + psbt = decode_challenge_psbt(psbt_signed["psbt"]) + signet_solution = get_solution_from_psbt(psbt) + + return finish_block(block, signet_solution, grind_cmd) def do_generate(args): - if args.max_blocks is not None: - if args.ongoing: - logging.error("Cannot specify both --ongoing and --max-blocks") - return 1 + if args.set_block_time is not None: + max_blocks = 1 + elif args.max_blocks is not None: if args.max_blocks < 1: - logging.error("N must be a positive integer") + logging.error("--max_blocks must specify a positive integer") return 1 max_blocks = args.max_blocks elif args.ongoing: @@ -270,17 +384,11 @@ def do_generate(args): else: max_blocks = 1 - if args.set_block_time is not None and max_blocks != 1: - logging.error("Cannot specify --ongoing or --max-blocks > 1 when using --set-block-time") - return 1 if args.set_block_time is not None and args.set_block_time < 0: args.set_block_time = time.time() logging.info("Treating negative block time as current time (%d)" % (args.set_block_time)) if args.min_nbits: - if args.nbits is not None: - logging.error("Cannot specify --nbits and --min-nbits") - return 1 args.nbits = "1e0377ae" logging.info("Using nbits=%s" % (args.nbits)) @@ -312,8 +420,13 @@ def do_generate(args): logging.error("--max-interval must be at least 960 (16 minutes)") return 1 + poolid = get_poolid(args) + ultimate_target = nbits_to_target(int(args.nbits,16)) + gen = Generate(multiminer=my_blocks, ultimate_target=ultimate_target, poisson=args.poisson, max_interval=args.max_interval, + standby_delay=args.standby_delay, backup_delay=args.backup_delay, set_block_time=args.set_block_time, poolid=poolid) + mined_blocks = 0 bestheader = {"hash": None} lastheader = None @@ -328,104 +441,55 @@ def do_generate(args): if lastheader is None: lastheader = bestheader["hash"] elif bestheader["hash"] != lastheader: - next_delta = next_block_delta(int(bestheader["bits"], 16), bestheader["hash"], ultimate_target, args.poisson, args.max_interval) + next_delta = gen.next_block_delta(int(bestheader["bits"], 16), bestheader["hash"]) next_delta += bestheader["time"] - time.time() - next_is_mine = next_block_is_mine(bestheader["hash"], my_blocks) + next_is_mine = gen.next_block_is_mine(bestheader["hash"]) logging.info("Received new block at height %d; next in %s (%s)", bestheader["height"], seconds_to_hms(next_delta), ("mine" if next_is_mine else "backup")) lastheader = bestheader["hash"] # when is the next block due to be mined? now = time.time() - if args.set_block_time is not None: - logging.debug("Setting start time to %d", args.set_block_time) - mine_time = args.set_block_time - action_time = now - is_mine = True - elif bestheader["height"] == 0: - time_delta = next_block_delta(int(bestheader["bits"], 16), bci["bestblockhash"], ultimate_target, args.poisson, args.max_interval) - time_delta *= 100 # 100 blocks - logging.info("Backdating time for first block to %d minutes ago" % (time_delta/60)) - mine_time = now - time_delta - action_time = now - is_mine = True - else: - time_delta = next_block_delta(int(bestheader["bits"], 16), bci["bestblockhash"], ultimate_target, args.poisson, args.max_interval) - mine_time = bestheader["time"] + time_delta - - is_mine = next_block_is_mine(bci["bestblockhash"], my_blocks) - - action_time = mine_time - if not is_mine: - action_time += args.backup_delay - - if args.standby_delay > 0: - action_time += args.standby_delay - elif mined_blocks == 0: - # for non-standby, always mine immediately on startup, - # even if the next block shouldn't be ours - action_time = now - - # don't want fractional times so round down - mine_time = int(mine_time) - action_time = int(action_time) - - # can't mine a block 2h in the future; 1h55m for some safety - action_time = max(action_time, mine_time - 6900) + gen.next_block_time(now, bestheader, (mined_blocks == 0)) # ready to go? otherwise sleep and check for new block - if now < action_time: - sleep_for = min(action_time - now, 60) - if mine_time < now: + if now < gen.action_time: + sleep_for = min(gen.action_time - now, 60) + if gen.mine_time < now: # someone else might have mined the block, # so check frequently, so we don't end up late # mining the next block if it's ours sleep_for = min(20, sleep_for) - minestr = "mine" if is_mine else "backup" - logging.debug("Sleeping for %s, next block due in %s (%s)" % (seconds_to_hms(sleep_for), seconds_to_hms(mine_time - now), minestr)) + minestr = "mine" if gen.is_mine else "backup" + logging.debug("Sleeping for %s, next block due in %s (%s)" % (seconds_to_hms(sleep_for), seconds_to_hms(gen.mine_time - now), minestr)) time.sleep(sleep_for) continue # gbt - tmpl = json.loads(args.bcli("getblocktemplate", '{"rules":["signet","segwit"]}')) - if tmpl["previousblockhash"] != bci["bestblockhash"]: - logging.warning("GBT based off unexpected block (%s not %s), retrying", tmpl["previousblockhash"], bci["bestblockhash"]) - time.sleep(1) + tmpl = gen.gbt(args.bcli, bci["bestblockhash"], now) + if tmpl is None: continue logging.debug("GBT template: %s", tmpl) - if tmpl["mintime"] > mine_time: - logging.info("Updating block time from %d to %d", mine_time, tmpl["mintime"]) - mine_time = tmpl["mintime"] - if mine_time > now: - logging.error("GBT mintime is in the future: %d is %d seconds later than %d", mine_time, (mine_time-now), now) - return 1 - # address for reward reward_addr, reward_spk = get_reward_addr_spk(args, tmpl["height"]) # mine block - logging.debug("Mining block delta=%s start=%s mine=%s", seconds_to_hms(mine_time-bestheader["time"]), mine_time, is_mine) + logging.debug("Mining block delta=%s start=%s mine=%s", seconds_to_hms(gen.mine_time-bestheader["time"]), gen.mine_time, gen.is_mine) mined_blocks += 1 - psbt = generate_psbt(tmpl, reward_spk, blocktime=mine_time) - input_stream = os.linesep.join([psbt, "true", "ALL"]).encode('utf8') - psbt_signed = json.loads(args.bcli("-stdin", "walletprocesspsbt", input=input_stream)) - if not psbt_signed.get("complete",False): - logging.debug("Generated PSBT: %s" % (psbt,)) - sys.stderr.write("PSBT signing failed\n") + block = gen.mine(args.bcli, args.grind_cmd, tmpl, reward_spk) + if block is None: return 1 - block, signet_solution = do_decode_psbt(psbt_signed["psbt"]) - block = finish_block(block, signet_solution, args.grind_cmd) # submit block r = args.bcli("-stdin", "submitblock", input=block.serialize().hex().encode('utf8')) # report - bstr = "block" if is_mine else "backup block" + bstr = "block" if gen.is_mine else "backup block" - next_delta = next_block_delta(block.nBits, block.hash, ultimate_target, args.poisson, args.max_interval) + next_delta = gen.next_block_delta(block.nBits, block.hash) next_delta += block.nTime - time.time() - next_is_mine = next_block_is_mine(block.hash, my_blocks) + next_is_mine = gen.next_block_is_mine(block.hash) logging.debug("Block hash %s payout to %s", block.hash, reward_addr) logging.info("Mined %s at height %d; next in %s (%s)", bstr, tmpl["height"], seconds_to_hms(next_delta), ("mine" if next_is_mine else "backup")) @@ -454,7 +518,7 @@ def do_calibrate(args): header.nTime = i header.nNonce = 0 headhex = header.serialize().hex() - cmd = args.grind_cmd.split(" ") + [headhex] + cmd = shlex.split(args.grind_cmd) + [headhex] newheadhex = subprocess.run(cmd, stdout=subprocess.PIPE, input=b"", check=True).stdout.strip() avg = (time.time() - start) * 1.0 / TRIALS @@ -492,11 +556,13 @@ def main(): generate = cmds.add_parser("generate", help="Mine blocks") generate.set_defaults(fn=do_generate) - generate.add_argument("--ongoing", action="store_true", help="Keep mining blocks") - generate.add_argument("--max-blocks", default=None, type=int, help="Max blocks to mine (default=1)") - generate.add_argument("--set-block-time", default=None, type=int, help="Set block time (unix timestamp)") - generate.add_argument("--nbits", default=None, type=str, help="Target nBits (specify difficulty)") - generate.add_argument("--min-nbits", action="store_true", help="Target minimum nBits (use min difficulty)") + howmany = generate.add_mutually_exclusive_group() + howmany.add_argument("--ongoing", action="store_true", help="Keep mining blocks") + howmany.add_argument("--max-blocks", default=None, type=int, help="Max blocks to mine (default=1)") + howmany.add_argument("--set-block-time", default=None, type=int, help="Set block time (unix timestamp); implies --max-blocks=1") + nbit_target = generate.add_mutually_exclusive_group() + nbit_target.add_argument("--nbits", default=None, type=str, help="Target nBits (specify difficulty)") + nbit_target.add_argument("--min-nbits", action="store_true", help="Target minimum nBits (use min difficulty)") generate.add_argument("--poisson", action="store_true", help="Simulate randomised block times") generate.add_argument("--multiminer", default=None, type=str, help="Specify which set of blocks to mine (eg: 1-40/100 for the first 40%%, 2/3 for the second 3rd)") generate.add_argument("--backup-delay", default=300, type=int, help="Seconds to delay before mining blocks reserved for other miners (default=300)") @@ -505,27 +571,26 @@ def main(): calibrate = cmds.add_parser("calibrate", help="Calibrate difficulty") calibrate.set_defaults(fn=do_calibrate) - calibrate.add_argument("--nbits", type=str, default=None) - calibrate.add_argument("--seconds", type=int, default=None) + calibrate_by = calibrate.add_mutually_exclusive_group() + calibrate_by.add_argument("--nbits", type=str, default=None) + calibrate_by.add_argument("--seconds", type=int, default=None) for sp in [genpsbt, generate]: - sp.add_argument("--address", default=None, type=str, help="Address for block reward payment") - sp.add_argument("--descriptor", default=None, type=str, help="Descriptor for block reward payment") + payto = sp.add_mutually_exclusive_group(required=True) + payto.add_argument("--address", default=None, type=str, help="Address for block reward payment") + payto.add_argument("--descriptor", default=None, type=str, help="Descriptor for block reward payment") + pool = sp.add_mutually_exclusive_group() + pool.add_argument("--poolnum", default=None, type=int, help="Identify blocks that you mine") + pool.add_argument("--poolid", default=None, type=str, help="Identify blocks that you mine (eg: /signet:1/)") for sp in [solvepsbt, generate, calibrate]: sp.add_argument("--grind-cmd", default=None, type=str, required=(sp==calibrate), help="Command to grind a block header for proof-of-work") args = parser.parse_args(sys.argv[1:]) - args.bcli = lambda *a, input=b"", **kwargs: bitcoin_cli(args.cli.split(" "), list(a), input=input, **kwargs) + args.bcli = lambda *a, input=b"", **kwargs: bitcoin_cli(shlex.split(args.cli), list(a), input=input, **kwargs) if hasattr(args, "address") and hasattr(args, "descriptor"): - if args.address is None and args.descriptor is None: - sys.stderr.write("Must specify --address or --descriptor\n") - return 1 - elif args.address is not None and args.descriptor is not None: - sys.stderr.write("Only specify one of --address or --descriptor\n") - return 1 args.derived_addresses = {} if args.debug: diff --git a/contrib/tracing/README.md b/contrib/tracing/README.md index 206bec1647..252053e7b8 100644 --- a/contrib/tracing/README.md +++ b/contrib/tracing/README.md @@ -82,7 +82,7 @@ about the connection. Peers can be selected individually to view recent P2P messages. ``` -$ python3 contrib/tracing/p2p_monitor.py ./src/bitcoind +$ python3 contrib/tracing/p2p_monitor.py $(pidof bitcoind) ``` Lists selectable peers and traffic and connection information. @@ -150,12 +150,12 @@ lost. BCC prints: `Possibly lost 2 samples` on lost messages. ``` -$ python3 contrib/tracing/log_raw_p2p_msgs.py ./src/bitcoind +$ python3 contrib/tracing/log_raw_p2p_msgs.py $(pidof bitcoind) ``` ``` Logging raw P2P messages. -Messages larger that about 32kb will be cut off! +Messages larger than about 32kb will be cut off! Some messages might be lost! outbound msg 'inv' from peer 4 (outbound-full-relay, XX.XXX.XX.4:8333) with 253 bytes: 0705000000be2245c8f844c9f763748e1a7… … @@ -188,7 +188,7 @@ In a different terminal, starting Bitcoin Core in SigNet mode and with re-indexing enabled. ``` -$ ./src/bitcoind -signet -reindex +$ ./build/bin/bitcoind -signet -reindex ``` This produces the following output. @@ -241,7 +241,7 @@ A BCC Python script to log the UTXO cache flushes. Based on the `utxocache:flush` tracepoint. ```bash -$ python3 contrib/tracing/log_utxocache_flush.py ./src/bitcoind +$ python3 contrib/tracing/log_utxocache_flush.py $(pidof bitcoind) ``` ``` @@ -300,7 +300,7 @@ comprising a timestamp along with all event data available via the event's tracepoint. ```console -$ python3 contrib/tracing/mempool_monitor.py ./src/bitcoind +$ python3 contrib/tracing/mempool_monitor.py $(pidof bitcoind) ``` ``` @@ -335,4 +335,25 @@ $ python3 contrib/tracing/mempool_monitor.py ./src/bitcoind │ 13:10:32Z added c78e87be86c828137a6e7e00a177c03b52202ce4c39029b99904c2a094b9da87 with feerate 11.00 sat/vB (1562 sat, 142 vbytes) │ │ │ └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘ + +### log_p2p_connections.bt + +A `bpftrace` script to log information about opened, closed, misbehaving, and +evicted P2P connections. Uses the `net:*_connection` tracepoints. + +```bash +$ bpftrace contrib/tracing/log_p2p_connections.bt +``` + +This should produce an output similar to the following. + +```bash +Attaching 6 probes... +Logging opened, closed, misbehaving, and evicted P2P connections +OUTBOUND conn to 127.0.0.1:15287: id=0, type=block-relay-only, network=0, total_out=1 +INBOUND conn from 127.0.0.1:45324: id=1, type=inbound, network=0, total_in=1 +MISBEHAVING conn id=1, score_before=0, score_increase=20, message='getdata message size = 50001', threshold_exceeded=false +CLOSED conn to 127.0.0.1:15287: id=0, type=block-relay-only, network=0, established=1231006505 +EVICTED conn to 127.0.0.1:45324: id=1, type=inbound, network=0, established=1612312312 +... ``` diff --git a/contrib/tracing/connectblock_benchmark.bt b/contrib/tracing/connectblock_benchmark.bt index 6e7a98ef07..c5d74309c4 100755 --- a/contrib/tracing/connectblock_benchmark.bt +++ b/contrib/tracing/connectblock_benchmark.bt @@ -16,7 +16,7 @@ This script requires a 'bitcoind' binary compiled with eBPF support and the 'validation:block_connected' USDT. By default, it's assumed that 'bitcoind' is - located in './src/bitcoind'. This can be modified in the script below. + located in './build/bin/bitcoind'. This can be modified in the script below. EXAMPLES: @@ -67,7 +67,7 @@ BEGIN connected block is between the start and end height (or the end height is unset). */ -usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/ +usdt:./build/bin/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 == 0 )/ { $height = arg1; $transactions = arg2; @@ -82,7 +82,7 @@ usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 @inputs = @inputs + $inputs; @sigops = @sigops + $sigops; - @durations = hist($duration / 1000); + @durations = hist($duration / 1e6); if ($height == $1 && $height != 0) { @start = nsecs; @@ -92,7 +92,7 @@ usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 if ($2 > 0 && $height >= $2) { @end = nsecs; $duration = @end - @start; - printf("\nTook %d ms to connect the blocks between height %d and %d.\n", $duration / 1000000, $1, $2); + printf("\nTook %d ms to connect the blocks between height %d and %d.\n", $duration / 1e9, $1, $2); exit(); } } @@ -102,7 +102,7 @@ usdt:./src/bitcoind:validation:block_connected /arg1 >= $1 && (arg1 <= $2 || $2 blocks where the time it took to connect the block is above the . */ -usdt:./src/bitcoind:validation:block_connected / (uint64) arg5 / 1000> $3 / +usdt:./build/bin/bitcoind:validation:block_connected / (uint64) arg5 / 1e6 > $3 / { $hash = arg0; $height = (int32) arg1; @@ -120,7 +120,7 @@ usdt:./src/bitcoind:validation:block_connected / (uint64) arg5 / 1000> $3 / printf("%02x", $b); $p -= 1; } - printf(") %4d tx %5d ins %5d sigops took %4d ms\n", $transactions, $inputs, $sigops, (uint64) $duration / 1000); + printf(") %4d tx %5d ins %5d sigops took %4d ms\n", $transactions, $inputs, $sigops, (uint64) $duration / 1e6); } diff --git a/contrib/tracing/log_p2p_connections.bt b/contrib/tracing/log_p2p_connections.bt new file mode 100755 index 0000000000..e04441e7c5 --- /dev/null +++ b/contrib/tracing/log_p2p_connections.bt @@ -0,0 +1,51 @@ +#!/usr/bin/env bpftrace + +BEGIN +{ + printf("Logging opened, closed, misbehaving, and evicted P2P connections\n") +} + +usdt:./build/bin/bitcoind:net:inbound_connection +{ + $id = (int64) arg0; + $addr = str(arg1); + $conn_type = str(arg2); + $network = (int32) arg3; + $existing = (uint64) arg4; + printf("INBOUND conn from %s: id=%ld, type=%s, network=%d, total=%d\n", $addr, $id, $conn_type, $network, $existing); +} + +usdt:./build/bin/bitcoind:net:outbound_connection +{ + $id = (int64) arg0; + $addr = str(arg1); + $conn_type = str(arg2); + $network = (int32) arg3; + $existing = (uint64) arg4; + printf("OUTBOUND conn to %s: id=%ld, type=%s, network=%d, total=%d\n", $addr, $id, $conn_type, $network, $existing); +} + +usdt:./build/bin/bitcoind:net:closed_connection +{ + $id = (int64) arg0; + $addr = str(arg1); + $conn_type = str(arg2); + $network = (int32) arg3; + printf("CLOSED conn to %s: id=%ld, type=%s, network=%d, established=%ld\n", $addr, $id, $conn_type, $network, arg4); +} + +usdt:./build/bin/bitcoind:net:evicted_inbound_connection +{ + $id = (int64) arg0; + $addr = str(arg1); + $conn_type = str(arg2); + $network = (int32) arg3; + printf("EVICTED conn to %s: id=%ld, type=%s, network=%d, established=%ld\n", $addr, $id, $conn_type, $network, arg4); +} + +usdt:./build/bin/bitcoind:net:misbehaving_connection +{ + $id = (int64) arg0; + $message = str(arg1); + printf("MISBEHAVING conn id=%ld, message='%s'\n", $id, $message); +} diff --git a/contrib/tracing/log_p2p_traffic.bt b/contrib/tracing/log_p2p_traffic.bt index f62956aa5e..7b07dd5e1c 100755 --- a/contrib/tracing/log_p2p_traffic.bt +++ b/contrib/tracing/log_p2p_traffic.bt @@ -5,7 +5,7 @@ BEGIN printf("Logging P2P traffic\n") } -usdt:./src/bitcoind:net:inbound_message +usdt:./build/bin/bitcoind:net:inbound_message { $peer_id = (int64) arg0; $peer_addr = str(arg1); @@ -15,7 +15,7 @@ usdt:./src/bitcoind:net:inbound_message printf("inbound '%s' msg from peer %d (%s, %s) with %d bytes\n", $msg_type, $peer_id, $peer_type, $peer_addr, $msg_len); } -usdt:./src/bitcoind:net:outbound_message +usdt:./build/bin/bitcoind:net:outbound_message { $peer_id = (int64) arg0; $peer_addr = str(arg1); diff --git a/contrib/tracing/log_raw_p2p_msgs.py b/contrib/tracing/log_raw_p2p_msgs.py index c0ab704106..1c0f03e19d 100755 --- a/contrib/tracing/log_raw_p2p_msgs.py +++ b/contrib/tracing/log_raw_p2p_msgs.py @@ -41,7 +41,8 @@ program = """ #include -#define MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; }) +// A min() macro. Prefixed with _TRACEPOINT_TEST to avoid collision with other MIN macros. +#define _TRACEPOINT_TEST_MIN(a,b) ({ __typeof__ (a) _a = (a); __typeof__ (b) _b = (b); _a < _b ? _a : _b; }) // Maximum possible allocation size // from include/linux/percpu.h in the Linux kernel @@ -77,6 +78,7 @@ int trace_inbound_message(struct pt_regs *ctx) { int idx = 0; struct p2p_message *msg = msg_arr.lookup(&idx); + void *paddr = NULL, *pconn_type = NULL, *pmsg_type = NULL, *pmsg = NULL; // lookup() does not return a NULL pointer. However, the BPF verifier // requires an explicit check that that the `msg` pointer isn't a NULL @@ -84,11 +86,15 @@ if (msg == NULL) return 1; bpf_usdt_readarg(1, ctx, &msg->peer_id); - bpf_usdt_readarg_p(2, ctx, &msg->peer_addr, MAX_PEER_ADDR_LENGTH); - bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH); - bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH); + bpf_usdt_readarg(2, ctx, &paddr); + bpf_probe_read_user_str(&msg->peer_addr, sizeof(msg->peer_addr), paddr); + bpf_usdt_readarg(3, ctx, &pconn_type); + bpf_probe_read_user_str(&msg->peer_conn_type, sizeof(msg->peer_conn_type), pconn_type); + bpf_usdt_readarg(4, ctx, &pmsg_type); + bpf_probe_read_user_str(&msg->msg_type, sizeof(msg->msg_type), pmsg_type); bpf_usdt_readarg(5, ctx, &msg->msg_size); - bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH)); + bpf_usdt_readarg(6, ctx, &pmsg); + bpf_probe_read_user(&msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH), pmsg); inbound_messages.perf_submit(ctx, msg, sizeof(*msg)); return 0; @@ -98,17 +104,23 @@ int idx = 0; struct p2p_message *msg = msg_arr.lookup(&idx); + void *paddr = NULL, *pconn_type = NULL, *pmsg_type = NULL, *pmsg = NULL; + // lookup() does not return a NULL pointer. However, the BPF verifier // requires an explicit check that that the `msg` pointer isn't a NULL // pointer. See https://github.com/iovisor/bcc/issues/2595 if (msg == NULL) return 1; bpf_usdt_readarg(1, ctx, &msg->peer_id); - bpf_usdt_readarg_p(2, ctx, &msg->peer_addr, MAX_PEER_ADDR_LENGTH); - bpf_usdt_readarg_p(3, ctx, &msg->peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH); - bpf_usdt_readarg_p(4, ctx, &msg->msg_type, MAX_MSG_TYPE_LENGTH); + bpf_usdt_readarg(2, ctx, &paddr); + bpf_probe_read_user_str(&msg->peer_addr, sizeof(msg->peer_addr), paddr); + bpf_usdt_readarg(3, ctx, &pconn_type); + bpf_probe_read_user_str(&msg->peer_conn_type, sizeof(msg->peer_conn_type), pconn_type); + bpf_usdt_readarg(4, ctx, &pmsg_type); + bpf_probe_read_user_str(&msg->msg_type, sizeof(msg->msg_type), pmsg_type); bpf_usdt_readarg(5, ctx, &msg->msg_size); - bpf_usdt_readarg_p(6, ctx, &msg->msg, MIN(msg->msg_size, MAX_MSG_DATA_LENGTH)); + bpf_usdt_readarg(6, ctx, &pmsg); + bpf_probe_read_user(&msg->msg, _TRACEPOINT_TEST_MIN(msg->msg_size, MAX_MSG_DATA_LENGTH), pmsg); outbound_messages.perf_submit(ctx, msg, sizeof(*msg)); return 0; @@ -117,9 +129,9 @@ def print_message(event, inbound): - print(f"%s %s msg '%s' from peer %d (%s, %s) with %d bytes: %s" % - ( - f"Warning: incomplete message (only %d out of %d bytes)!" % ( + print("{} {} msg '{}' from peer {} ({}, {}) with {} bytes: {}".format( + + "Warning: incomplete message (only {} out of {} bytes)!".format( len(event.msg), event.msg_size) if len(event.msg) < event.msg_size else "", "inbound" if inbound else "outbound", event.msg_type.decode("utf-8"), @@ -132,8 +144,9 @@ def print_message(event, inbound): ) -def main(bitcoind_path): - bitcoind_with_usdts = USDT(path=str(bitcoind_path)) +def main(pid): + print(f"Hooking into bitcoind with pid {pid}") + bitcoind_with_usdts = USDT(pid=int(pid)) # attaching the trace functions defined in the BPF program to the tracepoints bitcoind_with_usdts.enable_probe( @@ -166,7 +179,7 @@ def handle_outbound(_, data, size): bpf["outbound_messages"].open_perf_buffer(handle_outbound) print("Logging raw P2P messages.") - print("Messages larger that about 32kb will be cut off!") + print("Messages larger than about 32kb will be cut off!") print("Some messages might be lost!") while True: try: @@ -176,8 +189,8 @@ def handle_outbound(_, data, size): if __name__ == "__main__": - if len(sys.argv) < 2: - print("USAGE:", sys.argv[0], "path/to/bitcoind") + if len(sys.argv) != 2: + print("USAGE:", sys.argv[0], "") exit() - path = sys.argv[1] - main(path) + pid = sys.argv[1] + main(pid) diff --git a/contrib/tracing/log_utxocache_flush.py b/contrib/tracing/log_utxocache_flush.py index 6c568998e9..8ff9cd5e03 100755 --- a/contrib/tracing/log_utxocache_flush.py +++ b/contrib/tracing/log_utxocache_flush.py @@ -70,8 +70,9 @@ def print_event(event): )) -def main(bitcoind_path): - bitcoind_with_usdts = USDT(path=str(bitcoind_path)) +def main(pid): + print(f"Hooking into bitcoind with pid {pid}") + bitcoind_with_usdts = USDT(pid=int(pid)) # attaching the trace functions defined in the BPF program # to the tracepoints @@ -99,9 +100,9 @@ def handle_flush(_, data, size): if __name__ == "__main__": - if len(sys.argv) < 2: - print("USAGE: ", sys.argv[0], "path/to/bitcoind") + if len(sys.argv) != 2: + print("USAGE: ", sys.argv[0], "") exit(1) - path = sys.argv[1] - main(path) + pid = sys.argv[1] + main(pid) diff --git a/contrib/tracing/log_utxos.bt b/contrib/tracing/log_utxos.bt index 54d5010f82..d309c02915 100755 --- a/contrib/tracing/log_utxos.bt +++ b/contrib/tracing/log_utxos.bt @@ -8,7 +8,7 @@ This script requires a 'bitcoind' binary compiled with eBPF support and the 'utxocache' tracepoints. By default, it's assumed that 'bitcoind' is - located in './src/bitcoind'. This can be modified in the script below. + located in './build/bin/bitcoind'. This can be modified in the script below. NOTE: requires bpftrace v0.12.0 or above. */ @@ -22,7 +22,7 @@ BEGIN /* Attaches to the 'utxocache:add' tracepoint and prints additions to the UTXO set cache. */ -usdt:./src/bitcoind:utxocache:add +usdt:./build/bin/bitcoind:utxocache:add { $txid = arg0; $index = (uint32)arg1; @@ -44,7 +44,7 @@ usdt:./src/bitcoind:utxocache:add /* Attaches to the 'utxocache:spent' tracepoint and prints spents from the UTXO set cache. */ -usdt:./src/bitcoind:utxocache:spent +usdt:./build/bin/bitcoind:utxocache:spent { $txid = arg0; $index = (uint32)arg1; @@ -66,7 +66,7 @@ usdt:./src/bitcoind:utxocache:spent /* Attaches to the 'utxocache:uncache' tracepoint and uncache UTXOs from the UTXO set cache. */ -usdt:./src/bitcoind:utxocache:uncache +usdt:./build/bin/bitcoind:utxocache:uncache { $txid = arg0; $index = (uint32)arg1; diff --git a/contrib/tracing/mempool_monitor.py b/contrib/tracing/mempool_monitor.py index afb5e60372..22efa91783 100755 --- a/contrib/tracing/mempool_monitor.py +++ b/contrib/tracing/mempool_monitor.py @@ -65,8 +65,9 @@ int trace_added(struct pt_regs *ctx) { struct added_event added = {}; - - bpf_usdt_readarg_p(1, ctx, &added.hash, HASH_LENGTH); + void *phash = NULL; + bpf_usdt_readarg(1, ctx, phash); + bpf_probe_read_user(&added.hash, sizeof(added.hash), phash); bpf_usdt_readarg(2, ctx, &added.vsize); bpf_usdt_readarg(3, ctx, &added.fee); @@ -76,9 +77,11 @@ int trace_removed(struct pt_regs *ctx) { struct removed_event removed = {}; - - bpf_usdt_readarg_p(1, ctx, &removed.hash, HASH_LENGTH); - bpf_usdt_readarg_p(2, ctx, &removed.reason, MAX_REMOVAL_REASON_LENGTH); + void *phash = NULL, *preason = NULL; + bpf_usdt_readarg(1, ctx, phash); + bpf_probe_read_user(&removed.hash, sizeof(removed.hash), phash); + bpf_usdt_readarg(2, ctx, preason); + bpf_probe_read_user_str(&removed.reason, sizeof(removed.reason), preason); bpf_usdt_readarg(3, ctx, &removed.vsize); bpf_usdt_readarg(4, ctx, &removed.fee); bpf_usdt_readarg(5, ctx, &removed.entry_time); @@ -89,22 +92,25 @@ int trace_rejected(struct pt_regs *ctx) { struct rejected_event rejected = {}; - - bpf_usdt_readarg_p(1, ctx, &rejected.hash, HASH_LENGTH); - bpf_usdt_readarg_p(2, ctx, &rejected.reason, MAX_REJECT_REASON_LENGTH); - + void *phash = NULL, *preason = NULL; + bpf_usdt_readarg(1, ctx, phash); + bpf_probe_read_user(&rejected.hash, sizeof(rejected.hash), phash); + bpf_usdt_readarg(2, ctx, preason); + bpf_probe_read_user_str(&rejected.reason, sizeof(rejected.reason), preason); rejected_events.perf_submit(ctx, &rejected, sizeof(rejected)); return 0; } int trace_replaced(struct pt_regs *ctx) { struct replaced_event replaced = {}; - - bpf_usdt_readarg_p(1, ctx, &replaced.replaced_hash, HASH_LENGTH); + void *phash_replaced = NULL, *phash_replacement = NULL; + bpf_usdt_readarg(1, ctx, phash_replaced); + bpf_probe_read_user(&replaced.replaced_hash, sizeof(replaced.replaced_hash), phash_replaced); bpf_usdt_readarg(2, ctx, &replaced.replaced_vsize); bpf_usdt_readarg(3, ctx, &replaced.replaced_fee); bpf_usdt_readarg(4, ctx, &replaced.replaced_entry_time); - bpf_usdt_readarg_p(5, ctx, &replaced.replacement_hash, HASH_LENGTH); + bpf_usdt_readarg(5, ctx, phash_replacement); + bpf_probe_read_user(&replaced.replacement_hash, sizeof(replaced.replacement_hash), phash_replacement); bpf_usdt_readarg(6, ctx, &replaced.replacement_vsize); bpf_usdt_readarg(7, ctx, &replaced.replacement_fee); @@ -114,8 +120,9 @@ """ -def main(bitcoind_path): - bitcoind_with_usdts = USDT(path=str(bitcoind_path)) +def main(pid): + print(f"Hooking into bitcoind with pid {pid}") + bitcoind_with_usdts = USDT(pid=int(pid)) # attaching the trace functions defined in the BPF program # to the tracepoints @@ -365,8 +372,8 @@ def timestamp_age(timestamp): if __name__ == "__main__": if len(sys.argv) < 2: - print("USAGE: ", sys.argv[0], "path/to/bitcoind") + print("USAGE: ", sys.argv[0], "") exit(1) - path = sys.argv[1] - main(path) + pid = sys.argv[1] + main(pid) diff --git a/contrib/tracing/p2p_monitor.py b/contrib/tracing/p2p_monitor.py index 4ff701cac3..78225366d9 100755 --- a/contrib/tracing/p2p_monitor.py +++ b/contrib/tracing/p2p_monitor.py @@ -14,8 +14,9 @@ # outbound P2P messages. The eBPF program submits the P2P messages to # this script via a BPF ring buffer. -import sys import curses +import os +import sys from curses import wrapper, panel from bcc import BPF, USDT @@ -46,11 +47,15 @@ int trace_inbound_message(struct pt_regs *ctx) { struct p2p_message msg = {}; + void *paddr = NULL, *pconn_type = NULL, *pmsg_type = NULL; bpf_usdt_readarg(1, ctx, &msg.peer_id); - bpf_usdt_readarg_p(2, ctx, &msg.peer_addr, MAX_PEER_ADDR_LENGTH); - bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH); - bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH); + bpf_usdt_readarg(2, ctx, &paddr); + bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr); + bpf_usdt_readarg(3, ctx, &pconn_type); + bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type); + bpf_usdt_readarg(4, ctx, &pconn_type); + bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type); bpf_usdt_readarg(5, ctx, &msg.msg_size); inbound_messages.perf_submit(ctx, &msg, sizeof(msg)); @@ -59,11 +64,15 @@ int trace_outbound_message(struct pt_regs *ctx) { struct p2p_message msg = {}; + void *paddr = NULL, *pconn_type = NULL, *pmsg_type = NULL; bpf_usdt_readarg(1, ctx, &msg.peer_id); - bpf_usdt_readarg_p(2, ctx, &msg.peer_addr, MAX_PEER_ADDR_LENGTH); - bpf_usdt_readarg_p(3, ctx, &msg.peer_conn_type, MAX_PEER_CONN_TYPE_LENGTH); - bpf_usdt_readarg_p(4, ctx, &msg.msg_type, MAX_MSG_TYPE_LENGTH); + bpf_usdt_readarg(2, ctx, &paddr); + bpf_probe_read_user_str(&msg.peer_addr, sizeof(msg.peer_addr), paddr); + bpf_usdt_readarg(3, ctx, &pconn_type); + bpf_probe_read_user_str(&msg.peer_conn_type, sizeof(msg.peer_conn_type), pconn_type); + bpf_usdt_readarg(4, ctx, &pconn_type); + bpf_probe_read_user_str(&msg.msg_type, sizeof(msg.msg_type), pmsg_type); bpf_usdt_readarg(5, ctx, &msg.msg_size); outbound_messages.perf_submit(ctx, &msg, sizeof(msg)); @@ -115,10 +124,10 @@ def add_message(self, message): self.total_outbound_msgs += 1 -def main(bitcoind_path): +def main(pid): peers = dict() - - bitcoind_with_usdts = USDT(path=str(bitcoind_path)) + print(f"Hooking into bitcoind with pid {pid}") + bitcoind_with_usdts = USDT(pid=int(pid)) # attaching the trace functions defined in the BPF program to the tracepoints bitcoind_with_usdts.enable_probe( @@ -245,9 +254,14 @@ def render(screen, peers, cur_list_pos, scroll, ROWS_AVALIABLE_FOR_LIST, info_pa (msg.msg_type, msg.size), curses.A_NORMAL) +def running_as_root(): + return os.getuid() == 0 + if __name__ == "__main__": - if len(sys.argv) < 2: - print("USAGE:", sys.argv[0], "path/to/bitcoind") + if len(sys.argv) != 2: + print("USAGE:", sys.argv[0], "") exit() - path = sys.argv[1] - main(path) + if not running_as_root(): + print("You might not have the privileges required to hook into the tracepoints!") + pid = sys.argv[1] + main(pid) diff --git a/contrib/utxo-tools/utxo_to_sqlite.py b/contrib/utxo-tools/utxo_to_sqlite.py new file mode 100755 index 0000000000..4758fe39aa --- /dev/null +++ b/contrib/utxo-tools/utxo_to_sqlite.py @@ -0,0 +1,195 @@ +#!/usr/bin/env python3 +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or http://www.opensource.org/licenses/mit-license.php. +"""Tool to convert a compact-serialized UTXO set to a SQLite3 database. + +The input UTXO set can be generated by Bitcoin Core with the `dumptxoutset` RPC: +$ bitcoin-cli dumptxoutset ~/utxos.dat latest + +The created database contains a table `utxos` with the following schema: +(txid TEXT, vout INT, value INT, coinbase INT, height INT, scriptpubkey TEXT) +""" +import argparse +import os +import sqlite3 +import sys +import time + + +UTXO_DUMP_MAGIC = b'utxo\xff' +UTXO_DUMP_VERSION = 2 +NET_MAGIC_BYTES = { + b"\xf9\xbe\xb4\xd9": "Mainnet", + b"\x0a\x03\xcf\x40": "Signet", + b"\x0b\x11\x09\x07": "Testnet3", + b"\x1c\x16\x3f\x28": "Testnet4", + b"\xfa\xbf\xb5\xda": "Regtest", +} + + +def read_varint(f): + """Equivalent of `ReadVarInt()` (see serialization module).""" + n = 0 + while True: + dat = f.read(1)[0] + n = (n << 7) | (dat & 0x7f) + if (dat & 0x80) > 0: + n += 1 + else: + return n + + +def read_compactsize(f): + """Equivalent of `ReadCompactSize()` (see serialization module).""" + n = f.read(1)[0] + if n == 253: + n = int.from_bytes(f.read(2), "little") + elif n == 254: + n = int.from_bytes(f.read(4), "little") + elif n == 255: + n = int.from_bytes(f.read(8), "little") + return n + + +def decompress_amount(x): + """Equivalent of `DecompressAmount()` (see compressor module).""" + if x == 0: + return 0 + x -= 1 + e = x % 10 + x //= 10 + n = 0 + if e < 9: + d = (x % 9) + 1 + x //= 9 + n = x * 10 + d + else: + n = x + 1 + while e > 0: + n *= 10 + e -= 1 + return n + + +def decompress_script(f): + """Equivalent of `DecompressScript()` (see compressor module).""" + size = read_varint(f) # sizes 0-5 encode compressed script types + if size == 0: # P2PKH + return bytes([0x76, 0xa9, 20]) + f.read(20) + bytes([0x88, 0xac]) + elif size == 1: # P2SH + return bytes([0xa9, 20]) + f.read(20) + bytes([0x87]) + elif size in (2, 3): # P2PK (compressed) + return bytes([33, size]) + f.read(32) + bytes([0xac]) + elif size in (4, 5): # P2PK (uncompressed) + compressed_pubkey = bytes([size - 2]) + f.read(32) + return bytes([65]) + decompress_pubkey(compressed_pubkey) + bytes([0xac]) + else: # others (bare multisig, segwit etc.) + size -= 6 + assert size <= 10000, f"too long script with size {size}" + return f.read(size) + + +def decompress_pubkey(compressed_pubkey): + """Decompress pubkey by calculating y = sqrt(x^3 + 7) % p + (see functions `secp256k1_eckey_pubkey_parse` and `secp256k1_ge_set_xo_var`). + """ + P = 2**256 - 2**32 - 977 # secp256k1 field size + assert len(compressed_pubkey) == 33 and compressed_pubkey[0] in (2, 3) + x = int.from_bytes(compressed_pubkey[1:], 'big') + rhs = (x**3 + 7) % P + y = pow(rhs, (P + 1)//4, P) # get sqrt using Tonelli-Shanks algorithm (for p % 4 = 3) + assert pow(y, 2, P) == rhs, f"pubkey is not on curve ({compressed_pubkey.hex()})" + tag_is_odd = compressed_pubkey[0] == 3 + y_is_odd = (y & 1) == 1 + if tag_is_odd != y_is_odd: # fix parity (even/odd) if necessary + y = P - y + return bytes([4]) + x.to_bytes(32, 'big') + y.to_bytes(32, 'big') + + +def main(): + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument('infile', help='filename of compact-serialized UTXO set (input)') + parser.add_argument('outfile', help='filename of created SQLite3 database (output)') + parser.add_argument('-v', '--verbose', action='store_true', help='show details about each UTXO') + args = parser.parse_args() + + if not os.path.exists(args.infile): + print(f"Error: provided input file '{args.infile}' doesn't exist.") + sys.exit(1) + + if os.path.exists(args.outfile): + print(f"Error: provided output file '{args.outfile}' already exists.") + sys.exit(1) + + # create database table + con = sqlite3.connect(args.outfile) + con.execute("CREATE TABLE utxos(txid TEXT, vout INT, value INT, coinbase INT, height INT, scriptpubkey TEXT)") + + # read metadata (magic bytes, version, network magic, block hash, UTXO count) + f = open(args.infile, 'rb') + magic_bytes = f.read(5) + version = int.from_bytes(f.read(2), 'little') + network_magic = f.read(4) + block_hash = f.read(32) + num_utxos = int.from_bytes(f.read(8), 'little') + if magic_bytes != UTXO_DUMP_MAGIC: + print(f"Error: provided input file '{args.infile}' is not an UTXO dump.") + sys.exit(1) + if version != UTXO_DUMP_VERSION: + print(f"Error: provided input file '{args.infile}' has unknown UTXO dump version {version} " + f"(only version {UTXO_DUMP_VERSION} supported)") + sys.exit(1) + network_string = NET_MAGIC_BYTES.get(network_magic, f"unknown network ({network_magic.hex()})") + print(f"UTXO Snapshot for {network_string} at block hash " + f"{block_hash[::-1].hex()[:32]}..., contains {num_utxos} coins") + + start_time = time.time() + write_batch = [] + coins_per_hash_left = 0 + prevout_hash = None + max_height = 0 + + for coin_idx in range(1, num_utxos+1): + # read key (COutPoint) + if coins_per_hash_left == 0: # read next prevout hash + prevout_hash = f.read(32)[::-1].hex() + coins_per_hash_left = read_compactsize(f) + prevout_index = read_compactsize(f) + # read value (Coin) + code = read_varint(f) + height = code >> 1 + is_coinbase = code & 1 + amount = decompress_amount(read_varint(f)) + scriptpubkey = decompress_script(f).hex() + write_batch.append((prevout_hash, prevout_index, amount, is_coinbase, height, scriptpubkey)) + if height > max_height: + max_height = height + coins_per_hash_left -= 1 + + if args.verbose: + print(f"Coin {coin_idx}/{num_utxos}:") + print(f" prevout = {prevout_hash}:{prevout_index}") + print(f" amount = {amount}, height = {height}, coinbase = {is_coinbase}") + print(f" scriptPubKey = {scriptpubkey}\n") + + if coin_idx % (16*1024) == 0 or coin_idx == num_utxos: + # write utxo batch to database + con.executemany("INSERT INTO utxos VALUES(?, ?, ?, ?, ?, ?)", write_batch) + con.commit() + write_batch.clear() + + if coin_idx % (1024*1024) == 0: + elapsed = time.time() - start_time + print(f"{coin_idx} coins converted [{coin_idx/num_utxos*100:.2f}%], " + + f"{elapsed:.3f}s passed since start") + con.close() + + print(f"TOTAL: {num_utxos} coins written to {args.outfile}, snapshot height is {max_height}.") + if f.read(1) != b'': # EOF should be reached by now + print(f"WARNING: input file {args.infile} has not reached EOF yet!") + sys.exit(1) + + +if __name__ == '__main__': + main() diff --git a/contrib/valgrind.supp b/contrib/valgrind.supp index ee91acd5ef..7960f9c8e4 100644 --- a/contrib/valgrind.supp +++ b/contrib/valgrind.supp @@ -2,57 +2,24 @@ # dependencies that cannot be fixed in-tree. # # Example use: -# $ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin +# $ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin # $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ -# --show-leak-kinds=all src/test/test_bitcoin +# --show-leak-kinds=all build/bin/test_bitcoin # # To create suppressions for found issues, use the --gen-suppressions=all option: # $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ # --show-leak-kinds=all --gen-suppressions=all --show-reachable=yes \ -# --error-limit=no src/test/test_bitcoin +# --error-limit=no build/bin/test_bitcoin # # Note that suppressions may depend on OS and/or library versions. -# Tested on: -# * aarch64 (Debian Bookworm system libs, clang, without gui) -# * x86_64 (Debian Bookworm system libs, clang, without gui) -{ - Suppress libdb warning - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=662917 - Memcheck:Cond - obj:*/libdb_cxx-*.so - fun:__log_put -} -{ - Suppress libdb warning - Memcheck:Param - pwrite64(buf) - fun:pwrite - fun:__os_io -} -{ - Suppress libdb warning - Memcheck:Cond - fun:__log_putr.isra.1 -} -{ - Suppress libdb warning - Memcheck:Param - pwrite64(buf) - ... - obj:*/libdb_cxx-*.so -} +# Tested on aarch64 and x86_64 with Ubuntu Noble system libs, using clang-16 +# and GCC, without gui. { Suppress uninitialized bytes warning in compat code Memcheck:Param ioctl(TCSET{S,SW,SF}) fun:tcsetattr } -{ - Suppress libdb warning - Memcheck:Leak - fun:malloc - ... - obj:*/libdb_cxx-*.so -} { Suppress leaks on shutdown Memcheck:Leak diff --git a/contrib/verify-binaries/README.md b/contrib/verify-binaries/README.md index 04d683e69b..0f3e16a5bc 100644 --- a/contrib/verify-binaries/README.md +++ b/contrib/verify-binaries/README.md @@ -50,6 +50,7 @@ Get JSON output and don't prompt for user input (no auto key import): ```sh ./contrib/verify-binaries/verify.py --json pub 22.0-x86 +./contrib/verify-binaries/verify.py --json pub 23.0-rc5-linux-gnu ``` Rely only on local GPG state and manually specified keys, while requiring a @@ -57,14 +58,15 @@ threshold of at least 10 trusted signatures: ```sh ./contrib/verify-binaries/verify.py \ --trusted-keys 74E2DEF5D77260B98BC19438099BAD163C70FBFA,9D3CC86A72F8494342EA5FD10A41BDC3F4FAFF1C \ - --min-good-sigs 10 pub 22.0-x86 + --min-good-sigs 10 pub 22.0-linux ``` -If you only want to download the binaries for a certain platform, add the corresponding suffix, e.g.: +If you only want to download the binaries for a certain architecture and/or platform, add the corresponding suffix, e.g.: ```sh -./contrib/verify-binaries/verify.py pub 24.0.1-darwin -./contrib/verify-binaries/verify.py pub 23.1-rc1-win64 +./contrib/verify-binaries/verify.py pub 25.2-x86_64-linux +./contrib/verify-binaries/verify.py pub 24.1-rc1-darwin +./contrib/verify-binaries/verify.py pub 27.0-win64-setup.exe ``` If you do not want to keep the downloaded binaries, specify the cleanup option. diff --git a/contrib/verify-binaries/test.py b/contrib/verify-binaries/test.py index 22d718ece3..875606ec22 100755 --- a/contrib/verify-binaries/test.py +++ b/contrib/verify-binaries/test.py @@ -12,6 +12,21 @@ def main(): expect_code(run_verify("", "pub", '0.32.awefa.12f9h'), 11, "Malformed version should fail") expect_code(run_verify('--min-good-sigs 20', "pub", "22.0"), 9, "--min-good-sigs 20 should fail") + print("- testing verification (22.0-x86_64-linux-gnu.tar.gz)", flush=True) + _220_x86_64_linux_gnu = run_verify("--json", "pub", "22.0-x86_64-linux-gnu.tar.gz") + try: + result = json.loads(_220_x86_64_linux_gnu.stdout.decode()) + except Exception: + print("failed on 22.0-x86_64-linux-gnu.tar.gz --json:") + print_process_failure(_220_x86_64_linux_gnu) + raise + + expect_code(_220_x86_64_linux_gnu, 0, "22.0-x86_64-linux-gnu.tar.gz should succeed") + v = result['verified_binaries'] + assert result['good_trusted_sigs'] + assert len(v) == 1 + assert v['bitcoin-22.0-x86_64-linux-gnu.tar.gz'] == '59ebd25dd82a51638b7a6bb914586201e67db67b919b2a1ff08925a7936d1b16' + print("- testing verification (22.0)", flush=True) _220 = run_verify("--json", "pub", "22.0") try: diff --git a/contrib/verify-binaries/verify.py b/contrib/verify-binaries/verify.py index d0749f503f..6c07b36c9d 100755 --- a/contrib/verify-binaries/verify.py +++ b/contrib/verify-binaries/verify.py @@ -97,23 +97,17 @@ def bool_from_env(key, default=False) -> bool: VERSION_FORMAT = ".[.][-rc[0-9]][-platform]" -VERSION_EXAMPLE = "22.0-x86_64 or 23.1-rc1-darwin" +VERSION_EXAMPLE = "22.0 or 23.1-rc1-darwin.dmg or 27.0-x86_64-linux-gnu" def parse_version_string(version_str): - parts = version_str.split('-') - version_base = parts[0] - version_rc = "" - version_os = "" - if len(parts) == 2: # "-rcN" or "version-platform" - if "rc" in parts[1]: - version_rc = parts[1] - else: - version_os = parts[1] - elif len(parts) == 3: # "-rcN-platform" - version_rc = parts[1] - version_os = parts[2] + # "[-rcN][-platform]" + version_base, _, platform = version_str.partition('-') + rc = "" + if platform.startswith("rc"): # "-rcN[-platform]" + rc, _, platform = platform.partition('-') + # else "" or "-platform" - return version_base, version_rc, version_os + return version_base, rc, platform def download_with_wget(remote_file, local_file): @@ -122,7 +116,7 @@ def download_with_wget(remote_file, local_file): return result.returncode == 0, result.stdout.decode().rstrip() -def download_lines_with_urllib(url) -> t.Tuple[bool, t.List[str]]: +def download_lines_with_urllib(url) -> tuple[bool, list[str]]: """Get (success, text lines of a file) over HTTP.""" try: return (True, [ @@ -138,7 +132,7 @@ def verify_with_gpg( filename, signature_filename, output_filename: t.Optional[str] = None -) -> t.Tuple[int, str]: +) -> tuple[int, str]: with tempfile.NamedTemporaryFile() as status_file: args = [ 'gpg', '--yes', '--verify', '--verify-options', 'show-primary-uid-only', "--status-file", status_file.name, @@ -177,12 +171,12 @@ def __repr__(self): def parse_gpg_result( - output: t.List[str] -) -> t.Tuple[t.List[SigData], t.List[SigData], t.List[SigData]]: + output: list[str] +) -> tuple[list[SigData], list[SigData], list[SigData]]: """Returns good, unknown, and bad signatures from GPG stdout.""" - good_sigs: t.List[SigData] = [] - unknown_sigs: t.List[SigData] = [] - bad_sigs: t.List[SigData] = [] + good_sigs: list[SigData] = [] + unknown_sigs: list[SigData] = [] + bad_sigs: list[SigData] = [] total_resolved_sigs = 0 # Ensure that all lines we match on include a prefix that prevents malicious input @@ -265,7 +259,7 @@ def files_are_equal(filename1, filename2): def get_files_from_hosts_and_compare( - hosts: t.List[str], path: str, filename: str, require_all: bool = False + hosts: list[str], path: str, filename: str, require_all: bool = False ) -> ReturnCode: """ Retrieve the same file from a number of hosts and ensure they have the same contents. @@ -326,7 +320,7 @@ def join_url(host: str) -> str: return ReturnCode.SUCCESS -def check_multisig(sums_file: str, sigfilename: str, args: argparse.Namespace) -> t.Tuple[int, str, t.List[SigData], t.List[SigData], t.List[SigData]]: +def check_multisig(sums_file: str, sigfilename: str, args: argparse.Namespace) -> tuple[int, str, list[SigData], list[SigData], list[SigData]]: # check signature # # We don't write output to a file because this command will almost certainly @@ -365,8 +359,8 @@ def prompt_yn(prompt) -> bool: def verify_shasums_signature( signature_file_path: str, sums_file_path: str, args: argparse.Namespace -) -> t.Tuple[ - ReturnCode, t.List[SigData], t.List[SigData], t.List[SigData], t.List[SigData] +) -> tuple[ + ReturnCode, list[SigData], list[SigData], list[SigData], list[SigData] ]: min_good_sigs = args.min_good_sigs gpg_allowed_codes = [0, 2] # 2 is returned when untrusted signatures are present. @@ -429,14 +423,14 @@ def verify_shasums_signature( return (ReturnCode.SUCCESS, good_trusted, good_untrusted, unknown, bad) -def parse_sums_file(sums_file_path: str, filename_filter: t.List[str]) -> t.List[t.List[str]]: +def parse_sums_file(sums_file_path: str, filename_filter: list[str]) -> list[list[str]]: # extract hashes/filenames of binaries to verify from hash file; # each line has the following format: " " with open(sums_file_path, 'r', encoding='utf8') as hash_file: return [line.split()[:2] for line in hash_file if len(filename_filter) == 0 or any(f in line for f in filename_filter)] -def verify_binary_hashes(hashes_to_verify: t.List[t.List[str]]) -> t.Tuple[ReturnCode, t.Dict[str, str]]: +def verify_binary_hashes(hashes_to_verify: list[list[str]]) -> tuple[ReturnCode, dict[str, str]]: offending_files = [] files_to_hashes = {} @@ -514,7 +508,9 @@ def cleanup(): # Extract hashes and filenames hashes_to_verify = parse_sums_file(SUMS_FILENAME, [os_filter]) if not hashes_to_verify: - log.error("no files matched the platform specified") + available_versions = ["-".join(line[1].split("-")[2:]) for line in parse_sums_file(SUMS_FILENAME, [])] + closest_match = difflib.get_close_matches(os_filter, available_versions, cutoff=0, n=1)[0] + log.error(f"No files matched the platform specified. Did you mean: {closest_match}") return ReturnCode.NO_BINARIES_MATCH # remove binaries that are known not to be hosted by bitcoincore.org diff --git a/contrib/windeploy/detached-sig-create.sh b/contrib/windeploy/detached-sig-create.sh index 82fcf2d406..4ec726534c 100755 --- a/contrib/windeploy/detached-sig-create.sh +++ b/contrib/windeploy/detached-sig-create.sh @@ -8,9 +8,9 @@ if [ -z "$OSSLSIGNCODE" ]; then OSSLSIGNCODE=osslsigncode fi -if [ -z "$1" ]; then - echo "usage: $0 " - echo "example: $0 -key codesign.key" +if [ "$#" -ne 1 ]; then + echo "usage: $0 " + echo "example: $0 codesign.key" exit 1 fi @@ -22,12 +22,22 @@ OUTSUBDIR="${OUTDIR}/win" TIMESERVER=http://timestamp.comodoca.com CERTFILE="win-codesign.cert" +stty -echo +printf "Enter the passphrase for %s: " "$1" +read cs_key_pass +printf "\n" +stty echo + + mkdir -p "${OUTSUBDIR}" -# shellcheck disable=SC2046 -basename -a $(ls -1 "${SRCDIR}"/*-unsigned.exe) | while read UNSIGNED; do - echo Signing "${UNSIGNED}" - "${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -h sha256 -in "${SRCDIR}/${UNSIGNED}" -out "${WORKDIR}/${UNSIGNED}" "$@" - "${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${UNSIGNED}" -out "${OUTSUBDIR}/${UNSIGNED}.pem" && rm "${WORKDIR}/${UNSIGNED}" +find ${SRCDIR} -wholename "*.exe" -type f -exec realpath --relative-to=. {} \; | while read -r bin +do + echo Signing "${bin}" + bin_base="$(realpath --relative-to=${SRCDIR} "${bin}")" + mkdir -p "$(dirname ${WORKDIR}/"${bin_base}")" + "${OSSLSIGNCODE}" sign -certs "${CERTFILE}" -t "${TIMESERVER}" -h sha256 -in "${bin}" -out "${WORKDIR}/${bin_base}" -key "$1" -pass "${cs_key_pass}" + mkdir -p "$(dirname ${OUTSUBDIR}/"${bin_base}")" + "${OSSLSIGNCODE}" extract-signature -pem -in "${WORKDIR}/${bin_base}" -out "${OUTSUBDIR}/${bin_base}.pem" && rm "${WORKDIR}/${bin_base}" done rm -f "${OUT}" diff --git a/contrib/windeploy/win-codesign.cert b/contrib/windeploy/win-codesign.cert index 22f17296b6..ec60a3018d 100644 --- a/contrib/windeploy/win-codesign.cert +++ b/contrib/windeploy/win-codesign.cert @@ -1,8 +1,8 @@ -----BEGIN CERTIFICATE----- -MIIHfDCCBWSgAwIBAgIQCmVvdQal72U2QxbUTT3SRTANBgkqhkiG9w0BAQsFADBp +MIIHeTCCBWGgAwIBAgIQBzR46J2yq3g++NbQS/BBVDANBgkqhkiG9w0BAQsFADBp MQswCQYDVQQGEwJVUzEXMBUGA1UEChMORGlnaUNlcnQsIEluYy4xQTA/BgNVBAMT OERpZ2lDZXJ0IFRydXN0ZWQgRzQgQ29kZSBTaWduaW5nIFJTQTQwOTYgU0hBMzg0 -IDIwMjEgQ0ExMB4XDTIyMDUyNDAwMDAwMFoXDTI0MDUyOTIzNTk1OVowgYAxCzAJ +IDIwMjEgQ0ExMB4XDTI0MDUyMjAwMDAwMFoXDTI3MDUzMTIzNTk1OVowgYAxCzAJ BgNVBAYTAlVTMREwDwYDVQQIEwhEZWxhd2FyZTEOMAwGA1UEBxMFTGV3ZXMxJjAk BgNVBAoTHUJpdGNvaW4gQ29yZSBDb2RlIFNpZ25pbmcgTExDMSYwJAYDVQQDEx1C aXRjb2luIENvcmUgQ29kZSBTaWduaW5nIExMQzCCAiIwDQYJKoZIhvcNAQEBBQAD @@ -17,28 +17,28 @@ CDvScIgnQXmk+cbKMBtg9kM0F+aLWsN2xVf0uAj3U7sdXLrfJeW0DZIktWtTBQzX O/OE4Ka+1WFnDg0HJIih0cTjl9YYvfe53L4pCGy+qGt/XGBRqCMfXp3g+H9FGR5r pensVVcsrv3GbTfYdlpdmp9OHH5G57GTAZueobCZg7r7RKK0zPU9EiTLJxzyXuai v/Ksd8eIhHRjewMaQuAtQM1tO+oKAbLF0v2M7v7/aVT76X32JllYAizm3zjvAgMB -AAGjggIGMIICAjAfBgNVHSMEGDAWgBRoN+Drtjv4XxGG+/5hewiIZfROQjAdBgNV -HQ4EFgQUvCpU58PIuofv0kHJ3Ty0YDKEy3cwDgYDVR0PAQH/BAQDAgeAMBMGA1Ud -JQQMMAoGCCsGAQUFBwMDMIG1BgNVHR8Ega0wgaowU6BRoE+GTWh0dHA6Ly9jcmwz -LmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNENvZGVTaWduaW5nUlNBNDA5 -NlNIQTM4NDIwMjFDQTEuY3JsMFOgUaBPhk1odHRwOi8vY3JsNC5kaWdpY2VydC5j -b20vRGlnaUNlcnRUcnVzdGVkRzRDb2RlU2lnbmluZ1JTQTQwOTZTSEEzODQyMDIx -Q0ExLmNybDA+BgNVHSAENzA1MDMGBmeBDAEEATApMCcGCCsGAQUFBwIBFhtodHRw -Oi8vd3d3LmRpZ2ljZXJ0LmNvbS9DUFMwgZQGCCsGAQUFBwEBBIGHMIGEMCQGCCsG +AAGjggIDMIIB/zAfBgNVHSMEGDAWgBRoN+Drtjv4XxGG+/5hewiIZfROQjAdBgNV +HQ4EFgQUvCpU58PIuofv0kHJ3Ty0YDKEy3cwPgYDVR0gBDcwNTAzBgZngQwBBAEw +KTAnBggrBgEFBQcCARYbaHR0cDovL3d3dy5kaWdpY2VydC5jb20vQ1BTMA4GA1Ud +DwEB/wQEAwIHgDATBgNVHSUEDDAKBggrBgEFBQcDAzCBtQYDVR0fBIGtMIGqMFOg +UaBPhk1odHRwOi8vY3JsMy5kaWdpY2VydC5jb20vRGlnaUNlcnRUcnVzdGVkRzRD +b2RlU2lnbmluZ1JTQTQwOTZTSEEzODQyMDIxQ0ExLmNybDBToFGgT4ZNaHR0cDov +L2NybDQuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0VHJ1c3RlZEc0Q29kZVNpZ25pbmdS +U0E0MDk2U0hBMzg0MjAyMUNBMS5jcmwwgZQGCCsGAQUFBwEBBIGHMIGEMCQGCCsG AQUFBzABhhhodHRwOi8vb2NzcC5kaWdpY2VydC5jb20wXAYIKwYBBQUHMAKGUGh0 dHA6Ly9jYWNlcnRzLmRpZ2ljZXJ0LmNvbS9EaWdpQ2VydFRydXN0ZWRHNENvZGVT -aWduaW5nUlNBNDA5NlNIQTM4NDIwMjFDQTEuY3J0MAwGA1UdEwEB/wQCMAAwDQYJ -KoZIhvcNAQELBQADggIBABhpTZufRws1vrtI0xB1/UWrSEJxdPHivfpXE708dzum -Jh3TFzpsEUCQX5BJJet1l7x92sKNeAL7votA+8O8YvMD64Kim7VKA2BB8AOHKQbp -r1c2iZBwwofInviRYvsrvQta6KBy2KOe1L/l0KnpUazL9Tv4VKvuWAw/Qc0/eTQr -NZRsmADORxnZ1qW+SpF+/WbazIYjod/Oqb1U3on+PzyiGD3SjzNhsdFRptqzrIaY -UVV+2XHG4fN6A8wkyQL5NIVXGiK7rqS5VrRAv58Lf1ZZTghdAL+5SySE0OsR9t0K -W73ZB9pxbuZZ6Zfxjotjw+IilCEm3ADbc7Eb2ijI4x8mix0XWMUrhL34s7/jRyDi -P+30aSgjWp611tp/EYRW5kpIaFR8AesDdM0DSSCCRXOMwQG2Tq2+CnqItB5oLNPp -2XySwlIWvmjbzsREfIpE3yh3bxmHY+vFIc2R0nNkbWNIT6AGtaEQ7oWkgpK8YMkA -QCf4EUC4Qa7qHiH6YSmYJhjApBLC7UDwevgwxuDrwimWAj+tDkzdnENMcBp4SAy6 -LwUuDi2IU6HRSXWdh2YEkDbc3FdwknnnEWaB4dlRL85YjHyLXN0KiE7SKTj1LfR4 -dGeDqVUlDj9D5+X4a7F89wLP/um40/52HUQv5t5WcNr/47r9aVkx9DHs1b8oUnLg +aWduaW5nUlNBNDA5NlNIQTM4NDIwMjFDQTEuY3J0MAkGA1UdEwQCMAAwDQYJKoZI +hvcNAQELBQADggIBADdniG9IY9oOfw1e3+uc2lR4hoZqquJQRrCnbWJ1npnCTavI +CfcEEMuQ5ztg4TR7tQNj2KcaHWKuPYxEz2bg8HpSPG27lnXaz4pLgfqvjdZWNH2v +W6DGRUAwuMQHSV0qhuRcJPZuhwSFx/8y4r++jIcBxCbt/Jprt/bqc8vZZZzTDPfG +M6cGaKMDvF//OkUPVzh4s557kV7+LoaX8CigiACZky3Zj3tkQfJYkEvdQseNvX49 +CMJ+cjN+fGweshbn/DszAT5oXW5l2PXeceyGrE+5Ex1ELXCPqNj8ZSn+S9IKZOag +zDFBA93RTVD438peXPz//xgusgnmSqSPS5tCp9KSvew81acu4v/+egg9EgSSx5Ho +9fkOX7JuygvN3r3UZqsddxdwf2dPvBDYlMdieF8qsR7H5DQPQoaTVrIhW4TFtJl/ +UPjVlnDwu+yvMC70F+CaVgQs01uZ0VKuG3KNkkEj6+V/SM54NVVgcY/Q7llKIFA8 +Qk8Ip8/83cVBptKW+OU+i2ZwoYskLbdfDE31X2knUIouNZgBBMhzc5WjJCEGXAPm +9xYZMn87cc+ejxCw6/WC4b6tDCziO8drq76Pl6LTNPOtRkEVqt12p8Uqi9PgznUB +bdHeoF5XHt1Ca2ySpSYuMz5djwIC2ws8kiMm44/AyTm6dwRcesiOTqnaRc+t -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- MIIGsDCCBJigAwIBAgIQCK1AsmDSnEyfXs2pvZOu2TANBgkqhkiG9w0BAQwFADBi diff --git a/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py index d8087a4db3..b2290a6c5b 100755 --- a/contrib/zmq/zmq_sub.py +++ b/contrib/zmq/zmq_sub.py @@ -7,7 +7,7 @@ ZMQ example using python3's asyncio Bitcoin should be started with the command line arguments: - bitcoind -testnet -daemon \ + bitcoind -testnet4 -daemon \ -zmqpubrawtx=tcp://127.0.0.1:28332 \ -zmqpubrawblock=tcp://127.0.0.1:28332 \ -zmqpubhashtx=tcp://127.0.0.1:28332 \ diff --git a/depends/.gitignore b/depends/.gitignore index 19c506ce54..c53f7f610e 100644 --- a/depends/.gitignore +++ b/depends/.gitignore @@ -2,8 +2,8 @@ SDKs/ work/ built/ sources/ -config.site x86_64* +amd64* i686* mips* arm* diff --git a/depends/Makefile b/depends/Makefile index 3169117633..9767b8eb29 100644 --- a/depends/Makefile +++ b/depends/Makefile @@ -36,23 +36,17 @@ NO_BOOST ?= NO_LIBEVENT ?= NO_QT ?= NO_QR ?= -NO_BDB ?= -NO_SQLITE ?= NO_WALLET ?= NO_ZMQ ?= -NO_UPNP ?= NO_USDT ?= -NO_NATPMP ?= MULTIPROCESS ?= LTO ?= -NO_HARDEN ?= FALLBACK_DOWNLOAD_PATH ?= https://bitcoincore.org/depends-sources C_STANDARD ?= c11 -CXX_STANDARD ?= c++17 +CXX_STANDARD ?= c++20 BUILD = $(shell ./config.guess) -HOST ?= $(BUILD) PATCHES_PATH = $(BASEDIR)/patches BASEDIR = $(CURDIR) HASH_LENGTH:=11 @@ -61,11 +55,6 @@ DOWNLOAD_RETRIES:=3 HOST_ID_SALT ?= salt BUILD_ID_SALT ?= salt -host:=$(BUILD) -ifneq ($(HOST),) -host:=$(HOST) -endif - ifneq ($(DEBUG),) release_type=debug else @@ -75,9 +64,15 @@ endif base_build_dir=$(WORK_PATH)/build base_staging_dir=$(WORK_PATH)/staging base_download_dir=$(WORK_PATH)/download -canonical_host:=$(shell ./config.sub $(HOST)) build:=$(shell ./config.sub $(BUILD)) +host:=$(build) +ifneq ($(HOST),) +host:=$(HOST) +endif +HOST ?= $(BUILD) +canonical_host:=$(shell ./config.sub $(HOST)) + build_arch =$(firstword $(subst -, ,$(build))) build_vendor=$(word 2,$(subst -, ,$(build))) full_build_os:=$(subst $(build_arch)-$(build_vendor)-,,$(build)) @@ -101,10 +96,6 @@ host_os+=$(findstring netbsd,$(full_host_os)) host_os+=$(findstring openbsd,$(full_host_os)) host_os+=$(findstring mingw32,$(full_host_os)) -ifeq (android,$(findstring android,$(full_host_os))) -host_os:=android -endif - host_os:=$(strip $(host_os)) ifeq ($(host_os),) host_os=$(full_host_os) @@ -147,8 +138,16 @@ include packages/packages.mk # 2. Before including packages/*.mk (excluding packages/packages.mk), since # they rely on the build_id variables # -build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(build_AR)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') -$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' AR='$(host_AR)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' DEBUG='$(DEBUG)' LTO='$(LTO)' NO_HARDEN='$(NO_HARDEN)' ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') +build_id:=$(shell env CC='$(build_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(build_CXX)' CXX_STANDARD='$(CXX_STANDARD)' \ + AR='$(build_AR)' NM='$(build_NM)' RANLIB='$(build_RANLIB)' STRIP='$(build_STRIP)' SHA256SUM='$(build_SHA256SUM)' \ + DEBUG='$(DEBUG)' \ + ./gen_id '$(BUILD_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') + +$(host_arch)_$(host_os)_id:=$(shell env CC='$(host_CC)' C_STANDARD='$(C_STANDARD)' CXX='$(host_CXX)' CXX_STANDARD='$(CXX_STANDARD)' \ + CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CXXFLAGS='$(CXXFLAGS)' LDFLAGS='$(LDFLAGS)' \ + AR='$(host_AR)' NM='$(host_NM)' RANLIB='$(host_RANLIB)' STRIP='$(host_STRIP)' SHA256SUM='$(build_SHA256SUM)' \ + DEBUG='$(DEBUG)' LTO='$(LTO)' \ + ./gen_id '$(HOST_ID_SALT)' 'GUIX_ENVIRONMENT=$(realpath $(GUIX_ENVIRONMENT))') boost_packages_$(NO_BOOST) = $(boost_packages) @@ -157,20 +156,16 @@ libevent_packages_$(NO_LIBEVENT) = $(libevent_packages) qrencode_packages_$(NO_QR) = $(qrencode_$(host_os)_packages) qt_packages_$(NO_QT) = $(qt_packages) $(qt_$(host_os)_packages) $(qt_$(host_arch)_$(host_os)_packages) $(qrencode_packages_) +qt_native_packages_$(NO_QT) = $(qt_native_packages) -bdb_packages_$(NO_BDB) = $(bdb_packages) -sqlite_packages_$(NO_SQLITE) = $(sqlite_packages) -wallet_packages_$(NO_WALLET) = $(bdb_packages_) $(sqlite_packages_) - -upnp_packages_$(NO_UPNP) = $(upnp_packages) -natpmp_packages_$(NO_NATPMP) = $(natpmp_packages) +wallet_packages_$(NO_WALLET) = $(sqlite_packages) zmq_packages_$(NO_ZMQ) = $(zmq_packages) multiprocess_packages_$(MULTIPROCESS) = $(multiprocess_packages) usdt_packages_$(NO_USDT) = $(usdt_$(host_os)_packages) -packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(upnp_packages_) $(natpmp_packages_) $(usdt_packages_) -native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) +packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(boost_packages_) $(libevent_packages_) $(qt_packages_) $(wallet_packages_) $(usdt_packages_) +native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages) $(qt_native_packages_) ifneq ($(zmq_packages_),) packages += $(zmq_packages) @@ -183,14 +178,11 @@ endif all_packages = $(packages) $(native_packages) -meta_depends = Makefile funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk - -$(host_arch)_$(host_os)_native_binutils?=$($(host_os)_native_binutils) -$(host_arch)_$(host_os)_native_toolchain?=$($(host_os)_native_toolchain) +meta_depends = Makefile config.guess config.sub funcs.mk builders/default.mk hosts/default.mk hosts/$(host_os).mk builders/$(build_os).mk include funcs.mk -final_build_id_long+=$(shell $(build_SHA256SUM) config.site.in) +final_build_id_long+=$(shell $(build_SHA256SUM) toolchain.cmake.in) final_build_id+=$(shell echo -n "$(final_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH)) $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) rm -rf $(@D) @@ -198,68 +190,51 @@ $(host_prefix)/.stamp_$(final_build_id): $(native_packages) $(packages) echo copying packages: $^ echo to: $(@D) cd $(@D); $(foreach package,$^, $(build_TAR) xf $($(package)_cached); ) + echo To build Bitcoin Core with these packages, pass \'--toolchain $(@D)/toolchain.cmake\' to the first CMake invocation. touch $@ -# $PATH is not preserved between ./configure and make by convention. Its -# modification and overriding at ./configure time is (as I understand it) -# supposed to be captured by the AC_{PROG_{,OBJ}CXX,PATH_{PROG,TOOL}} macros, -# which will expand the program names to their full absolute paths. The notable -# exception is command line overriding: ./configure CC=clang, which skips the -# program name expansion step, and works because the user implicitly indicates -# with CC=clang that clang will be available in $PATH at all times, and is most -# likely part of the user's system. -# -# Therefore, when we "seed the autoconf cache"/"override well-known program -# vars" by setting AR= in our config.site, either one of two things needs -# to be true for the build system to work correctly: -# -# 1. If we refer to the program by name (e.g. AR=riscv64-gnu-linux-ar), the -# tool needs to be available in $PATH at all times. -# -# 2. If the tool is _**not**_ expected to be available in $PATH at all times -# (such as is the case for our native_cctools binutils tools), it needs to -# be referred to by its absolute path, such as would be output by the -# AC_PATH_{PROG,TOOL} macros. -# -# Minor note: it is also okay to refer to tools by their absolute path even if -# we expect them to be available in $PATH at all times, more specificity does -# not hurt. -$(host_prefix)/share/config.site : config.site.in $(host_prefix)/.stamp_$(final_build_id) +ifeq ($(host),$(build)) + crosscompiling=FALSE +else + crosscompiling=TRUE +endif + +$(host_prefix)/toolchain.cmake : toolchain.cmake.in $(host_prefix)/.stamp_$(final_build_id) @mkdir -p $(@D) - sed -e 's|@HOST@|$(host)|' \ + sed -e 's|@depends_crosscompiling@|$(crosscompiling)|' \ + -e 's|@host@|$(host)|' \ + -e 's|@host_system_name@|$($(host_os)_cmake_system_name)|' \ + -e 's|@host_system_version@|$($(host_os)_cmake_system_version)|' \ + -e 's|@host_arch@|$(host_arch)|' \ -e 's|@CC@|$(host_CC)|' \ -e 's|@CXX@|$(host_CXX)|' \ + -e 's|@OSX_SDK@|$(OSX_SDK)|' \ -e 's|@AR@|$(host_AR)|' \ -e 's|@RANLIB@|$(host_RANLIB)|' \ - -e 's|@NM@|$(host_NM)|' \ -e 's|@STRIP@|$(host_STRIP)|' \ - -e 's|@OTOOL@|$(host_OTOOL)|' \ - -e 's|@INSTALL_NAME_TOOL@|$(host_INSTALL_NAME_TOOL)|' \ - -e 's|@DSYMUTIL@|$(host_DSYMUTIL)|' \ - -e 's|@build_os@|$(build_os)|' \ - -e 's|@host_os@|$(host_os)|' \ - -e 's|@CFLAGS@|$(strip $(host_CFLAGS) $(host_$(release_type)_CFLAGS))|' \ - -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS) $(host_$(release_type)_CXXFLAGS))|' \ - -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS) $(host_$(release_type)_CPPFLAGS))|' \ - -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS) $(host_$(release_type)_LDFLAGS))|' \ - -e 's|@allow_host_packages@|$(ALLOW_HOST_PACKAGES)|' \ - -e 's|@no_qt@|$(NO_QT)|' \ - -e 's|@no_qr@|$(NO_QR)|' \ - -e 's|@no_zmq@|$(NO_ZMQ)|' \ - -e 's|@no_wallet@|$(NO_WALLET)|' \ - -e 's|@no_bdb@|$(NO_BDB)|' \ - -e 's|@no_sqlite@|$(NO_SQLITE)|' \ - -e 's|@no_upnp@|$(NO_UPNP)|' \ - -e 's|@no_usdt@|$(NO_USDT)|' \ - -e 's|@no_natpmp@|$(NO_NATPMP)|' \ + -e 's|@OBJCOPY@|$(host_OBJCOPY)|' \ + -e 's|@OBJDUMP@|$(host_OBJDUMP)|' \ + -e 's|@CFLAGS@|$(strip $(host_CFLAGS))|' \ + -e 's|@CFLAGS_RELEASE@|$(strip $(host_release_CFLAGS))|' \ + -e 's|@CFLAGS_DEBUG@|$(strip $(host_debug_CFLAGS))|' \ + -e 's|@CXXFLAGS@|$(strip $(host_CXXFLAGS))|' \ + -e 's|@CXXFLAGS_RELEASE@|$(strip $(host_release_CXXFLAGS))|' \ + -e 's|@CXXFLAGS_DEBUG@|$(strip $(host_debug_CXXFLAGS))|' \ + -e 's|@CPPFLAGS@|$(strip $(host_CPPFLAGS))|' \ + -e 's|@CPPFLAGS_RELEASE@|$(strip $(host_release_CPPFLAGS))|' \ + -e 's|@CPPFLAGS_DEBUG@|$(strip $(host_debug_CPPFLAGS))|' \ + -e 's|@LDFLAGS@|$(strip $(host_LDFLAGS))|' \ + -e 's|@LDFLAGS_RELEASE@|$(strip $(host_release_LDFLAGS))|' \ + -e 's|@LDFLAGS_DEBUG@|$(strip $(host_debug_LDFLAGS))|' \ + -e 's|@qt_packages@|$(qt_packages_)|' \ + -e 's|@qrencode_packages@|$(qrencode_packages_)|' \ + -e 's|@zmq_packages@|$(zmq_packages_)|' \ + -e 's|@wallet_packages@|$(wallet_packages_)|' \ + -e 's|@usdt_packages@|$(usdt_packages_)|' \ -e 's|@multiprocess@|$(MULTIPROCESS)|' \ - -e 's|@lto@|$(LTO)|' \ - -e 's|@no_harden@|$(NO_HARDEN)|' \ - -e 's|@debug@|$(DEBUG)|' \ $< > $@ touch $@ - define check_or_remove_cached mkdir -p $(BASE_CACHE)/$(host)/$(package) && cd $(BASE_CACHE)/$(host)/$(package); \ $(build_SHA256SUM) -c $($(package)_cached_checksum) >/dev/null 2>/dev/null || \ @@ -279,7 +254,7 @@ check-packages: check-sources: @$(foreach package,$(all_packages),$(call check_or_remove_sources,$(package));) -$(host_prefix)/share/config.site: check-packages +$(host_prefix)/toolchain.cmake: check-packages check-packages: check-sources @@ -289,7 +264,7 @@ clean-all: clean clean: @rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD) *.log -install: check-packages $(host_prefix)/share/config.site +install: check-packages $(host_prefix)/toolchain.cmake download-one: check-sources $(all_sources) diff --git a/depends/README.md b/depends/README.md index b5992a3fef..b1247b319e 100644 --- a/depends/README.md +++ b/depends/README.md @@ -1,69 +1,142 @@ -### Usage +# Depends build + +This is a system of building and caching dependencies necessary for building +Bitcoin Core. It supports cross-compilation. For more details see [description.md](description.md), +as well as [packages.md](packages.md) for how to add packages. + +## Usage + +### Ubuntu & Debian + + apt install cmake curl make patch + +Skip the following packages if you don't intend to use the GUI and will build with [`NO_QT=1`](#dependency-options): + + apt install bison g++ ninja-build pkgconf python3 xz-utils To build dependencies for the current arch+OS: make -To build for another arch/OS: +### macOS - make HOST=host-platform-triplet +Install Xcode Command Line Tools and Homebrew Package Manager, +see [build-osx.md](../doc/build-osx.md). -For example: + brew install cmake make ninja - make HOST=x86_64-w64-mingw32 -j4 +To build dependencies for the current arch+OS: + + gmake + +### FreeBSD + + pkg install bash + +To build dependencies for the current arch+OS: + + gmake + +### NetBSD + + pkgin install bash gmake + +To build dependencies for the current arch+OS: + + gmake -**Bitcoin Core's `configure` script by default will ignore the depends output.** In +### OpenBSD + + pkg_add bash gmake gtar + +To build dependencies for the current arch+OS: + + gmake + +## Configuring Bitcoin Core + +**When configuring Bitcoin Core, CMake by default will ignore the depends output.** In order for it to pick up libraries, tools, and settings from the depends build, -you must set the `CONFIG_SITE` environment variable to point to a `config.site` settings file. -Make sure that `CONFIG_SITE` is an absolute path. -In the above example, a file named `depends/x86_64-w64-mingw32/share/config.site` will be -created. To use it during compilation: +you must specify the toolchain file. +In the above example for Ubuntu, a file named `depends/x86_64-pc-linux-gnu/toolchain.cmake` will be +created. To use it during configuring Bitcoin Core: + + cmake -B build --toolchain depends/x86_64-pc-linux-gnu/toolchain.cmake + +## Dependency Options + +The following can be set when running make: `make FOO=bar` + +- `SOURCES_PATH`: Downloaded sources will be placed here +- `BASE_CACHE`: Built packages will be placed here +- `SDK_PATH`: Path where SDKs can be found (used by macOS) +- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up +- `C_STANDARD`: Set the C standard version used. Defaults to `c11`. +- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++20`. +- `NO_BOOST`: Don't download/build/cache Boost +- `NO_LIBEVENT`: Don't download/build/cache Libevent +- `NO_QT`: Don't download/build/cache Qt and its dependencies +- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode +- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ +- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet (SQLite) +- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints +- `MULTIPROCESS`: Build libmultiprocess (experimental) +- `DEBUG`: Disable some optimizations and enable more runtime checking +- `HOST_ID_SALT`: Optional salt to use when generating host package ids +- `BUILD_ID_SALT`: Optional salt to use when generating build package ids +- `LOG`: Use file-based logging for individual packages. During a package build its log file + resides in the `depends` directory, and the log file is printed out automatically in case + of build error. After successful build log files are moved along with package archives +- `LTO`: Enable options needed for LTO. Does not add `-flto` related options to *FLAGS. + +If some packages are not built, for example `make NO_WALLET=1`, the appropriate CMake cache +variables will be set when generating the Bitcoin Core buildsystem. In this case, `-DENABLE_WALLET=OFF`. + +## Cross compilation + +To build for another arch/OS: - CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure + make HOST=host-platform-triplet + +For example: -The default install prefix when using `config.site` is `--prefix=depends/`, -so depends build outputs will be installed in that location. + make HOST=x86_64-w64-mingw32 -j4 Common `host-platform-triplet`s for cross compilation are: -- `i686-pc-linux-gnu` for Linux 32 bit -- `x86_64-pc-linux-gnu` for x86 Linux +- `i686-pc-linux-gnu` for Linux x86 32 bit +- `x86_64-pc-linux-gnu` for Linux x86 64 bit - `x86_64-w64-mingw32` for Win64 - `x86_64-apple-darwin` for macOS - `arm64-apple-darwin` for ARM macOS - `arm-linux-gnueabihf` for Linux ARM 32 bit - `aarch64-linux-gnu` for Linux ARM 64 bit -- `powerpc64-linux-gnu` for Linux POWER 64-bit (big endian) -- `powerpc64le-linux-gnu` for Linux POWER 64-bit (little endian) +- `powerpc64-linux-gnu` for Linux POWER 64 bit (big endian) +- `powerpc64le-linux-gnu` for Linux POWER 64 bit (little endian) - `riscv32-linux-gnu` for Linux RISC-V 32 bit - `riscv64-linux-gnu` for Linux RISC-V 64 bit - `s390x-linux-gnu` for Linux S390X -- `armv7a-linux-android` for Android ARM 32 bit -- `aarch64-linux-android` for Android ARM 64 bit -- `x86_64-linux-android` for Android x86 64 bit - -The paths are automatically configured and no other options are needed unless targeting [Android](../doc/build-android.md). -### Install the required dependencies: Ubuntu & Debian +The paths are automatically configured and no other options are needed. #### For macOS cross compilation - sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools xorriso + apt install clang lld llvm zip -Note: You must obtain the macOS SDK before proceeding with a cross-compile. -Under the depends directory, create a subdirectory named `SDKs`. -Then, place the extracted SDK under this new directory. +Clang 18 or later is required. You must also obtain the macOS SDK before +proceeding with a cross-compile. Under the depends directory, create a +subdirectory named `SDKs`. Then, place the extracted SDK under this new directory. For more information, see [SDK Extraction](../contrib/macdeploy/README.md#sdk-extraction). #### For Win64 cross compilation -- see [build-windows.md](../doc/build-windows.md#cross-compilation-for-ubuntu-and-windows-subsystem-for-linux) + apt install g++-mingw-w64-x86-64-posix #### For linux (including i386, ARM) cross compilation Common linux dependencies: - sudo apt-get install make automake cmake curl g++-multilib libtool binutils bsdmainutils pkg-config python3 patch bison + sudo apt-get install g++-multilib binutils For linux ARM cross compilation: @@ -85,59 +158,9 @@ For linux S390X cross compilation: sudo apt-get install g++-s390x-linux-gnu binutils-s390x-linux-gnu -### Install the required dependencies: OpenBSD - - pkg_add bash gtar - -### Dependency Options - -The following can be set when running make: `make FOO=bar` - -- `SOURCES_PATH`: Downloaded sources will be placed here -- `BASE_CACHE`: Built packages will be placed here -- `SDK_PATH`: Path where SDKs can be found (used by macOS) -- `FALLBACK_DOWNLOAD_PATH`: If a source file can't be fetched, try here before giving up -- `C_STANDARD`: Set the C standard version used. Defaults to `c11`. -- `CXX_STANDARD`: Set the C++ standard version used. Defaults to `c++17`. -- `NO_BOOST`: Don't download/build/cache Boost -- `NO_LIBEVENT`: Don't download/build/cache Libevent -- `NO_QT`: Don't download/build/cache Qt and its dependencies -- `NO_QR`: Don't download/build/cache packages needed for enabling qrencode -- `NO_ZMQ`: Don't download/build/cache packages needed for enabling ZeroMQ -- `NO_WALLET`: Don't download/build/cache libs needed to enable the wallet -- `NO_BDB`: Don't download/build/cache BerkeleyDB -- `NO_SQLITE`: Don't download/build/cache SQLite -- `NO_UPNP`: Don't download/build/cache packages needed for enabling UPnP -- `NO_NATPMP`: Don't download/build/cache packages needed for enabling NAT-PMP -- `NO_USDT`: Don't download/build/cache packages needed for enabling USDT tracepoints -- `ALLOW_HOST_PACKAGES`: Packages that are missed in dependencies (due to `NO_*` option or - build script logic) are searched for among the host system packages using - `pkg-config`. It allows building with packages of other (newer) versions -- `MULTIPROCESS`: Build libmultiprocess (experimental, requires CMake) -- `DEBUG`: Disable some optimizations and enable more runtime checking -- `HOST_ID_SALT`: Optional salt to use when generating host package ids -- `BUILD_ID_SALT`: Optional salt to use when generating build package ids -- `FORCE_USE_SYSTEM_CLANG`: (EXPERTS ONLY) When cross-compiling for macOS, use Clang found in the - system's `$PATH` rather than the default prebuilt release of Clang - from llvm.org. Clang 8 or later is required -- `LOG`: Use file-based logging for individual packages. During a package build its log file - resides in the `depends` directory, and the log file is printed out automatically in case - of build error. After successful build log files are moved along with package archives -- `LTO`: Use LTO when building packages. -- `NO_HARDEN=1`: Don't use hardening options when building packages - -If some packages are not built, for example `make NO_WALLET=1`, the appropriate -options will be passed to bitcoin's configure. In this case, `--disable-wallet`. - ### Additional targets download: run 'make download' to fetch all sources without building them download-osx: run 'make download-osx' to fetch all sources needed for macOS builds download-win: run 'make download-win' to fetch all sources needed for win builds download-linux: run 'make download-linux' to fetch all sources needed for linux builds - - -### Other documentation - -- [description.md](description.md): General description of the depends system -- [packages.md](packages.md): Steps for adding packages diff --git a/depends/builders/darwin.mk b/depends/builders/darwin.mk index 8ed82b276d..2b59353e84 100644 --- a/depends/builders/darwin.mk +++ b/depends/builders/darwin.mk @@ -3,26 +3,21 @@ build_darwin_CXX:=$(shell xcrun -f clang++) -isysroot$(shell xcrun --show-sdk-pa build_darwin_AR:=$(shell xcrun -f ar) build_darwin_RANLIB:=$(shell xcrun -f ranlib) build_darwin_STRIP:=$(shell xcrun -f strip) -build_darwin_OTOOL:=$(shell xcrun -f otool) +build_darwin_OBJDUMP:=$(shell xcrun -f objdump) build_darwin_NM:=$(shell xcrun -f nm) -build_darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) build_darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) build_darwin_SHA256SUM=shasum -a 256 build_darwin_DOWNLOAD=curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o #darwin host on darwin builder. overrides darwin host preferences. -darwin_CC=$(shell xcrun -f clang) -mmacosx-version-min=$(OSX_MIN_VERSION) -isysroot$(shell xcrun --show-sdk-path) -darwin_CXX:=$(shell xcrun -f clang++) -mmacosx-version-min=$(OSX_MIN_VERSION) -stdlib=libc++ -isysroot$(shell xcrun --show-sdk-path) +darwin_CC=$(shell xcrun -f clang) -isysroot$(shell xcrun --show-sdk-path) +darwin_CXX:=$(shell xcrun -f clang++) -stdlib=libc++ -isysroot$(shell xcrun --show-sdk-path) darwin_AR:=$(shell xcrun -f ar) darwin_RANLIB:=$(shell xcrun -f ranlib) darwin_STRIP:=$(shell xcrun -f strip) -darwin_LIBTOOL:=$(shell xcrun -f libtool) -darwin_OTOOL:=$(shell xcrun -f otool) +darwin_OBJDUMP:=$(shell xcrun -f objdump) darwin_NM:=$(shell xcrun -f nm) -darwin_INSTALL_NAME_TOOL:=$(shell xcrun -f install_name_tool) darwin_DSYMUTIL:=$(shell xcrun -f dsymutil) -darwin_native_binutils= -darwin_native_toolchain= x86_64_darwin_CFLAGS += -arch x86_64 x86_64_darwin_CXXFLAGS += -arch x86_64 diff --git a/depends/builders/default.mk b/depends/builders/default.mk index cc6dec66c2..2a1709d98a 100644 --- a/depends/builders/default.mk +++ b/depends/builders/default.mk @@ -1,17 +1,19 @@ default_build_CC = gcc default_build_CXX = g++ default_build_AR = ar +default_build_OBJDUMP = objdump default_build_TAR = tar default_build_RANLIB = ranlib default_build_STRIP = strip default_build_NM = nm +default_build_TOUCH = touch -h -m -t 200001011200 define add_build_tool_func build_$(build_os)_$1 ?= $$(default_build_$1) build_$(build_arch)_$(build_os)_$1 ?= $$(build_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1) endef -$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_build_tool_func,$(var)))) +$(foreach var,CC CXX AR TAR RANLIB NM STRIP SHA256SUM DOWNLOAD OBJDUMP DSYMUTIL TOUCH,$(eval $(call add_build_tool_func,$(var)))) define add_build_flags_func build_$(build_arch)_$(build_os)_$1 += $(build_$(build_os)_$1) build_$1=$$(build_$(build_arch)_$(build_os)_$1) diff --git a/depends/builders/freebsd.mk b/depends/builders/freebsd.mk index 465f58e04d..18316f492e 100644 --- a/depends/builders/freebsd.mk +++ b/depends/builders/freebsd.mk @@ -1,5 +1,5 @@ build_freebsd_CC=clang build_freebsd_CXX=clang++ -build_freebsd_SHA256SUM = shasum -a 256 +build_freebsd_SHA256SUM = sha256sum build_freebsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o diff --git a/depends/builders/openbsd.mk b/depends/builders/openbsd.mk index 44825d106a..9c94c4baae 100644 --- a/depends/builders/openbsd.mk +++ b/depends/builders/openbsd.mk @@ -5,3 +5,5 @@ build_openbsd_SHA256SUM = sha256 build_openbsd_DOWNLOAD = curl --location --fail --connect-timeout $(DOWNLOAD_CONNECT_TIMEOUT) --retry $(DOWNLOAD_RETRIES) -o build_openbsd_TAR = gtar +# openBSD touch doesn't understand -h +build_openbsd_TOUCH = touch -m -t 200001011200 diff --git a/depends/config.guess b/depends/config.guess index 69188da73d..48a684601b 100755 --- a/depends/config.guess +++ b/depends/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2023 Free Software Foundation, Inc. +# Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale -timestamp='2023-01-01' +timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] -Output the configuration name of the system \`$me' is run on. +Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit @@ -60,13 +60,13 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -102,8 +102,8 @@ GUESS= # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. -# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still -# use `HOST_CC' if defined, but it is deprecated. +# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still +# use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. @@ -123,7 +123,7 @@ set_cc_for_build() { dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" - for driver in cc gcc c89 c99 ; do + for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break @@ -155,6 +155,9 @@ Linux|GNU|GNU/*) set_cc_for_build cat <<-EOF > "$dummy.c" + #if defined(__ANDROID__) + LIBC=android + #else #include #if defined(__UCLIBC__) LIBC=uclibc @@ -162,6 +165,8 @@ Linux|GNU|GNU/*) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu + #elif defined(__LLVM_LIBC__) + LIBC=llvm #else #include /* First heuristic to detect musl libc. */ @@ -169,6 +174,7 @@ Linux|GNU|GNU/*) LIBC=musl #endif #endif + #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" @@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in UNAME_RELEASE=`uname -v` ;; esac - # Japanese Language versions have a version number like `4.1.3-JL'. + # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; @@ -628,7 +634,8 @@ EOF sed 's/^ //' << EOF > "$dummy.c" #include - main() + int + main () { if (!__power_pc()) exit(1); @@ -712,7 +719,8 @@ EOF #include #include - int main () + int + main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); @@ -904,7 +912,7 @@ EOF fi ;; *:FreeBSD:*:*) - UNAME_PROCESSOR=`/usr/bin/uname -p` + UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; @@ -976,7 +984,27 @@ EOF GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) - GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + set_cc_for_build + CPU=$UNAME_MACHINE + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + ABI=64 + sed 's/^ //' << EOF > "$dummy.c" + #ifdef __ARM_EABI__ + #ifdef __ARM_PCS_VFP + ABI=eabihf + #else + ABI=eabi + #endif + #endif +EOF + cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` + eval "$cc_set_abi" + case $ABI in + eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; + esac + fi + GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be @@ -1042,6 +1070,15 @@ EOF k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; + kvx:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + kvx:cos:*:*) + GUESS=$UNAME_MACHINE-unknown-cos + ;; + kvx:mbr:*:*) + GUESS=$UNAME_MACHINE-unknown-mbr + ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; @@ -1197,7 +1234,7 @@ EOF GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) - # If we were able to find `uname', then EMX Unix compatibility + # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; @@ -1338,7 +1375,7 @@ EOF GUESS=ns32k-sni-sysv fi ;; - PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; @@ -1560,6 +1597,9 @@ EOF *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; + *:Ironclad:*:*) + GUESS=$UNAME_MACHINE-unknown-ironclad + ;; esac # Do we have a guess based on uname results? @@ -1583,6 +1623,7 @@ cat > "$dummy.c" <." version="\ GNU config.sub ($timestamp) -Copyright 1992-2023 Free Software Foundation, Inc. +Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" -Try \`$me --help' for more information." +Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do @@ -120,7 +120,6 @@ case $# in esac # Split fields of configuration type -# shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 + echo "Invalid configuration '$1': more than four components" >&2 exit 1 ;; *-*-*-*) @@ -142,10 +141,21 @@ case $1 in # parts maybe_os=$field2-$field3 case $maybe_os in - nto-qnx* | linux-* | uclinux-uclibc* \ - | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ - | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ - | storm-chaos* | os2-emx* | rtmk-nova* | managarm-*) + cloudabi*-eabi* \ + | kfreebsd*-gnu* \ + | knetbsd*-gnu* \ + | kopensolaris*-gnu* \ + | linux-* \ + | managarm-* \ + | netbsd*-eabi* \ + | netbsd*-gnu* \ + | nto-qnx* \ + | os2-emx* \ + | rtmk-nova* \ + | storm-chaos* \ + | uclinux-gnu* \ + | uclinux-uclibc* \ + | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; @@ -160,8 +170,12 @@ case $1 in esac ;; *-*) - # A lone config we happen to match not fitting any pattern case $field1-$field2 in + # Shorthands that happen to contain a single dash + convex-c[12] | convex-c3[248]) + basic_machine=$field2-convex + basic_os= + ;; decstation-3100) basic_machine=mips-dec basic_os= @@ -169,28 +183,88 @@ case $1 in *-*) # Second component is usually, but not always the OS case $field2 in - # Prevent following clause from handling this valid os + # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; - zephyr*) - basic_machine=$field1-unknown - basic_os=$field2 - ;; # Manufacturers - dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ - | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ - | unicom* | ibm* | next | hp | isi* | apollo | altos* \ - | convergent* | ncr* | news | 32* | 3600* | 3100* \ - | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ - | ultra | tti* | harris | dolphin | highlevel | gould \ - | cbm | ns | masscomp | apple | axis | knuth | cray \ - | microblaze* | sim | cisco \ - | oki | wec | wrs | winbond) + 3100* \ + | 32* \ + | 3300* \ + | 3600* \ + | 7300* \ + | acorn \ + | altos* \ + | apollo \ + | apple \ + | atari \ + | att* \ + | axis \ + | be \ + | bull \ + | cbm \ + | ccur \ + | cisco \ + | commodore \ + | convergent* \ + | convex* \ + | cray \ + | crds \ + | dec* \ + | delta* \ + | dg \ + | digital \ + | dolphin \ + | encore* \ + | gould \ + | harris \ + | highlevel \ + | hitachi* \ + | hp \ + | ibm* \ + | intergraph \ + | isi* \ + | knuth \ + | masscomp \ + | microblaze* \ + | mips* \ + | motorola* \ + | ncr* \ + | news \ + | next \ + | ns \ + | oki \ + | omron* \ + | pc533* \ + | rebel \ + | rom68k \ + | rombug \ + | semi \ + | sequent* \ + | siemens \ + | sgi* \ + | siemens \ + | sim \ + | sni \ + | sony* \ + | stratus \ + | sun \ + | sun[234]* \ + | tektronix \ + | tti* \ + | ultra \ + | unicom* \ + | wec \ + | winbond \ + | wrs) basic_machine=$field1-$field2 basic_os= ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; *) basic_machine=$field1 basic_os=$field2 @@ -271,26 +345,6 @@ case $1 in basic_machine=arm-unknown basic_os=cegcc ;; - convex-c1) - basic_machine=c1-convex - basic_os=bsd - ;; - convex-c2) - basic_machine=c2-convex - basic_os=bsd - ;; - convex-c32) - basic_machine=c32-convex - basic_os=bsd - ;; - convex-c34) - basic_machine=c34-convex - basic_os=bsd - ;; - convex-c38) - basic_machine=c38-convex - basic_os=bsd - ;; cray) basic_machine=j90-cray basic_os=unicos @@ -713,15 +767,26 @@ case $basic_machine in vendor=dec basic_os=tops20 ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) + delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; - dpx2*) + # This used to be dpx2*, but that gets the RS6000-based + # DPX/20 and the x86-based DPX/2-100 wrong. See + # https://oldskool.silicium.org/stations/bull_dpx20.htm + # https://www.feb-patrimoine.com/english/bull_dpx2.htm + # https://www.feb-patrimoine.com/english/unix_and_bull.htm + dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull - basic_os=sysv3 + ;; + dpx2100 | dpx21xx) + cpu=i386 + vendor=bull + ;; + dpx20) + cpu=rs6000 + vendor=bull ;; encore | umax | mmax) cpu=ns32k @@ -836,18 +901,6 @@ case $basic_machine in next | m*-next) cpu=m68k vendor=next - case $basic_os in - openstep*) - ;; - nextstep*) - ;; - ns2*) - basic_os=nextstep2 - ;; - *) - basic_os=nextstep3 - ;; - esac ;; np1) cpu=np1 @@ -936,14 +989,13 @@ case $basic_machine in ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read cpu vendor <&2 + echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2 exit 1 ;; esac @@ -1306,11 +1491,12 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if test x$basic_os != x +if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. +obj= case $basic_os in gnu/linux*) kernel=linux @@ -1325,7 +1511,6 @@ case $basic_os in os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) - # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&2 + fi + ;; *) - echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 + exit 1 + ;; +esac + +case $obj in + aout* | coff* | elf* | pe*) + ;; + '') + # empty is fine + ;; + *) + echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 + exit 1 + ;; +esac + +# Here we handle the constraint that a (synthetic) cpu and os are +# valid only in combination with each other and nowhere else. +case $cpu-$os in + # The "javascript-unknown-ghcjs" triple is used by GHC; we + # accept it here in order to tolerate that, but reject any + # variations. + javascript-ghcjs) + ;; + javascript-* | *-ghcjs) + echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. -case $kernel-$os in - linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ - | linux-musl* | linux-relibc* | linux-uclibc* | linux-mlibc* ) +case $kernel-$os-$obj in + linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ + | linux-mlibc*- | linux-musl*- | linux-newlib*- \ + | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) + ;; + uclinux-uclibc*- | uclinux-gnu*- ) ;; - uclinux-uclibc* ) + managarm-mlibc*- | managarm-kernel*- ) ;; - managarm-mlibc* | managarm-kernel* ) + windows*-msvc*-) ;; - -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* | -mlibc* ) + -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ + | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. - echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; - -kernel* ) - echo "Invalid configuration \`$1': \`$os' needs explicit kernel." 1>&2 + -kernel*- ) + echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; - *-kernel* ) - echo "Invalid configuration \`$1': \`$kernel' does not support \`$os'." 1>&2 + *-kernel*- ) + echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; - kfreebsd*-gnu* | kopensolaris*-gnu*) + *-msvc*- ) + echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 + exit 1 ;; - vxworks-simlinux | vxworks-simwindows | vxworks-spe) + kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; - nto-qnx*) + vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; - os2-emx) + nto-qnx*-) ;; - *-eabi* | *-gnueabi*) + os2-emx-) ;; - -*) + rtmk-nova-) + ;; + *-eabi*- | *-gnueabi*-) + ;; + none--*) + # None (no kernel, i.e. freestanding / bare metal), + # can be paired with an machine code file format + ;; + -*-) # Blank kernel with real OS is always fine. ;; - *-*) - echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + --*) + # Blank kernel and OS with real machine code file format is always fine. + ;; + *-*-*) + echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac @@ -1826,7 +2273,7 @@ case $vendor in *-riscix*) vendor=acorn ;; - *-sunos*) + *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) @@ -1896,7 +2343,7 @@ case $vendor in ;; esac -echo "$cpu-$vendor-${kernel:+$kernel-}$os" +echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: diff --git a/depends/description.md b/depends/description.md index 0a6f2e6442..fa345bfe85 100644 --- a/depends/description.md +++ b/depends/description.md @@ -6,13 +6,12 @@ There are several features that make it different from most similar systems: In theory, binaries for any target OS/architecture can be created, from a builder running any OS/architecture. In practice, build-side tools must be specified when the defaults don't fit, and packages must be amended to work -on new hosts. For now, a build architecture of x86_64 is assumed, either on -Linux or macOS. +on new hosts. ### No reliance on timestamps File presence is used to determine what needs to be built. This makes the -results distributable and easily digestable by automated builders. +results distributable and easily digestible by automated builders. ### Each build only has its specified dependencies available at build-time. @@ -28,7 +27,7 @@ etc), and as well as a hash of the same data for each recursive dependency. If any portion of a package's build recipe changes, it will be rebuilt as well as any other package that depends on it. If any of the main makefiles (Makefile, funcs.mk, etc) are changed, all packages will be rebuilt. After building, the -results are cached into a tarball that can be re-used and distributed. +results are cached into a tarball that can be reused and distributed. ### Package build results are (relatively) deterministic. diff --git a/depends/funcs.mk b/depends/funcs.mk index 987be4e611..b499b6a78f 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -6,7 +6,6 @@ $(1)_objc=$$($$($(1)_type)_OBJC) $(1)_objcxx=$$($$($(1)_type)_OBJCXX) $(1)_ar=$$($$($(1)_type)_AR) $(1)_ranlib=$$($$($(1)_type)_RANLIB) -$(1)_libtool=$$($$($(1)_type)_LIBTOOL) $(1)_nm=$$($$($(1)_type)_NM) $(1)_cflags=$$($$($(1)_type)_CFLAGS) \ $$($$($(1)_type)_$$(release_type)_CFLAGS) @@ -40,34 +39,71 @@ define fetch_file $(call fetch_file_inner,$(1),$(FALLBACK_DOWNLOAD_PATH),$(3),$(4),$(5)))) endef +# Shell script to create a source tarball in $(1)_source from local directory +# $(1)_local_dir instead of downloading remote sources. Tarball is recreated if +# any paths in the local directory have a newer mtime, and checksum of the +# tarball is saved to $(1)_fetched and returned as output. +define fetch_local_dir_sha256 + if ! [ -f $($(1)_source) ] || [ -n "$$(find $($(1)_local_dir) -newer $($(1)_source) | head -n1)" ]; then \ + mkdir -p $(dir $($(1)_source)) && \ + $(build_TAR) -c -f $($(1)_source) -C $($(1)_local_dir) . && \ + rm -f $($(1)_fetched); \ + fi && \ + if ! [ -f $($(1)_fetched) ] || [ -n "$$(find $($(1)_source) -newer $($(1)_fetched))" ]; then \ + mkdir -p $(dir $($(1)_fetched)) && \ + cd $($(1)_source_dir) && \ + $(build_SHA256SUM) $($(1)_all_sources) > $($(1)_fetched); \ + fi && \ + cut -d" " -f1 $($(1)_fetched) +endef + define int_get_build_recipe_hash -$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $(PATCHES_PATH)/$(1)/,$($(1)_patches)) | cut -d" " -f1)) +$(eval $(1)_patches_path?=$(PATCHES_PATH)/$(1)) +$(eval $(1)_all_file_checksums:=$(shell $(build_SHA256SUM) $(meta_depends) packages/$(1).mk $(addprefix $($(1)_patches_path)/,$($(1)_patches)) | cut -d" " -f1)) +# If $(1)_local_dir is set, create a tarball of the local directory contents to +# use as the source of the package, and include a hash of the tarball in the +# package id, so if directory contents change, the package and packages +# depending on it will be rebuilt. +$(if $($(1)_local_dir),$(eval $(1)_sha256_hash:=$(shell $(call fetch_local_dir_sha256,$(1))))) +$(if $($(1)_local_dir),$(eval $(1)_all_file_checksums+=$($(1)_sha256_hash))) $(eval $(1)_recipe_hash:=$(shell echo -n "$($(1)_all_file_checksums)" | $(build_SHA256SUM) | cut -d" " -f1)) endef define int_get_build_id $(eval $(1)_dependencies += $($(1)_$(host_arch)_$(host_os)_dependencies) $($(1)_$(host_os)_dependencies)) -$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($($(1)_type)_native_toolchain) $($($(1)_type)_native_binutils) $($(1)_dependencies))) +$(eval $(1)_all_dependencies:=$(call int_get_all_dependencies,$(1),$($(1)_dependencies))) $(foreach dep,$($(1)_all_dependencies),$(eval $(1)_build_id_deps+=$(dep)-$($(dep)_version)-$($(dep)_recipe_hash))) $(eval $(1)_build_id_long:=$(1)-$($(1)_version)-$($(1)_recipe_hash)-$(release_type) $($(1)_build_id_deps) $($($(1)_type)_id)) $(eval $(1)_build_id:=$(shell echo -n "$($(1)_build_id_long)" | $(build_SHA256SUM) | cut -c-$(HASH_LENGTH))) final_build_id_long+=$($(package)_build_id_long) #compute package-specific paths -$(1)_build_subdir?=. -$(1)_download_file?=$($(1)_file_name) -$(1)_source_dir:=$(SOURCES_PATH) -$(1)_source:=$$($(1)_source_dir)/$($(1)_file_name) $(1)_staging_dir=$(base_staging_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) $(1)_staging_prefix_dir:=$$($(1)_staging_dir)$($($(1)_type)_prefix) $(1)_extract_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id) -$(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version) $(1)_build_dir:=$$($(1)_extract_dir)/$$($(1)_build_subdir) $(1)_cached_checksum:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz.hash $(1)_patch_dir:=$(base_build_dir)/$(host)/$(1)/$($(1)_version)-$($(1)_build_id)/.patches-$($(1)_build_id) -$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/ $(1)_cached:=$(BASE_CACHE)/$(host)/$(1)/$(1)-$($(1)_version)-$($(1)_build_id).tar.gz $(1)_build_log:=$(BASEDIR)/$(1)-$($(1)_version)-$($(1)_build_id).log +endef + +# Convert a string to a human-readable filename, replacing dot, slash, and space +# characters that could cause problems with dashes and collapsing them. +define int_friendly_file_name +$(subst $(null) $(null),-,$(strip $(subst ., ,$(subst /, ,$(1))))) +endef + +define int_get_build_properties +$(1)_build_subdir?=. +$(1)_download_file?=$($(1)_file_name) +$(1)_source_dir:=$(SOURCES_PATH) +# If $(1)_file_name is empty and $(1)_local_dir is nonempty, set file name to a +# .tar file with a friendly filename named after the directory path. +$(if $($(1)_file_name),,$(if $($(1)_local_dir),$(eval $(1)_file_name:=$(call int_friendly_file_name,$($(1)_local_dir)).tar))) +$(1)_source:=$$($(1)_source_dir)/$($(1)_file_name) +$(1)_download_dir:=$(base_download_dir)/$(1)-$($(1)_version) +$(1)_prefixbin:=$($($(1)_type)_prefix)/bin/ $(1)_all_sources=$($(1)_file_name) $($(1)_extra_sources) #stamps @@ -139,16 +175,16 @@ $(1)_config_env+=PKG_CONFIG_LIBDIR=$($($(1)_type)_prefix)/lib/pkgconfig $(1)_config_env+=PKG_CONFIG_PATH=$($($(1)_type)_prefix)/share/pkgconfig $(1)_config_env+=PKG_CONFIG_SYSROOT_DIR=/ $(1)_config_env+=CMAKE_MODULE_PATH=$($($(1)_type)_prefix)/lib/cmake -$(1)_config_env+=PATH=$(build_prefix)/bin:$(PATH) -$(1)_build_env+=PATH=$(build_prefix)/bin:$(PATH) -$(1)_stage_env+=PATH=$(build_prefix)/bin:$(PATH) +$(1)_config_env+=PATH="$(build_prefix)/bin:$(PATH)" +$(1)_build_env+=PATH="$(build_prefix)/bin:$(PATH)" +$(1)_stage_env+=PATH="$(build_prefix)/bin:$(PATH)" # Setting a --build type that differs from --host will explicitly enable # cross-compilation mode. Note that --build defaults to the output of # config.guess, which is what we set it too here. This also quells autoconf # warnings, "If you wanted to set the --build type, don't use --host.", # when using versions older than 2.70. -$(1)_autoconf=./configure --build=$(BUILD) --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" +$(1)_autoconf=./configure --build=$(BUILD) --host=$($($(1)_type)_host) --prefix=$($($(1)_type)_prefix) --with-pic $$($(1)_config_opts) CC="$$($(1)_cc)" CXX="$$($(1)_cxx)" ifneq ($($(1)_nm),) $(1)_autoconf += NM="$$($(1)_nm)" endif @@ -171,17 +207,29 @@ ifneq ($($(1)_ldflags),) $(1)_autoconf += LDFLAGS="$$($(1)_ldflags)" endif +# We hardcode the library install path to "lib" to match the PKG_CONFIG_PATH +# setting in depends/toolchain.cmake.in, which also hardcodes "lib". +# Without this setting, CMake by default would use the OS library +# directory, which might be "lib64" or something else, not "lib", on multiarch systems. $(1)_cmake=env CC="$$($(1)_cc)" \ CFLAGS="$$($(1)_cppflags) $$($(1)_cflags)" \ CXX="$$($(1)_cxx)" \ CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \ LDFLAGS="$$($(1)_ldflags)" \ - cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" $$($(1)_config_opts) + cmake -G "Unix Makefiles" \ + -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)" \ + -DCMAKE_AR=`which $$($(1)_ar)` \ + -DCMAKE_NM=`which $$($(1)_nm)` \ + -DCMAKE_RANLIB=`which $$($(1)_ranlib)` \ + -DCMAKE_INSTALL_LIBDIR=lib/ \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DCMAKE_VERBOSE_MAKEFILE:BOOL=$(V) \ + $$($(1)_config_opts) ifeq ($($(1)_type),build) $(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib" else ifneq ($(host),$(build)) -$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system) +$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system_name) $(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host) $(1)_cmake += -DCMAKE_CXX_COMPILER_TARGET=$(host) endif @@ -208,7 +256,7 @@ $($(1)_extracted): | $($(1)_fetched) $($(1)_preprocessed): | $($(1)_extracted) echo Preprocessing $(1)... mkdir -p $$(@D) $($(1)_patch_dir) - $(foreach patch,$($(1)_patches),cd $(PATCHES_PATH)/$(1); cp $(patch) $($(1)_patch_dir) ;) + $(foreach patch,$($(1)_patches),cd $($(1)_patches_path); cp $(patch) $($(1)_patch_dir) ;) { cd $$(@D); $($(1)_preprocess_cmds); } $$($(1)_logging) touch $$@ $($(1)_configured): | $($(1)_dependencies) $($(1)_preprocessed) @@ -235,7 +283,7 @@ $($(1)_postprocessed): | $($(1)_staged) $($(1)_cached): | $($(1)_dependencies) $($(1)_postprocessed) echo Caching $(1)... cd $$($(1)_staging_dir)/$(host_prefix); \ - find . ! -name '.stamp_postprocessed' -print0 | TZ=UTC xargs -0r touch -h -m -t 200001011200; \ + find . ! -name '.stamp_postprocessed' -print0 | TZ=UTC xargs -0r $(build_TOUCH); \ find . ! -name '.stamp_postprocessed' | LC_ALL=C sort | $(build_TAR) --numeric-owner --no-recursion -czf $$($(1)_staging_dir)/$$(@F) -T - mkdir -p $$(@D) rm -rf $$(@D) && mkdir -p $$(@D) @@ -276,6 +324,9 @@ $(foreach package,$(all_packages),$(eval $(call int_vars,$(package)))) $(foreach native_package,$(native_packages),$(eval include packages/$(native_package).mk)) $(foreach package,$(packages),$(eval include packages/$(package).mk)) +#set build properties for included package files +$(foreach package,$(all_packages),$(eval $(call int_get_build_properties,$(package)))) + #compute a hash of all files that comprise this package's build recipe $(foreach package,$(all_packages),$(eval $(call int_get_build_recipe_hash,$(package)))) @@ -287,6 +338,3 @@ $(foreach package,$(all_packages),$(eval $(call int_config_attach_build_config,$ #create build targets $(foreach package,$(all_packages),$(eval $(call int_add_cmds,$(package)))) - -#special exception: if a toolchain package exists, all non-native packages depend on it -$(foreach package,$(packages),$(eval $($(package)_extracted): |$($($(host_arch)_$(host_os)_native_toolchain)_cached) $($($(host_arch)_$(host_os)_native_binutils)_cached) )) diff --git a/depends/gen_id b/depends/gen_id index 3341310e46..5504deeb0e 100755 --- a/depends/gen_id +++ b/depends/gen_id @@ -1,8 +1,9 @@ #!/usr/bin/env bash # Usage: env [ CC=... ] [ C_STANDARD=...] [ CXX=... ] [CXX_STANDARD=...] \ -# [ AR=... ] [ RANLIB=... ] [ STRIP=... ] [ DEBUG=... ] \ -# [ LTO=... ] [ NO_HARDEN=... ] ./build-id [ID_SALT]... +# [ CPPFLAGS=... ] [CFLAGS=...] [CXXFLAGS=...] [LDFLAGS=...] \ +# [ AR=... ] [ NM=... ] [ RANLIB=... ] [ STRIP=... ] [ DEBUG=... ] \ +# [ LTO=... ] ./gen_id [ID_SALT]... # # Prints to stdout a SHA256 hash representing the current toolset, used by # depends/Makefile as a build id for caching purposes (detecting when the @@ -34,6 +35,13 @@ echo "$@" echo "END ID SALT" + echo "BEGIN FLAGS" + echo "CPPFLAGS=${CPPFLAGS}" + echo "CFLAGS=${CFLAGS}" + echo "CXXFLAGS=${CXXFLAGS}" + echo "LDFLAGS=${LDFLAGS}" + echo "END FLAGS" + # GCC only prints COLLECT_LTO_WRAPPER when invoked with just "-v", but we want # the information from "-v -E -" as well, so just include both. echo "BEGIN CC" @@ -50,12 +58,27 @@ echo "CXX_STANDARD=${CXX_STANDARD}" echo "END CXX" + # We use lld when cross-compiling for macOS, and it's version should + # be tied to LLVM. However someone compiling with GCC and -fuse-ld=lld + # would not see a cache bust if the LLVM toolchain was updated. + echo "BEGIN lld" + bash -c "ld.lld --version" + echo "END lld" + + echo "BEGIN mold" + bash -c "mold --version" + echo "END mold" + echo "BEGIN AR" bash -c "${AR} --version" env | grep '^AR_' - echo "ZERO_AR_DATE=${ZERO_AR_DATE}" echo "END AR" + echo "BEGIN NM" + bash -c "${NM} --version" + env | grep '^NM_' + echo "END NM" + echo "BEGIN RANLIB" bash -c "${RANLIB} --version" env | grep '^RANLIB_' @@ -70,10 +93,6 @@ echo "LTO=${LTO}" echo "END LTO" - echo "BEGIN NO_HARDEN" - echo "NO_HARDEN=${NO_HARDEN}" - echo "END NO_HARDEN" - echo "END ALL" ) | if [ -n "$DEBUG" ] && command -v tee > /dev/null 2>&1; then # When debugging and `tee` is available, output the preimage to stderr diff --git a/depends/hosts/android.mk b/depends/hosts/android.mk deleted file mode 100644 index b53966dcf8..0000000000 --- a/depends/hosts/android.mk +++ /dev/null @@ -1,20 +0,0 @@ -ifeq ($(HOST),armv7a-linux-android) -android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang++ -android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)eabi$(ANDROID_API_LEVEL)-clang -else -android_CXX=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang++ -android_CC=$(ANDROID_TOOLCHAIN_BIN)/$(HOST)$(ANDROID_API_LEVEL)-clang -endif - -android_CFLAGS=-std=$(C_STANDARD) -android_CXXFLAGS=-std=$(CXX_STANDARD) - -ifneq ($(LTO),) -android_CFLAGS += -flto -android_LDFLAGS += -flto -endif - -android_AR=$(ANDROID_TOOLCHAIN_BIN)/llvm-ar -android_RANLIB=$(ANDROID_TOOLCHAIN_BIN)/llvm-ranlib - -android_cmake_system=Android diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index fa6d6d4b8b..6f39718eff 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,30 +1,11 @@ -OSX_MIN_VERSION=11.0 -OSX_SDK_VERSION=11.0 -XCODE_VERSION=12.2 -XCODE_BUILD_ID=12B45b -LD64_VERSION=609 +OSX_MIN_VERSION=13.0 +OSX_SDK_VERSION=14.0 +XCODE_VERSION=15.0 +XCODE_BUILD_ID=15A240d +LLD_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers -darwin_native_binutils=native_cctools - -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -# FORCE_USE_SYSTEM_CLANG is empty, so we use our depends-managed, pinned clang -# from llvm.org - -# Clang is a dependency of native_cctools when FORCE_USE_SYSTEM_CLANG is empty -darwin_native_toolchain=native_cctools - -clang_prog=$(build_prefix)/bin/clang -clangxx_prog=$(clang_prog)++ -llvm_config_prog=$(build_prefix)/bin/llvm-config - -else -# FORCE_USE_SYSTEM_CLANG is non-empty, so we use the clang from the user's -# system - -darwin_native_toolchain= - # We can't just use $(shell command -v clang) because GNU Make handles builtins # in a special way and doesn't know that `command` is a POSIX-standard builtin # prior to 1af314465e5dfe3e8baa839a32a72e83c04f26ef, first released in v4.2.90. @@ -34,20 +15,14 @@ darwin_native_toolchain= # Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang") clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++") -llvm_config_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-config") - -llvm_lib_dir=$(shell $(llvm_config_prog) --libdir) -endif -cctools_TOOLS=AR RANLIB STRIP NM LIBTOOL OTOOL INSTALL_NAME_TOOL DSYMUTIL - -# Make-only lowercase function -lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) - -# For well-known tools provided by cctools, make sure that their well-known -# variable is set to the full path of the tool, just like how AC_PATH_{TOO,PROG} -# would. -$(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(host)-$(call lc,$(TOOL)))) +darwin_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar") +darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil") +darwin_NM=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-nm") +darwin_OBJCOPY=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objcopy") +darwin_OBJDUMP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-objdump") +darwin_RANLIB=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ranlib") +darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip") # Flag explanations: # @@ -56,11 +31,6 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$( # Ensures that modern linker features are enabled. See here for more # details: https://github.com/bitcoin/bitcoin/pull/19407. # -# -B$(build_prefix)/bin -# -# Explicitly point to our binaries (e.g. cctools) so that they are -# ensured to be found and preferred over other possibilities. -# # -isysroot$(OSX_SDK) -nostdlibinc # # Disable default include paths built into the compiler as well as @@ -71,37 +41,42 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$( # # Adds the desired paths from the SDK # +# -platform_version +# +# Indicate to the linker the platform, the oldest supported version, +# and the SDK used. +# +# -no_adhoc_codesign +# +# Disable adhoc codesigning (for now) when using LLVM tooling, to avoid +# non-determinism issues with the Identifier field. -darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ - -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ - -u LIBRARY_PATH \ - $(clang_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \ - -B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \ +darwin_CC=$(clang_prog) --target=$(host) \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \ - -u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \ - -u LIBRARY_PATH \ - $(clangxx_prog) --target=$(host) -mmacosx-version-min=$(OSX_MIN_VERSION) \ - -B$(build_prefix)/bin -mlinker-version=$(LD64_VERSION) \ +darwin_CXX=$(clangxx_prog) --target=$(host) \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include/c++/v1 \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -darwin_CFLAGS=-pipe -std=$(C_STANDARD) -darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) +darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) +darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) -ifneq ($(LTO),) -darwin_CFLAGS += -flto -darwin_CXXFLAGS += -flto -darwin_LDFLAGS += -flto +ifneq ($(build_os),darwin) +darwin_CFLAGS += -mlinker-version=$(LLD_VERSION) +darwin_CXXFLAGS += -mlinker-version=$(LLD_VERSION) +darwin_LDFLAGS += -Wl,-no_adhoc_codesign -fuse-ld=lld endif darwin_release_CFLAGS=-O2 darwin_release_CXXFLAGS=$(darwin_release_CFLAGS) -darwin_debug_CFLAGS=-O1 +darwin_debug_CFLAGS=-O1 -g darwin_debug_CXXFLAGS=$(darwin_debug_CFLAGS) -darwin_cmake_system=Darwin +darwin_cmake_system_name=Darwin +# Darwin version, which corresponds to OSX_MIN_VERSION. +# See https://en.wikipedia.org/wiki/Darwin_(operating_system) +darwin_cmake_system_version=20.1 diff --git a/depends/hosts/default.mk b/depends/hosts/default.mk index bad4568bcb..22409c4004 100644 --- a/depends/hosts/default.mk +++ b/depends/hosts/default.mk @@ -7,9 +7,9 @@ default_host_CXX = $(host_toolchain)g++ default_host_AR = $(host_toolchain)ar default_host_RANLIB = $(host_toolchain)ranlib default_host_STRIP = $(host_toolchain)strip -default_host_LIBTOOL = $(host_toolchain)libtool default_host_NM = $(host_toolchain)nm default_host_OBJCOPY = $(host_toolchain)objcopy +default_host_OBJDUMP = $(host_toolchain)objdump define add_host_tool_func ifneq ($(filter $(origin $1),undefined default),) @@ -29,8 +29,8 @@ endef define add_host_flags_func ifeq ($(filter $(origin $1),undefined default),) -$(host_arch)_$(host_os)_$1 = -$(host_arch)_$(host_os)_$(release_type)_$1 = $($1) +$(host_arch)_$(host_os)_$1 = $($1) +$(host_arch)_$(host_os)_$(release_type)_$1 = else $(host_arch)_$(host_os)_$1 += $($(host_os)_$1) $(host_arch)_$(host_os)_$(release_type)_$1 += $($(host_os)_$(release_type)_$1) @@ -39,5 +39,5 @@ host_$1 = $$($(host_arch)_$(host_os)_$1) host_$(release_type)_$1 = $$($(host_arch)_$(host_os)_$(release_type)_$1) endef -$(foreach tool,CC CXX AR RANLIB STRIP LIBTOOL NM OBJCOPY OTOOL INSTALL_NAME_TOOL DSYMUTIL,$(eval $(call add_host_tool_func,$(tool)))) +$(foreach tool,CC CXX AR RANLIB STRIP NM OBJCOPY OBJDUMP DSYMUTIL,$(eval $(call add_host_tool_func,$(tool)))) $(foreach flags,CFLAGS CXXFLAGS CPPFLAGS LDFLAGS, $(eval $(call add_host_flags_func,$(flags)))) diff --git a/depends/hosts/freebsd.mk b/depends/hosts/freebsd.mk index 5351d0b900..009d215f82 100644 --- a/depends/hosts/freebsd.mk +++ b/depends/hosts/freebsd.mk @@ -1,16 +1,10 @@ freebsd_CFLAGS=-pipe -std=$(C_STANDARD) freebsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -ifneq ($(LTO),) -freebsd_CFLAGS += -flto -freebsd_CXXFLAGS += -flto -freebsd_LDFLAGS += -flto -endif - freebsd_release_CFLAGS=-O2 freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS) -freebsd_debug_CFLAGS=-O1 +freebsd_debug_CFLAGS=-O1 -g freebsd_debug_CXXFLAGS=$(freebsd_debug_CFLAGS) ifeq (86,$(findstring 86,$(build_arch))) @@ -34,4 +28,4 @@ x86_64_freebsd_CC=$(default_host_CC) -m64 x86_64_freebsd_CXX=$(default_host_CXX) -m64 endif -freebsd_cmake_system=FreeBSD +freebsd_cmake_system_name=FreeBSD diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index 0e2496174e..e2f34265d1 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -2,10 +2,6 @@ linux_CFLAGS=-pipe -std=$(C_STANDARD) linux_CXXFLAGS=-pipe -std=$(CXX_STANDARD) ifneq ($(LTO),) -linux_CFLAGS += -flto -linux_CXXFLAGS += -flto -linux_LDFLAGS += -flto - linux_AR = $(host_toolchain)gcc-ar linux_NM = $(host_toolchain)gcc-nm linux_RANLIB = $(host_toolchain)gcc-ranlib @@ -14,10 +10,14 @@ endif linux_release_CFLAGS=-O2 linux_release_CXXFLAGS=$(linux_release_CFLAGS) -linux_debug_CFLAGS=-O1 +linux_debug_CFLAGS=-O1 -g linux_debug_CXXFLAGS=$(linux_debug_CFLAGS) -linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -D_LIBCPP_ENABLE_ASSERTIONS=1 +# https://gcc.gnu.org/onlinedocs/libstdc++/manual/debug_mode.html +linux_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC + +# https://libcxx.llvm.org/Hardening.html +linux_debug_CPPFLAGS+=-D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG ifeq (86,$(findstring 86,$(build_arch))) i686_linux_CC=gcc -m32 @@ -39,4 +39,7 @@ i686_linux_CXX=$(default_host_CXX) -m32 x86_64_linux_CC=$(default_host_CC) -m64 x86_64_linux_CXX=$(default_host_CXX) -m64 endif -linux_cmake_system=Linux + +linux_cmake_system_name=Linux +# Refer to doc/dependencies.md for the minimum required kernel. +linux_cmake_system_version=3.17.0 diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk index fc1cc1afbe..4628f7255d 100644 --- a/depends/hosts/mingw32.mk +++ b/depends/hosts/mingw32.mk @@ -1,3 +1,6 @@ +ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-gcc-posix"),) +mingw32_CC := $(host)-gcc-posix +endif ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),) mingw32_CXX := $(host)-g++-posix endif @@ -6,10 +9,6 @@ mingw32_CFLAGS=-pipe -std=$(C_STANDARD) mingw32_CXXFLAGS=-pipe -std=$(CXX_STANDARD) ifneq ($(LTO),) -mingw32_CFLAGS += -flto -mingw32_CXXFLAGS += -flto -mingw32_LDFLAGS += -flto - mingw32_AR = $(host_toolchain)gcc-ar mingw32_NM = $(host_toolchain)gcc-nm mingw32_RANLIB = $(host_toolchain)gcc-ranlib @@ -18,9 +17,11 @@ endif mingw32_release_CFLAGS=-O2 mingw32_release_CXXFLAGS=$(mingw32_release_CFLAGS) -mingw32_debug_CFLAGS=-O1 +mingw32_debug_CFLAGS=-O1 -g mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS) mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC -mingw32_cmake_system=Windows +mingw32_cmake_system_name=Windows +# Windows 10 +mingw32_cmake_system_version=10.0 diff --git a/depends/hosts/netbsd.mk b/depends/hosts/netbsd.mk index 14121dca20..d2b79f9d5b 100644 --- a/depends/hosts/netbsd.mk +++ b/depends/hosts/netbsd.mk @@ -2,21 +2,15 @@ netbsd_CFLAGS=-pipe -std=$(C_STANDARD) netbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) ifneq ($(LTO),) -netbsd_CFLAGS += -flto -netbsd_CXXFLAGS += -flto -netbsd_LDFLAGS += -flto - netbsd_AR = $(host_toolchain)gcc-ar netbsd_NM = $(host_toolchain)gcc-nm netbsd_RANLIB = $(host_toolchain)gcc-ranlib endif -netbsd_CXXFLAGS=$(netbsd_CFLAGS) - netbsd_release_CFLAGS=-O2 netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS) -netbsd_debug_CFLAGS=-O1 +netbsd_debug_CFLAGS=-O1 -g netbsd_debug_CXXFLAGS=$(netbsd_debug_CFLAGS) ifeq (86,$(findstring 86,$(build_arch))) @@ -40,4 +34,4 @@ x86_64_netbsd_CC=$(default_host_CC) -m64 x86_64_netbsd_CXX=$(default_host_CXX) -m64 endif -netbsd_cmake_system=NetBSD +netbsd_cmake_system_name=NetBSD diff --git a/depends/hosts/openbsd.mk b/depends/hosts/openbsd.mk index d330e94d2e..53595689b6 100644 --- a/depends/hosts/openbsd.mk +++ b/depends/hosts/openbsd.mk @@ -1,16 +1,10 @@ openbsd_CFLAGS=-pipe -std=$(C_STANDARD) openbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -ifneq ($(LTO),) -openbsd_CFLAGS += -flto -openbsd_CXXFLAGS += -flto -openbsd_LDFLAGS += -flto -endif - openbsd_release_CFLAGS=-O2 openbsd_release_CXXFLAGS=$(openbsd_release_CFLAGS) -openbsd_debug_CFLAGS=-O1 +openbsd_debug_CFLAGS=-O1 -g openbsd_debug_CXXFLAGS=$(openbsd_debug_CFLAGS) ifeq (86,$(findstring 86,$(build_arch))) @@ -34,4 +28,4 @@ x86_64_openbsd_CC=$(default_host_CC) -m64 x86_64_openbsd_CXX=$(default_host_CXX) -m64 endif -openbsd_cmake_system=OpenBSD +openbsd_cmake_system_name=OpenBSD diff --git a/depends/packages.md b/depends/packages.md index 4158b46d28..105fd90bab 100644 --- a/depends/packages.md +++ b/depends/packages.md @@ -6,12 +6,13 @@ The package "mylib" will be used here as an example General tips: - mylib_foo is written as $(package)_foo in order to make recipes more similar. - Secondary dependency packages relative to the bitcoin binaries/libraries (i.e. - those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't + those not in `ALLOWED_LIBRARIES` in `contrib/guix/symbol-check.py`) don't need to be shared and should be built statically whenever possible. See [below](#secondary-dependencies) for more details. ## Identifiers -Each package is required to define at least these variables: +If package does not define a `$(package)_local_dir` variable, it is required to +define these variables: $(package)_version: Version of the upstream library or program. If there is no version, a @@ -28,6 +29,9 @@ Each package is required to define at least these variables: $(package)_sha256_hash: The sha256 hash of the upstream file +If a package does define a `$(package)_local_dir` variable, the above variables +are not required and will be ignored. + These variables are optional: $(package)_build_subdir: @@ -48,6 +52,18 @@ These variables are optional: Any extra files that will be fetched via $(package)_fetch_cmds. These are specified so that they can be fetched and verified via 'make download'. +## Local packages + +If a package defines a `$(package)_local_dir` variable, the specified directory +will be treated as a download source, and a tarball of its contents will be +saved to `sources/`. A hash of the tarball will also become part of the package +build id, so if the directory contents change, the package and everything +depending on it will be rebuilt. For efficiency, the tarball is cached once it +has been created, but if the local directory is touched, it will be rebuilt. + +Local packages can be useful for using git submodules or subtrees to manage +package sources, or for testing local changes that are not available to +download from an external source. ## Build Variables: After defining the main identifiers, build variables may be added or customized @@ -74,7 +90,6 @@ These variables may be set to override or append their default values. $(package)_objcxx $(package)_ar $(package)_ranlib - $(package)_libtool $(package)_nm $(package)_cflags $(package)_cxxflags @@ -154,8 +169,8 @@ Most autotools projects can be properly staged using: ## Build outputs: In general, the output of a depends package should not contain any libtool -archives. Instead, the package should output `.pc` (`pkg-config`) files where -possible. +archives or `.pc` (`pkg-config`) files. Instead, the package should output +`.cmake` (CMake) files where possible. From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Handling_Libtool_Archives): @@ -163,10 +178,13 @@ From the [Gentoo Wiki entry](https://wiki.gentoo.org/wiki/Project:Quality_Assura > creates. This leads to massive overlinking, which is toxic to the Gentoo > ecosystem, as it leads to a massive number of unnecessary rebuilds. +Where possible, packages are built with Position Independent Code. Either using +the Autotools `--with-pic` flag, or `CMAKE_POSITION_INDEPENDENT_CODE` with CMake. + ## Secondary dependencies: Secondary dependency packages relative to the bitcoin binaries/libraries (i.e. -those not in `ALLOWED_LIBRARIES` in `contrib/devtools/symbol-check.py`) don't +those not in `ALLOWED_LIBRARIES` in `contrib/guix/symbol-check.py`) don't need to be shared and should be built statically whenever possible. This improves general build reliability as illustrated by the following example: diff --git a/depends/packages/bdb.mk b/depends/packages/bdb.mk deleted file mode 100644 index 9f5a925015..0000000000 --- a/depends/packages/bdb.mk +++ /dev/null @@ -1,39 +0,0 @@ -package=bdb -$(package)_version=4.8.30 -$(package)_download_path=https://download.oracle.com/berkeley-db -$(package)_file_name=db-$($(package)_version).NC.tar.gz -$(package)_sha256_hash=12edc0df75bf9abd7f82f821795bcee50f42cb2e5f76a6a281b85732798364ef -$(package)_build_subdir=build_unix -$(package)_patches=clang_cxx_11.patch - -define $(package)_set_vars -$(package)_config_opts=--disable-shared --enable-cxx --disable-replication --enable-option-checking -$(package)_config_opts_mingw32=--enable-mingw -$(package)_config_opts_linux=--with-pic -$(package)_config_opts_freebsd=--with-pic -$(package)_config_opts_netbsd=--with-pic -$(package)_config_opts_openbsd=--with-pic -$(package)_config_opts_android=--with-pic -$(package)_cflags+=-Wno-error=implicit-function-declaration -Wno-error=format-security -Wno-error=implicit-int -$(package)_cppflags_freebsd=-D_XOPEN_SOURCE=600 -D__BSD_VISIBLE=1 -$(package)_cppflags_netbsd=-D_XOPEN_SOURCE=600 -$(package)_cppflags_openbsd=-D_XOPEN_SOURCE=600 -$(package)_cppflags_mingw32=-DUNICODE -D_UNICODE -endef - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/clang_cxx_11.patch && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub dist -endef - -define $(package)_config_cmds - ../dist/$($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) libdb_cxx-4.8.a libdb-4.8.a -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install_lib install_include -endef diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index ebc097d686..938e9971ba 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -1,8 +1,8 @@ package=boost $(package)_version=1.81.0 -$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version)/source/ -$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.bz2 -$(package)_sha256_hash=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa +$(package)_download_path=https://archives.boost.io/release/$($(package)_version)/source/ +$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.gz +$(package)_sha256_hash=205666dea9f6a7cfed87c7a6dfbeb52a2c1b9de55712c9c1a87735d7181452b6 define $(package)_stage_cmds mkdir -p $($(package)_staging_prefix_dir)/include && \ diff --git a/depends/packages/capnp.mk b/depends/packages/capnp.mk index f4778c1ecd..f8c4406f3e 100644 --- a/depends/packages/capnp.mk +++ b/depends/packages/capnp.mk @@ -4,17 +4,21 @@ $(package)_download_path=$(native_$(package)_download_path) $(package)_download_file=$(native_$(package)_download_file) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) -$(package)_dependencies=native_$(package) +$(package)_patches=abi_placement_new.patch -define $(package)_set_vars := -$(package)_config_opts := --with-external-capnp -$(package)_config_opts += CAPNP="$$(native_capnp_prefixbin)/capnp" -$(package)_config_opts += CAPNP_CXX="$$(native_capnp_prefixbin)/capnp-c++" -$(package)_config_opts_android := --disable-shared +define $(package)_set_vars + $(package)_config_opts := -DBUILD_TESTING=OFF + $(package)_config_opts += -DWITH_OPENSSL=OFF + $(package)_config_opts += -DWITH_ZLIB=OFF + $(package)_cxxflags += -fdebug-prefix-map=$($(package)_extract_dir)=/usr -fmacro-prefix-map=$($(package)_extract_dir)=/usr +endef + +define $(package)_preprocess_cmds + patch -p2 < $($(package)_patch_dir)/abi_placement_new.patch endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) . endef define $(package)_build_cmds @@ -24,3 +28,7 @@ endef define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install endef + +define $(package)_postprocess_cmds + rm -rf lib/pkgconfig +endef diff --git a/depends/packages/expat.mk b/depends/packages/expat.mk index bb203d06f8..fb7d509938 100644 --- a/depends/packages/expat.mk +++ b/depends/packages/expat.mk @@ -3,20 +3,25 @@ $(package)_version=2.4.8 $(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/ $(package)_file_name=$(package)-$($(package)_version).tar.xz $(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25 +$(package)_build_subdir=build +$(package)_patches += cmake_minimum.patch # -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional # definitions in endian.h, which are required for a working -# endianess check in configure when building with -flto. +# endianness check in configure when building with -flto. define $(package)_set_vars - $(package)_config_opts=--disable-shared --without-docbook --without-tests --without-examples - $(package)_config_opts += --disable-dependency-tracking --enable-option-checking - $(package)_config_opts += --without-xmlwf - $(package)_config_opts_linux=--with-pic + $(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF + $(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF + $(package)_config_opts += -DBUILD_SHARED_LIBS=OFF $(package)_cppflags += -D_DEFAULT_SOURCE endef +define $(package)_preprocess_cmds + patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch +endef + define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -28,5 +33,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf share lib/cmake lib/*.la + rm -rf share lib/cmake endef diff --git a/depends/packages/fontconfig.mk b/depends/packages/fontconfig.mk index 444acfe36d..bd20d7c9ff 100644 --- a/depends/packages/fontconfig.mk +++ b/depends/packages/fontconfig.mk @@ -1,8 +1,8 @@ package=fontconfig $(package)_version=2.12.6 $(package)_download_path=https://www.freedesktop.org/software/fontconfig/release/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=cf0c30807d08f6a28ab46c61b8dbd55c97d2f292cf88f3a07d3384687f31f017 +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=064b9ebf060c9e77011733ac9dc0e2ce92870b574cca2405e11f5353a683c334 $(package)_dependencies=freetype expat $(package)_patches=gperf_header_regen.patch @@ -29,5 +29,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm -rf var lib/*.la + rm -rf bin etc share var lib/*.la endef diff --git a/depends/packages/freetype.mk b/depends/packages/freetype.mk index 6f5dbe0f01..fef0beaa7b 100644 --- a/depends/packages/freetype.mk +++ b/depends/packages/freetype.mk @@ -3,15 +3,17 @@ $(package)_version=2.11.0 $(package)_download_path=https://download.savannah.gnu.org/releases/$(package) $(package)_file_name=$(package)-$($(package)_version).tar.xz $(package)_sha256_hash=8bee39bd3968c4804b70614a0a3ad597299ad0e824bc8aad5ce8aaf48067bde7 +$(package)_build_subdir=build define $(package)_set_vars - $(package)_config_opts=--without-zlib --without-png --without-harfbuzz --without-bzip2 --disable-static - $(package)_config_opts += --enable-option-checking --without-brotli - $(package)_config_opts_linux=--with-pic + $(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DBUILD_SHARED_LIBS=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE + $(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -22,6 +24,3 @@ define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install endef -define $(package)_postprocess_cmds - rm -rf share/man lib/*.la -endef diff --git a/depends/packages/libXau.mk b/depends/packages/libXau.mk index b7e032c0b2..6bafc4f41a 100644 --- a/depends/packages/libXau.mk +++ b/depends/packages/libXau.mk @@ -1,8 +1,8 @@ package=libXau $(package)_version=1.0.9 $(package)_download_path=https://xorg.freedesktop.org/releases/individual/lib/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=ccf8cbf0dbf676faa2ea0a6d64bcc3b6746064722b606c8c52917ed00dcb73ec +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=1f123d8304b082ad63a9e89376400a3b1d4c29e67e3ea07b3f659cccca690eea $(package)_dependencies=xproto # When updating this package, check the default value of @@ -10,7 +10,6 @@ $(package)_dependencies=xproto define $(package)_set_vars $(package)_config_opts=--disable-shared --disable-lint-library --without-lint $(package)_config_opts += --disable-dependency-tracking --enable-option-checking - $(package)_config_opts_linux=--with-pic endef define $(package)_preprocess_cmds diff --git a/depends/packages/libevent.mk b/depends/packages/libevent.mk index 9650f77db9..dadd3b1b75 100644 --- a/depends/packages/libevent.mk +++ b/depends/packages/libevent.mk @@ -3,32 +3,29 @@ $(package)_version=2.1.12-stable $(package)_download_path=https://github.com/libevent/libevent/releases/download/release-$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb +$(package)_patches=cmake_fixups.patch +$(package)_patches += netbsd_fixup.patch +$(package)_build_subdir=build # When building for Windows, we set _WIN32_WINNT to target the same Windows -# version as we do in configure. Due to quirks in libevents build system, this +# version as we do in releases. Due to quirks in libevents build system, this # is also required to enable support for ipv6. See #19375. define $(package)_set_vars - $(package)_config_opts=--disable-shared --disable-openssl --disable-libevent-regress --disable-samples - $(package)_config_opts += --disable-dependency-tracking --enable-option-checking - $(package)_config_opts_release=--disable-debug-mode - $(package)_config_opts_linux=--with-pic - $(package)_config_opts_freebsd=--with-pic - $(package)_config_opts_netbsd=--with-pic - $(package)_config_opts_openbsd=--with-pic - $(package)_config_opts_android=--with-pic - $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601 - - ifeq ($(NO_HARDEN),) - $(package)_cppflags+=-D_FORTIFY_SOURCE=3 - endif + $(package)_config_opts=-DCMAKE_BUILD_TYPE=None -DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON + $(package)_config_opts+=-DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON + $(package)_config_opts+=-DEVENT__DISABLE_TESTS=ON -DEVENT__LIBRARY_TYPE=STATIC + $(package)_cflags += -fdebug-prefix-map=$($(package)_extract_dir)=/usr -fmacro-prefix-map=$($(package)_extract_dir)=/usr + $(package)_cppflags += -D_GNU_SOURCE -D_FORTIFY_SOURCE=3 + $(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0A00 endef define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub build-aux + patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch && \ + patch -p1 < $($(package)_patch_dir)/netbsd_fixup.patch endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds @@ -40,7 +37,8 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm lib/*.la && \ + rm -rf bin lib/pkgconfig && \ rm include/ev*.h && \ - rm include/event2/*_compat.h + rm include/event2/*_compat.h && \ + rm lib/libevent.a endef diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk deleted file mode 100644 index 765d649377..0000000000 --- a/depends/packages/libmultiprocess.mk +++ /dev/null @@ -1,28 +0,0 @@ -package=libmultiprocess -$(package)_version=$(native_$(package)_version) -$(package)_download_path=$(native_$(package)_download_path) -$(package)_file_name=$(native_$(package)_file_name) -$(package)_sha256_hash=$(native_$(package)_sha256_hash) -$(package)_dependencies=native_$(package) capnp -ifneq ($(host),$(build)) -$(package)_dependencies += native_capnp -endif - -define $(package)_set_vars := -ifneq ($(host),$(build)) -$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp" -$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++" -endif -endef - -define $(package)_config_cmds - $($(package)_cmake) . -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install-lib -endef diff --git a/depends/packages/libnatpmp.mk b/depends/packages/libnatpmp.mk deleted file mode 100644 index 2eddc76d9c..0000000000 --- a/depends/packages/libnatpmp.mk +++ /dev/null @@ -1,22 +0,0 @@ -package=libnatpmp -$(package)_version=07004b97cf691774efebe70404cf22201e4d330d -$(package)_download_path=https://github.com/miniupnp/libnatpmp/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=9321953ceb39d07c25463e266e50d0ae7b64676bb3a986d932b18881ed94f1fb - -define $(package)_set_vars - $(package)_build_opts=CC="$($(package)_cc)" - $(package)_build_opts_mingw32=CPPFLAGS=-DNATPMP_STATICLIB - $(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)" - $(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" -endef - -define $(package)_build_cmds - $(MAKE) libnatpmp.a $($(package)_build_opts) -endef - -define $(package)_stage_cmds - mkdir -p $($(package)_staging_prefix_dir)/include $($(package)_staging_prefix_dir)/lib &&\ - install *.h $($(package)_staging_prefix_dir)/include &&\ - install libnatpmp.a $($(package)_staging_prefix_dir)/lib -endef diff --git a/depends/packages/libxcb_util.mk b/depends/packages/libxcb_util.mk index 6f1b9cd7c6..dc4456f85c 100644 --- a/depends/packages/libxcb_util.mk +++ b/depends/packages/libxcb_util.mk @@ -1,14 +1,13 @@ package=libxcb_util $(package)_version=0.4.0 $(package)_download_path=https://xcb.freedesktop.org/dist -$(package)_file_name=xcb-util-$($(package)_version).tar.bz2 -$(package)_sha256_hash=46e49469cb3b594af1d33176cd7565def2be3fa8be4371d62271fabb5eae50e9 +$(package)_file_name=xcb-util-$($(package)_version).tar.gz +$(package)_sha256_hash=0ed0934e2ef4ddff53fcc70fc64fb16fe766cd41ee00330312e20a985fd927a7 $(package)_dependencies=libxcb define $(package)_set_vars $(package)_config_opts = --disable-shared --disable-devel-docs --without-doxygen $(package)_config_opts += --disable-dependency-tracking --enable-option-checking -$(package)_config_opts += --with-pic endef define $(package)_preprocess_cmds diff --git a/depends/packages/libxcb_util_cursor.mk b/depends/packages/libxcb_util_cursor.mk new file mode 100644 index 0000000000..b308890638 --- /dev/null +++ b/depends/packages/libxcb_util_cursor.mk @@ -0,0 +1,31 @@ +package=libxcb_util_cursor +$(package)_version=0.1.5 +$(package)_download_path=https://xcb.freedesktop.org/dist +$(package)_file_name=xcb-util-cursor-$($(package)_version).tar.gz +$(package)_sha256_hash=0e9c5446dc6f3beb8af6ebfcc9e27bcc6da6fe2860f7fc07b99144dfa568e93b +$(package)_dependencies=libxcb libxcb_util_render libxcb_util_image + +define $(package)_set_vars +$(package)_config_opts = --disable-static +$(package)_config_opts += --disable-dependency-tracking --enable-option-checking +endef + +define $(package)_preprocess_cmds + cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub . +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds + rm lib/*.la +endef diff --git a/depends/packages/libxcb_util_image.mk b/depends/packages/libxcb_util_image.mk index d12d67e8e8..2228250fec 100644 --- a/depends/packages/libxcb_util_image.mk +++ b/depends/packages/libxcb_util_image.mk @@ -1,8 +1,8 @@ package=libxcb_util_image $(package)_version=0.4.0 $(package)_download_path=https://xcb.freedesktop.org/dist -$(package)_file_name=xcb-util-image-$($(package)_version).tar.bz2 -$(package)_sha256_hash=2db96a37d78831d643538dd1b595d7d712e04bdccf8896a5e18ce0f398ea2ffc +$(package)_file_name=xcb-util-image-$($(package)_version).tar.gz +$(package)_sha256_hash=cb2c86190cf6216260b7357a57d9100811bb6f78c24576a3a5bfef6ad3740a42 $(package)_dependencies=libxcb libxcb_util define $(package)_set_vars diff --git a/depends/packages/libxcb_util_keysyms.mk b/depends/packages/libxcb_util_keysyms.mk index d4f72dedbe..56bc33d258 100644 --- a/depends/packages/libxcb_util_keysyms.mk +++ b/depends/packages/libxcb_util_keysyms.mk @@ -1,8 +1,8 @@ package=libxcb_util_keysyms $(package)_version=0.4.0 $(package)_download_path=https://xcb.freedesktop.org/dist -$(package)_file_name=xcb-util-keysyms-$($(package)_version).tar.bz2 -$(package)_sha256_hash=0ef8490ff1dede52b7de533158547f8b454b241aa3e4dcca369507f66f216dd9 +$(package)_file_name=xcb-util-keysyms-$($(package)_version).tar.gz +$(package)_sha256_hash=0807cf078fbe38489a41d755095c58239e1b67299f14460dec2ec811e96caa96 $(package)_dependencies=libxcb xproto define $(package)_set_vars diff --git a/depends/packages/libxcb_util_render.mk b/depends/packages/libxcb_util_render.mk index 28f1fb073c..ee2883feda 100644 --- a/depends/packages/libxcb_util_render.mk +++ b/depends/packages/libxcb_util_render.mk @@ -1,8 +1,8 @@ package=libxcb_util_render $(package)_version=0.3.9 $(package)_download_path=https://xcb.freedesktop.org/dist -$(package)_file_name=xcb-util-renderutil-$($(package)_version).tar.bz2 -$(package)_sha256_hash=c6e97e48fb1286d6394dddb1c1732f00227c70bd1bedb7d1acabefdd340bea5b +$(package)_file_name=xcb-util-renderutil-$($(package)_version).tar.gz +$(package)_sha256_hash=55eee797e3214fe39d0f3f4d9448cc53cffe06706d108824ea37bb79fcedcad5 $(package)_dependencies=libxcb define $(package)_set_vars diff --git a/depends/packages/libxcb_util_wm.mk b/depends/packages/libxcb_util_wm.mk index 3b905ba4ec..a68fd23f8a 100644 --- a/depends/packages/libxcb_util_wm.mk +++ b/depends/packages/libxcb_util_wm.mk @@ -1,8 +1,8 @@ package=libxcb_util_wm $(package)_version=0.4.1 $(package)_download_path=https://xcb.freedesktop.org/dist -$(package)_file_name=xcb-util-wm-$($(package)_version).tar.bz2 -$(package)_sha256_hash=28bf8179640eaa89276d2b0f1ce4285103d136be6c98262b6151aaee1d3c2a3f +$(package)_file_name=xcb-util-wm-$($(package)_version).tar.gz +$(package)_sha256_hash=038b39c4bdc04a792d62d163ba7908f4bb3373057208c07110be73c1b04b8334 $(package)_dependencies=libxcb define $(package)_set_vars diff --git a/depends/packages/miniupnpc.mk b/depends/packages/miniupnpc.mk deleted file mode 100644 index 7ad2529e47..0000000000 --- a/depends/packages/miniupnpc.mk +++ /dev/null @@ -1,30 +0,0 @@ -package=miniupnpc -$(package)_version=2.2.2 -$(package)_download_path=https://miniupnp.tuxfamily.org/files/ -$(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=888fb0976ba61518276fe1eda988589c700a3f2a69d71089260d75562afd3687 -$(package)_patches=dont_leak_info.patch respect_mingw_cflags.patch - -# Next time this package is updated, ensure that _WIN32_WINNT is still properly set. -# See discussion in https://github.com/bitcoin/bitcoin/pull/25964. -define $(package)_set_vars -$(package)_build_opts=CC="$($(package)_cc)" -$(package)_build_opts_darwin=LIBTOOL="$($(package)_libtool)" -$(package)_build_opts_mingw32=-f Makefile.mingw CFLAGS="$($(package)_cflags) -D_WIN32_WINNT=0x0601" -$(package)_build_env+=CFLAGS="$($(package)_cflags) $($(package)_cppflags)" AR="$($(package)_ar)" -endef - -define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/dont_leak_info.patch && \ - patch -p1 < $($(package)_patch_dir)/respect_mingw_cflags.patch -endef - -define $(package)_build_cmds - $(MAKE) libminiupnpc.a $($(package)_build_opts) -endef - -define $(package)_stage_cmds - mkdir -p $($(package)_staging_prefix_dir)/include/miniupnpc $($(package)_staging_prefix_dir)/lib &&\ - install *.h $($(package)_staging_prefix_dir)/include/miniupnpc &&\ - install libminiupnpc.a $($(package)_staging_prefix_dir)/lib -endef diff --git a/depends/packages/native_capnp.mk b/depends/packages/native_capnp.mk index ed5a6deee2..e67b103716 100644 --- a/depends/packages/native_capnp.mk +++ b/depends/packages/native_capnp.mk @@ -1,12 +1,18 @@ package=native_capnp -$(package)_version=0.7.0 +$(package)_version=1.1.0 $(package)_download_path=https://capnproto.org/ $(package)_download_file=capnproto-c++-$($(package)_version).tar.gz $(package)_file_name=capnproto-cxx-$($(package)_version).tar.gz -$(package)_sha256_hash=c9a4c0bd88123064d483ab46ecee777f14d933359e23bff6fb4f4dbd28b4cd41 +$(package)_sha256_hash=07167580e563f5e821e3b2af1c238c16ec7181612650c5901330fa9a0da50939 + +define $(package)_set_vars + $(package)_config_opts := -DBUILD_TESTING=OFF + $(package)_config_opts += -DWITH_OPENSSL=OFF + $(package)_config_opts += -DWITH_ZLIB=OFF +endef define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) . endef define $(package)_build_cmds @@ -16,3 +22,7 @@ endef define $(package)_stage_cmds $(MAKE) DESTDIR=$($(package)_staging_dir) install endef + +define $(package)_postprocess_cmds + rm -rf lib/pkgconfig +endef diff --git a/depends/packages/native_cctools.mk b/depends/packages/native_cctools.mk deleted file mode 100644 index 4860934a8e..0000000000 --- a/depends/packages/native_cctools.mk +++ /dev/null @@ -1,46 +0,0 @@ -package=native_cctools -$(package)_version=2ef2e931cf641547eb8a68cfebde61003587c9fd -$(package)_download_path=https://github.com/tpoechtrager/cctools-port/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=6b73269efdf5c58a070e7357b66ee760501388549d6a12b423723f45888b074b -$(package)_build_subdir=cctools -$(package)_dependencies=native_libtapi -$(package)_patches=no_fixup_chains.patch - -define $(package)_set_vars - $(package)_config_opts=--target=$(host) --enable-lto-support - $(package)_config_opts+=--with-llvm-config=$(llvm_config_prog) - $(package)_ldflags+=-Wl,-rpath=\\$$$$$$$$\$$$$$$$$ORIGIN/../lib - $(package)_cc=$(clang_prog) - $(package)_cxx=$(clangxx_prog) -endef - -ifneq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -define $(package)_preprocess_cmds - mkdir -p $($(package)_staging_prefix_dir)/lib && \ - cp $(llvm_lib_dir)/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools && \ - patch -p1 < $($(package)_patch_dir)/no_fixup_chains.patch -endef -else -define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub cctools && \ - patch -p1 < $($(package)_patch_dir)/no_fixup_chains.patch -endef -endif - -define $(package)_config_cmds - $($(package)_autoconf) -endef - -define $(package)_build_cmds - $(MAKE) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef - -define $(package)_postprocess_cmds - rm -rf share -endef diff --git a/depends/packages/native_clang.mk b/depends/packages/native_clang.mk deleted file mode 100644 index 661b9c2c1c..0000000000 --- a/depends/packages/native_clang.mk +++ /dev/null @@ -1,24 +0,0 @@ -package=native_clang -$(package)_version=15.0.6 -$(package)_download_path=https://github.com/llvm/llvm-project/releases/download/llvmorg-$($(package)_version) -ifneq (,$(findstring aarch64,$(BUILD))) -$(package)_file_name=clang+llvm-$($(package)_version)-aarch64-linux-gnu.tar.xz -$(package)_sha256_hash=8ca4d68cf103da8331ca3f35fe23d940c1b78fb7f0d4763c1c059e352f5d1bec -else -$(package)_file_name=clang+llvm-$($(package)_version)-x86_64-linux-gnu-ubuntu-18.04.tar.xz -$(package)_sha256_hash=38bc7f5563642e73e69ac5626724e206d6d539fbef653541b34cae0ba9c3f036 -endif - -define $(package)_stage_cmds - mkdir -p $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include && \ - mkdir -p $($(package)_staging_prefix_dir)/bin && \ - mkdir -p $($(package)_staging_prefix_dir)/include/llvm-c && \ - cp bin/clang $($(package)_staging_prefix_dir)/bin/ && \ - cp -P bin/clang++ $($(package)_staging_prefix_dir)/bin/ && \ - cp bin/dsymutil $($(package)_staging_prefix_dir)/bin/$(host)-dsymutil && \ - cp bin/llvm-config $($(package)_staging_prefix_dir)/bin/ && \ - cp include/llvm-c/ExternC.h $($(package)_staging_prefix_dir)/include/llvm-c && \ - cp include/llvm-c/lto.h $($(package)_staging_prefix_dir)/include/llvm-c && \ - cp lib/libLTO.so $($(package)_staging_prefix_dir)/lib/ && \ - cp -r lib/clang/$($(package)_version)/include/* $($(package)_staging_prefix_dir)/lib/clang/$($(package)_version)/include/ -endef diff --git a/depends/packages/native_ds_store.mk b/depends/packages/native_ds_store.mk deleted file mode 100644 index 51a95f48ef..0000000000 --- a/depends/packages/native_ds_store.mk +++ /dev/null @@ -1,15 +0,0 @@ -package=native_ds_store -$(package)_version=1.3.0 -$(package)_download_path=https://github.com/dmgbuild/ds_store/archive/ -$(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=76b3280cd4e19e5179defa23fb594a9dd32643b0c80d774bd3108361d94fb46d -$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages - -define $(package)_build_cmds - python3 setup.py build -endef - -define $(package)_stage_cmds - mkdir -p $($(package)_install_libdir) && \ - python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) -endef diff --git a/depends/packages/native_libmultiprocess.mk b/depends/packages/native_libmultiprocess.mk index e647afba5f..f494f6e8a5 100644 --- a/depends/packages/native_libmultiprocess.mk +++ b/depends/packages/native_libmultiprocess.mk @@ -1,8 +1,5 @@ package=native_libmultiprocess -$(package)_version=1af83d15239ccfa7e47b8764029320953dd7fdf1 -$(package)_download_path=https://github.com/chaincodelabs/libmultiprocess/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=e5587d3feedc7f8473f178a89b94163a11076629825d664964799bbbd5844da5 +$(package)_local_dir=../src/ipc/libmultiprocess $(package)_dependencies=native_capnp define $(package)_config_cmds diff --git a/depends/packages/native_libtapi.mk b/depends/packages/native_libtapi.mk deleted file mode 100644 index 052bb23689..0000000000 --- a/depends/packages/native_libtapi.mk +++ /dev/null @@ -1,17 +0,0 @@ -package=native_libtapi -$(package)_version=664b8414f89612f2dfd35a9b679c345aa5389026 -$(package)_download_path=https://github.com/tpoechtrager/apple-libtapi/archive -$(package)_file_name=$($(package)_version).tar.gz -$(package)_sha256_hash=62e419c12d1c9fad67cc1cd523132bc00db050998337c734c15bc8d73cc02b61 - -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -$(package)_dependencies=native_clang -endif - -define $(package)_build_cmds - CC=$(clang_prog) CXX=$(clangxx_prog) INSTALLPREFIX=$($(package)_staging_prefix_dir) ./build.sh -endef - -define $(package)_stage_cmds - ./install.sh -endef diff --git a/depends/packages/native_mac_alias.mk b/depends/packages/native_mac_alias.mk deleted file mode 100644 index ddd631186e..0000000000 --- a/depends/packages/native_mac_alias.mk +++ /dev/null @@ -1,15 +0,0 @@ -package=native_mac_alias -$(package)_version=2.2.0 -$(package)_download_path=https://github.com/dmgbuild/mac_alias/archive/ -$(package)_file_name=v$($(package)_version).tar.gz -$(package)_sha256_hash=421e6d7586d1f155c7db3e7da01ca0dacc9649a509a253ad7077b70174426499 -$(package)_install_libdir=$(build_prefix)/lib/python3/dist-packages - -define $(package)_build_cmds - python3 setup.py build -endef - -define $(package)_stage_cmds - mkdir -p $($(package)_install_libdir) && \ - python3 setup.py install --root=$($(package)_staging_dir) --prefix=$(build_prefix) --install-lib=$($(package)_install_libdir) -endef diff --git a/depends/packages/native_qt.mk b/depends/packages/native_qt.mk new file mode 100644 index 0000000000..fc59c4d3cc --- /dev/null +++ b/depends/packages/native_qt.mk @@ -0,0 +1,156 @@ +package=native_qt +include packages/qt_details.mk +$(package)_version=$(qt_details_version) +$(package)_download_path=$(qt_details_download_path) +$(package)_file_name=$(qt_details_qtbase_file_name) +$(package)_sha256_hash=$(qt_details_qtbase_sha256_hash) +$(package)_patches_path := $(qt_details_patches_path) +$(package)_patches := dont_hardcode_pwd.patch +$(package)_patches += qtbase-moc-ignore-gcc-macro.patch +$(package)_patches += qtbase_skip_tools.patch +$(package)_patches += rcc_hardcode_timestamp.patch +$(package)_patches += qttools_skip_dependencies.patch + +$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name) +$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash) + +$(package)_qttools_file_name=$(qt_details_qttools_file_name) +$(package)_qttools_sha256_hash=$(qt_details_qttools_sha256_hash) + +$(package)_extra_sources := $($(package)_qttranslations_file_name) +$(package)_extra_sources += $($(package)_qttools_file_name) + +$(package)_top_download_path=$(qt_details_top_download_path) +$(package)_top_cmakelists_file_name=$(qt_details_top_cmakelists_file_name) +$(package)_top_cmakelists_download_file=$(qt_details_top_cmakelists_download_file) +$(package)_top_cmakelists_sha256_hash=$(qt_details_top_cmakelists_sha256_hash) +$(package)_top_cmake_download_path=$(qt_details_top_cmake_download_path) +$(package)_top_cmake_ecmoptionaladdsubdirectory_file_name=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name) +$(package)_top_cmake_ecmoptionaladdsubdirectory_download_file=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file) +$(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) +$(package)_top_cmake_qttoplevelhelpers_file_name=$(qt_details_top_cmake_qttoplevelhelpers_file_name) +$(package)_top_cmake_qttoplevelhelpers_download_file=$(qt_details_top_cmake_qttoplevelhelpers_download_file) +$(package)_top_cmake_qttoplevelhelpers_sha256_hash=$(qt_details_top_cmake_qttoplevelhelpers_sha256_hash) + +$(package)_extra_sources += $($(package)_top_cmakelists_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) + +define $(package)_set_vars +# Build options. +$(package)_config_opts := -release +$(package)_config_opts += -make tools +$(package)_config_opts += -no-pkg-config +$(package)_config_opts += -no-reduce-relocations +$(package)_config_opts += -no-use-gold-linker +$(package)_config_opts += -prefix $(host_prefix) +$(package)_config_opts += -static + +# Modules. +$(package)_config_opts += -no-feature-concurrent +$(package)_config_opts += -no-feature-network +$(package)_config_opts += -no-feature-printsupport +$(package)_config_opts += -no-feature-sql +$(package)_config_opts += -no-feature-testlib +$(package)_config_opts += -no-feature-xml +$(package)_config_opts += -no-gui +$(package)_config_opts += -no-widgets + +$(package)_config_opts += -no-glib +$(package)_config_opts += -no-icu +$(package)_config_opts += -no-libudev +$(package)_config_opts += -no-openssl +$(package)_config_opts += -no-zstd +$(package)_config_opts += -qt-pcre +$(package)_config_opts += -qt-zlib +$(package)_config_opts += -no-feature-backtrace +$(package)_config_opts += -no-feature-permissions +$(package)_config_opts += -no-feature-process +$(package)_config_opts += -no-feature-settings + +# Core tools. +$(package)_config_opts += -no-feature-androiddeployqt +$(package)_config_opts += -no-feature-macdeployqt +$(package)_config_opts += -no-feature-windeployqt +$(package)_config_opts += -no-feature-qmake + +# Qt Tools module. +$(package)_config_opts += -feature-linguist +$(package)_config_opts += -no-feature-assistant +$(package)_config_opts += -no-feature-clang +$(package)_config_opts += -no-feature-clangcpp +$(package)_config_opts += -no-feature-designer +$(package)_config_opts += -no-feature-pixeltool +$(package)_config_opts += -no-feature-qdoc +$(package)_config_opts += -no-feature-qtattributionsscanner +$(package)_config_opts += -no-feature-qtdiag +$(package)_config_opts += -no-feature-qtplugininfo + +$(package)_config_env := CC="$$(build_CC)" +$(package)_config_env += CXX="$$(build_CXX)" +ifeq ($(build_os),darwin) +$(package)_config_env += OBJC="$$(build_CC)" +$(package)_config_env += OBJCXX="$$(build_CXX)" +endif + +$(package)_cmake_opts := -DCMAKE_EXE_LINKER_FLAGS="$$(build_LDFLAGS)" +ifneq ($(V),) +$(package)_cmake_opts += --log-level=STATUS +endif +endef + +define $(package)_fetch_cmds +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_download_path),$($(package)_top_cmakelists_download_file),$($(package)_top_cmakelists_file_name)-$($(package)_version),$($(package)_top_cmakelists_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_ecmoptionaladdsubdirectory_download_file),$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version),$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_qttoplevelhelpers_download_file),$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version),$($(package)_top_cmake_qttoplevelhelpers_sha256_hash)) +endef + +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir qtbase && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ + mkdir qttranslations && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ + mkdir qttools && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) +endef + +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_skip_tools.patch && \ + patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ + patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch +endef + +define $(package)_config_cmds + cd qtbase && \ + ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts) +endef + +define $(package)_build_cmds + cmake --build . -- $$(filter -j%,$$(MAKEFLAGS)) +endef + +define $(package)_stage_cmds + cmake --install . --prefix $($(package)_staging_prefix_dir) +endef + +define $(package)_postprocess_cmds + rm -rf doc/ && \ + mv translations/ .. +endef diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index b3600b72d0..7802cd915e 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -5,35 +5,21 @@ boost_packages = boost libevent_packages = libevent qrencode_linux_packages = qrencode -qrencode_android_packages = qrencode qrencode_darwin_packages = qrencode qrencode_mingw32_packages = qrencode -qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm -qt_android_packages=qt +qt_linux_packages:=qt expat libxcb xcb_proto libXau xproto freetype fontconfig libxkbcommon libxcb_util libxcb_util_cursor libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm qt_darwin_packages=qt qt_mingw32_packages=qt +ifneq ($(host),$(build)) +qt_native_packages := native_qt +endif -bdb_packages=bdb sqlite_packages=sqlite zmq_packages=zeromq -upnp_packages=miniupnpc -natpmp_packages=libnatpmp - -multiprocess_packages = libmultiprocess capnp +multiprocess_packages = capnp multiprocess_native_packages = native_libmultiprocess native_capnp usdt_linux_packages=systemtap - -darwin_native_packages = native_ds_store native_mac_alias - -ifneq ($(build_os),darwin) -darwin_native_packages += native_cctools native_libtapi - -ifeq ($(strip $(FORCE_USE_SYSTEM_CLANG)),) -darwin_native_packages+= native_clang -endif - -endif diff --git a/depends/packages/qrencode.mk b/depends/packages/qrencode.mk index 2afd95d7c4..e3f614091d 100644 --- a/depends/packages/qrencode.mk +++ b/depends/packages/qrencode.mk @@ -1,24 +1,24 @@ package=qrencode $(package)_version=4.1.1 $(package)_download_path=https://fukuchi.org/works/qrencode/ -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=e455d9732f8041cf5b9c388e345a641fd15707860f928e94507b1961256a6923 +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=da448ed4f52aba6bcb0cd48cac0dd51b8692bccc4cd127431402fca6f8171e8e +$(package)_patches=cmake_fixups.patch define $(package)_set_vars -$(package)_config_opts=--disable-shared --without-tools --without-tests --without-png -$(package)_config_opts += --disable-gprof --disable-gcov --disable-mudflap -$(package)_config_opts += --disable-dependency-tracking --enable-option-checking -$(package)_config_opts_linux=--with-pic -$(package)_config_opts_android=--with-pic +$(package)_config_opts := -DWITH_TOOLS=NO -DWITH_TESTS=NO -DGPROF=OFF -DCOVERAGE=OFF +$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE -DWITHOUT_PNG=ON +$(package)_config_opts += -DCMAKE_DISABLE_FIND_PACKAGE_ICONV=TRUE $(package)_cflags += -Wno-int-conversion -Wno-implicit-function-declaration endef define $(package)_preprocess_cmds - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub use + patch -p1 < $($(package)_patch_dir)/cmake_fixups.patch endef + define $(package)_config_cmds - $($(package)_autoconf) + $($(package)_cmake) -S . -B . endef define $(package)_build_cmds @@ -30,5 +30,5 @@ define $(package)_stage_cmds endef define $(package)_postprocess_cmds - rm lib/*.la + rm -rf share endef diff --git a/depends/packages/qt.mk b/depends/packages/qt.mk index 136ce32579..bd7d432897 100644 --- a/depends/packages/qt.mk +++ b/depends/packages/qt.mk @@ -1,119 +1,104 @@ package=qt -$(package)_version=5.15.5 -$(package)_download_path=https://download.qt.io/official_releases/qt/5.15/$($(package)_version)/submodules -$(package)_suffix=everywhere-opensource-src-$($(package)_version).tar.xz -$(package)_file_name=qtbase-$($(package)_suffix) -$(package)_sha256_hash=0c42c799aa7c89e479a07c451bf5a301e291266ba789e81afc18f95049524edc -$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm -$(package)_qt_libs=corelib network widgets gui plugins testlib -$(package)_linguist_tools = lrelease lupdate lconvert -$(package)_patches = qt.pro -$(package)_patches += qttools_src.pro -$(package)_patches += mac-qmake.conf -$(package)_patches += fix_qt_pkgconfig.patch -$(package)_patches += no-xlib.patch -$(package)_patches += dont_hardcode_x86_64.patch -$(package)_patches += fix_montery_include.patch -$(package)_patches += fix_android_jni_static.patch -$(package)_patches += dont_hardcode_pwd.patch +include packages/qt_details.mk +$(package)_version=$(qt_details_version) +$(package)_download_path=$(qt_details_download_path) +$(package)_file_name=$(qt_details_qtbase_file_name) +$(package)_sha256_hash=$(qt_details_qtbase_sha256_hash) +ifneq ($(host),$(build)) +$(package)_dependencies := native_$(package) +endif +$(package)_linux_dependencies=freetype fontconfig libxcb libxkbcommon libxcb_util libxcb_util_cursor libxcb_util_render libxcb_util_keysyms libxcb_util_image libxcb_util_wm +$(package)_patches_path := $(qt_details_patches_path) +$(package)_patches := dont_hardcode_pwd.patch $(package)_patches += qtbase-moc-ignore-gcc-macro.patch -$(package)_patches += use_android_ndk23.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 +$(package)_patches += qtbase_skip_tools.patch $(package)_patches += rcc_hardcode_timestamp.patch -$(package)_patches += duplicate_lcqpafonts.patch -$(package)_patches += fast_fixed_dtoa_no_optimize.patch -$(package)_patches += guix_cross_lib_path.patch +$(package)_patches += qttools_skip_dependencies.patch -$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix) -$(package)_qttranslations_sha256_hash=c92af4171397a0ed272330b4fa0669790fcac8d050b07c8b8cc565ebeba6735e +$(package)_qttranslations_file_name=$(qt_details_qttranslations_file_name) +$(package)_qttranslations_sha256_hash=$(qt_details_qttranslations_sha256_hash) -$(package)_qttools_file_name=qttools-$($(package)_suffix) -$(package)_qttools_sha256_hash=6d0778b71b2742cb527561791d1d3d255366163d54a10f78c683a398f09ffc6c +$(package)_qttools_file_name=$(qt_details_qttools_file_name) +$(package)_qttools_sha256_hash=$(qt_details_qttools_sha256_hash) -$(package)_extra_sources = $($(package)_qttranslations_file_name) +$(package)_extra_sources := $($(package)_qttranslations_file_name) $(package)_extra_sources += $($(package)_qttools_file_name) +$(package)_top_download_path=$(qt_details_top_download_path) +$(package)_top_cmakelists_file_name=$(qt_details_top_cmakelists_file_name) +$(package)_top_cmakelists_download_file=$(qt_details_top_cmakelists_download_file) +$(package)_top_cmakelists_sha256_hash=$(qt_details_top_cmakelists_sha256_hash) +$(package)_top_cmake_download_path=$(qt_details_top_cmake_download_path) +$(package)_top_cmake_ecmoptionaladdsubdirectory_file_name=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name) +$(package)_top_cmake_ecmoptionaladdsubdirectory_download_file=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file) +$(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash=$(qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) +$(package)_top_cmake_qttoplevelhelpers_file_name=$(qt_details_top_cmake_qttoplevelhelpers_file_name) +$(package)_top_cmake_qttoplevelhelpers_download_file=$(qt_details_top_cmake_qttoplevelhelpers_download_file) +$(package)_top_cmake_qttoplevelhelpers_sha256_hash=$(qt_details_top_cmake_qttoplevelhelpers_sha256_hash) + +$(package)_extra_sources += $($(package)_top_cmakelists_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) +$(package)_extra_sources += $($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) + define $(package)_set_vars -$(package)_config_env = QT_MAC_SDK_NO_VERSION_CHECK=1 -$(package)_config_opts_release = -release -$(package)_config_opts_release += -silent -$(package)_config_opts_debug = -debug -$(package)_config_opts_debug += -optimized-tools -$(package)_config_opts += -bindir $(build_prefix)/bin -$(package)_config_opts += -c++std c++17 -$(package)_config_opts += -confirm-license -$(package)_config_opts += -hostprefix $(build_prefix) -$(package)_config_opts += -no-compile-examples -$(package)_config_opts += -no-cups -$(package)_config_opts += -no-egl +$(package)_config_opts_release := -release +$(package)_config_opts_debug := -debug +$(package)_config_opts := -no-egl $(package)_config_opts += -no-eglfs $(package)_config_opts += -no-evdev $(package)_config_opts += -no-gif $(package)_config_opts += -no-glib $(package)_config_opts += -no-icu $(package)_config_opts += -no-ico -$(package)_config_opts += -no-iconv $(package)_config_opts += -no-kms $(package)_config_opts += -no-linuxfb $(package)_config_opts += -no-libjpeg $(package)_config_opts += -no-libproxy $(package)_config_opts += -no-libudev -$(package)_config_opts += -no-mimetype-database $(package)_config_opts += -no-mtdev +$(package)_config_opts += -no-opengl $(package)_config_opts += -no-openssl $(package)_config_opts += -no-openvg $(package)_config_opts += -no-reduce-relocations $(package)_config_opts += -no-schannel $(package)_config_opts += -no-sctp $(package)_config_opts += -no-securetransport -$(package)_config_opts += -no-sql-db2 -$(package)_config_opts += -no-sql-ibase -$(package)_config_opts += -no-sql-oci -$(package)_config_opts += -no-sql-tds -$(package)_config_opts += -no-sql-mysql -$(package)_config_opts += -no-sql-odbc -$(package)_config_opts += -no-sql-psql -$(package)_config_opts += -no-sql-sqlite -$(package)_config_opts += -no-sql-sqlite2 $(package)_config_opts += -no-system-proxies $(package)_config_opts += -no-use-gold-linker $(package)_config_opts += -no-zstd $(package)_config_opts += -nomake examples $(package)_config_opts += -nomake tests -$(package)_config_opts += -nomake tools -$(package)_config_opts += -opensource -$(package)_config_opts += -pkg-config $(package)_config_opts += -prefix $(host_prefix) +$(package)_config_opts += -qt-doubleconversion +$(package)_config_opts += -qt-harfbuzz +ifneq ($(host),$(build)) +$(package)_config_opts += -qt-host-path $(build_prefix) +endif $(package)_config_opts += -qt-libpng $(package)_config_opts += -qt-pcre -$(package)_config_opts += -qt-harfbuzz $(package)_config_opts += -qt-zlib $(package)_config_opts += -static -$(package)_config_opts += -v -$(package)_config_opts += -no-feature-bearermanagement +$(package)_config_opts += -no-feature-backtrace $(package)_config_opts += -no-feature-colordialog -$(package)_config_opts += -no-feature-commandlineparser $(package)_config_opts += -no-feature-concurrent $(package)_config_opts += -no-feature-dial -$(package)_config_opts += -no-feature-fontcombobox -$(package)_config_opts += -no-feature-ftp +$(package)_config_opts += -no-feature-gssapi $(package)_config_opts += -no-feature-http $(package)_config_opts += -no-feature-image_heuristic_mask $(package)_config_opts += -no-feature-keysequenceedit $(package)_config_opts += -no-feature-lcdnumber +$(package)_config_opts += -no-feature-libresolv $(package)_config_opts += -no-feature-networkdiskcache $(package)_config_opts += -no-feature-networkproxy -$(package)_config_opts += -no-feature-pdf -$(package)_config_opts += -no-feature-printdialog -$(package)_config_opts += -no-feature-printer -$(package)_config_opts += -no-feature-printpreviewdialog -$(package)_config_opts += -no-feature-printpreviewwidget +$(package)_config_opts += -no-feature-printsupport $(package)_config_opts += -no-feature-sessionmanager $(package)_config_opts += -no-feature-socks5 $(package)_config_opts += -no-feature-sql -$(package)_config_opts += -no-feature-sqlmodel -$(package)_config_opts += -no-feature-statemachine -$(package)_config_opts += -no-feature-syntaxhighlighter -$(package)_config_opts += -no-feature-textbrowser +$(package)_config_opts += -no-feature-textmarkdownreader $(package)_config_opts += -no-feature-textmarkdownwriter $(package)_config_opts += -no-feature-textodfwriter $(package)_config_opts += -no-feature-topleveldomain @@ -123,166 +108,177 @@ $(package)_config_opts += -no-feature-undogroup $(package)_config_opts += -no-feature-undostack $(package)_config_opts += -no-feature-undoview $(package)_config_opts += -no-feature-vnc -$(package)_config_opts += -no-feature-wizard -$(package)_config_opts += -no-feature-xml - -$(package)_config_opts_darwin = -no-dbus -$(package)_config_opts_darwin += -no-opengl -$(package)_config_opts_darwin += -pch -$(package)_config_opts_darwin += -no-feature-corewlan -$(package)_config_opts_darwin += -no-freetype -$(package)_config_opts_darwin += QMAKE_MACOSX_DEPLOYMENT_TARGET=$(OSX_MIN_VERSION) +$(package)_config_opts += -no-feature-vulkan -# Optimizing using > -O1 causes non-determinism when building across arches. -$(package)_config_opts_aarch64_darwin += "QMAKE_CFLAGS_OPTIMIZE_FULL = -O1" +# Core tools. +$(package)_config_opts += -no-feature-androiddeployqt +$(package)_config_opts += -no-feature-macdeployqt +$(package)_config_opts += -no-feature-qmake +$(package)_config_opts += -no-feature-windeployqt -ifneq ($(build_os),darwin) -$(package)_config_opts_darwin += -xplatform macx-clang-linux -$(package)_config_opts_darwin += -device-option MAC_SDK_PATH=$(OSX_SDK) -$(package)_config_opts_darwin += -device-option MAC_SDK_VERSION=$(OSX_SDK_VERSION) -$(package)_config_opts_darwin += -device-option CROSS_COMPILE="$(host)-" -$(package)_config_opts_darwin += -device-option MAC_TARGET=$(host) -$(package)_config_opts_darwin += -device-option XCODE_VERSION=$(XCODE_VERSION) +ifeq ($(host),$(build)) +# Qt Tools module. +$(package)_config_opts += -feature-linguist +$(package)_config_opts += -no-feature-assistant +$(package)_config_opts += -no-feature-clang +$(package)_config_opts += -no-feature-clangcpp +$(package)_config_opts += -no-feature-designer +$(package)_config_opts += -no-feature-pixeltool +$(package)_config_opts += -no-feature-qdoc +$(package)_config_opts += -no-feature-qtattributionsscanner +$(package)_config_opts += -no-feature-qtdiag +$(package)_config_opts += -no-feature-qtplugininfo endif -ifneq ($(build_arch),$(host_arch)) -$(package)_config_opts_aarch64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 -$(package)_config_opts_x86_64_darwin += -device-option QMAKE_APPLE_DEVICE_ARCHS=x86_64 -endif +$(package)_config_opts_darwin := -no-dbus +$(package)_config_opts_darwin += -no-feature-printsupport +$(package)_config_opts_darwin += -no-freetype +$(package)_config_opts_darwin += -no-pkg-config -$(package)_config_opts_linux = -xcb -$(package)_config_opts_linux += -no-xcb-xlib +$(package)_config_opts_linux := -dbus-runtime +$(package)_config_opts_linux += -fontconfig +$(package)_config_opts_linux += -no-feature-process $(package)_config_opts_linux += -no-feature-xlib +$(package)_config_opts_linux += -no-xcb-xlib +$(package)_config_opts_linux += -pkg-config $(package)_config_opts_linux += -system-freetype -$(package)_config_opts_linux += -fontconfig -$(package)_config_opts_linux += -no-opengl -$(package)_config_opts_linux += -no-feature-vulkan -$(package)_config_opts_linux += -dbus-runtime +$(package)_config_opts_linux += -xcb ifneq ($(LTO),) $(package)_config_opts_linux += -ltcg endif -ifneq (,$(findstring clang,$($(package)_cxx))) - ifneq (,$(findstring -stdlib=libc++,$($(package)_cxx))) - $(package)_config_opts_linux += -platform linux-clang-libc++ -xplatform linux-clang-libc++ - else - $(package)_config_opts_linux += -platform linux-clang -xplatform linux-clang - endif -else - $(package)_config_opts_linux += -platform linux-g++ -xplatform bitcoin-linux-g++ -endif - -$(package)_config_opts_mingw32 = -no-opengl -$(package)_config_opts_mingw32 += -no-dbus +$(package)_config_opts_mingw32 := -no-dbus $(package)_config_opts_mingw32 += -no-freetype -$(package)_config_opts_mingw32 += -xplatform win32-g++ -$(package)_config_opts_mingw32 += "QMAKE_CFLAGS = '$($(package)_cflags) $($(package)_cppflags)'" -$(package)_config_opts_mingw32 += "QMAKE_CXX = '$($(package)_cxx)'" -$(package)_config_opts_mingw32 += "QMAKE_CXXFLAGS = '$($(package)_cxxflags) $($(package)_cppflags)'" -$(package)_config_opts_mingw32 += "QMAKE_LFLAGS = '$($(package)_ldflags)'" -$(package)_config_opts_mingw32 += "QMAKE_LIB = '$($(package)_ar) rc'" -$(package)_config_opts_mingw32 += -device-option CROSS_COMPILE="$(host)-" -$(package)_config_opts_mingw32 += -pch +$(package)_config_opts_mingw32 += -no-pkg-config -$(package)_config_opts_android = -xplatform android-clang -$(package)_config_opts_android += -android-sdk $(ANDROID_SDK) -$(package)_config_opts_android += -android-ndk $(ANDROID_NDK) -$(package)_config_opts_android += -android-ndk-platform android-$(ANDROID_API_LEVEL) -$(package)_config_opts_android += -egl -$(package)_config_opts_android += -no-dbus -$(package)_config_opts_android += -opengl es2 -$(package)_config_opts_android += -qt-freetype -$(package)_config_opts_android += -no-fontconfig -$(package)_config_opts_android += -L $(host_prefix)/lib -$(package)_config_opts_android += -I $(host_prefix)/include -$(package)_config_opts_android += -pch -$(package)_config_opts_android += -no-feature-vulkan +# CMake build options. +$(package)_config_env := CC="$$($(package)_cc)" +$(package)_config_env += CXX="$$($(package)_cxx)" +$(package)_config_env_darwin := OBJC="$$($(package)_cc)" +$(package)_config_env_darwin += OBJCXX="$$($(package)_cxx)" -$(package)_config_opts_aarch64_android += -android-arch arm64-v8a -$(package)_config_opts_armv7a_android += -android-arch armeabi-v7a -$(package)_config_opts_x86_64_android += -android-arch x86_64 +$(package)_cmake_opts := -DCMAKE_PREFIX_PATH=$(host_prefix) +$(package)_cmake_opts += -DQT_FEATURE_cxx20=ON +$(package)_cmake_opts += -DQT_ENABLE_CXX_EXTENSIONS=OFF +ifneq ($(V),) +$(package)_cmake_opts += --log-level=STATUS +endif + +$(package)_cmake_opts += -DQT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS=ON +$(package)_cmake_opts += -DCMAKE_C_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_C_FLAGS_RELEASE="$$($$($(package)_type)_release_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_C_FLAGS_DEBUG="$$($$($(package)_type)_debug_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CXXFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS_RELEASE="$$($$($(package)_type)_release_CXXFLAGS)" +$(package)_cmake_opts += -DCMAKE_CXX_FLAGS_DEBUG="$$($$($(package)_type)_debug_CXXFLAGS)" +ifeq ($(host_os),darwin) +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS_RELEASE="$$($$($(package)_type)_release_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJC_FLAGS_DEBUG="$$($$($(package)_type)_debug_CFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS="$$($(package)_cppflags) $$($$($(package)_type)_CXXFLAGS) -ffile-prefix-map=$$($(package)_extract_dir)=/usr" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS_RELEASE="$$($$($(package)_type)_release_CXXFLAGS)" +$(package)_cmake_opts += -DCMAKE_OBJCXX_FLAGS_DEBUG="$$($$($(package)_type)_debug_CXXFLAGS)" +endif +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS="$$($$($(package)_type)_LDFLAGS)" +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS_RELEASE="$$($$($(package)_type)_release_LDFLAGS)" +$(package)_cmake_opts += -DCMAKE_EXE_LINKER_FLAGS_DEBUG="$$($$($(package)_type)_debug_LDFLAGS)" + +ifneq ($(host),$(build)) +$(package)_cmake_opts += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system_name) +$(package)_cmake_opts += -DCMAKE_SYSTEM_VERSION=$($(host_os)_cmake_system_version) +$(package)_cmake_opts += -DCMAKE_SYSTEM_PROCESSOR=$(host_arch) +# Native packages cannot be used during cross-compiling. However, +# Qt still unconditionally tries to find them, which causes issues +# in some cases, such as when cross-compiling from macOS to Windows. +# Explicitly disable this unnecessary Qt behaviour. +$(package)_cmake_opts += -DCMAKE_DISABLE_FIND_PACKAGE_Libb2=TRUE +$(package)_cmake_opts += -DCMAKE_DISABLE_FIND_PACKAGE_WrapSystemDoubleConversion=TRUE +$(package)_cmake_opts += -DCMAKE_DISABLE_FIND_PACKAGE_WrapSystemMd4c=TRUE +$(package)_cmake_opts += -DCMAKE_DISABLE_FIND_PACKAGE_WrapZSTD=TRUE +endif +ifeq ($(host_os),darwin) +$(package)_cmake_opts += -DCMAKE_INSTALL_NAME_TOOL=true +$(package)_cmake_opts += -DCMAKE_FRAMEWORK_PATH=$(OSX_SDK)/System/Library/Frameworks +$(package)_cmake_opts += -DQT_INTERNAL_APPLE_SDK_VERSION=$(OSX_SDK_VERSION) +$(package)_cmake_opts += -DQT_INTERNAL_XCODE_VERSION=$(XCODE_VERSION) +$(package)_cmake_opts += -DQT_NO_APPLE_SDK_MAX_VERSION_CHECK=ON +endif endef define $(package)_fetch_cmds $(call fetch_file,$(package),$($(package)_download_path),$($(package)_download_file),$($(package)_file_name),$($(package)_sha256_hash)) && \ $(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttranslations_file_name),$($(package)_qttranslations_file_name),$($(package)_qttranslations_sha256_hash)) && \ -$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) +$(call fetch_file,$(package),$($(package)_download_path),$($(package)_qttools_file_name),$($(package)_qttools_file_name),$($(package)_qttools_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_download_path),$($(package)_top_cmakelists_download_file),$($(package)_top_cmakelists_file_name)-$($(package)_version),$($(package)_top_cmakelists_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_ecmoptionaladdsubdirectory_download_file),$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version),$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash)) && \ +$(call fetch_file,$(package),$($(package)_top_cmake_download_path),$($(package)_top_cmake_qttoplevelhelpers_download_file),$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version),$($(package)_top_cmake_qttoplevelhelpers_sha256_hash)) endef +ifeq ($(host),$(build)) define $(package)_extract_cmds mkdir -p $($(package)_extract_dir) && \ echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttranslations_sha256_hash) $($(package)_source_dir)/$($(package)_qttranslations_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ echo "$($(package)_qttools_sha256_hash) $($(package)_source_dir)/$($(package)_qttools_file_name)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ mkdir qtbase && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ mkdir qttranslations && \ $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttranslations_file_name) -C qttranslations && \ mkdir qttools && \ - $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source_dir)/$($(package)_qttools_file_name) -C qttools && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) +endef +else +define $(package)_extract_cmds + mkdir -p $($(package)_extract_dir) && \ + echo "$($(package)_sha256_hash) $($(package)_source)" > $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmakelists_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_ecmoptionaladdsubdirectory_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + echo "$($(package)_top_cmake_qttoplevelhelpers_sha256_hash) $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version)" >> $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + $(build_SHA256SUM) -c $($(package)_extract_dir)/.$($(package)_file_name).hash && \ + mkdir qtbase && \ + $(build_TAR) --no-same-owner --strip-components=1 -xf $($(package)_source) -C qtbase && \ + cp $($(package)_source_dir)/$($(package)_top_cmakelists_file_name)-$($(package)_version) ./$($(package)_top_cmakelists_file_name) && \ + mkdir cmake && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_ecmoptionaladdsubdirectory_file_name) && \ + cp $($(package)_source_dir)/$($(package)_top_cmake_qttoplevelhelpers_file_name)-$($(package)_version) cmake/$($(package)_top_cmake_qttoplevelhelpers_file_name) endef +endif -# Preprocessing steps work as follows: -# -# 1. Apply our patches to the extracted source. See each patch for more info. -# -# 2. Create a macOS-Clang-Linux mkspec using our mac-qmake.conf. -# -# 3. After making a copy of the mkspec for the linux-arm-gnueabi host, named -# bitcoin-linux-g++, replace tool names with $($($(package)_type)_TOOL). -# -# 4. Put our C, CXX and LD FLAGS into gcc-base.conf. Only used for non-host builds. -# -# 5. In clang.conf, swap out clang & clang++, for our compiler + flags. See #17466. define $(package)_preprocess_cmds - cp $($(package)_patch_dir)/qt.pro qt.pro && \ - cp $($(package)_patch_dir)/qttools_src.pro qttools/src/src.pro && \ patch -p1 -i $($(package)_patch_dir)/dont_hardcode_pwd.patch && \ - patch -p1 -i $($(package)_patch_dir)/fix_qt_pkgconfig.patch && \ - patch -p1 -i $($(package)_patch_dir)/fix_android_jni_static.patch && \ - patch -p1 -i $($(package)_patch_dir)/no-xlib.patch && \ - patch -p1 -i $($(package)_patch_dir)/dont_hardcode_x86_64.patch && \ patch -p1 -i $($(package)_patch_dir)/qtbase-moc-ignore-gcc-macro.patch && \ - patch -p1 -i $($(package)_patch_dir)/fix_montery_include.patch && \ - patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \ - patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \ - patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \ - patch -p1 -i $($(package)_patch_dir)/fast_fixed_dtoa_no_optimize.patch && \ - patch -p1 -i $($(package)_patch_dir)/guix_cross_lib_path.patch && \ - mkdir -p qtbase/mkspecs/macx-clang-linux &&\ - cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\ - cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \ - cp -r qtbase/mkspecs/linux-arm-gnueabi-g++ qtbase/mkspecs/bitcoin-linux-g++ && \ - sed -i.old "s|arm-linux-gnueabi-gcc|$($($(package)_type)_CC)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-g++|$($($(package)_type)_CXX)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-ar|$($($(package)_type)_AR)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-objcopy|$($($(package)_type)_OBJCOPY)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-nm|$($($(package)_type)_NM)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - sed -i.old "s|arm-linux-gnueabi-strip|$($($(package)_type)_STRIP)|" qtbase/mkspecs/bitcoin-linux-g++/qmake.conf && \ - echo "!host_build: QMAKE_CFLAGS += $($(package)_cflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_CXXFLAGS += $($(package)_cxxflags) $($(package)_cppflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - echo "!host_build: QMAKE_LFLAGS += $($(package)_ldflags)" >> qtbase/mkspecs/common/gcc-base.conf && \ - sed -i.old "s|QMAKE_CC = \$$$$\$$$${CROSS_COMPILE}clang|QMAKE_CC = $($(package)_cc)|" qtbase/mkspecs/common/clang.conf && \ - sed -i.old "s|QMAKE_CXX = \$$$$\$$$${CROSS_COMPILE}clang++|QMAKE_CXX = $($(package)_cxx)|" qtbase/mkspecs/common/clang.conf + 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 && \ + patch -p1 -i $($(package)_patch_dir)/qtbase_skip_tools.patch && \ + patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch endef +ifeq ($(host),$(build)) + $(package)_preprocess_cmds += && patch -p1 -i $($(package)_patch_dir)/qttools_skip_dependencies.patch +endif define $(package)_config_cmds cd qtbase && \ - ./configure -top-level $($(package)_config_opts) + ./configure -top-level $($(package)_config_opts) -- $($(package)_cmake_opts) endef define $(package)_build_cmds - $(MAKE) + cmake --build . -- $$(filter -j%,$$(MAKEFLAGS)) endef define $(package)_stage_cmds - $(MAKE) -C qtbase/src INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_qt_libs))) && \ - $(MAKE) -C qttools/src/linguist INSTALL_ROOT=$($(package)_staging_dir) $(addsuffix -install_subtargets,$(addprefix sub-,$($(package)_linguist_tools))) && \ - $(MAKE) -C qttranslations INSTALL_ROOT=$($(package)_staging_dir) install_subtargets + cmake --install . --prefix $($(package)_staging_prefix_dir) endef define $(package)_postprocess_cmds - rm -rf native/mkspecs/ native/lib/ lib/cmake/ && \ - rm -f lib/lib*.la + rm -rf doc/ endef diff --git a/depends/packages/qt_details.mk b/depends/packages/qt_details.mk new file mode 100644 index 0000000000..341448149e --- /dev/null +++ b/depends/packages/qt_details.mk @@ -0,0 +1,26 @@ +qt_details_version := 6.7.3 +qt_details_download_path := https://download.qt.io/archive/qt/6.7/$(qt_details_version)/submodules +qt_details_suffix := everywhere-src-$(qt_details_version).tar.xz + +qt_details_qtbase_file_name := qtbase-$(qt_details_suffix) +qt_details_qtbase_sha256_hash := 8ccbb9ab055205ac76632c9eeddd1ed6fc66936fc56afc2ed0fd5d9e23da3097 + +qt_details_qttranslations_file_name := qttranslations-$(qt_details_suffix) +qt_details_qttranslations_sha256_hash := dcc762acac043b9bb5e4d369b6d6f53e0ecfcf76a408fe0db5f7ef071c9d6dc8 + +qt_details_qttools_file_name := qttools-$(qt_details_suffix) +qt_details_qttools_sha256_hash := f03bb7df619cd9ac9dba110e30b7bcab5dd88eb8bdc9cc752563b4367233203f + +qt_details_patches_path := $(PATCHES_PATH)/qt + +qt_details_top_download_path := https://code.qt.io/cgit/qt/qt5.git/plain +qt_details_top_cmakelists_file_name := CMakeLists.txt +qt_details_top_cmakelists_download_file := $(qt_details_top_cmakelists_file_name)?h=$(qt_details_version) +qt_details_top_cmakelists_sha256_hash := 9fb720a633c0c0a21c31fe62a34bf617726fed72480d4064f29ca5d6973d513f +qt_details_top_cmake_download_path := $(qt_details_top_download_path)/cmake +qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name := ECMOptionalAddSubdirectory.cmake +qt_details_top_cmake_ecmoptionaladdsubdirectory_download_file := $(qt_details_top_cmake_ecmoptionaladdsubdirectory_file_name)?h=$(qt_details_version) +qt_details_top_cmake_ecmoptionaladdsubdirectory_sha256_hash := 97ee8bbfcb0a4bdcc6c1af77e467a1da0c5b386c42be2aa97d840247af5f6f70 +qt_details_top_cmake_qttoplevelhelpers_file_name := QtTopLevelHelpers.cmake +qt_details_top_cmake_qttoplevelhelpers_download_file := $(qt_details_top_cmake_qttoplevelhelpers_file_name)?h=$(qt_details_version) +qt_details_top_cmake_qttoplevelhelpers_sha256_hash := 5ac2a7159ee27b5b86d26ecff44922e7b8f319aa847b7b5766dc17932fd4a294 diff --git a/depends/packages/sqlite.mk b/depends/packages/sqlite.mk index a8ec89c6c6..67b7719eb8 100644 --- a/depends/packages/sqlite.mk +++ b/depends/packages/sqlite.mk @@ -1,20 +1,17 @@ package=sqlite -$(package)_version=3380500 -$(package)_download_path=https://sqlite.org/2022/ +$(package)_version=3460100 +$(package)_download_path=https://sqlite.org/2024/ $(package)_file_name=sqlite-autoconf-$($(package)_version).tar.gz -$(package)_sha256_hash=5af07de982ba658fd91a03170c945f99c971f6955bc79df3266544373e39869c +$(package)_sha256_hash=67d3fe6d268e6eaddcae3727fce58fcc8e9c53869bdd07a0c61e38ddf2965071 define $(package)_set_vars $(package)_config_opts=--disable-shared --disable-readline --disable-dynamic-extensions --enable-option-checking $(package)_config_opts+= --disable-rtree --disable-fts4 --disable-fts5 -$(package)_config_opts_linux=--with-pic -$(package)_config_opts_freebsd=--with-pic -$(package)_config_opts_netbsd=--with-pic -$(package)_config_opts_openbsd=--with-pic -$(package)_config_opts_debug=--enable-debug -$(package)_cflags+=-DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED -$(package)_cflags+=-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -$(package)_cflags+=-DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT +# We avoid using `--enable-debug` because it overrides CFLAGS, a behavior we want to prevent. +$(package)_cppflags_debug += -DSQLITE_DEBUG +$(package)_cppflags+=-DSQLITE_DQS=0 -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_DEPRECATED +$(package)_cppflags+=-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_JSON -DSQLITE_LIKE_DOESNT_MATCH_BLOBS +$(package)_cppflags+=-DSQLITE_OMIT_DECLTYPE -DSQLITE_OMIT_PROGRESS_CALLBACK -DSQLITE_OMIT_AUTOINIT endef define $(package)_preprocess_cmds @@ -30,7 +27,7 @@ define $(package)_build_cmds endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA + $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS endef define $(package)_postprocess_cmds diff --git a/depends/packages/systemtap.mk b/depends/packages/systemtap.mk index 541ebeee01..c912e18c31 100644 --- a/depends/packages/systemtap.mk +++ b/depends/packages/systemtap.mk @@ -3,11 +3,10 @@ $(package)_version=4.8 $(package)_download_path=https://sourceware.org/ftp/systemtap/releases/ $(package)_file_name=$(package)-$($(package)_version).tar.gz $(package)_sha256_hash=cbd50a4eba5b261394dc454c12448ddec73e55e6742fda7f508f9fbc1331c223 -$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch fix_variadic_warning.patch +$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch define $(package)_preprocess_cmds patch -p1 < $($(package)_patch_dir)/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch && \ - patch -p1 < $($(package)_patch_dir)/fix_variadic_warning.patch && \ mkdir -p $($(package)_staging_prefix_dir)/include/sys && \ cp includes/sys/sdt.h $($(package)_staging_prefix_dir)/include/sys/sdt.h endef diff --git a/depends/packages/xproto.mk b/depends/packages/xproto.mk index 7a43c52faf..0a534556ee 100644 --- a/depends/packages/xproto.mk +++ b/depends/packages/xproto.mk @@ -1,8 +1,8 @@ package=xproto $(package)_version=7.0.31 $(package)_download_path=https://xorg.freedesktop.org/releases/individual/proto -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=c6f9747da0bd3a95f86b17fb8dd5e717c8f3ab7f0ece3ba1b247899ec1ef7747 +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=6d755eaae27b45c5cc75529a12855fed5de5969b367ed05003944cf901ed43c7 define $(package)_set_vars $(package)_config_opts=--without-fop --without-xmlto --without-xsltproc --disable-specs @@ -21,6 +21,8 @@ define $(package)_build_cmds $(MAKE) endef +# mkdir detection is broken on Alpine. Set MKDIRPROG to ensure we always +# use "mkdir -p", and avoid parallelism issues during install. define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install + $(MAKE) MKDIRPROG="mkdir -p" DESTDIR=$($(package)_staging_dir) install endef diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk index d715232793..8bf84b1f1c 100644 --- a/depends/packages/zeromq.mk +++ b/depends/packages/zeromq.mk @@ -1,42 +1,49 @@ package=zeromq -$(package)_version=4.3.4 +$(package)_version=4.3.5 $(package)_download_path=https://github.com/zeromq/libzmq/releases/download/v$($(package)_version)/ $(package)_file_name=$(package)-$($(package)_version).tar.gz -$(package)_sha256_hash=c593001a89f5a85dd2ddf564805deb860e02471171b3f204944857336295c3e5 -$(package)_patches=remove_libstd_link.patch netbsd_kevent_void.patch +$(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a913bfab43 +$(package)_build_subdir=build +$(package)_patches = macos_mktemp_check.patch +$(package)_patches += builtin_sha1.patch +$(package)_patches += fix_have_windows.patch +$(package)_patches += openbsd_kqueue_headers.patch +$(package)_patches += cmake_minimum.patch +$(package)_patches += cacheline_undefined.patch +$(package)_patches += no_librt.patch define $(package)_set_vars - $(package)_config_opts = --without-docs --disable-shared --disable-valgrind - $(package)_config_opts += --disable-perf --disable-curve-keygen --disable-curve --disable-libbsd - $(package)_config_opts += --without-libsodium --without-libgssapi_krb5 --without-pgm --without-norm --without-vmci - $(package)_config_opts += --disable-libunwind --disable-radix-tree --without-gcov --disable-dependency-tracking - $(package)_config_opts += --disable-Werror --disable-drafts --enable-option-checking - $(package)_config_opts_linux=--with-pic - $(package)_config_opts_freebsd=--with-pic - $(package)_config_opts_netbsd=--with-pic - $(package)_config_opts_openbsd=--with-pic - $(package)_config_opts_android=--with-pic + $(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DWITH_DOCS=OFF -DWITH_LIBSODIUM=OFF + $(package)_config_opts += -DWITH_LIBBSD=OFF -DENABLE_CURVE=OFF -DENABLE_CPACK=OFF + $(package)_config_opts += -DBUILD_SHARED=OFF -DBUILD_TESTS=OFF -DZMQ_BUILD_TESTS=OFF + $(package)_config_opts += -DENABLE_DRAFTS=OFF -DZMQ_BUILD_TESTS=OFF + $(package)_cxxflags += -fdebug-prefix-map=$($(package)_extract_dir)=/usr -fmacro-prefix-map=$($(package)_extract_dir)=/usr + $(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0A00 -DZMQ_HAVE_IPC=OFF endef define $(package)_preprocess_cmds - patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \ - patch -p1 < $($(package)_patch_dir)/netbsd_kevent_void.patch + patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \ + patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \ + patch -p1 < $($(package)_patch_dir)/cacheline_undefined.patch && \ + patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch && \ + patch -p1 < $($(package)_patch_dir)/openbsd_kqueue_headers.patch && \ + patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch && \ + patch -p1 < $($(package)_patch_dir)/no_librt.patch endef define $(package)_config_cmds - ./autogen.sh && \ - cp -f $(BASEDIR)/config.guess $(BASEDIR)/config.sub config && \ - $($(package)_autoconf) + $($(package)_cmake) -S .. -B . endef define $(package)_build_cmds - $(MAKE) src/libzmq.la + $(MAKE) endef define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install-libLTLIBRARIES install-includeHEADERS install-pkgconfigDATA + $(MAKE) DESTDIR=$($(package)_staging_dir) install endef define $(package)_postprocess_cmds - rm -rf bin share lib/*.la + rm -rf share && \ + rm -rf lib/pkgconfig endef diff --git a/depends/patches/bdb/clang_cxx_11.patch b/depends/patches/bdb/clang_cxx_11.patch deleted file mode 100644 index 58f7ddc7d5..0000000000 --- a/depends/patches/bdb/clang_cxx_11.patch +++ /dev/null @@ -1,147 +0,0 @@ -commit 3311d68f11d1697565401eee6efc85c34f022ea7 -Author: fanquake -Date: Mon Aug 17 20:03:56 2020 +0800 - - Fix C++11 compatibility - -diff --git a/dbinc/atomic.h b/dbinc/atomic.h -index 0034dcc..7c11d4a 100644 ---- a/dbinc/atomic.h -+++ b/dbinc/atomic.h -@@ -70,7 +70,7 @@ typedef struct { - * These have no memory barriers; the caller must include them when necessary. - */ - #define atomic_read(p) ((p)->value) --#define atomic_init(p, val) ((p)->value = (val)) -+#define atomic_init_db(p, val) ((p)->value = (val)) - - #ifdef HAVE_ATOMIC_SUPPORT - -@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val; - #define atomic_inc(env, p) __atomic_inc(p) - #define atomic_dec(env, p) __atomic_dec(p) - #define atomic_compare_exchange(env, p, o, n) \ -- __atomic_compare_exchange((p), (o), (n)) -+ __atomic_compare_exchange_db((p), (o), (n)) - static inline int __atomic_inc(db_atomic_t *p) - { - int temp; -@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p) - * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html - * which configure could be changed to use. - */ --static inline int __atomic_compare_exchange( -+static inline int __atomic_compare_exchange_db( - db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval) - { - atomic_value_t was; -@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange( - #define atomic_dec(env, p) (--(p)->value) - #define atomic_compare_exchange(env, p, oldval, newval) \ - (DB_ASSERT(env, atomic_read(p) == (oldval)), \ -- atomic_init(p, (newval)), 1) -+ atomic_init_db(p, (newval)), 1) - #else - #define atomic_inc(env, p) __atomic_inc(env, p) - #define atomic_dec(env, p) __atomic_dec(env, p) -diff --git a/mp/mp_fget.c b/mp/mp_fget.c -index 5fdee5a..0b75f57 100644 ---- a/mp/mp_fget.c -+++ b/mp/mp_fget.c -@@ -617,7 +617,7 @@ alloc: /* Allocate a new buffer header and data space. */ - - /* Initialize enough so we can call __memp_bhfree. */ - alloc_bhp->flags = 0; -- atomic_init(&alloc_bhp->ref, 1); -+ atomic_init_db(&alloc_bhp->ref, 1); - #ifdef DIAGNOSTIC - if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { - __db_errx(env, -@@ -911,7 +911,7 @@ alloc: /* Allocate a new buffer header and data space. */ - MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize, - PROT_READ); - -- atomic_init(&alloc_bhp->ref, 1); -+ atomic_init_db(&alloc_bhp->ref, 1); - MUTEX_LOCK(env, alloc_bhp->mtx_buf); - alloc_bhp->priority = bhp->priority; - alloc_bhp->pgno = bhp->pgno; -diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c -index 34467d2..f05aa0c 100644 ---- a/mp/mp_mvcc.c -+++ b/mp/mp_mvcc.c -@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp) - #else - memcpy(frozen_bhp, bhp, SSZA(BH, buf)); - #endif -- atomic_init(&frozen_bhp->ref, 0); -+ atomic_init_db(&frozen_bhp->ref, 0); - if (mutex != MUTEX_INVALID) - frozen_bhp->mtx_buf = mutex; - else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, -@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp) - #endif - alloc_bhp->mtx_buf = mutex; - MUTEX_LOCK(env, alloc_bhp->mtx_buf); -- atomic_init(&alloc_bhp->ref, 1); -+ atomic_init_db(&alloc_bhp->ref, 1); - F_CLR(alloc_bhp, BH_FROZEN); - } - -diff --git a/mp/mp_region.c b/mp/mp_region.c -index e6cece9..ddbe906 100644 ---- a/mp/mp_region.c -+++ b/mp/mp_region.c -@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) - MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) - return (ret); - SH_TAILQ_INIT(&htab[i].hash_bucket); -- atomic_init(&htab[i].hash_page_dirty, 0); -+ atomic_init_db(&htab[i].hash_page_dirty, 0); - } - - /* -@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) - hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID : - mtx_base + i; - SH_TAILQ_INIT(&hp->hash_bucket); -- atomic_init(&hp->hash_page_dirty, 0); -+ atomic_init_db(&hp->hash_page_dirty, 0); - #ifdef HAVE_STATISTICS - hp->hash_io_wait = 0; - hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; -diff --git a/mutex/mut_method.c b/mutex/mut_method.c -index 2588763..5c6d516 100644 ---- a/mutex/mut_method.c -+++ b/mutex/mut_method.c -@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval) - MUTEX_LOCK(env, mtx); - ret = atomic_read(v) == oldval; - if (ret) -- atomic_init(v, newval); -+ atomic_init_db(v, newval); - MUTEX_UNLOCK(env, mtx); - - return (ret); -diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c -index f3922e0..e40fcdf 100644 ---- a/mutex/mut_tas.c -+++ b/mutex/mut_tas.c -@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags) - - #ifdef HAVE_SHARED_LATCHES - if (F_ISSET(mutexp, DB_MUTEX_SHARED)) -- atomic_init(&mutexp->sharecount, 0); -+ atomic_init_db(&mutexp->sharecount, 0); - else - #endif - if (MUTEX_INIT(&mutexp->tas)) { -@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex) - F_CLR(mutexp, DB_MUTEX_LOCKED); - /* Flush flag update before zeroing count */ - MEMBAR_EXIT(); -- atomic_init(&mutexp->sharecount, 0); -+ atomic_init_db(&mutexp->sharecount, 0); - } else { - DB_ASSERT(env, sharecount > 0); - MEMBAR_EXIT(); diff --git a/depends/patches/capnp/abi_placement_new.patch b/depends/patches/capnp/abi_placement_new.patch new file mode 100644 index 0000000000..9aef85db8e --- /dev/null +++ b/depends/patches/capnp/abi_placement_new.patch @@ -0,0 +1,71 @@ +From 74560f26f75dda4257dce541ca362a1e763b2971 Mon Sep 17 00:00:00 2001 +From: Ryan Ofsky +Date: Thu, 6 Feb 2025 08:39:05 -0500 +Subject: [PATCH 1/1] Avoid gcc/clang ABI incompatibility caused by + PlacementNew + +GCC and clang do not use same calling convention for passing empty struct +parameters. There is more information about this in +https://itanium-cxx-abi.github.io/cxx-abi/cxx-abi-dev/archives/2015-December/002869.html + +Unfortunately this can create an issue in capnproto if it is built without +optimizations in GCC, and the resulting static libraries are used in a clang +program, or vice versa. + +Depending on what order libraries are specified on the linker command line, and +whether code compiled with the other compiler is calling any header functions +that cause weak a `operator new(unsigned int, kj::_::PlacementNew, void*)` +symbol to be defined in its own objects, this can cause the linker to link a +GCC-generated `kj::ctor` with a clang-generated `operator new`, and the +resulting program to crash due to the compilers using different calling +conventions for `operator new`. + +This problem is difficult to avoid in general, but pretty easy to avoid here by +changing `operator new` parameter order so the empty struct parameter is last. + +This change should be beneficial for capnproto users that may be compiling it +without optimizations, and not necessarily using a single compiler to build all +their dependencies. + +The problem does not occur if any optimizations are enabled because `operator +new` calls are inlined in that case. +--- + c++/src/kj/common.h | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/c++/src/kj/common.h b/c++/src/kj/common.h +index b8edde3c..28ab11d6 100644 +--- a/c++/src/kj/common.h ++++ b/c++/src/kj/common.h +@@ -1034,24 +1034,27 @@ private: + + // We want placement new, but we don't want to #include . operator new cannot be defined in + // a namespace, and defining it globally conflicts with the definition in . So we have to +-// define a dummy type and an operator new that uses it. ++// define a dummy type and an operator new that uses it. The dummy type is intentionally passed ++// as the last parameter so clang and GCC ABI calling conventions for empty struct struct parameters ++// are compatible, and there are not segfaults trying to call clang operator new/delete from GCC or ++// vice versa. + + namespace _ { // private + struct PlacementNew {}; + } // namespace _ (private) + } // namespace kj + +-inline void* operator new(size_t, kj::_::PlacementNew, void* __p) noexcept { ++inline void* operator new(size_t, void* __p, kj::_::PlacementNew) noexcept { + return __p; + } + +-inline void operator delete(void*, kj::_::PlacementNew, void* __p) noexcept {} ++inline void operator delete(void*, void* __p, kj::_::PlacementNew) noexcept {} + + namespace kj { + + template + inline void ctor(T& location, Params&&... params) { +- new (_::PlacementNew(), &location) T(kj::fwd(params)...); ++ new (&location, _::PlacementNew()) T(kj::fwd(params)...); + } + + template diff --git a/depends/patches/expat/cmake_minimum.patch b/depends/patches/expat/cmake_minimum.patch new file mode 100644 index 0000000000..a849a82a33 --- /dev/null +++ b/depends/patches/expat/cmake_minimum.patch @@ -0,0 +1,13 @@ +build: set minimum required CMake to 3.16 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -33,7 +33,7 @@ + # Unlike most of Expat, + # this file is copyrighted under the BSD-license for buildsystem files of KDE. + +-cmake_minimum_required(VERSION 3.1.3) ++cmake_minimum_required(VERSION 3.16) + + # This allows controlling documented build time switches + # when Expat is pulled in using the add_subdirectory function, e.g. diff --git a/depends/patches/libevent/cmake_fixups.patch b/depends/patches/libevent/cmake_fixups.patch new file mode 100644 index 0000000000..a8812afd1e --- /dev/null +++ b/depends/patches/libevent/cmake_fixups.patch @@ -0,0 +1,13 @@ +cmake: set minimum version to 3.5 + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -19,7 +19,7 @@ + # start libevent.sln + # + +-cmake_minimum_required(VERSION 3.1 FATAL_ERROR) ++cmake_minimum_required(VERSION 3.5 FATAL_ERROR) + + if (POLICY CMP0054) + cmake_policy(SET CMP0054 NEW) diff --git a/depends/patches/libevent/netbsd_fixup.patch b/depends/patches/libevent/netbsd_fixup.patch new file mode 100644 index 0000000000..21d96aaf45 --- /dev/null +++ b/depends/patches/libevent/netbsd_fixup.patch @@ -0,0 +1,23 @@ +Improve portability on NetBSD + +According to GCC documentation, "the various `-std` options disable +certain keywords". +This change adheres to GCC's recommendation by replacing the `typeof` +keyword with its alternative, `__typeof__`. + +See https://github.com/libevent/libevent/commit/1759485e9a59147a47a674f5132fcfe764e7748c. + + +--- a/kqueue.c ++++ b/kqueue.c +@@ -52,8 +52,8 @@ + * intptr_t, whereas others define it as void*. There doesn't seem to be an + * easy way to tell them apart via autoconf, so we need to use OS macros. */ + #if defined(__NetBSD__) +-#define PTR_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(x)) +-#define INT_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(intptr_t)(x)) ++#define PTR_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(x)) ++#define INT_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(intptr_t)(x)) + #elif defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__) + #define PTR_TO_UDATA(x) ((intptr_t)(x)) + #define INT_TO_UDATA(x) ((intptr_t)(x)) diff --git a/depends/patches/miniupnpc/dont_leak_info.patch b/depends/patches/miniupnpc/dont_leak_info.patch deleted file mode 100644 index 512f9c50ea..0000000000 --- a/depends/patches/miniupnpc/dont_leak_info.patch +++ /dev/null @@ -1,32 +0,0 @@ -commit 8815452257437ba36607d0e2381c01142d1c7bb0 -Author: fanquake -Date: Thu Nov 19 10:51:19 2020 +0800 - - Don't leak OS and miniupnpc version info in User-Agent - -diff --git a//minisoap.c b/minisoap.c -index 7860667..775580b 100644 ---- a/minisoap.c -+++ b/minisoap.c -@@ -90,7 +90,7 @@ int soapPostSubmit(SOCKET fd, - headerssize = snprintf(headerbuf, sizeof(headerbuf), - "POST %s HTTP/%s\r\n" - "Host: %s%s\r\n" -- "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" -+ "User-Agent: " UPNP_VERSION_STRING "\r\n" - "Content-Length: %d\r\n" - "Content-Type: text/xml\r\n" - "SOAPAction: \"%s\"\r\n" -diff --git a/miniwget.c b/miniwget.c -index d5b7970..05aeb9c 100644 ---- a/miniwget.c -+++ b/miniwget.c -@@ -444,7 +444,7 @@ miniwget3(const char * host, - "GET %s HTTP/%s\r\n" - "Host: %s:%d\r\n" - "Connection: Close\r\n" -- "User-Agent: " OS_STRING ", " UPNP_VERSION_STRING ", MiniUPnPc/" MINIUPNPC_VERSION_STRING "\r\n" -+ "User-Agent: " UPNP_VERSION_STRING "\r\n" - - "\r\n", - path, httpversion, host, port); diff --git a/depends/patches/miniupnpc/respect_mingw_cflags.patch b/depends/patches/miniupnpc/respect_mingw_cflags.patch deleted file mode 100644 index a44580ddab..0000000000 --- a/depends/patches/miniupnpc/respect_mingw_cflags.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit fec515a7ac9991a0ee91068fda046b54b191155e -Author: fanquake -Date: Wed Jul 27 15:52:37 2022 +0100 - - build: respect CFLAGS in makefile.mingw - - Similar to the other Makefile. - - Cherry-pick of https://github.com/miniupnp/miniupnp/pull/619. - -diff --git a/Makefile.mingw b/Makefile.mingw -index 2bff7bd..88430d2 100644 ---- a/Makefile.mingw -+++ b/Makefile.mingw -@@ -19,7 +19,7 @@ else - RM = rm -f - endif - #CFLAGS = -Wall -g -DDEBUG -D_WIN32_WINNT=0X501 --CFLAGS = -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501 -+CFLAGS ?= -Wall -W -Wstrict-prototypes -Os -DNDEBUG -D_WIN32_WINNT=0X501 - LDLIBS = -lws2_32 -liphlpapi - # -lwsock32 - # -liphlpapi is needed for GetBestRoute() and GetIpAddrTable() diff --git a/depends/patches/native_cctools/no_fixup_chains.patch b/depends/patches/native_cctools/no_fixup_chains.patch deleted file mode 100644 index 2516ea8200..0000000000 --- a/depends/patches/native_cctools/no_fixup_chains.patch +++ /dev/null @@ -1,23 +0,0 @@ -commit 5860b35ff6c7241d1c35a1b3197b45e5c9ff86cf -Author: fanquake -Date: Thu Jun 29 11:52:43 2023 +0100 - - ld64: add support for -no_fixup_chains - - This is added in later versions, and is required if we want to be able - to disable fixup_chains, for use in security tests. - -diff --git a/cctools/ld64/src/ld/Options.cpp b/cctools/ld64/src/ld/Options.cpp -index 15e8e88..b6580af 100644 ---- a/cctools/ld64/src/ld/Options.cpp -+++ b/cctools/ld64/src/ld/Options.cpp -@@ -4128,6 +4128,9 @@ void Options::parse(int argc, const char* argv[]) - else if ( strcmp(arg, "-fixup_chains") == 0 ) { - fMakeChainedFixups = true; - } -+ else if ( strcmp(arg, "-no_fixup_chains") == 0 ) { -+ fMakeChainedFixups = false; -+ } - else if (strcmp(arg, "-debug_variant") == 0) { - fDebugVariant = true; - } diff --git a/depends/patches/qrencode/cmake_fixups.patch b/depends/patches/qrencode/cmake_fixups.patch new file mode 100644 index 0000000000..7518d756cb --- /dev/null +++ b/depends/patches/qrencode/cmake_fixups.patch @@ -0,0 +1,23 @@ +cmake: set minimum version to 3.5 + +Correct some dev warning output. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 773e037..a558145 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,4 +1,4 @@ +-cmake_minimum_required(VERSION 3.1.0) ++cmake_minimum_required(VERSION 3.5) + + project(QRencode VERSION 4.1.1 LANGUAGES C) + +@@ -20,7 +20,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") + set(CMAKE_THREAD_PREFER_PTHREAD ON) + find_package(Threads) + find_package(PNG) +-find_package(Iconv) ++find_package(ICONV) + + if(CMAKE_USE_PTHREADS_INIT) + add_definitions(-DHAVE_LIBPTHREAD=1) diff --git a/depends/patches/qt/dont_hardcode_pwd.patch b/depends/patches/qt/dont_hardcode_pwd.patch index a74e9cb098..217b6bec15 100644 --- a/depends/patches/qt/dont_hardcode_pwd.patch +++ b/depends/patches/qt/dont_hardcode_pwd.patch @@ -1,27 +1,51 @@ -commit 0e953866fc4672486e29e1ba6d83b4207e7b2f0b -Author: fanquake -Date: Tue Aug 18 15:09:06 2020 +0800 +Do not assume FHS in scripts - Don't hardcode pwd path +On systems that do not follow the Filesystem Hierarchy Standard, such as +guix, the hardcoded `/bin/pwd` will fail to be found so that the script +will fail. - Let a man use his builtins if he wants to! Also, removes the unnecessary - assumption that pwd lives under /bin/pwd. +Use `pwd`, instead, so that the command can be found through the normal +path search mechanism. - See #15581. +See https://github.com/qt/qtbase/commit/3388de698bfb9bbc456c08f03e83bf3e749df35c. diff --git a/qtbase/configure b/qtbase/configure index 08b49a8d..faea5b55 100755 --- a/qtbase/configure +++ b/qtbase/configure -@@ -36,9 +36,9 @@ - relconf=`basename $0` +@@ -9,9 +9,9 @@ + # the directory of this script is the "source tree" - relpath=`dirname $0` + relpath=`dirname "$0"` -relpath=`(cd "$relpath"; /bin/pwd)` +relpath=`(cd "$relpath"; pwd)` # the current directory is the "build tree" or "object tree" -outpath=`/bin/pwd` +outpath=`pwd` + outpathPrefix=$outpath + + # do this early so we don't store it in config.status - WHICH="which" +--- a/qtbase/bin/qt-cmake.in ++++ b/qtbase/bin/qt-cmake.in +@@ -2,7 +2,7 @@ + + # The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory. + script_dir_path=`dirname $0` +-script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` ++script_dir_path=`(cd "$script_dir_path"; pwd)` + + # Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH. + original_cmake_path="@CMAKE_COMMAND@" +--- a/qtbase/bin/qt-configure-module.in ++++ b/qtbase/bin/qt-configure-module.in +@@ -2,7 +2,7 @@ + set -eu + + script_dir_path=`dirname $0` +-script_dir_path=`(cd "$script_dir_path"; /bin/pwd)` ++script_dir_path=`(cd "$script_dir_path"; pwd)` + + printUsage() + { diff --git a/depends/patches/qt/dont_hardcode_x86_64.patch b/depends/patches/qt/dont_hardcode_x86_64.patch deleted file mode 100644 index a66426877a..0000000000 --- a/depends/patches/qt/dont_hardcode_x86_64.patch +++ /dev/null @@ -1,119 +0,0 @@ -macOS: Don't hard-code x86_64 as the architecture when using qmake - -Upstream commit: - - Qt 6.1: 9082cc8e8d5a6441dabe5e7a95bc0cd9085b95fe - -For other Qt branches see -https://codereview.qt-project.org/q/I70db7e4c27f0d3da5d0af33cb491d72c312d3fa8 - - ---- old/qtbase/configure.json -+++ new/qtbase/configure.json -@@ -244,11 +244,18 @@ - - "testTypeDependencies": { - "linkerSupportsFlag": [ "use_bfd_linker", "use_gold_linker", "use_lld_linker" ], -- "verifySpec": [ "shared", "use_bfd_linker", "use_gold_linker", "use_lld_linker", "compiler-flags", "qmakeargs", "commit" ], -+ "verifySpec": [ -+ "shared", -+ "use_bfd_linker", "use_gold_linker", "use_lld_linker", -+ "compiler-flags", "qmakeargs", -+ "simulator_and_device", -+ "thread", -+ "commit" ], - "compile": [ "verifyspec" ], - "detectPkgConfig": [ "cross_compile", "machineTuple" ], - "library": [ "pkg-config", "compiler-flags" ], -- "getPkgConfigVariable": [ "pkg-config" ] -+ "getPkgConfigVariable": [ "pkg-config" ], -+ "architecture" : [ "verifyspec" ] - }, - - "testTypeAliases": { -@@ -762,7 +769,7 @@ - }, - "architecture": { - "label": "Architecture", -- "output": [ "architecture" ] -+ "output": [ "architecture", "commitConfig" ] - }, - "pkg-config": { - "label": "Using pkg-config", -diff --git a/configure.pri b/configure.pri -index 49755f7abfd..8be9b10d7d4 100644 ---- old/qtbase/configure.pri -+++ new/qtbase/configure.pri -@@ -662,6 +662,13 @@ defineTest(qtConfOutput_commitOptions) { - write_file($$QT_BUILD_TREE/mkspecs/qdevice.pri, $${currentConfig}.output.devicePro)|error() - } - -+# Output is written after configuring each Qt module, -+# but some tests within a module might depend on the -+# configuration output of previous tests. -+defineTest(qtConfOutput_commitConfig) { -+ qtConfProcessOutput() -+} -+ - # type (empty or 'host'), option name, default value - defineTest(processQtPath) { - out_var = config.rel_input.$${2} -diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf -index d16b77acb8e..4ba0a8eaa36 100644 ---- old/qtbase/mkspecs/common/macx.conf -+++ new/qtbase/mkspecs/common/macx.conf -@@ -6,7 +6,6 @@ QMAKE_PLATFORM += macos osx macx - QMAKE_MAC_SDK = macosx - - QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.13 --QMAKE_APPLE_DEVICE_ARCHS = x86_64 - - # Should be 10.15, but as long as the CI builds with - # older SDKs we have to keep this. -diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf -index 92a9112bca6..d888731ec8d 100644 ---- old/qtbase/mkspecs/features/mac/default_post.prf -+++ new/qtbase/mkspecs/features/mac/default_post.prf -@@ -95,6 +95,11 @@ app_extension_api_only { - QMAKE_LFLAGS += $$QMAKE_CFLAGS_APPLICATION_EXTENSION - } - -+# Non-universal builds do not set QMAKE_APPLE_DEVICE_ARCHS, -+# so we pick it up from what the arch test resolved instead. -+isEmpty(QMAKE_APPLE_DEVICE_ARCHS): \ -+ QMAKE_APPLE_DEVICE_ARCHS = $$QT_ARCH -+ - macx-xcode { - qmake_pkginfo_typeinfo.name = QMAKE_PKGINFO_TYPEINFO - !isEmpty(QMAKE_PKGINFO_TYPEINFO): \ -@@ -150,9 +155,6 @@ macx-xcode { - simulator: VALID_SIMULATOR_ARCHS = $$QMAKE_APPLE_SIMULATOR_ARCHS - VALID_ARCHS = $$VALID_DEVICE_ARCHS $$VALID_SIMULATOR_ARCHS - -- isEmpty(VALID_ARCHS): \ -- error("QMAKE_APPLE_DEVICE_ARCHS or QMAKE_APPLE_SIMULATOR_ARCHS must contain at least one architecture") -- - single_arch: VALID_ARCHS = $$first(VALID_ARCHS) - - ACTIVE_ARCHS = $(filter $(EXPORT_VALID_ARCHS), $(ARCHS)) -diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf -index efbe7c1e55b..8add6dc8043 100644 ---- old/qtbase/mkspecs/features/toolchain.prf -+++ new/qtbase/mkspecs/features/toolchain.prf -@@ -182,9 +182,14 @@ isEmpty($${target_prefix}.INCDIRS) { - # UIKit simulator platforms will see the device SDK's sysroot in - # QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass. - darwin { -- # Clang doesn't pick up the architecture from the sysroot, and will -- # default to the host architecture, so we need to manually set it. -- cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS -+ uikit { -+ # Clang doesn't automatically pick up the architecture, just because -+ # we're passing the iOS sysroot below, and we will end up building the -+ # test for the host architecture, resulting in linker errors when -+ # linking against the iOS libraries. We work around this by passing -+ # the architecture explicitly. -+ cxx_flags += -arch $$first(QMAKE_APPLE_DEVICE_ARCHS) -+ } - - uikit:macx-xcode: \ - cxx_flags += -isysroot $$sdk_path_device.value diff --git a/depends/patches/qt/duplicate_lcqpafonts.patch b/depends/patches/qt/duplicate_lcqpafonts.patch deleted file mode 100644 index c460b51dcf..0000000000 --- a/depends/patches/qt/duplicate_lcqpafonts.patch +++ /dev/null @@ -1,104 +0,0 @@ -QtGui: Fix duplication of logging category lcQpaFonts - -Move it to qplatformfontdatabase.h. - -Upstream commit: - - Qt 6.0: ab01885e48873fb2ad71841a3f1627fe4d9cd835 - ---- a/qtbase/src/gui/text/qplatformfontdatabase.cpp -+++ b/qtbase/src/gui/text/qplatformfontdatabase.cpp -@@ -52,6 +52,8 @@ - - QT_BEGIN_NAMESPACE - -+Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -+ - void qt_registerFont(const QString &familyname, const QString &stylename, - const QString &foundryname, int weight, - QFont::Style style, int stretch, bool antialiased, - ---- a/qtbase/src/gui/text/qplatformfontdatabase.h -+++ b/qtbase/src/gui/text/qplatformfontdatabase.h -@@ -50,6 +50,7 @@ - // - - #include -+#include - #include - #include - #include -@@ -62,6 +63,7 @@ - - QT_BEGIN_NAMESPACE - -+Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) - - class QWritingSystemsPrivate; - - ---- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm -+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm -@@ -86,8 +86,6 @@ - - QT_BEGIN_NAMESPACE - --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -- - static float SYNTHETIC_ITALIC_SKEW = std::tan(14.f * std::acos(0.f) / 90.f); - - bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length) - ---- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h -+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h -@@ -64,8 +64,6 @@ - - QT_BEGIN_NAMESPACE - --Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) -- - class QCoreTextFontEngine : public QFontEngine - { - Q_GADGET - ---- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp -+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp -@@ -68,8 +68,6 @@ - - QT_BEGIN_NAMESPACE - --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") -- - #ifndef QT_NO_DIRECTWRITE - // ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711) - - ---- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h -+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h -@@ -63,8 +63,6 @@ - - QT_BEGIN_NAMESPACE - --Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts) -- - class QWindowsFontEngineData - { - Q_DISABLE_COPY_MOVE(QWindowsFontEngineData) - ---- a/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp -+++ b/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp -@@ -40,6 +40,7 @@ - #include "qgenericunixthemes_p.h" - - #include "qpa/qplatformtheme_p.h" -+#include "qpa/qplatformfontdatabase.h" - - #include - #include -@@ -76,7 +77,6 @@ - QT_BEGIN_NAMESPACE - - Q_DECLARE_LOGGING_CATEGORY(qLcTray) --Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts") - - ResourceHelper::ResourceHelper() - { diff --git a/depends/patches/qt/fast_fixed_dtoa_no_optimize.patch b/depends/patches/qt/fast_fixed_dtoa_no_optimize.patch deleted file mode 100644 index d4d6539f56..0000000000 --- a/depends/patches/qt/fast_fixed_dtoa_no_optimize.patch +++ /dev/null @@ -1,20 +0,0 @@ -Modify the optimisation flags for FastFixedDtoa. -This fixes a non-determinism issue in the asm produced for -this function when cross-compiling on x86_64 and aarch64 for -the arm-linux-gnueabihf HOST. - ---- a/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h -+++ b/qtbase/src/3rdparty/double-conversion/fixed-dtoa.h -@@ -48,9 +48,12 @@ namespace double_conversion { - // - // This method only works for some parameters. If it can't handle the input it - // returns false. The output is null-terminated when the function succeeds. -+#pragma GCC push_options -+#pragma GCC optimize ("-O1") - bool FastFixedDtoa(double v, int fractional_count, - Vector buffer, int* length, int* decimal_point); - -+#pragma GCC pop_options - } // namespace double_conversion - - #endif // DOUBLE_CONVERSION_FIXED_DTOA_H_ diff --git a/depends/patches/qt/fix_android_jni_static.patch b/depends/patches/qt/fix_android_jni_static.patch deleted file mode 100644 index 936b82e152..0000000000 --- a/depends/patches/qt/fix_android_jni_static.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- old/qtbase/src/plugins/platforms/android/androidjnimain.cpp -+++ new/qtbase/src/plugins/platforms/android/androidjnimain.cpp -@@ -943,6 +943,14 @@ Q_DECL_EXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void */*reserved*/) - __android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed"); - return -1; - } -+ -+ const jint ret = QT_PREPEND_NAMESPACE(QtAndroidPrivate::initJNI(vm, env)); -+ if (ret != 0) -+ { -+ __android_log_print(ANDROID_LOG_FATAL, "Qt", "initJNI failed"); -+ return ret; -+ } -+ - QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false); - - m_javaVM = vm; - diff --git a/depends/patches/qt/fix_montery_include.patch b/depends/patches/qt/fix_montery_include.patch deleted file mode 100644 index 38b700addf..0000000000 --- a/depends/patches/qt/fix_montery_include.patch +++ /dev/null @@ -1,21 +0,0 @@ -From dece6f5840463ae2ddf927d65eb1b3680e34a547 -From: Øystein Heskestad -Date: Wed, 27 Oct 2021 13:07:46 +0200 -Subject: [PATCH] Add missing macOS header file that was indirectly included before - -See: https://bugreports.qt.io/browse/QTBUG-97855 - -Upstream Commits: - - Qt 6.2: c884bf138a21dd7320e35cef34d24e22e74d7ce0 - -diff --git a/qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h b/qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -index e070ba97..07c75b04 100644 ---- a/qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -+++ b/qtbase/src/plugins/platforms/cocoa/qiosurfacegraphicsbuffer.h -@@ -40,6 +40,7 @@ - #ifndef QIOSURFACEGRAPHICSBUFFER_H - #define QIOSURFACEGRAPHICSBUFFER_H - -+#include - #include - #include diff --git a/depends/patches/qt/fix_qt_pkgconfig.patch b/depends/patches/qt/fix_qt_pkgconfig.patch deleted file mode 100644 index 73f4d89f73..0000000000 --- a/depends/patches/qt/fix_qt_pkgconfig.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- old/qtbase/mkspecs/features/qt_module.prf -+++ new/qtbase/mkspecs/features/qt_module.prf -@@ -269,7 +269,7 @@ load(qt_installs) - load(qt_targets) - - # this builds on top of qt_common --!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) { -+if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) { - CONFIG += create_pc - QMAKE_PKGCONFIG_DESTDIR = pkgconfig - host_build: \ diff --git a/depends/patches/qt/guix_cross_lib_path.patch b/depends/patches/qt/guix_cross_lib_path.patch deleted file mode 100644 index 7911dc21d7..0000000000 --- a/depends/patches/qt/guix_cross_lib_path.patch +++ /dev/null @@ -1,17 +0,0 @@ -Facilitate guix building with CROSS_LIBRARY_PATH - -See discussion in https://github.com/bitcoin/bitcoin/pull/15277. - ---- a/qtbase/mkspecs/features/toolchain.prf -+++ b/qtbase/mkspecs/features/toolchain.prf -@@ -236,8 +236,8 @@ isEmpty($${target_prefix}.INCDIRS) { - add_libraries = false - for (line, output) { - line ~= s/^[ \\t]*// # remove leading spaces -- contains(line, "LIBRARY_PATH=.*") { -- line ~= s/^LIBRARY_PATH=// # remove leading LIBRARY_PATH= -+ contains(line, "(CROSS_)?LIBRARY_PATH=.*") { -+ line ~= s/^(CROSS_)?LIBRARY_PATH=// # remove leading (CROSS_)?LIBRARY_PATH= - equals(QMAKE_HOST.os, Windows): \ - paths = $$split(line, ;) - else: \ diff --git a/depends/patches/qt/mac-qmake.conf b/depends/patches/qt/mac-qmake.conf deleted file mode 100644 index cb94bf07b4..0000000000 --- a/depends/patches/qt/mac-qmake.conf +++ /dev/null @@ -1,22 +0,0 @@ -MAKEFILE_GENERATOR = UNIX -CONFIG += app_bundle incremental lib_version_first absolute_library_soname -QMAKE_INCREMENTAL_STYLE = sublib -include(../common/macx.conf) -include(../common/gcc-base-mac.conf) -include(../common/clang.conf) -include(../common/clang-mac.conf) -QMAKE_MAC_SDK_PATH=$${MAC_SDK_PATH} -QMAKE_XCODE_VERSION = $${XCODE_VERSION} -QMAKE_XCODE_DEVELOPER_PATH=/Developer -QMAKE_MAC_SDK=macosx -QMAKE_MAC_SDK.macosx.Path = $${MAC_SDK_PATH} -QMAKE_MAC_SDK.macosx.platform_name = macosx -QMAKE_MAC_SDK.macosx.SDKVersion = $${MAC_SDK_VERSION} -QMAKE_MAC_SDK.macosx.PlatformPath = /phony -!host_build: QMAKE_CFLAGS += -target $${MAC_TARGET} -!host_build: QMAKE_OBJECTIVE_CFLAGS += $$QMAKE_CFLAGS -!host_build: QMAKE_CXXFLAGS += -target $${MAC_TARGET} -!host_build: QMAKE_LFLAGS += -target $${MAC_TARGET} -QMAKE_AR = $${CROSS_COMPILE}ar cq -QMAKE_RANLIB=$${CROSS_COMPILE}ranlib -load(qt_config) diff --git a/depends/patches/qt/memory_resource.patch b/depends/patches/qt/memory_resource.patch new file mode 100644 index 0000000000..14e25121c0 --- /dev/null +++ b/depends/patches/qt/memory_resource.patch @@ -0,0 +1,16 @@ +Fix unusable memory_resource on macos + +See https://bugreports.qt.io/browse/QTBUG-117484 +and https://bugreports.qt.io/browse/QTBUG-114316 + +--- a/qtbase/src/corelib/tools/qduplicatetracker_p.h ++++ b/qtbase/src/corelib/tools/qduplicatetracker_p.h +@@ -52,7 +52,7 @@ + + #include + +-#if QT_HAS_INCLUDE() && __cplusplus > 201402L ++#ifdef __cpp_lib_memory_resource + # include + # include + #else diff --git a/depends/patches/qt/no-xlib.patch b/depends/patches/qt/no-xlib.patch deleted file mode 100644 index d6846aaca2..0000000000 --- a/depends/patches/qt/no-xlib.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 9563cef873ae82e06f60708d706d054717e801ce Mon Sep 17 00:00:00 2001 -From: Carl Dong -Date: Thu, 18 Jul 2019 17:22:05 -0400 -Subject: [PATCH] Wrap xlib related code blocks in #if's - -They are not necessary to compile QT. ---- - qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp -index 7c62c2e2b3..c05c6c0a07 100644 ---- a/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp -+++ b/qtbase/src/plugins/platforms/xcb/qxcbcursor.cpp -@@ -49,7 +49,9 @@ - #include - #include - #include -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - #include -+#endif - #include - #include - -@@ -391,6 +391,7 @@ void QXcbCursor::changeCursor(QCursor *cursor, QWindow *window) - xcb_flush(xcb_connection()); - } - -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - static int cursorIdForShape(int cshape) - { - int cursorId = 0; -@@ -444,6 +445,7 @@ static int cursorIdForShape(int cshape) - } - return cursorId; - } -+#endif - - xcb_cursor_t QXcbCursor::createNonStandardCursor(int cshape) - { -@@ -556,7 +558,9 @@ static xcb_cursor_t loadCursor(void *dpy, int cshape) - xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - { - xcb_connection_t *conn = xcb_connection(); -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - int cursorId = cursorIdForShape(cshape); -+#endif - xcb_cursor_t cursor = XCB_NONE; - - // Try Xcursor first -@@ -586,6 +590,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - // Non-standard X11 cursors are created from bitmaps - cursor = createNonStandardCursor(cshape); - -+#if QT_CONFIG(xcb_xlib) && QT_CONFIG(library) - // Create a glpyh cursor if everything else failed - if (!cursor && cursorId) { - cursor = xcb_generate_id(conn); -@@ -593,6 +598,7 @@ xcb_cursor_t QXcbCursor::createFontCursor(int cshape) - cursorId, cursorId + 1, - 0xFFFF, 0xFFFF, 0xFFFF, 0, 0, 0); - } -+#endif - - if (cursor && cshape >= 0 && cshape < Qt::LastCursor && connection()->hasXFixes()) { - const char *name = cursorNames[cshape].front(); --- -2.22.0 - diff --git a/depends/patches/qt/qt.pro b/depends/patches/qt/qt.pro deleted file mode 100644 index 8f2e900a84..0000000000 --- a/depends/patches/qt/qt.pro +++ /dev/null @@ -1,16 +0,0 @@ -# Create the super cache so modules will add themselves to it. -cache(, super) - -!QTDIR_build: cache(CONFIG, add, $$list(QTDIR_build)) - -prl = no_install_prl -CONFIG += $$prl -cache(CONFIG, add stash, prl) - -TEMPLATE = subdirs -SUBDIRS = qtbase qttools qttranslations - -qttools.depends = qtbase -qttranslations.depends = qttools - -load(qt_configure) diff --git a/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch b/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch index f0c14a9400..e5e7b126f6 100644 --- a/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch +++ b/depends/patches/qt/qtbase-moc-ignore-gcc-macro.patch @@ -7,7 +7,7 @@ Upstream report: https://bugreports.qt.io/browse/QTBUG-83160 diff --git a/qtbase/src/tools/moc/main.cpp b/qtbase/src/tools/moc/main.cpp --- a/qtbase/src/tools/moc/main.cpp +++ b/qtbase/src/tools/moc/main.cpp -@@ -238,6 +238,7 @@ int runMoc(int argc, char **argv) +@@ -186,6 +186,7 @@ int runMoc(int argc, char **argv) dummyVariadicFunctionMacro.arguments += Symbol(0, PP_IDENTIFIER, "__VA_ARGS__"); pp.macros["__attribute__"] = dummyVariadicFunctionMacro; pp.macros["__declspec"] = dummyVariadicFunctionMacro; diff --git a/depends/patches/qt/qtbase_avoid_native_float16.patch b/depends/patches/qt/qtbase_avoid_native_float16.patch new file mode 100644 index 0000000000..ec03d140e3 --- /dev/null +++ b/depends/patches/qt/qtbase_avoid_native_float16.patch @@ -0,0 +1,37 @@ +Avoid using native float16 types in Qt's qfloat16 + +Using native float16 types may introduce compatibility issues +in release binaries for Linux platforms. + +See: https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e42d2d2a20f2bb59928bc895ec9f46503a1b5c73 + +This patch can be dropped once the minimum required libgcc version +is updated to 12.x or newer. + + +--- a/qtbase/src/corelib/global/qtypes.h ++++ b/qtbase/src/corelib/global/qtypes.h +@@ -258,23 +258,8 @@ using qsizetype = QIntegerForSizeof::Signed; + + // Define a native float16 type + namespace QtPrivate { +-#if defined(__STDCPP_FLOAT16_T__) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = std::float16_t; +-#elif defined(Q_CC_CLANG) && defined(__FLT16_MAX__) && 0 +-// disabled due to https://github.com/llvm/llvm-project/issues/56963 +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = decltype(__FLT16_MAX__); +-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__ARM_FP16_FORMAT_IEEE) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = __fp16; +-#elif defined(Q_CC_GNU_ONLY) && defined(__FLT16_MAX__) && defined(__SSE2__) +-# define QFLOAT16_IS_NATIVE 1 +-using NativeFloat16Type = _Float16; +-#else + # define QFLOAT16_IS_NATIVE 0 + using NativeFloat16Type = void; +-#endif + } // QtPrivate + + #endif // __cplusplus diff --git a/depends/patches/qt/qtbase_avoid_qmain.patch b/depends/patches/qt/qtbase_avoid_qmain.patch new file mode 100644 index 0000000000..45a54fe881 --- /dev/null +++ b/depends/patches/qt/qtbase_avoid_qmain.patch @@ -0,0 +1,21 @@ +Avoid defining QT_NEEDS_QMAIN macro + +Qt's QT_NEEDS_QMAIN macro renames our main() function to qMain(), +which breaks our assumptions regarding exported symbols. In particular, +the CONTROL_FLOW security check fails for Windows builds in Guix. + +The QT_NEEDS_QMAIN macro is required for linking to the Qt DLLs only, +so we can safely disable it. + + +--- a/qtbase/src/entrypoint/CMakeLists.txt ++++ b/qtbase/src/entrypoint/CMakeLists.txt +@@ -104,8 +104,6 @@ if(WIN32) + APPEND PROPERTY INTERFACE_QT_MODULE_LDFLAGS "-lmingw32" + ) + +- target_compile_definitions(EntryPointPrivate INTERFACE QT_NEEDS_QMAIN) +- qt_internal_extend_target(EntryPointImplementation DEFINES QT_NEEDS_QMAIN) + endif() + + qt_internal_add_sync_header_dependencies(EntryPointImplementation Core) diff --git a/depends/patches/qt/qtbase_platformsupport.patch b/depends/patches/qt/qtbase_platformsupport.patch new file mode 100644 index 0000000000..45ccaea53a --- /dev/null +++ b/depends/patches/qt/qtbase_platformsupport.patch @@ -0,0 +1,34 @@ +CMake: Prevent creation of empty InputSupportPrivate module + +The combination of + -no-feature-evdev + -no-feature-tslib + -no-feature-libinput +led to the creation of the InputSupportPrivate module without source +files. + +This triggered CMake upstream issue 23464 when using CMake < 3.25. + +Fix this by adjusting the inexact condition that decides whether to +build InputSupportPrivate. + + +See: https://codereview.qt-project.org/c/qt/qtbase/+/633612 + + +--- a/qtbase/src/platformsupport/CMakeLists.txt ++++ b/qtbase/src/platformsupport/CMakeLists.txt +@@ -3,7 +3,12 @@ + + add_subdirectory(devicediscovery) + add_subdirectory(fbconvenience) +-if(QT_FEATURE_evdev OR QT_FEATURE_integrityhid OR QT_FEATURE_libinput OR QT_FEATURE_tslib OR QT_FEATURE_xkbcommon) ++if(QT_FEATURE_evdev ++ OR QT_FEATURE_vxworksevdev ++ OR QT_FEATURE_integrityhid ++ OR QT_FEATURE_libinput ++ OR QT_FEATURE_tslib ++ OR (QT_FEATURE_libinput AND QT_FEATURE_xkbcommon)) + add_subdirectory(input) + endif() + if(QT_FEATURE_kms) diff --git a/depends/patches/qt/qtbase_plugins_cocoa.patch b/depends/patches/qt/qtbase_plugins_cocoa.patch new file mode 100644 index 0000000000..118a72d66e --- /dev/null +++ b/depends/patches/qt/qtbase_plugins_cocoa.patch @@ -0,0 +1,21 @@ +CMake: Fix macOS -no-feature-sessionmanager build with CMake < 3.25 + +Work around CMake issue 23464. + + +See: https://codereview.qt-project.org/c/qt/qtbase/+/634002 + + +--- a/qtbase/src/plugins/platforms/cocoa/CMakeLists.txt ++++ b/qtbase/src/plugins/platforms/cocoa/CMakeLists.txt +@@ -102,3 +102,10 @@ qt_internal_extend_target(QCocoaIntegrationPlugin CONDITION QT_FEATURE_sessionma + SOURCES + qcocoasessionmanager.cpp qcocoasessionmanager.h + ) ++ ++# Work around CMake issue 23464 ++if(CMAKE_VERSION VERSION_LESS "3.25" AND NOT QT_FEATURE_sessionmanager) ++ set_target_properties(QCocoaIntegrationPlugin PROPERTIES ++ DISABLE_PRECOMPILE_HEADERS ON ++ ) ++endif() diff --git a/depends/patches/qt/qtbase_skip_tools.patch b/depends/patches/qt/qtbase_skip_tools.patch new file mode 100644 index 0000000000..bbd87e8689 --- /dev/null +++ b/depends/patches/qt/qtbase_skip_tools.patch @@ -0,0 +1,61 @@ +Skip building/installing unneeded tools: + +1. Wrapper CMake scripts. +2. CI support files. +3. tracepointgen and tracegen tools. +4. Qt Look Ahead LR Parser Generator (qlalr). +5. Qt Vulkan Header Generator (qvkgen). + + +--- a/qtbase/cmake/QtBaseGlobalTargets.cmake ++++ b/qtbase/cmake/QtBaseGlobalTargets.cmake +@@ -118,9 +118,6 @@ qt_generate_global_module_pri_file() + qt_generate_global_device_pri_file() + qt_generate_qmake_and_qtpaths_wrapper_for_target() + +-# Depends on the global features being evaluated. +-qt_internal_create_wrapper_scripts() +- + add_library(Qt::GlobalConfig ALIAS GlobalConfig) + + add_library(GlobalConfigPrivate INTERFACE) + +--- a/qtbase/cmake/QtBaseGlobalTargets.cmake ++++ b/qtbase/cmake/QtBaseGlobalTargets.cmake +@@ -349,12 +349,3 @@ elseif(WASM) + qt_install(PROGRAMS "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/qt-wasmtestrunner.py" + DESTINATION "${INSTALL_LIBEXECDIR}") + endif() +- +-# Install CI support files to libexec. +-qt_path_join(__qt_libexec_install_dir "${QT_INSTALL_DIR}" "${INSTALL_LIBEXECDIR}") +-qt_copy_or_install(FILES coin/instructions/qmake/ensure_pro_file.cmake +- DESTINATION "${__qt_libexec_install_dir}") +-qt_copy_or_install(PROGRAMS "util/testrunner/qt-testrunner.py" +- DESTINATION "${__qt_libexec_install_dir}") +-qt_copy_or_install(PROGRAMS "util/testrunner/sanitizer-testrunner.py" +- DESTINATION "${__qt_libexec_install_dir}") + + +--- a/qtbase/src/CMakeLists.txt ++++ b/qtbase/src/CMakeLists.txt +@@ -21,8 +21,6 @@ function(find_or_build_bootstrap_names) + endif() + add_subdirectory(tools/moc) + add_subdirectory(tools/rcc) +- add_subdirectory(tools/tracepointgen) +- add_subdirectory(tools/tracegen) + add_subdirectory(tools/cmake_automoc_parser) + endfunction() + +--- a/qtbase/src/tools/CMakeLists.txt ++++ b/qtbase/src/tools/CMakeLists.txt +@@ -11,8 +11,6 @@ if (QT_FEATURE_dbus) + add_subdirectory(qdbuscpp2xml) + add_subdirectory(qdbusxml2cpp) + endif() +-add_subdirectory(qlalr) +-add_subdirectory(qvkgen) + if (QT_FEATURE_commandlineparser) + add_subdirectory(qtpaths) + endif() diff --git a/depends/patches/qt/qttools_skip_dependencies.patch b/depends/patches/qt/qttools_skip_dependencies.patch new file mode 100644 index 0000000000..09f66f4497 --- /dev/null +++ b/depends/patches/qt/qttools_skip_dependencies.patch @@ -0,0 +1,36 @@ +QtTools: Skip unnecessary dependencies: + +1. The LLVM installatiion. +2. Build only required tools. + + +--- a/qttools/configure.cmake ++++ b/qttools/configure.cmake +@@ -17,7 +17,7 @@ + # Presumably because 6.0 ClangConfig.cmake files are not good enough? + # In any case explicitly request a minimum version of 8.x for now, otherwise + # building with CMake will fail at compilation time. +-qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) ++#qt_find_package(WrapLibClang 8 PROVIDED_TARGETS WrapLibClang::WrapLibClang) + # special case end + + if(TARGET WrapLibClang::WrapLibClang) + +--- a/qttools/src/linguist/CMakeLists.txt ++++ b/qttools/src/linguist/CMakeLists.txt +@@ -9,15 +9,8 @@ if(NOT QT_FEATURE_linguist) + return() + endif() + add_subdirectory(lconvert) +-add_subdirectory(lprodump) + add_subdirectory(lrelease) +-add_subdirectory(lrelease-pro) + add_subdirectory(lupdate) +-add_subdirectory(lupdate-pro) +-if(QT_FEATURE_process AND QT_FEATURE_pushbutton AND QT_FEATURE_toolbutton +- AND QT_FEATURE_png AND QT_FEATURE_printsupport AND TARGET Qt::Widgets) +- add_subdirectory(linguist) +-endif() + + # Create a fake module that would emulate the Qt5::LinguistTools CMake Config package + qt_internal_add_module(Linguist diff --git a/depends/patches/qt/qttools_src.pro b/depends/patches/qt/qttools_src.pro deleted file mode 100644 index 6ef71a0942..0000000000 --- a/depends/patches/qt/qttools_src.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs -SUBDIRS = linguist - -fb = force_bootstrap -CONFIG += $$fb -cache(CONFIG, add, fb) diff --git a/depends/patches/qt/rcc_hardcode_timestamp.patch b/depends/patches/qt/rcc_hardcode_timestamp.patch index 03f3897975..e72f4bd037 100644 --- a/depends/patches/qt/rcc_hardcode_timestamp.patch +++ b/depends/patches/qt/rcc_hardcode_timestamp.patch @@ -6,11 +6,11 @@ the SOURCE_DATE_EPOCH variable set, e.g., for Guix builds. --- old/qtbase/src/tools/rcc/rcc.cpp +++ new/qtbase/src/tools/rcc/rcc.cpp -@@ -227,14 +227,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) +@@ -201,14 +201,7 @@ void RCCFileInfo::writeDataInfo(RCCResourceLibrary &lib) if (lib.formatVersion() >= 2) { // last modified time stamp -- const QDateTime lastModified = m_fileInfo.lastModified(); +- const QDateTime lastModified = m_fileInfo.lastModified(QTimeZone::UTC); - quint64 lastmod = quint64(lastModified.isValid() ? lastModified.toMSecsSinceEpoch() : 0); - static const quint64 sourceDate = 1000 * qgetenv("QT_RCC_SOURCE_DATE_OVERRIDE").toULongLong(); - if (sourceDate != 0) diff --git a/depends/patches/qt/use_android_ndk23.patch b/depends/patches/qt/use_android_ndk23.patch deleted file mode 100644 index f22367d527..0000000000 --- a/depends/patches/qt/use_android_ndk23.patch +++ /dev/null @@ -1,13 +0,0 @@ -Use Android NDK r23 LTS - ---- old/qtbase/mkspecs/features/android/default_pre.prf -+++ new/qtbase/mkspecs/features/android/default_pre.prf -@@ -76,7 +76,7 @@ else: equals(QT_ARCH, x86_64): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/x86_64-linux- - else: equals(QT_ARCH, arm64-v8a): CROSS_COMPILE = $$NDK_LLVM_PATH/bin/aarch64-linux-android- - else: CROSS_COMPILE = $$NDK_LLVM_PATH/bin/arm-linux-androideabi- - --QMAKE_RANLIB = $${CROSS_COMPILE}ranlib -+QMAKE_RANLIB = $$NDK_LLVM_PATH/bin/llvm-ranlib - QMAKE_LINK_SHLIB = $$QMAKE_LINK - QMAKE_LFLAGS = - diff --git a/depends/patches/systemtap/fix_variadic_warning.patch b/depends/patches/systemtap/fix_variadic_warning.patch deleted file mode 100644 index 93cc2d6081..0000000000 --- a/depends/patches/systemtap/fix_variadic_warning.patch +++ /dev/null @@ -1,16 +0,0 @@ -Could be dropped after a migration to C++20. -See: https://github.com/bitcoin/bitcoin/issues/26916. - -diff --git a/includes/sys/sdt.h b/includes/sys/sdt.h -index 4075a5f..7c6138c 100644 ---- a/includes/sys/sdt.h -+++ b/includes/sys/sdt.h -@@ -276,7 +276,7 @@ __extension__ extern unsigned long long __sdt_unsp; - _SDT_ASM_1(.purgem _SDT_TYPE_) \ - _SDT_ASM_1(.purgem _SDT_TYPE) - --#define _SDT_ASM_BODY(provider, name, pack_args, args, ...) \ -+#define _SDT_ASM_BODY(provider, name, pack_args, args) \ - _SDT_DEF_MACROS \ - _SDT_ASM_1(990: _SDT_NOP) \ - _SDT_ASM_3( .pushsection .note.stapsdt,_SDT_ASM_AUTOGROUP,"note") \ diff --git a/depends/patches/zeromq/builtin_sha1.patch b/depends/patches/zeromq/builtin_sha1.patch new file mode 100644 index 0000000000..5481c9dbdd --- /dev/null +++ b/depends/patches/zeromq/builtin_sha1.patch @@ -0,0 +1,17 @@ +Don't use builtin sha1 if not using ws + +The builtin SHA1 (ZMQ_USE_BUILTIN_SHA1) is only used in the websocket +engine (ws_engine.cpp). +Upstreamed in https://github.com/zeromq/libzmq/pull/4670. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -234,7 +234,7 @@ if(NOT ZMQ_USE_GNUTLS) + endif() + endif() + endif() +- if(NOT ZMQ_USE_NSS) ++ if(ENABLE_WS AND NOT ZMQ_USE_NSS) + list(APPEND sources ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.c + ${CMAKE_CURRENT_SOURCE_DIR}/external/sha1/sha1.h) + message(STATUS "Using builtin sha1") diff --git a/depends/patches/zeromq/cacheline_undefined.patch b/depends/patches/zeromq/cacheline_undefined.patch new file mode 100644 index 0000000000..02bd2a5fe5 --- /dev/null +++ b/depends/patches/zeromq/cacheline_undefined.patch @@ -0,0 +1,15 @@ +Use proper STREQUAL instead of EQUAL to compare strings.txt + +See: https://github.com/zeromq/libzmq/pull/4711. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -476,7 +476,7 @@ execute_process( + if(CACHELINE_SIZE STREQUAL "" + OR CACHELINE_SIZE EQUAL 0 + OR CACHELINE_SIZE EQUAL -1 +- OR CACHELINE_SIZE EQUAL "undefined") ++ OR CACHELINE_SIZE STREQUAL "undefined") + set(ZMQ_CACHELINE_SIZE 64) + else() + set(ZMQ_CACHELINE_SIZE ${CACHELINE_SIZE}) diff --git a/depends/patches/zeromq/cmake_minimum.patch b/depends/patches/zeromq/cmake_minimum.patch new file mode 100644 index 0000000000..d6b6b5fae7 --- /dev/null +++ b/depends/patches/zeromq/cmake_minimum.patch @@ -0,0 +1,18 @@ +Set a more sane cmake_minimum_required. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,12 +1,7 @@ + # CMake build script for ZeroMQ ++cmake_minimum_required(VERSION 3.16) + project(ZeroMQ) + +-if(${CMAKE_SYSTEM_NAME} STREQUAL Darwin) +- cmake_minimum_required(VERSION 3.0.2) +-else() +- cmake_minimum_required(VERSION 2.8.12) +-endif() +- + include(CheckIncludeFiles) + include(CheckCCompilerFlag) + include(CheckCXXCompilerFlag) diff --git a/depends/patches/zeromq/fix_have_windows.patch b/depends/patches/zeromq/fix_have_windows.patch new file mode 100644 index 0000000000..e77ef31adf --- /dev/null +++ b/depends/patches/zeromq/fix_have_windows.patch @@ -0,0 +1,54 @@ +This fixes several instances where _MSC_VER was +used to determine whether to use afunix.h or not. + +See https://github.com/zeromq/libzmq/pull/4678. +--- a/src/ipc_address.hpp ++++ b/src/ipc_address.hpp +@@ -7,7 +7,7 @@ + + #include + +-#if defined _MSC_VER ++#if defined ZMQ_HAVE_WINDOWS + #include + #else + #include +diff --git a/src/ipc_connecter.cpp b/src/ipc_connecter.cpp +index 3f988745..ed2a0645 100644 +--- a/src/ipc_connecter.cpp ++++ b/src/ipc_connecter.cpp +@@ -16,7 +16,7 @@ + #include "ipc_address.hpp" + #include "session_base.hpp" + +-#ifdef _MSC_VER ++#if defined ZMQ_HAVE_WINDOWS + #include + #else + #include +diff --git a/src/ipc_listener.cpp b/src/ipc_listener.cpp +index 50126040..5428579b 100644 +--- a/src/ipc_listener.cpp ++++ b/src/ipc_listener.cpp +@@ -17,7 +17,7 @@ + #include "socket_base.hpp" + #include "address.hpp" + +-#ifdef _MSC_VER ++#ifdef ZMQ_HAVE_WINDOWS + #ifdef ZMQ_IOTHREAD_POLLER_USE_SELECT + #error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport + #endif +diff --git a/tests/testutil.cpp b/tests/testutil.cpp +index bdc80283..6f21e8f6 100644 +--- a/tests/testutil.cpp ++++ b/tests/testutil.cpp +@@ -7,7 +7,7 @@ + + #if defined _WIN32 + #include "../src/windows.hpp" +-#if defined _MSC_VER ++#if defined ZMQ_HAVE_WINDOWS + #if defined ZMQ_HAVE_IPC + #include + #include diff --git a/depends/patches/zeromq/macos_mktemp_check.patch b/depends/patches/zeromq/macos_mktemp_check.patch new file mode 100644 index 0000000000..c703abcd71 --- /dev/null +++ b/depends/patches/zeromq/macos_mktemp_check.patch @@ -0,0 +1,16 @@ +build: fix mkdtemp check on macOS + +On macOS, mkdtemp is in unistd.h. Fix the CMake check so that is works. +Upstreamed in https://github.com/zeromq/libzmq/pull/4668. + +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -599,7 +599,7 @@ if(NOT MSVC) + + check_cxx_symbol_exists(fork unistd.h HAVE_FORK) + check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME) +- check_cxx_symbol_exists(mkdtemp stdlib.h HAVE_MKDTEMP) ++ check_cxx_symbol_exists(mkdtemp "stdlib.h;unistd.h" HAVE_MKDTEMP) + check_cxx_symbol_exists(accept4 sys/socket.h HAVE_ACCEPT4) + check_cxx_symbol_exists(strnlen string.h HAVE_STRNLEN) + else() diff --git a/depends/patches/zeromq/netbsd_kevent_void.patch b/depends/patches/zeromq/netbsd_kevent_void.patch deleted file mode 100644 index 845c6bdda6..0000000000 --- a/depends/patches/zeromq/netbsd_kevent_void.patch +++ /dev/null @@ -1,57 +0,0 @@ -commit 129137d5182967dbfcfec66bad843df2a992a78f -Author: fanquake -Date: Mon Jan 3 20:13:33 2022 +0800 - - problem: kevent udata is now void* on NetBSD Current (10) - - solution: check for the intptr_t variant in configure. - -diff --git a/configure.ac b/configure.ac -index 1a571291..402f8b86 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -307,6 +307,27 @@ case "${host_os}" in - if test "x$libzmq_netbsd_has_atomic" = "xno"; then - AC_DEFINE(ZMQ_FORCE_MUTEXES, 1, [Force to use mutexes]) - fi -+ # NetBSD Current (to become 10) has changed the type of udata in it's -+ # kevent struct from intptr_t to void * to align with darwin and other -+ # BSDs, see upstream commit: -+ # https://github.com/NetBSD/src/commit/e5ead823eb916b56589d2c6c560dbcfe4a2d0afc -+ AC_MSG_CHECKING([whether kevent udata type is intptr_t]) -+ AC_LANG_PUSH([C++]) -+ AC_LINK_IFELSE([AC_LANG_PROGRAM( -+ [[#include -+ #include -+ #include ]], -+ [[struct kevent ev; -+ intptr_t udata; -+ EV_SET(&ev, 0, 0, EV_ADD, 0, 0, udata); -+ return 0;]])], -+ [libzmq_netbsd_kevent_udata_intptr_t=yes], -+ [libzmq_netbsd_kevent_udata_intptr_t=no]) -+ AC_LANG_POP([C++]) -+ AC_MSG_RESULT([$libzmq_netbsd_kevent_udata_intptr_t]) -+ if test "x$libzmq_netbsd_kevent_udata_intptr_t" = "xyes"; then -+ AC_DEFINE(ZMQ_NETBSD_KEVENT_UDATA_INTPTR_T, 1, [kevent udata type is intptr_t]) -+ fi - ;; - *openbsd*|*bitrig*) - # Define on OpenBSD to enable all library features -diff --git a/src/kqueue.cpp b/src/kqueue.cpp -index 53d82ac4..a6a7a7f2 100644 ---- a/src/kqueue.cpp -+++ b/src/kqueue.cpp -@@ -46,9 +46,9 @@ - #include "i_poll_events.hpp" - #include "likely.hpp" - --// NetBSD defines (struct kevent).udata as intptr_t, everyone else --// as void *. --#if defined ZMQ_HAVE_NETBSD -+// NetBSD up to version 9 defines (struct kevent).udata as intptr_t, -+// everyone else as void *. -+#if defined ZMQ_HAVE_NETBSD && defined(ZMQ_NETBSD_KEVENT_UDATA_INTPTR_T) - #define kevent_udata_t intptr_t - #else - #define kevent_udata_t void * diff --git a/depends/patches/zeromq/no_librt.patch b/depends/patches/zeromq/no_librt.patch new file mode 100644 index 0000000000..b63854c95b --- /dev/null +++ b/depends/patches/zeromq/no_librt.patch @@ -0,0 +1,54 @@ +We don't use librt, so don't try and link against it. + +Related to: https://github.com/zeromq/libzmq/pull/4702. + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 03462271..87ceab3c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -564,13 +564,6 @@ else() + check_cxx_symbol_exists(SO_BUSY_POLL sys/socket.h ZMQ_HAVE_BUSY_POLL) + endif() + +-if(NOT MINGW) +- find_library(RT_LIBRARY rt) +- if(RT_LIBRARY) +- set(pkg_config_libs_private "${pkg_config_libs_private} -lrt") +- endif() +-endif() +- + find_package(Threads) + + if(WIN32 AND NOT CYGWIN) +@@ -588,9 +581,7 @@ if(WIN32 AND NOT CYGWIN) + endif() + + if(NOT MSVC) +- set(CMAKE_REQUIRED_LIBRARIES rt) + check_cxx_symbol_exists(clock_gettime time.h HAVE_CLOCK_GETTIME) +- set(CMAKE_REQUIRED_LIBRARIES) + + check_cxx_symbol_exists(fork unistd.h HAVE_FORK) + check_cxx_symbol_exists(gethrtime sys/time.h HAVE_GETHRTIME) +@@ -1503,10 +1494,6 @@ if(BUILD_SHARED) + target_link_libraries(libzmq iphlpapi) + endif() + +- if(RT_LIBRARY) +- target_link_libraries(libzmq -lrt) +- endif() +- + if(norm_FOUND) + target_link_libraries(libzmq norm::norm) + endif() +@@ -1553,10 +1540,6 @@ if(BUILD_STATIC) + target_link_libraries(libzmq-static iphlpapi) + endif() + +- if(RT_LIBRARY) +- target_link_libraries(libzmq-static -lrt) +- endif() +- + if(CMAKE_SYSTEM_NAME MATCHES "QNX") + add_definitions(-DUNITY_EXCLUDE_MATH_H) + endif() diff --git a/depends/patches/zeromq/openbsd_kqueue_headers.patch b/depends/patches/zeromq/openbsd_kqueue_headers.patch new file mode 100644 index 0000000000..7000e209fe --- /dev/null +++ b/depends/patches/zeromq/openbsd_kqueue_headers.patch @@ -0,0 +1,24 @@ +commit ff231d267370493814f933d151441866bf1e200b +Author: Min RK +Date: Fri Feb 23 13:21:08 2024 +0100 + + Problem: cmake search for kqueue missing headers + + Solution: include sys/types.h and sys/time.h as documented by kqueue + and used in autotools + + fixes kqueue detection on openbsd + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f956f3fd..814d5d46 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -380,7 +380,7 @@ endif(WIN32) + + if(NOT MSVC) + if(POLLER STREQUAL "") +- check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE) ++ check_cxx_symbol_exists(kqueue "sys/types.h;sys/event.h;sys/time.h" HAVE_KQUEUE) + if(HAVE_KQUEUE) + set(POLLER "kqueue") + endif() diff --git a/depends/patches/zeromq/remove_libstd_link.patch b/depends/patches/zeromq/remove_libstd_link.patch deleted file mode 100644 index ddf91e6abf..0000000000 --- a/depends/patches/zeromq/remove_libstd_link.patch +++ /dev/null @@ -1,25 +0,0 @@ -commit 47d4cd12a2c051815ddda78adebdb3923b260d8a -Author: fanquake -Date: Tue Aug 18 14:45:40 2020 +0800 - - Remove needless linking against libstdc++ - - This is broken for a number of reasons, including: - - g++ understands "static-libstdc++ -lstdc++" to mean "link against - whatever libstdc++ exists, probably shared", which in itself is buggy. - - another stdlib (libc++ for example) may be in use - - See #11981. - -diff --git a/src/libzmq.pc.in b/src/libzmq.pc.in -index 233bc3a..3c2bf0d 100644 ---- a/src/libzmq.pc.in -+++ b/src/libzmq.pc.in -@@ -7,6 +7,6 @@ Name: libzmq - Description: 0MQ c++ library - Version: @VERSION@ - Libs: -L${libdir} -lzmq --Libs.private: -lstdc++ @pkg_config_libs_private@ -+Libs.private: @pkg_config_libs_private@ - Requires.private: @pkg_config_names_private@ - Cflags: -I${includedir} @pkg_config_defines@ diff --git a/depends/toolchain.cmake.in b/depends/toolchain.cmake.in new file mode 100644 index 0000000000..a38cb6135b --- /dev/null +++ b/depends/toolchain.cmake.in @@ -0,0 +1,159 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +# This file is expected to be highly volatile and may still change substantially. + +# If CMAKE_SYSTEM_NAME is set within a toolchain file, CMake will also +# set CMAKE_CROSSCOMPILING to TRUE, even if CMAKE_SYSTEM_NAME matches +# CMAKE_HOST_SYSTEM_NAME. To avoid potential misconfiguration of CMake, +# it is best not to touch CMAKE_SYSTEM_NAME unless cross-compiling is +# intended. +if(@depends_crosscompiling@) + set(CMAKE_SYSTEM_NAME @host_system_name@) + set(CMAKE_SYSTEM_VERSION @host_system_version@) + set(CMAKE_SYSTEM_PROCESSOR @host_arch@) + + set(CMAKE_C_COMPILER_TARGET @host@) + set(CMAKE_CXX_COMPILER_TARGET @host@) + set(CMAKE_OBJCXX_COMPILER_TARGET @host@) +endif() + +if(NOT DEFINED CMAKE_C_FLAGS_INIT) + set(CMAKE_C_FLAGS_INIT "@CFLAGS@") +endif() +if(NOT DEFINED CMAKE_C_FLAGS_RELWITHDEBINFO_INIT) + set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "@CFLAGS_RELEASE@") +endif() +if(NOT DEFINED CMAKE_C_FLAGS_DEBUG_INIT) + set(CMAKE_C_FLAGS_DEBUG_INIT "@CFLAGS_DEBUG@") +endif() + +if(NOT DEFINED CMAKE_C_COMPILER) + set(CMAKE_C_COMPILER @CC@) +endif() + +if(NOT DEFINED CMAKE_CXX_FLAGS_INIT) + set(CMAKE_CXX_FLAGS_INIT "@CXXFLAGS@") + set(CMAKE_OBJCXX_FLAGS_INIT "@CXXFLAGS@") +endif() +if(NOT DEFINED CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT) + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "@CXXFLAGS_RELEASE@") + set(CMAKE_OBJCXX_FLAGS_RELWITHDEBINFO_INIT "@CXXFLAGS_RELEASE@") +endif() +if(NOT DEFINED CMAKE_CXX_FLAGS_DEBUG_INIT) + set(CMAKE_CXX_FLAGS_DEBUG_INIT "@CXXFLAGS_DEBUG@") + set(CMAKE_OBJCXX_FLAGS_DEBUG_INIT "@CXXFLAGS_DEBUG@") +endif() + +if(NOT DEFINED CMAKE_CXX_COMPILER) + set(CMAKE_CXX_COMPILER @CXX@) + set(CMAKE_OBJCXX_COMPILER ${CMAKE_CXX_COMPILER}) +endif() + +# The DEPENDS_COMPILE_DEFINITIONS* variables are to be treated as lists. +set(DEPENDS_COMPILE_DEFINITIONS @CPPFLAGS@) +set(DEPENDS_COMPILE_DEFINITIONS_RELWITHDEBINFO @CPPFLAGS_RELEASE@) +set(DEPENDS_COMPILE_DEFINITIONS_DEBUG @CPPFLAGS_DEBUG@) + +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT) + set(CMAKE_EXE_LINKER_FLAGS_INIT "@LDFLAGS@") +endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_INIT "@LDFLAGS@") +endif() +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT) + set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@") +endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@") +endif() +if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT) + set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@") +endif() +if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT) + set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@") +endif() + +set(CMAKE_AR "@AR@") +set(CMAKE_RANLIB "@RANLIB@") +set(CMAKE_STRIP "@STRIP@") +set(CMAKE_OBJCOPY "@OBJCOPY@") +set(CMAKE_OBJDUMP "@OBJDUMP@") + +# Using our own built dependencies should not be +# affected by a potentially random environment. +set(CMAKE_FIND_USE_CMAKE_ENVIRONMENT_PATH OFF) + +set(CMAKE_FIND_ROOT_PATH "${CMAKE_CURRENT_LIST_DIR}") +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations") + +if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE) + # The find_package(Qt ...) function internally uses find_library() + # calls for all dependencies to ensure their availability. + # In turn, the find_library() inspects the well-known locations + # on the file system; therefore, a hint is required. + set(CMAKE_FRAMEWORK_PATH "@OSX_SDK@/System/Library/Frameworks") +endif() + + +if(CMAKE_SYSTEM_NAME STREQUAL "Linux") + # Customize pkg-config behavior for finding dependencies + # of the xcb QPA platform plugin: + # 1. Restrict search paths to the depends. + # 2. Make output suitable for static linking. + cmake_path(APPEND CMAKE_CURRENT_LIST_DIR "lib" "pkgconfig" OUTPUT_VARIABLE pkg_config_path) + set(ENV{PKG_CONFIG_PATH} ${pkg_config_path}) + set(ENV{PKG_CONFIG_LIBDIR} ${pkg_config_path}) + unset(pkg_config_path) + set(PKG_CONFIG_ARGN --static) +endif() + + +# Set configuration options for the main build system. +# The depends/Makefile can generate values with "not-set" +# semantics as empty strings or strings containing only spaces. +# Therefore, MATCHES must be used rather than STREQUAL. +if("@qt_packages@" MATCHES "^[ ]*$") + set(BUILD_GUI OFF CACHE BOOL "") +else() + set(BUILD_GUI ON CACHE BOOL "") + set(Qt6_ROOT "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "") +endif() + +if("@qrencode_packages@" MATCHES "^[ ]*$") + set(WITH_QRENCODE OFF CACHE BOOL "") +else() + set(WITH_QRENCODE ON CACHE BOOL "") +endif() + +if("@zmq_packages@" MATCHES "^[ ]*$") + set(WITH_ZMQ OFF CACHE BOOL "") +else() + set(WITH_ZMQ ON CACHE BOOL "") +endif() + +if("@wallet_packages@" MATCHES "^[ ]*$") + set(ENABLE_WALLET OFF CACHE BOOL "") +else() + set(ENABLE_WALLET ON CACHE BOOL "") +endif() + +if("@usdt_packages@" MATCHES "^[ ]*$") + set(WITH_USDT OFF CACHE BOOL "") +else() + set(WITH_USDT ON CACHE BOOL "") +endif() + +if("@multiprocess@" STREQUAL "1") + set(ENABLE_IPC ON CACHE BOOL "") + set(MPGEN_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/mpgen" CACHE FILEPATH "") + set(CAPNP_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnp" CACHE FILEPATH "") + set(CAPNPC_CXX_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/native/bin/capnpc-c++" CACHE FILEPATH "") +else() + set(ENABLE_IPC OFF CACHE BOOL "") +endif() diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index 38498103bb..0000000000 --- a/doc/.gitignore +++ /dev/null @@ -1 +0,0 @@ -Doxyfile diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt new file mode 100644 index 0000000000..310a90612b --- /dev/null +++ b/doc/CMakeLists.txt @@ -0,0 +1,25 @@ +# Copyright (c) 2024-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +find_package(Doxygen COMPONENTS dot) + +if(DOXYGEN_FOUND) + set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) + configure_file(Doxyfile.in ${doxyfile} USE_SOURCE_PERMISSIONS) + + # In CMake 3.27, The FindDoxygen module's doxygen_add_docs() + # command gained a CONFIG_FILE option to specify a custom doxygen + # configuration file. + # TODO: Consider using it. + add_custom_target(docs + COMMAND Doxygen::doxygen ${doxyfile} + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + COMMENT "Generating developer documentation" + VERBATIM USES_TERMINAL + ) +else() + add_custom_target(docs + COMMAND ${CMAKE_COMMAND} -E echo "Error: Doxygen not found" + ) +endif() diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in index d8fd46d1c7..cbbb6551f1 100644 --- a/doc/Doxyfile.in +++ b/doc/Doxyfile.in @@ -38,7 +38,7 @@ PROJECT_NAME = "Bitcoin Core" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = @PACKAGE_VERSION@ +PROJECT_NUMBER = @CLIENT_VERSION_STRING@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -58,7 +58,7 @@ PROJECT_LOGO = doc/bitcoin_logo_doxygen.png # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = doc/doxygen +OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/doc/doxygen # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and diff --git a/doc/JSON-RPC-interface.md b/doc/JSON-RPC-interface.md index 6cbb6ebd72..e7f085a377 100644 --- a/doc/JSON-RPC-interface.md +++ b/doc/JSON-RPC-interface.md @@ -33,10 +33,10 @@ requests when multiple wallets are in use. ```sh # Get block count from the / endpoint when rpcuser=alice and rpcport=38332 -$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: text/plain;' localhost:38332/ +$ curl --user alice --data-binary '{"jsonrpc": "2.0", "id": "0", "method": "getblockcount", "params": []}' -H 'content-type: application/json' localhost:38332/ # Get balance from the /wallet/walletname endpoint when rpcuser=alice, rpcport=38332 and rpcwallet=desc-wallet -$ curl --user alice --data-binary '{"jsonrpc": "1.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: text/plain;' localhost:38332/wallet/desc-wallet +$ curl --user alice --data-binary '{"jsonrpc": "2.0", "id": "0", "method": "getbalance", "params": []}' -H 'content-type: application/json' localhost:38332/wallet/desc-wallet ``` @@ -62,6 +62,8 @@ bitcoin-cli -named createwallet wallet_name=mywallet load_on_startup=true bitcoin-cli -named createwallet mywallet load_on_startup=true ``` +`bitcoin rpc` can also be substituted for `bitcoin-cli -named`, and is a newer alternative. + ## Versioning The RPC interface might change from one major version of Bitcoin Core to the @@ -74,6 +76,22 @@ major version via the `-deprecatedrpc=` command line option. The release notes of a new major release come with detailed instructions on what RPC features were deprecated and how to re-enable them temporarily. +## JSON-RPC 1.1 vs 2.0 + +The server recognizes [JSON-RPC v2.0](https://www.jsonrpc.org/specification) requests +and responds accordingly. A 2.0 request is identified by the presence of +`"jsonrpc": "2.0"` in the request body. If that key + value is not present in a request, +the legacy JSON-RPC v1.1 protocol is followed instead, which was the only available +protocol in v27.0 and prior releases. + +|| 1.1 | 2.0 | +|-|-|-| +| Request marker | `"version": "1.1"` (or none) | `"jsonrpc": "2.0"` | +| Response marker | (none) | `"jsonrpc": "2.0"` | +| `"error"` and `"result"` fields in response | both present | only one is present | +| HTTP codes in response | `200` unless there is any kind of RPC error (invalid parameters, method not found, etc) | Always `200` unless there is an actual HTTP server error (request parsing error, endpoint not found, etc) | +| Notifications: requests that get no reply | (not supported) | Supported for requests that exclude the "id" field. Returns HTTP status `204` "No Content" | + ## Security The RPC interface allows other programs to control Bitcoin Core, @@ -128,7 +146,7 @@ RPC interface will be abused. Instead, expose it only on the host system's localhost, for example: `-p 127.0.0.1:8332:8332` -- **Secure authentication:** By default, Bitcoin Core generates unique +- **Secure authentication:** By default, when no `rpcpassword` is specified, Bitcoin Core generates unique login credentials each time it restarts and puts them into a file readable only by the user that started Bitcoin Core, allowing any of that user's RPC clients with read access to the file to login diff --git a/doc/README.md b/doc/README.md index c570432aa4..0959c6c7f0 100644 --- a/doc/README.md +++ b/doc/README.md @@ -3,7 +3,7 @@ Bitcoin Core Setup --------------------- -Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires a few hundred gigabytes of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to a day or more. +Bitcoin Core is the original Bitcoin client and it builds the backbone of the network. It downloads and, by default, stores the entire history of Bitcoin transactions, which requires several hundred gigabytes or more of disk space. Depending on the speed of your computer and network connection, the synchronization process can take anywhere from a few hours to several days or more. To download Bitcoin Core, visit [bitcoincore.org](https://bitcoincore.org/en/download/). @@ -17,6 +17,9 @@ Unpack the files into a directory and run: - `bin/bitcoin-qt` (GUI) or - `bin/bitcoind` (headless) +- `bin/bitcoin` (wrapper command) + +The `bitcoin` command supports subcommands like `bitcoin gui`, `bitcoin node`, and `bitcoin rpc` exposing different functionality. Subcommands can be listed with `bitcoin help`. ### Windows @@ -41,11 +44,10 @@ The following are developer notes on how to build Bitcoin Core on your native pl - [Dependencies](dependencies.md) - [macOS Build Notes](build-osx.md) - [Unix Build Notes](build-unix.md) -- [Windows Build Notes](build-windows.md) +- [Windows Build Notes](build-windows-msvc.md) - [FreeBSD Build Notes](build-freebsd.md) - [OpenBSD Build Notes](build-openbsd.md) - [NetBSD Build Notes](build-netbsd.md) -- [Android Build Notes](build-android.md) Development --------------------- @@ -59,7 +61,6 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th - [Translation Strings Policy](translation_strings_policy.md) - [JSON-RPC Interface](JSON-RPC-interface.md) - [Unauthenticated REST Interface](REST-interface.md) -- [Shared Libraries](shared-libraries.md) - [BIPS](bips.md) - [Dnsseed Policy](dnsseed-policy.md) - [Benchmarking](benchmarking.md) @@ -79,6 +80,7 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th - [Init Scripts (systemd/upstart/openrc)](init.md) - [Managing Wallets](managing-wallets.md) - [Multisig Tutorial](multisig-tutorial.md) +- [Offline Signing Tutorial](offline-signing-tutorial.md) - [P2P bad ports definition and list](p2p-bad-ports.md) - [PSBT support](psbt.md) - [Reduce Memory](reduce-memory.md) diff --git a/doc/REST-interface.md b/doc/REST-interface.md index 2d7d0e3769..fbed4a36b2 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -4,7 +4,7 @@ Unauthenticated REST Interface The REST API can be enabled with the `-rest` option. The interface runs on the same port as the JSON-RPC interface, by default port 8332 for mainnet, port 18332 for testnet, -port 38332 for signet, and port 18443 for regtest. +port 48332 for testnet4, port 38332 for signet, and port 18443 for regtest. REST Interface consistency guarantees ------------------------------------- @@ -117,7 +117,7 @@ $ curl localhost:18332/rest/getutxos/checkmempool/b2cdfd7b89def827ff8af7cd9bff76 "value" : 8.8687, "scriptPubKey" : { "asm" : "OP_DUP OP_HASH160 1c7cebb529b86a04c683dfa87be49de35bcf589e OP_EQUALVERIFY OP_CHECKSIG", - "desc" : "addr(mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD)#gj9tznmy" + "desc" : "addr(mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD)#gj9tznmy", "hex" : "76a9141c7cebb529b86a04c683dfa87be49de35bcf589e88ac", "type" : "pubkeyhash", "address" : "mi7as51dvLJsizWnTMurtRmrP8hG2m1XvD" diff --git a/doc/assumeutxo.md b/doc/assumeutxo.md new file mode 100644 index 0000000000..17858de540 --- /dev/null +++ b/doc/assumeutxo.md @@ -0,0 +1,85 @@ +# Assumeutxo Usage + +Assumeutxo is a feature that allows fast bootstrapping of a validating bitcoind +instance. + +For notes on the design of Assumeutxo, please refer to [the design doc](/doc/design/assumeutxo.md). + +## Loading a snapshot + +There is currently no canonical source for snapshots, but any downloaded snapshot +will be checked against a hash that's been hardcoded in source code. If there is +no source for the snapshot you need, you can generate it yourself using +`dumptxoutset` on another node that is already synced (see +[Generating a snapshot](#generating-a-snapshot)). + +Once you've obtained the snapshot, you can use the RPC command `loadtxoutset` to +load it. + +``` +$ bitcoin-cli -rpcclienttimeout=0 loadtxoutset /path/to/input +``` + +After the snapshot has loaded, the syncing process of both the snapshot chain +and the background IBD chain can be monitored with the `getchainstates` RPC. + +### Pruning + +A pruned node can load a snapshot. To save space, it's possible to delete the +snapshot file as soon as `loadtxoutset` finishes. + +The minimum `-prune` setting is 550 MiB, but this functionality ignores that +minimum and uses at least 1100 MiB. + +As the background sync continues there will be temporarily two chainstate +directories, each multiple gigabytes in size (likely growing larger than the +downloaded snapshot). + +### Indexes + +Indexes work but don't take advantage of this feature. They always start building +from the genesis block and can only apply blocks in order. Once the background +validation reaches the snapshot block, indexes will continue to build all the +way to the tip. + + +For indexes that support pruning, note that these indexes only allow blocks that +were already indexed to be pruned. Blocks that are not indexed yet will also +not be pruned. + +This means that, if the snapshot is old, then a lot of blocks after the snapshot +block will need to be downloaded, and these blocks can't be pruned until they +are indexed, so they could consume a lot of disk space until indexing catches up +to the snapshot block. + +## Generating a snapshot + +The RPC command `dumptxoutset` can be used to generate a snapshot for the current +tip (using type "latest") or a recent height (using type "rollback"). A generated +snapshot from one node can then be loaded +on any other node. However, keep in mind that the snapshot hash needs to be +listed in the chainparams to make it usable. If there is no snapshot hash for +the height you have chosen already, you will need to change the code there and +re-compile. + +Using the type parameter "rollback", `dumptxoutset` can also be used to verify the +hardcoded snapshot hash in the source code by regenerating the snapshot and +comparing the hash. + +Example usage: + +``` +$ bitcoin-cli -rpcclienttimeout=0 dumptxoutset /path/to/output rollback +``` + +For most of the duration of `dumptxoutset` running the node is in a temporary +state that does not actually reflect reality, i.e. blocks are marked invalid +although we know they are not invalid. Because of this it is discouraged to +interact with the node in any other way during this time to avoid inconsistent +results and race conditions, particularly RPCs that interact with blockstorage. +This inconsistent state is also why network activity is temporarily disabled, +causing us to disconnect from all peers. + +`dumptxoutset` takes some time to complete, independent of hardware and +what parameter is chosen. Because of that it is recommended to increase the RPC +client timeout value (use `-rpcclienttimeout=0` for no timeout). diff --git a/doc/benchmarking.md b/doc/benchmarking.md index 84d5f2c444..7a2e20a3d2 100644 --- a/doc/benchmarking.md +++ b/doc/benchmarking.md @@ -8,16 +8,17 @@ thread queue, wallet balance. Running --------------------- -For benchmarking, you only need to compile `bitcoin_bench`. The bench runner -warns if you configure with `--enable-debug`, but consider if building without +For benchmarking, you only need to compile `bench_bitcoin`. The bench runner +warns if you configure with `-DCMAKE_BUILD_TYPE=Debug`, but consider if building without it will impact the benchmark(s) you are interested in by unlatching log printers and lock analysis. - make -C src bitcoin_bench + cmake -B build -DBUILD_BENCH=ON + cmake --build build -t bench_bitcoin After compiling bitcoin-core, the benchmarks can be run with: - src/bench/bench_bitcoin + build/bin/bench_bitcoin The output will look similar to: ``` @@ -39,23 +40,38 @@ The output will look similar to: Help --------------------- - src/bench/bench_bitcoin -? + build/bin/bench_bitcoin -h To print the various options, like listing the benchmarks without running them or using a regex filter to only run certain benchmarks. Notes --------------------- -More benchmarks are needed for, in no particular order: -- Script Validation -- Coins database -- Memory pool -- Cuckoo Cache -- P2P throughput + +Benchmarks help with monitoring for performance regressions and can act as a +scope for future performance improvements. They should cover components that +impact performance critical functions of the system. Functions are performance +critical if their performance impacts users and the cost associated with a +degradation in performance is high. A non-exhaustive list: + +- Initial block download (Cost: slow IBD results in full node operation being + less accessible) +- Block template creation (Cost: slow block template creation may result in + lower fee revenue for miners) +- Block propagation (Cost: slow block propagation may increase the rate of + orphaned blocks and mining centralization) + +A change aiming to improve the performance may be rejected when a clear +end-to-end performance improvement cannot be demonstrated. The change might +also be rejected if the code bloat or review/maintenance burden is too high to +justify the improvement. + +Benchmarks are ill-suited for testing denial-of-service issues as they are +restricted to the same input set (introducing bias). [Fuzz +tests](/doc/fuzzing.md) are better suited for this purpose, as they are +specifically aimed at exploring the possible input space. Going Further -------------------- -To monitor Bitcoin Core performance more in depth (like reindex or IBD): https://github.com/chaincodelabs/bitcoinperf - -To generate Flame Graphs for Bitcoin Core: https://github.com/eklitzke/bitcoin/blob/flamegraphs/doc/flamegraphs.md +To monitor Bitcoin Core performance more in depth (like reindex or IBD): https://github.com/bitcoin-dev-tools/benchcoin diff --git a/doc/bips.md b/doc/bips.md index 94213f8048..a95b3159ec 100644 --- a/doc/bips.md +++ b/doc/bips.md @@ -30,10 +30,10 @@ BIPs that are implemented by Bitcoin Core: * [`BIP 84`](https://github.com/bitcoin/bips/blob/master/bip-0084.mediawiki): The experimental descriptor wallets introduced in **v0.21.0** by default use the Hierarchical Deterministic Wallet derivation proposed by BIP 84. ([PR #16528](https://github.com/bitcoin/bitcoin/pull/16528)) * [`BIP 86`](https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki): Descriptor wallets by default use the Hierarchical Deterministic Wallet derivation proposed by BIP 86 since **v23.0** ([PR #22364](https://github.com/bitcoin/bitcoin/pull/22364)). * [`BIP 90`](https://github.com/bitcoin/bips/blob/master/bip-0090.mediawiki): Trigger mechanism for activation of BIPs 34, 65, and 66 has been simplified to block height checks since **v0.14.0** ([PR #8391](https://github.com/bitcoin/bitcoin/pull/8391)). +* [`BIP 94`](https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki): Testnet 4 (`-testnet4`) supported as of **v28.0** ([PR #29775](https://github.com/bitcoin/bitcoin/pull/29775)). * [`BIP 111`](https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki): `NODE_BLOOM` service bit added, and enforced for all peer versions as of **v0.13.0** ([PR #6579](https://github.com/bitcoin/bitcoin/pull/6579) and [PR #6641](https://github.com/bitcoin/bitcoin/pull/6641)). * [`BIP 112`](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki): The CHECKSEQUENCEVERIFY opcode has been implemented since **v0.12.1** ([PR #7524](https://github.com/bitcoin/bitcoin/pull/7524)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)). * [`BIP 113`](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki): Median time past lock-time calculations have been implemented since **v0.12.1** ([PR #6566](https://github.com/bitcoin/bitcoin/pull/6566)), and has been *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)). -* [`BIP 125`](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki): Opt-in full replace-by-fee signaling partially implemented. See doc/policy/mempool-replacements.md. * [`BIP 130`](https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki): direct headers announcement is negotiated with peer versions `>=70012` as of **v0.12.0** ([PR 6494](https://github.com/bitcoin/bitcoin/pull/6494)). * [`BIP 133`](https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki): feefilter messages are respected and sent for peer versions `>=70013` as of **v0.13.0** ([PR 7542](https://github.com/bitcoin/bitcoin/pull/7542)). * [`BIP 141`](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki): Segregated Witness (Consensus Layer) as of **v0.13.0** ([PR 8149](https://github.com/bitcoin/bitcoin/pull/8149)), defined for mainnet as of **v0.13.1** ([PR 8937](https://github.com/bitcoin/bitcoin/pull/8937)), and *buried* since **v0.19.0** ([PR #16060](https://github.com/bitcoin/bitcoin/pull/16060)). @@ -49,6 +49,7 @@ BIPs that are implemented by Bitcoin Core: * [`BIP 173`](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/bitcoin/bitcoin/pull/11167)). Bech32 addresses are generated by default as of **v0.20.0** ([PR 16884](https://github.com/bitcoin/bitcoin/pull/16884)). * [`BIP 174`](https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki): RPCs to operate on Partially Signed Bitcoin Transactions (PSBT) are present as of **v0.17.0** ([PR 13557](https://github.com/bitcoin/bitcoin/pull/13557)). * [`BIP 176`](https://github.com/bitcoin/bips/blob/master/bip-0176.mediawiki): Bits Denomination [QT only] is supported as of **v0.16.0** ([PR 12035](https://github.com/bitcoin/bitcoin/pull/12035)). +* [`BIP 324`](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki): The v2 transport protocol specified by BIP324 and the associated `NODE_P2P_V2` service bit are supported as of **v26.0**, but off by default ([PR 28331](https://github.com/bitcoin/bitcoin/pull/28331)). On by default as of **v27.0** ([PR 29347](https://github.com/bitcoin/bitcoin/pull/29347)). * [`BIP 325`](https://github.com/bitcoin/bips/blob/master/bip-0325.mediawiki): Signet test network is supported as of **v0.21.0** ([PR 18267](https://github.com/bitcoin/bitcoin/pull/18267)). * [`BIP 339`](https://github.com/bitcoin/bips/blob/master/bip-0339.mediawiki): Relay of transactions by wtxid is supported as of **v0.21.0** ([PR 18044](https://github.com/bitcoin/bitcoin/pull/18044)). * [`BIP 340`](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki) @@ -60,6 +61,7 @@ BIPs that are implemented by Bitcoin Core: [PR 21686](https://github.com/bitcoin/bitcoin/pull/21686)). * [`BIP 350`](https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki): Addresses for native v1+ segregated Witness outputs use Bech32m instead of Bech32 as of **v22.0** ([PR 20861](https://github.com/bitcoin/bitcoin/pull/20861)). * [`BIP 371`](https://github.com/bitcoin/bips/blob/master/bip-0371.mediawiki): Taproot fields for PSBT as of **v24.0** ([PR 22558](https://github.com/bitcoin/bitcoin/pull/22558)). +* [`BIP 379`](https://github.com/bitcoin/bips/blob/master/bip-0379.md): Miniscript was partially implemented in **v24.0** ([PR 24148](https://github.com/bitcoin/bitcoin/pull/24148)), and fully implemented as of **v26.0** ([PR 27255](https://github.com/bitcoin/bitcoin/pull/27255)). * [`BIP 380`](https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki) [`381`](https://github.com/bitcoin/bips/blob/master/bip-0381.mediawiki) [`382`](https://github.com/bitcoin/bips/blob/master/bip-0382.mediawiki) @@ -68,3 +70,5 @@ BIPs that are implemented by Bitcoin Core: [`385`](https://github.com/bitcoin/bips/blob/master/bip-0385.mediawiki): Output Script Descriptors, and most of Script Expressions are implemented as of **v0.17.0** ([PR 13697](https://github.com/bitcoin/bitcoin/pull/13697)). * [`BIP 386`](https://github.com/bitcoin/bips/blob/master/bip-0386.mediawiki): tr() Output Script Descriptors are implemented as of **v22.0** ([PR 22051](https://github.com/bitcoin/bitcoin/pull/22051)). +* [`BIP 387`](https://github.com/bitcoin/bips/blob/master/bip-0387.mediawiki): Tapscript Multisig Output Script Descriptors are implemented as of **v24.0** ([PR 24043](https://github.com/bitcoin/bitcoin/pull/24043)). +* [`BIP 431`](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki): transactions with nVersion=3 are standard and treated as Topologically Restricted Until Confirmation as of **v28.0** ([PR 29496](https://github.com/bitcoin/bitcoin/pull/29496)). diff --git a/doc/bitcoin-conf.md b/doc/bitcoin-conf.md index 1ebfb4c1de..daa7fcba00 100644 --- a/doc/bitcoin-conf.md +++ b/doc/bitcoin-conf.md @@ -8,6 +8,16 @@ Changes to the configuration file while `bitcoind` or `bitcoin-qt` is running on Users should never make any configuration changes which they do not understand. Furthermore, users should always be wary of accepting any configuration changes provided to them by another source (even if they believe that they do understand them). +## Configuration File Precedence + +Options specified in the configuration file can be overridden by options in the [`settings.json` file](files.md) and by options specified on the command line. + +The `settings.json` file contains dynamic settings that are set by the Bitcoin Core GUI and RPCs at runtime, and augment or replace the static settings specified in the `bitcoin.conf` file. + +Command line options also augment or replace `bitcoin.conf` options, and can be useful for scripting and debugging. + +It is possible to see which setting values are in use by checking `debug.log` output. Any unrecognized options that are found in `bitcoin.conf` also show up as warnings in `debug.log` output. + ## Configuration File Format The configuration file is a plain text file and consists of `option=value` entries, one per line. Leading and trailing whitespaces are removed. @@ -31,7 +41,7 @@ Comments may appear in two ways: ### Network specific options Network specific options can be: -- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`), `[signet]` or `[regtest]`; +- placed into sections with headers `[main]` (not `[mainnet]`), `[test]` (not `[testnet]`, for testnet3), `[testnet4]`, `[signet]` or `[regtest]`; - prefixed with a chain name; e.g., `regtest.maxmempool=100`. Network specific options take precedence over non-network specific options. @@ -49,6 +59,14 @@ regtest.rpcport=3000 rpcport=4000 ``` +### Negated options + +Almost all options can be negated by being specified with a `no` prefix. For example an option `-foo` could be negated by writing `nofoo=1` or `nofoo=` in the configuration file or `-nofoo=1` or `-nofoo` on the command line. + +In general, negating an option is like setting it to `0` if it is a boolean or integer option, and setting it to an empty string or path or list if it is a string or path or list option. + +However, there are exceptions to this general rule. For example, it is an error to negate some options (e.g. `-nodatadir` is disallowed), and some negated strings are treated like `"0"` instead of `""` (e.g. `-noproxy` is treated like `-proxy=0`), and some negating some lists can have side effects in addition to clearing the lists (e.g. `-noconnect` disables automatic connections in addition to dropping any manual connections specified previously with `-connect=`). When there are exceptions to the rule, they should either be obvious from context, or should be mentioned in usage documentation. Nonobvious, undocumented exceptions should be reported as bugs. + ## Configuration File Path The configuration file is not automatically created; you can create it using your favorite text editor. By default, the configuration file name is `bitcoin.conf` and it is located in the Bitcoin data directory, but both the Bitcoin data directory and the configuration file path may be changed using the `-datadir` and `-conf` command-line options. @@ -59,7 +77,7 @@ The `includeconf=` option in the `bitcoin.conf` file can be used to includ Operating System | Data Directory | Example Path -- | -- | -- -Windows | `%APPDATA%\Bitcoin\` | `C:\Users\username\AppData\Roaming\Bitcoin\bitcoin.conf` +Windows | `%LOCALAPPDATA%\Bitcoin\` | `C:\Users\username\AppData\Local\Bitcoin\bitcoin.conf` Linux | `$HOME/.bitcoin/` | `/home/username/.bitcoin/bitcoin.conf` macOS | `$HOME/Library/Application Support/Bitcoin/` | `/Users/username/Library/Application Support/Bitcoin/bitcoin.conf` diff --git a/doc/build-android.md b/doc/build-android.md deleted file mode 100644 index 2f2e01c441..0000000000 --- a/doc/build-android.md +++ /dev/null @@ -1,25 +0,0 @@ -ANDROID BUILD NOTES -====================== - -This guide describes how to build and package the `bitcoin-qt` GUI for Android on Linux and macOS. - - -## Dependencies - -Before proceeding with an Android build one needs to get the [Android SDK](https://developer.android.com/studio) and use the "SDK Manager" tool to download the NDK and one or more "Platform packages" (these are Android versions and have a corresponding API level). - -The minimum supported Android NDK version is [r23](https://github.com/android/ndk/wiki/Changelog-r23). - -In order to build `ANDROID_API_LEVEL` (API level corresponding to the Android version targeted, e.g. Android 9.0 Pie is 28 and its "Platform package" needs to be available) and `ANDROID_TOOLCHAIN_BIN` (path to toolchain binaries depending on the platform the build is being performed on) need to be set. - -API levels from 24 to 29 have been tested to work. - -If the build includes Qt, environment variables `ANDROID_SDK` and `ANDROID_NDK` need to be set as well but can otherwise be omitted. -This is an example command for a default build with no disabled dependencies: - - ANDROID_SDK=/home/user/Android/Sdk ANDROID_NDK=/home/user/Android/Sdk/ndk-bundle make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin - - -## Building and packaging - -After the depends are built configure with one of the resulting prefixes and run `make && make apk` in `src/qt`. \ No newline at end of file diff --git a/doc/build-freebsd.md b/doc/build-freebsd.md index aa10e4a891..ba3b5cd595 100644 --- a/doc/build-freebsd.md +++ b/doc/build-freebsd.md @@ -1,6 +1,6 @@ # FreeBSD Build Guide -**Updated for FreeBSD [12.3](https://www.freebsd.org/releases/12.3R/announce/)** +**Updated for FreeBSD [14.0](https://www.freebsd.org/releases/14.0R/announce/)** This guide describes how to build bitcoind, command-line utilities, and GUI on FreeBSD. @@ -10,15 +10,14 @@ This guide describes how to build bitcoind, command-line utilities, and GUI on F Run the following as root to install the base dependencies for building. ```bash -pkg install autoconf automake boost-libs git gmake libevent libtool pkgconf - +pkg install boost-libs cmake git libevent pkgconf ``` See [dependencies.md](dependencies.md) for a complete overview. ### 2. Clone Bitcoin Repo Now that `git` and all the required dependencies are installed, let's clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory. -``` bash +```bash git clone https://github.com/bitcoin/bitcoin.git ``` @@ -31,49 +30,30 @@ It is not necessary to build wallet functionality to run either `bitcoind` or `b `sqlite3` is required to support [descriptor wallets](descriptors.md). Skip if you don't intend to use descriptor wallets. -``` bash +```bash pkg install sqlite3 ``` -###### Legacy Wallet Support -BerkeleyDB is only required if legacy wallet support is required. - -It is required to use Berkeley DB 4.8. You **cannot** use the BerkeleyDB library -from ports. However, you can build DB 4.8 yourself [using depends](/depends). - -``` -gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 -``` - -When the build is complete, the Berkeley DB installation location will be displayed: - -``` -to: /path/to/bitcoin/depends/x86_64-unknown-freebsd[release-number] -``` - -Finally, set `BDB_PREFIX` to this path according to your shell: - -``` -csh: setenv BDB_PREFIX [path displayed above] -``` - -``` -sh/bash: export BDB_PREFIX=[path displayed above] -``` - #### GUI Dependencies -###### Qt5 +###### Qt6 + +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. -Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`. Skip if you don't intend to use the GUI. ```bash -pkg install qt5 +pkg install qt6-buildtools qt6-core qt6-gui qt6-linguisttools qt6-testlib qt6-widgets ``` + ###### libqrencode -The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `libqrencode`. Skip if not using the GUI or don't want QR code functionality. +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: + ```bash pkg install libqrencode ``` + +Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI. + --- #### Notifications @@ -89,7 +69,7 @@ There is an included test suite that is useful for testing code changes when dev To run the test suite (recommended), you will need to have Python 3 installed: ```bash -pkg install python3 databases/py-sqlite3 +pkg install python3 databases/py-sqlite3 net/py-pyzmq ``` --- @@ -100,33 +80,21 @@ pkg install python3 databases/py-sqlite3 There are many ways to configure Bitcoin Core, here are a few common examples: ##### Descriptor Wallet and GUI: -This explicitly enables the GUI and disables legacy wallet support, assuming `sqlite` and `qt` are installed. +This enables the GUI, assuming `sqlite` and `qt` are installed. ```bash -./autogen.sh -./configure --without-bdb --with-gui=yes MAKE=gmake +cmake -B build -DBUILD_GUI=ON ``` -##### Descriptor & Legacy Wallet. No GUI: -This enables support for both wallet types and disables the GUI, assuming -`sqlite3` and `db4` are both installed. -```bash -./autogen.sh -./configure --with-gui=no \ - BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \ - BDB_CFLAGS="-I${BDB_PREFIX}/include" \ - MAKE=gmake -``` +Run `cmake -B build -LH` to see the full list of available options. ##### No Wallet or GUI -``` bash -./autogen.sh -./configure --without-wallet --with-gui=no MAKE=gmake +```bash +cmake -B build -DENABLE_WALLET=OFF ``` ### 2. Compile -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). ```bash -gmake # use "-j N" for N parallel jobs -gmake check # Run tests if Python 3 is available +cmake --build build # Use "-j N" for N parallel jobs. +ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ``` diff --git a/doc/build-netbsd.md b/doc/build-netbsd.md index 0f05cdcba7..da51c8744a 100644 --- a/doc/build-netbsd.md +++ b/doc/build-netbsd.md @@ -1,6 +1,6 @@ # NetBSD Build Guide -Updated for NetBSD [9.2](https://netbsd.org/releases/formal-9/NetBSD-9.2.html). +**Updated for NetBSD [10.1](https://netbsd.org/releases/formal-10/NetBSD-10.1.html)** This guide describes how to build bitcoind, command-line utilities, and GUI on NetBSD. @@ -12,23 +12,22 @@ Install the required dependencies the usual way you [install software on NetBSD] The example commands below use `pkgin`. ```bash -pkgin install autoconf automake libtool pkg-config git gmake boost libevent - +pkgin install git cmake pkg-config boost-headers libevent ``` NetBSD currently ships with an older version of `gcc` than is needed to build. You should upgrade your `gcc` and then pass this new version to the configure script. -For example, grab `gcc9`: +For example, grab `gcc12`: ``` -pkgin install gcc9 +pkgin install gcc12 ``` Then, when configuring, pass the following: ```bash -./configure +cmake -B build ... - CC="/usr/pkg/gcc9/bin/gcc" \ - CXX="/usr/pkg/gcc9/bin/g++" \ + -DCMAKE_C_COMPILER="/usr/pkg/gcc12/bin/gcc" \ + -DCMAKE_CXX_COMPILER="/usr/pkg/gcc12/bin/g++" \ ... ``` @@ -56,26 +55,32 @@ It is not necessary to build wallet functionality to run bitcoind or the GUI. pkgin install sqlite3 ``` -###### Legacy Wallet Support +#### GUI Dependencies +###### Qt6 -`db4` is required to enable support for legacy wallets. +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ```bash -pkgin install db4 +pkgin install qt6-qtbase qt6-qttools ``` -#### GUI Dependencies +###### libqrencode -Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install `qt5`. +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: ```bash -pkgin install qt5 +pkgin install qrencode ``` -The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`. +Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI. +#### Notifications +###### ZeroMQ + +Bitcoin Core can provide notifications via ZeroMQ. If the package is installed, support will be compiled in. ```bash -pkgin install qrencode +pkgin zeromq ``` #### Test Suite Dependencies @@ -84,13 +89,10 @@ There is an included test suite that is useful for testing code changes when dev To run the test suite (recommended), you will need to have Python 3 installed: ```bash -pkgin install python37 +pkgin install python310 py310-zmq ``` -### Building Bitcoin Core - -**Note**: Use `gmake` (the non-GNU `make` will exit with an error). - +## Building Bitcoin Core ### 1. Configuration @@ -98,19 +100,16 @@ There are many ways to configure Bitcoin Core. Here is an example that explicitly disables the wallet and GUI: ```bash -./autogen.sh -./configure --without-wallet --with-gui=no \ - CPPFLAGS="-I/usr/pkg/include" \ - MAKE=gmake +cmake -B build -DENABLE_WALLET=OFF -DBUILD_GUI=OFF ``` -For a full list of configuration options, see the output of `./configure --help` +Run `cmake -B build -LH` to see the full list of available options. ### 2. Compile Build and run the tests: ```bash -gmake # use "-j N" here for N parallel jobs -gmake check # Run tests if Python 3 is available +cmake --build build # Use "-j N" for N parallel jobs. +ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ``` diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index 96ee714341..8929e3b742 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -1,6 +1,6 @@ # OpenBSD Build Guide -**Updated for OpenBSD [7.3](https://www.openbsd.org/73.html)** +**Updated for OpenBSD [7.6](https://www.openbsd.org/76.html)** This guide describes how to build bitcoind, command-line utilities, and GUI on OpenBSD. @@ -10,9 +10,7 @@ This guide describes how to build bitcoind, command-line utilities, and GUI on O Run the following as root to install the base dependencies for building. ```bash -pkg_add bash git gmake libevent libtool boost -# Select the newest version of the following packages: -pkg_add autoconf automake python +pkg_add git cmake boost libevent ``` See [dependencies.md](dependencies.md) for a complete overview. @@ -28,83 +26,71 @@ git clone https://github.com/bitcoin/bitcoin.git #### Wallet Dependencies It is not necessary to build wallet functionality to run either `bitcoind` or `bitcoin-qt`. +SQLite is required to build the wallet. -###### Descriptor Wallet Support - -`sqlite3` is required to support [descriptor wallets](descriptors.md). ``` bash pkg_add sqlite3 ``` -###### Legacy Wallet Support -BerkeleyDB is only required to support legacy wallets. +#### GUI Dependencies +###### Qt6 -It is recommended to use Berkeley DB 4.8. You cannot use the BerkeleyDB library -from ports. However you can build it yourself, [using depends](/depends). +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ```bash -gmake -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 -... -to: /path/to/bitcoin/depends/x86_64-unknown-openbsd +pkg_add qt6-qtbase qt6-qttools ``` -Then set `BDB_PREFIX`: +###### libqrencode + +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: ```bash -export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-unknown-openbsd" +pkg_add libqrencode ``` -#### GUI Dependencies -###### Qt5 +Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI. -Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, Qt 5 is required. +--- +#### Notifications +###### ZeroMQ + +Bitcoin Core can provide notifications via ZeroMQ. If the package is installed, support will be compiled in. ```bash -pkg_add qt5 +pkg_add zeromq ``` -## Building Bitcoin Core - -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). +#### Test Suite Dependencies +There is an included test suite that is useful for testing code changes when developing. +To run the test suite (recommended), you will need to have Python 3 installed: -Preparation: ```bash - -# Adapt the following for the version you installed (major.minor only): -export AUTOCONF_VERSION=2.71 -export AUTOMAKE_VERSION=1.16 - -./autogen.sh +pkg_add python py3-zmq # Select the newest version of the python package if necessary. ``` +## Building Bitcoin Core + ### 1. Configuration There are many ways to configure Bitcoin Core, here are a few common examples: ##### Descriptor Wallet and GUI: -This enables the GUI and descriptor wallet support, assuming `sqlite` and `qt5` are installed. +This enables descriptor wallet support and the GUI, assuming SQLite and Qt 6 are installed. ```bash -./configure MAKE=gmake +cmake -B build -DBUILD_GUI=ON ``` -##### Descriptor & Legacy Wallet. No GUI: -This enables support for both wallet types and disables the GUI: - -```bash -./configure --with-gui=no \ - BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \ - BDB_CFLAGS="-I${BDB_PREFIX}/include" \ - MAKE=gmake -``` +Run `cmake -B build -LH` to see the full list of available options. ### 2. Compile -**Important**: Use `gmake` (the non-GNU `make` will exit with an error). ```bash -gmake # use "-j N" for N parallel jobs -gmake check # Run tests if Python 3 is available +cmake --build build # Use "-j N" for N parallel jobs. +ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ``` ## Resource limits diff --git a/doc/build-osx.md b/doc/build-osx.md index f11ed97e09..08e2e54c2a 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -1,15 +1,15 @@ # macOS Build Guide -**Updated for MacOS [11.2](https://www.apple.com/macos/big-sur/)** +**Updated for MacOS [15](https://www.apple.com/macos/macos-sequoia/)** -This guide describes how to build bitcoind, command-line utilities, and GUI on macOS +This guide describes how to build bitcoind, command-line utilities, and GUI on macOS. ## Preparation The commands in this guide should be executed in a Terminal application. macOS comes with a built-in Terminal located in: -``` +```bash /Applications/Utilities/Terminal.app ``` @@ -48,7 +48,7 @@ See [dependencies.md](dependencies.md) for a complete overview. To install, run the following from your terminal: ``` bash -brew install automake libtool boost pkg-config libevent +brew install cmake boost pkgconf libevent ``` ### 4. Clone Bitcoin repository @@ -74,63 +74,31 @@ It is not necessary to build wallet functionality to run `bitcoind` or `bitcoin macOS ships with a useable `sqlite` package, meaning you don't need to install anything. -###### Legacy Wallet Support - -`berkeley-db@4` is only required to support for legacy wallets. -Skip if you don't intend to use legacy wallets. - -``` bash -brew install berkeley-db@4 -``` --- #### GUI Dependencies ###### Qt -Bitcoin Core includes a GUI built with the cross-platform Qt Framework. -To compile the GUI, we need to install `qt@5`. -Skip if you don't intend to use the GUI. +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +Qt, libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. ``` bash -brew install qt@5 +brew install qt@6 ``` Note: Building with Qt binaries downloaded from the Qt website is not officially supported. See the notes in [#7714](https://github.com/bitcoin/bitcoin/issues/7714). -###### qrencode +###### libqrencode -The GUI can encode addresses in a QR Code. To build in QR support for the GUI, install `qrencode`. -Skip if not using the GUI or don't want QR code functionality. +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: ``` bash brew install qrencode ``` ---- - -#### Port Mapping Dependencies - -###### miniupnpc - -miniupnpc may be used for UPnP port mapping. -Skip if you do not need this functionality. - -``` bash -brew install miniupnpc -``` - -###### libnatpmp - -libnatpmp may be used for NAT-PMP port mapping. -Skip if you do not need this functionality. -``` bash -brew install libnatpmp -``` - -Note: UPnP and NAT-PMP support will be compiled in and disabled by default. -Check out the [further configuration](#further-configuration) section for more information. +Otherwise, if you don't need QR encoding support, you can pass `-DWITH_QRENCODE=OFF` to disable this feature. --- @@ -143,13 +111,25 @@ Skip if you do not need ZMQ functionality. brew install zeromq ``` -ZMQ is automatically compiled in and enabled if the dependency is detected. Check out the [further configuration](#further-configuration) section for more information. For more information on ZMQ, see: [zmq.md](zmq.md) --- +### IPC Dependencies + +Compiling IPC-enabled binaries with `-DENABLE_IPC=ON` requires the following dependency. +Skip if you do not need IPC functionality. + +```bash +brew install capnp +``` + +For more information on IPC, see: [multiprocess.md](multiprocess.md). + +--- + #### Test Suite Dependencies There is an included test suite that is useful for testing code changes when developing. @@ -163,14 +143,8 @@ brew install python #### Deploy Dependencies -You can deploy a `.dmg` containing the Bitcoin Core application using `make deploy`. -This command depends on a couple of python packages, so it is required that you have `python` installed. - -Ensuring that `python` is installed, you can install the deploy dependencies by running the following commands in your terminal: - -``` bash -pip3 install ds_store mac_alias -``` +You can [deploy](#3-deploy-optional) a `.zip` containing the Bitcoin Core application. +It is required that you have `python` and `zip` installed. ## Building Bitcoin Core @@ -178,35 +152,19 @@ pip3 install ds_store mac_alias There are many ways to configure Bitcoin Core, here are a few common examples: -##### Wallet (BDB + SQlite) Support, No GUI: - -If `berkeley-db@4` is installed, then legacy wallet support will be built. -If `berkeley-db@4` is not installed, then this will throw an error. -If `sqlite` is installed, then descriptor wallet support will also be built. -Additionally, this explicitly disables the GUI. - -``` bash -./autogen.sh -./configure --with-gui=no -``` - ##### Wallet (only SQlite) and GUI Support: -This explicitly enables the GUI and disables legacy wallet support. -If `qt` is not installed, this will throw an error. -If `sqlite` is installed then descriptor wallet functionality will be built. -If `sqlite` is not installed, then wallet functionality will be disabled. +This enables the GUI. +If `sqlite` or `qt` are not installed, this will throw an error. ``` bash -./autogen.sh -./configure --without-bdb --with-gui=yes +cmake -B build -DBUILD_GUI=ON ``` ##### No Wallet or GUI ``` bash -./autogen.sh -./configure --without-wallet --with-gui=no +cmake -B build -DENABLE_WALLET=OFF ``` ##### Further Configuration @@ -215,7 +173,7 @@ You may want to dig deeper into the configuration options to achieve your desire Examine the output of the following command for a full list of configuration options: ``` bash -./configure -help +cmake -B build -LH ``` ### 2. Compile @@ -224,22 +182,26 @@ After configuration, you are ready to compile. Run the following in your terminal to compile Bitcoin Core: ``` bash -make # use "-j N" here for N parallel jobs -make check # Run tests if Python 3 is available +cmake --build build # Use "-j N" here for N parallel jobs. +ctest --test-dir build # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. ``` ### 3. Deploy (optional) -You can also create a `.dmg` containing the `.app` bundle by running the following command: +You can also create a `.zip` containing the `.app` bundle by running the following command: ``` bash -make deploy +cmake --build build --target deploy ``` ## Running Bitcoin Core -Bitcoin Core should now be available at `./src/bitcoind`. -If you compiled support for the GUI, it should be available at `./src/qt/bitcoin-qt`. +Bitcoin Core should now be available at `./build/bin/bitcoind`. +If you compiled support for the GUI, it should be available at `./build/bin/bitcoin-qt`. + +There is also a multifunction command line interface at `./build/bin/bitcoin` +supporting subcommands like `bitcoin node`, `bitcoin gui`, `bitcoin rpc`, and +others that can be listed with `bitcoin help`. The first time you run `bitcoind` or `bitcoin-qt`, it will start downloading the blockchain. This process could take many hours, or even days on slower than average systems. @@ -269,8 +231,8 @@ tail -f $HOME/Library/Application\ Support/Bitcoin/debug.log ## Other commands: ```shell -./src/bitcoind -daemon # Starts the bitcoin daemon. -./src/bitcoin-cli --help # Outputs a list of command-line options. -./src/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running. -./src/qt/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control +./build/bin/bitcoind -daemon # Starts the bitcoin daemon. +./build/bin/bitcoin-cli --help # Outputs a list of command-line options. +./build/bin/bitcoin-cli help # Outputs a list of RPC commands when the daemon is running. +./build/bin/bitcoin-qt -server # Starts the bitcoin-qt server mode, allows bitcoin-cli control ``` diff --git a/doc/build-unix.md b/doc/build-unix.md index bf367fc421..591b229ecb 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -8,10 +8,9 @@ To Build --------------------- ```bash -./autogen.sh -./configure -make # use "-j N" for N parallel jobs -make install # optional +cmake -B build +cmake --build build # use "-j N" for N parallel jobs +cmake --install build # optional ``` See below for instructions on how to [install the dependencies on popular Linux @@ -22,19 +21,20 @@ distributions](#linux-distribution-specific-instructions), or the C++ compilers are memory-hungry. It is recommended to have at least 1.5 GB of memory available when compiling Bitcoin Core. On systems with less, gcc can be -tuned to conserve memory with additional CXXFLAGS: +tuned to conserve memory with additional `CMAKE_CXX_FLAGS`: - ./configure CXXFLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" + cmake -B build -DCMAKE_CXX_FLAGS="--param ggc-min-expand=1 --param ggc-min-heapsize=32768" -Alternatively, or in addition, debugging information can be skipped for compilation. The default compile flags are -`-g -O2`, and can be changed with: +Alternatively, or in addition, debugging information can be skipped for compilation. +For the default build type `RelWithDebInfo`, the default compile flags are +`-O2 -g`, and can be changed with: - ./configure CXXFLAGS="-O2" + cmake -B build -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="-O2 -g0" Finally, clang (often less resource hungry) can be used instead of gcc, which is used by default: - ./configure CXX=clang++ CC=clang + cmake -B build -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang ## Linux Distribution Specific Instructions @@ -44,7 +44,7 @@ Finally, clang (often less resource hungry) can be used instead of gcc, which is Build requirements: - sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 + sudo apt-get install build-essential cmake pkgconf python3 Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies: @@ -54,17 +54,8 @@ SQLite is required for the descriptor wallet: sudo apt install libsqlite3-dev -Berkeley DB is only required for the legacy wallet. Ubuntu and Debian have their own `libdb-dev` and `libdb++-dev` packages, -but these will install Berkeley DB 5.3 or later. This will break binary wallet compatibility with the distributed -executables, which are based on BerkeleyDB 4.8. If you do not care about wallet compatibility, pass -`--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley DB [yourself](#berkeley-db). - To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): - - sudo apt install libminiupnpc-dev libnatpmp-dev - ZMQ dependencies (provides ZMQ API): sudo apt-get install libzmq3-dev @@ -73,26 +64,29 @@ User-Space, Statically Defined Tracing (USDT) dependencies: sudo apt install systemtap-sdt-dev +IPC-enabled binaries are compiled with `-DENABLE_IPC=ON` and require the following dependencies. +Skip if you do not need IPC functionality. + + sudo apt-get install libcapnp-dev capnproto + GUI dependencies: -If you want to build bitcoin-qt, make sure that the required packages for Qt development -are installed. Qt 5 is necessary to build the GUI. -To build without GUI pass `--without-gui`. +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. -To build with Qt 5 you need the following: + sudo apt-get install qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libgl-dev - sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools +For Qt 6.5 and later, the `libxcb-cursor0` package must be installed at runtime. Additionally, to support Wayland protocol for modern desktop environments: - sudo apt install qtwayland5 + sudo apt install qt6-wayland -libqrencode (optional) can be installed with: +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: sudo apt-get install libqrencode-dev -Once these are installed, they will be found by configure and a bitcoin-qt executable will be -built by default. +Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI. ### Fedora @@ -101,7 +95,7 @@ built by default. Build requirements: - sudo dnf install gcc-c++ libtool make autoconf automake python3 + sudo dnf install gcc-c++ cmake make python3 Now, you can either build from self-compiled [depends](#dependencies) or install the required dependencies: @@ -111,17 +105,8 @@ SQLite is required for the descriptor wallet: sudo dnf install sqlite-devel -Berkeley DB is only required for the legacy wallet. Fedora releases have only `libdb-devel` and `libdb-cxx-devel` packages, but these will install -Berkeley DB 5.3 or later. This will break binary wallet compatibility with the distributed executables, which -are based on Berkeley DB 4.8. If you do not care about wallet compatibility, -pass `--with-incompatible-bdb` to configure. Otherwise, you can build Berkeley DB [yourself](#berkeley-db). - To build Bitcoin Core without wallet, see [*Disable-wallet mode*](#disable-wallet-mode) -Optional port mapping libraries (see: `--with-miniupnpc` and `--with-natpmp`): - - sudo dnf install miniupnpc-devel libnatpmp-devel - ZMQ dependencies (provides ZMQ API): sudo dnf install zeromq-devel @@ -130,26 +115,29 @@ User-Space, Statically Defined Tracing (USDT) dependencies: sudo dnf install systemtap-sdt-devel +IPC-enabled binaries are compiled with `-DENABLE_IPC=ON` and require the following dependency. +Skip if you do not need IPC functionality. + + sudo dnf install capnproto + GUI dependencies: -If you want to build bitcoin-qt, make sure that the required packages for Qt development -are installed. Qt 5 is necessary to build the GUI. -To build without GUI pass `--without-gui`. +Bitcoin Core includes a GUI built with the cross-platform Qt Framework. To compile the GUI, we need to install +the necessary parts of Qt, the libqrencode and pass `-DBUILD_GUI=ON`. Skip if you don't intend to use the GUI. -To build with Qt 5 you need the following: + sudo dnf install qt6-qtbase-devel qt6-qttools-devel - sudo dnf install qt5-qttools-devel qt5-qtbase-devel +For Qt 6.5 and later, the `xcb-util-cursor` package must be installed at runtime. Additionally, to support Wayland protocol for modern desktop environments: - sudo dnf install qt5-qtwayland + sudo dnf install qt6-qtwayland -libqrencode (optional) can be installed with: +The GUI will be able to encode addresses in QR codes unless this feature is explicitly disabled. To install libqrencode, run: sudo dnf install qrencode-devel -Once these are installed, they will be found by configure and a bitcoin-qt executable will be -built by default. +Otherwise, if you don't need QR encoding support, use the `-DWITH_QRENCODE=OFF` option to disable this feature in order to compile the GUI. ## Dependencies @@ -157,37 +145,14 @@ See [dependencies.md](dependencies.md) for a complete overview, and [depends](/depends/README.md) on how to compile them yourself, if you wish to not use the packages of your Linux distribution. -### Berkeley DB - -The legacy wallet uses Berkeley DB. To ensure backwards compatibility it is -recommended to use Berkeley DB 4.8. If you have to build it yourself, and don't -want to use any other libraries built in depends, you can do: -```bash -make -C depends NO_BOOST=1 NO_LIBEVENT=1 NO_QT=1 NO_SQLITE=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1 -... -to: /path/to/bitcoin/depends/x86_64-pc-linux-gnu -``` -and configure using the following: -```bash -export BDB_PREFIX="/path/to/bitcoin/depends/x86_64-pc-linux-gnu" - -./configure \ - BDB_LIBS="-L${BDB_PREFIX}/lib -ldb_cxx-4.8" \ - BDB_CFLAGS="-I${BDB_PREFIX}/include" -``` - -**Note**: Make sure that `BDB_PREFIX` is an absolute path. - -**Note**: You only need Berkeley DB if the legacy wallet is enabled (see [*Disable-wallet mode*](#disable-wallet-mode)). - Disable-wallet mode -------------------- When the intention is to only run a P2P node, without a wallet, Bitcoin Core can be compiled in disable-wallet mode with: - ./configure --disable-wallet + cmake -B build -DENABLE_WALLET=OFF -In this case there is no dependency on SQLite or Berkeley DB. +In this case there is no dependency on SQLite. Mining is also possible in disable-wallet mode using the `getblocktemplate` RPC call. @@ -195,19 +160,19 @@ Additional Configure Flags -------------------------- A list of additional configure flags can be displayed with: - ./configure --help + cmake -B build -LH Setup and Build Example: Arch Linux ----------------------------------- This example lists the steps necessary to setup and build a command line only distribution of the latest changes on Arch Linux: - pacman --sync --needed autoconf automake boost gcc git libevent libtool make pkgconf python sqlite + pacman --sync --needed cmake boost gcc git libevent make python sqlite git clone https://github.com/bitcoin/bitcoin.git cd bitcoin/ - ./autogen.sh - ./configure - make check - ./src/bitcoind + cmake -B build + cmake --build build + ctest --test-dir build + ./build/bin/bitcoind + ./build/bin/bitcoin help -If you intend to work with legacy Berkeley DB wallets, see [Berkeley DB](#berkeley-db) section. diff --git a/doc/build-windows-msvc.md b/doc/build-windows-msvc.md new file mode 100644 index 0000000000..151c175031 --- /dev/null +++ b/doc/build-windows-msvc.md @@ -0,0 +1,95 @@ +# Windows / MSVC Build Guide + +This guide describes how to build bitcoind, command-line utilities, and GUI on Windows using Microsoft Visual Studio. + +For cross-compiling options, please see [`build-windows.md`](./build-windows.md). + +## Preparation + +### 1. Visual Studio + +This guide relies on using CMake and vcpkg package manager provided with the Visual Studio installation. +Here are requirements for the Visual Studio installation: +1. Minimum required version: Visual Studio 2022 version 17.13. +2. Installed components: +- The "Desktop development with C++" workload. + +The commands in this guide should be executed in "Developer PowerShell for VS 2022" or "Developer Command Prompt for VS 2022". +The former is assumed hereinafter. + +### 2. Git + +Download and install [Git for Windows](https://git-scm.com/downloads/win). Once installed, Git is available from PowerShell or the Command Prompt. + +### 3. Clone Bitcoin Repository + +Clone the Bitcoin Core repository to a directory. All build scripts and commands will run from this directory. +``` +git clone https://github.com/bitcoin/bitcoin.git +``` + + +## Triplets and Presets + +The Bitcoin Core project supports the following vcpkg triplets: +- `x64-windows` (both CRT and library linkage is dynamic) +- `x64-windows-static` (both CRT and library linkage is static) + +To facilitate build process, the Bitcoin Core project provides presets, which are used in this guide. + +Available presets can be listed as follows: +``` +cmake --list-presets +``` + +By default, all presets set `BUILD_GUI` to `ON`. + +## Building + +CMake will put the resulting object files, libraries, and executables into a dedicated build directory. + +In the following instructions, the "Debug" configuration can be specified instead of the "Release" one. + +### 4. Building with Static Linking with GUI + +``` +cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated. +cmake --build build --config Release # Use "-j N" for N parallel jobs. +ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. +cmake --install build --config Release # Optional. +``` + +If building with `BUILD_GUI=ON`, vcpkg installation during the build +configuration step might fail because of extremely long paths required during +vcpkg installation if your vcpkg instance is installed in the default Visual +Studio directory. This can be avoided without modifying your vcpkg root +directory by changing vcpkg's intermediate build directory with the +`--x-buildtrees-root` argument to something shorter, for example: + +```powershell +cmake -B build --preset vs2022-static -DVCPKG_INSTALL_OPTIONS="--x-buildtrees-root=C:\vcpkg" +``` + +### 5. Building with Dynamic Linking without GUI + +``` +cmake -B build --preset vs2022 -DBUILD_GUI=OFF # It might take a while if the vcpkg binary cache is unpopulated or invalidated. +cmake --build build --config Release # Use "-j N" for N parallel jobs. +ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available. +``` + +## Performance Notes + +### 6. vcpkg Manifest Default Features + +One can skip vcpkg manifest default features to speedup the configuration step. +For example, the following invocation will skip all features except for "wallet" and "tests" and their dependencies: +``` +cmake -B build --preset vs2022 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet;tests" -DBUILD_GUI=OFF +``` + +Available features are listed in the [`vcpkg.json`](/vcpkg.json) file. + +### 7. Antivirus Software + +To improve the build process performance, one might add the Bitcoin repository directory to the Microsoft Defender Antivirus exclusions. diff --git a/doc/build-windows.md b/doc/build-windows.md index 027e8f80f5..03af0654ce 100644 --- a/doc/build-windows.md +++ b/doc/build-windows.md @@ -7,12 +7,15 @@ The options known to work for building Bitcoin Core on Windows are: * On Linux, using the [Mingw-w64](https://www.mingw-w64.org/) cross compiler tool chain. * On Windows, using [Windows Subsystem for Linux (WSL)](https://learn.microsoft.com/en-us/windows/wsl/about) and Mingw-w64. -* On Windows, using [Microsoft Visual Studio](https://visualstudio.microsoft.com). See [README.md](/build_msvc/README.md). +* On Windows, using [Microsoft Visual Studio](https://visualstudio.microsoft.com). See [`build-windows-msvc.md`](./build-windows-msvc.md). Other options which may work, but which have not been extensively tested are (please contribute instructions): * On Windows, using a POSIX compatibility layer application such as [cygwin](https://www.cygwin.com/) or [msys2](https://www.msys2.org/). +The instructions below work on Ubuntu and Debian. Make sure the distribution's `g++-mingw-w64-x86-64-posix` +package meets the minimum required `g++` version specified in [dependencies.md](dependencies.md). + Installing Windows Subsystem for Linux --------------------------------------- @@ -25,63 +28,28 @@ The steps below can be performed on Ubuntu or WSL. The depends system will also work on other Linux distributions, however the commands for installing the toolchain will be different. -First, install the general dependencies: - - sudo apt update - sudo apt upgrade - sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git +See [README.md](../depends/README.md) in the depends directory for which +dependencies to install and [dependencies.md](dependencies.md) for a complete overview. -A host toolchain (`build-essential`) is necessary because some dependency -packages need to build host utilities that are used in the build process. +If you want to build the Windows installer using the `deploy` build target, you will need [NSIS](https://nsis.sourceforge.io/Main_Page): -See [dependencies.md](dependencies.md) for a complete overview. + apt install nsis -If you want to build the windows installer with `make deploy` you need [NSIS](https://nsis.sourceforge.io/Main_Page): - - sudo apt install nsis Acquire the source in the usual way: git clone https://github.com/bitcoin/bitcoin.git cd bitcoin -## Building for 64-bit Windows - -The first step is to install the mingw-w64 cross-compilation tool chain: - - on modern systems (Ubuntu 21.04 Hirsute Hippo or newer, Debian 11 Bullseye or newer): - -```sh -sudo apt install g++-mingw-w64-x86-64-posix -``` - - - on older systems: - -```sh -sudo apt install g++-mingw-w64-x86-64 -``` - -Once the toolchain is installed the build steps are common: - Note that for WSL the Bitcoin Core source path MUST be somewhere in the default mount file system, for example /usr/src/bitcoin, AND not under /mnt/d/. If this is not the case the dependency autoconf scripts will fail. This means you cannot use a directory that is located directly on the host Windows file system to perform the build. -Additional WSL Note: WSL support for [launching Win32 applications](https://learn.microsoft.com/en-us/archive/blogs/wsl/windows-and-ubuntu-interoperability#launching-win32-applications-from-within-wsl) -results in `Autoconf` configure scripts being able to execute Windows Portable Executable files. This can cause -unexpected behaviour during the build, such as Win32 error dialogs for missing libraries. The recommended approach -is to temporarily disable WSL support for Win32 applications. - Build using: - PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var - sudo bash -c "echo 0 > /proc/sys/fs/binfmt_misc/status" # Disable WSL support for Win32 applications. - cd depends - make HOST=x86_64-w64-mingw32 - cd .. - ./autogen.sh - CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ - make # use "-j N" for N parallel jobs - sudo bash -c "echo 1 > /proc/sys/fs/binfmt_misc/status" # Enable WSL support for Win32 applications. + gmake -C depends HOST=x86_64-w64-mingw32 # Use "-j N" for N parallel jobs. + cmake -B build --toolchain depends/x86_64-w64-mingw32/toolchain.cmake + cmake --build build # Use "-j N" for N parallel jobs. ## Depends system @@ -94,9 +62,17 @@ After building using the Windows subsystem it can be useful to copy the compiled executables to a directory on the Windows drive in the same directory structure as they appear in the release `.zip` archive. This can be done in the following way. This will install to `c:\workspace\bitcoin`, for example: +```shell +cmake --install build --prefix /mnt/c/workspace/bitcoin +``` - make install DESTDIR=/mnt/c/workspace/bitcoin +Note that due to the presence of debug information, the binaries may be very large, +if you do not need the debug information, you can prune it during install by calling: +```shell +cmake --install build --prefix /mnt/c/workspace/bitcoin --strip +``` You can also create an installer using: - - make deploy +```shell +cmake --build build --target deploy +``` diff --git a/doc/cjdns.md b/doc/cjdns.md index 031cd1978b..35fe87adfa 100644 --- a/doc/cjdns.md +++ b/doc/cjdns.md @@ -113,3 +113,5 @@ To see which CJDNS peers your node is connected to, use `bitcoin-cli -netinfo 4` or the `getpeerinfo` RPC (i.e. `bitcoin-cli getpeerinfo`). You can use the `getnodeaddresses` RPC to fetch a number of CJDNS peers known to your node; run `bitcoin-cli help getnodeaddresses` for details. + +`bitcoin rpc` can also be substituted for `bitcoin-cli`. diff --git a/doc/dependencies.md b/doc/dependencies.md index 804f796abe..bc8cc7fb20 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -1,50 +1,50 @@ # Dependencies These are the dependencies used by Bitcoin Core. -You can find installation instructions in the `build-*.md` file for your platform. -"Runtime" and "Version Used" are both in reference to the release binaries. +You can find installation instructions in the `/doc/build-*.md` file for your platform, or self-compile +them using [depends](/depends/README.md). + +## Compiler + +Bitcoin Core requires one of the following compilers. | Dependency | Minimum required | | --- | --- | -| [Autoconf](https://www.gnu.org/software/autoconf/) | [2.69](https://github.com/bitcoin/bitcoin/pull/17769) | -| [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) | -| [Clang](https://clang.llvm.org) | [10.0](https://github.com/bitcoin/bitcoin/pull/27682) | -| [GCC](https://gcc.gnu.org) | [9.1](https://github.com/bitcoin/bitcoin/pull/27662) | -| [Python](https://www.python.org) (scripts, tests) | [3.8](https://github.com/bitcoin/bitcoin/pull/27483) | -| [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A | +| [Clang](https://clang.llvm.org) | [16.0](https://github.com/bitcoin/bitcoin/pull/30263) | +| [GCC](https://gcc.gnu.org) | [11.1](https://github.com/bitcoin/bitcoin/pull/29091) | ## Required -| Dependency | Releases | Version used | Minimum required | Runtime | -| --- | --- | --- | --- | --- | -| [Boost](../depends/packages/boost.mk) | [link](https://www.boost.org/users/download/) | [1.81.0](https://github.com/bitcoin/bitcoin/pull/26557) | [1.64.0](https://github.com/bitcoin/bitcoin/pull/22320) | No | -| [libevent](../depends/packages/libevent.mk) | [link](https://github.com/libevent/libevent/releases) | [2.1.12-stable](https://github.com/bitcoin/bitcoin/pull/21991) | [2.1.8](https://github.com/bitcoin/bitcoin/pull/24681) | No | -| glibc | [link](https://www.gnu.org/software/libc/) | N/A | [2.27](https://github.com/bitcoin/bitcoin/pull/27029) | Yes | -| Linux Kernel | [link](https://www.kernel.org/) | N/A | [3.17.0](https://github.com/bitcoin/bitcoin/pull/27699) | Yes | +### Build + +| Dependency | Releases | Minimum required | +| --- | --- | --- | +| [Boost](../depends/packages/boost.mk) | [link](https://www.boost.org/users/download/) | [1.73.0](https://github.com/bitcoin/bitcoin/pull/29066) | +| CMake | [link](https://cmake.org/) | [3.22](https://github.com/bitcoin/bitcoin/pull/30454) | +| [libevent](../depends/packages/libevent.mk) | [link](https://github.com/libevent/libevent/releases) | [2.1.8](https://github.com/bitcoin/bitcoin/pull/24681) | + +### Runtime + +| Dependency | Releases | Minimum required | +| --- | --- | --- | +| glibc | [link](https://www.gnu.org/software/libc/) | [2.31](https://github.com/bitcoin/bitcoin/pull/29987) ## Optional -### GUI -| Dependency | Releases | Version used | Minimum required | Runtime | -| --- | --- | --- | --- | --- | -| [Fontconfig](../depends/packages/fontconfig.mk) | [link](https://www.freedesktop.org/wiki/Software/fontconfig/) | [2.12.6](https://github.com/bitcoin/bitcoin/pull/23495) | 2.6 | Yes | -| [FreeType](../depends/packages/freetype.mk) | [link](https://freetype.org) | [2.11.0](https://github.com/bitcoin/bitcoin/commit/01544dd78ccc0b0474571da854e27adef97137fb) | 2.3.0 | Yes | -| [qrencode](../depends/packages/qrencode.mk) | [link](https://fukuchi.org/works/qrencode/) | [4.1.1](https://github.com/bitcoin/bitcoin/pull/27312) | | No | -| [Qt](../depends/packages/qt.mk) | [link](https://download.qt.io/official_releases/qt/) | [5.15.5](https://github.com/bitcoin/bitcoin/pull/25719) | [5.11.3](https://github.com/bitcoin/bitcoin/pull/24132) | No | - -### Networking -| Dependency | Releases | Version used | Minimum required | Runtime | -| --- | --- | --- | --- | --- | -| [libnatpmp](../depends/packages/libnatpmp.mk) | [link](https://github.com/miniupnp/libnatpmp/) | commit [07004b9...](https://github.com/bitcoin/bitcoin/pull/25917) | | No | -| [MiniUPnPc](../depends/packages/miniupnpc.mk) | [link](https://miniupnp.tuxfamily.org/) | [2.2.2](https://github.com/bitcoin/bitcoin/pull/20421) | 2.1 | No | - -### Notifications -| Dependency | Releases | Version used | Minimum required | Runtime | -| --- | --- | --- | --- | --- | -| [ZeroMQ](../depends/packages/zeromq.mk) | [link](https://github.com/zeromq/libzmq/releases) | [4.3.4](https://github.com/bitcoin/bitcoin/pull/23956) | 4.0.0 | No | - -### Wallet -| Dependency | Releases | Version used | Minimum required | Runtime | -| --- | --- | --- | --- | --- | -| [Berkeley DB](../depends/packages/bdb.mk) (legacy wallet) | [link](https://www.oracle.com/technetwork/database/database-technologies/berkeleydb/downloads/index.html) | 4.8.30 | 4.8.x | No | -| [SQLite](../depends/packages/sqlite.mk) | [link](https://sqlite.org) | [3.38.5](https://github.com/bitcoin/bitcoin/pull/25378) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | No | +### Build + +| Dependency | Releases | Minimum required | +| --- | --- | --- | +| Python (scripts, tests) | [link](https://www.python.org) | [3.10](https://github.com/bitcoin/bitcoin/pull/30527) | +| [Qt](../depends/packages/qt.mk) (gui) | [link](https://download.qt.io/archive/qt/) | [6.2](https://github.com/bitcoin/bitcoin/pull/30997) | +| [qrencode](../depends/packages/qrencode.mk) (gui) | [link](https://fukuchi.org/works/qrencode/) | N/A | +| [SQLite](../depends/packages/sqlite.mk) (wallet) | [link](https://sqlite.org) | [3.7.17](https://github.com/bitcoin/bitcoin/pull/19077) | +| [systemtap](../depends/packages/systemtap.mk) ([tracing](tracing.md)) | [link](https://sourceware.org/systemtap/) | N/A | +| [ZeroMQ](../depends/packages/zeromq.mk) (notifications) | [link](https://github.com/zeromq/libzmq/releases) | 4.0.0 | + +### Runtime + +| Dependency | Releases | Minimum required | +| --- | --- | --- | +| [Fontconfig](../depends/packages/fontconfig.mk) (gui) | [link](https://www.freedesktop.org/wiki/Software/fontconfig/) | 2.6 | +| [FreeType](../depends/packages/freetype.mk) (gui) | [link](https://freetype.org) | 2.3.0 | diff --git a/doc/descriptors.md b/doc/descriptors.md index 1baf652f30..928e8806c6 100644 --- a/doc/descriptors.md +++ b/doc/descriptors.md @@ -11,8 +11,6 @@ Supporting RPCs are: addresses. - `listunspent` outputs a specialized descriptor for the reported unspent outputs. - `getaddressinfo` outputs a descriptor for solvable addresses (since v0.18). -- `importmulti` takes as input descriptors to import into a legacy wallet - (since v0.18). - `generatetodescriptor` takes as input a descriptor and generates coins to it (`regtest` only, since v0.19). - `utxoupdatepsbt` takes as input descriptors to add information to the psbt @@ -23,6 +21,11 @@ Supporting RPCs are: - `listdescriptors` outputs descriptors imported into a descriptor wallet (since v22). - `scanblocks` takes as input descriptors to scan for in blocks and returns the relevant blockhashes (since v25). +- `getdescriptoractivity` takes as input descriptors and blockhashes (as output + by `scanblocks`) and returns rich event data related to spends or receives associated + with the given descriptors. + +Bitcoin Core v24 extended `wsh()` output descriptor with [Miniscript](https://bitcoin.sipa.be/miniscript/) support (initially watch-only). Signing support for Miniscript descriptors was added in v25. And since v26 Miniscript expressions can now be used in Taproot descriptors. This document describes the language. For the specifics on usage, see the RPC documentation for the functions mentioned above. @@ -42,6 +45,7 @@ Output descriptors currently support: - Any type of supported address through the `addr` function. - Raw hex scripts through the `raw` function. - Public keys (compressed and uncompressed) in hex notation, or BIP32 extended pubkeys with derivation paths. +- [Miniscript](https://bitcoin.sipa.be/miniscript/) expressions in `wsh` (P2WSH) and `tr` (P2TR) functions. ## Examples @@ -63,6 +67,8 @@ Output descriptors currently support: - `wsh(sortedmulti(1,xpub661MyMwAqRbcFW31YEwpkMuc5THy2PSt5bDMsktWQcFF8syAmRUapSCGu8ED9W6oDMSgv6Zz8idoc4a6mr8BDzTJY47LJhkJ8UB7WEGuduB/1/0/*,xpub69H7F5d8KSRgmmdJg2KhpAK8SR3DjMwAdkxj3ZuxV27CprR9LgpeyGmXUbC6wb7ERfvrnKZjXoUmmDznezpbZb7ap6r1D3tgFxHmwMkQTPH/0/0/*))` describes a set of *1-of-2* P2WSH multisig outputs where one multisig key is the *1/0/`i`* child of the first specified xpub and the other multisig key is the *0/0/`i`* child of the second specified xpub, and `i` is any number in a configurable range (`0-1000` by default). The order of public keys in the resulting witnessScripts is determined by the lexicographic order of the public keys at that index. - `tr(c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5,{pk(fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556),pk(e493dbf1c10d80f3581e4904930b1404cc6c13900ee0758474fa94abe8c4cd13)})` describes a P2TR output with the `c6...` x-only pubkey as internal key, and two script paths. - `tr(c6047f9441ed7d6d3045406e95c07cd85c778e4b8cef3ca7abac09b95c709ee5,sortedmulti_a(2,2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4,5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc))` describes a P2TR output with the `c6...` x-only pubkey as internal key, and a single `multi_a` script that needs 2 signatures with 2 specified x-only keys, which will be sorted lexicographically. +- `wsh(sortedmulti(2,[6f53d49c/44h/1h/0h]tpubDDjsCRDQ9YzyaAq9rspCfq8RZFrWoBpYnLxK6sS2hS2yukqSczgcYiur8Scx4Hd5AZatxTuzMtJQJhchufv1FRFanLqUP7JHwusSSpfcEp2/0/*,[e6807791/44h/1h/0h]tpubDDAfvogaaAxaFJ6c15ht7Tq6ZmiqFYfrSmZsHu7tHXBgnjMZSHAeHSwhvjARNA6Qybon4ksPksjRbPDVp7yXA1KjTjSd5x18KHqbppnXP1s/0/*,[367c9cfa/44h/1h/0h]tpubDDtPnSgWYk8dDnaDwnof4ehcnjuL5VoUt1eW2MoAed1grPHuXPDnkX1fWMvXfcz3NqFxPbhqNZ3QBdYjLz2hABeM9Z2oqMR1Gt2HHYDoCgh/0/*))#av0kxgw0` describes a *2-of-3* multisig. For brevity, the internal "change" descriptor accompanying the above external "receiving" descriptor is not included here, but it typically differs only in the xpub derivation steps, ending in `/1/*` for change addresses. +- `wsh(thresh(4,pk([7258e4f9/44h/1h/0h]tpubDCZrkQoEU3845aFKUu9VQBYWZtrTwxMzcxnBwKFCYXHD6gEXvtFcxddCCLFsEwmxQaG15izcHxj48SXg1QS5FQGMBx5Ak6deXKPAL7wauBU/0/*),s:pk([c80b1469/44h/1h/0h]tpubDD3UwwHoNUF4F3Vi5PiUVTc3ji1uThuRfFyBexTSHoAcHuWW2z8qEE2YujegcLtgthr3wMp3ZauvNG9eT9xfJyxXCfNty8h6rDBYU8UU1qq/0/*),s:pk([4e5024fe/44h/1h/0h]tpubDDLrpPymPLSCJyCMLQdmcWxrAWwsqqssm5NdxT2WSdEBPSXNXxwbeKtsHAyXPpLkhUyKovtZgCi47QxVpw9iVkg95UUgeevyAqtJ9dqBqa1/0/*),s:pk([3b1d1ee9/44h/1h/0h]tpubDCmDTANBWPzf6d8Ap1J5Ku7J1Ay92MpHMrEV7M5muWxCrTBN1g5f1NPcjMEL6dJHxbvEKNZtYCdowaSTN81DAyLsmv6w6xjJHCQNkxrsrfu/0/*),sln:after(840000),sln:after(1050000),sln:after(1260000)))#k28080kv` describes a Miniscript multisig with spending policy: `thresh(4,pk(key_1),pk(key_2),pk(key_3),pk(key_4),after(t1),after(t2),after(t3))` that starts as 4-of-4 and "decays" to 3-of-4, 2-of-4, and finally 1-of-4 at each future halvening block height. For brevity, the internal "change" descriptor accompanying the above external "receiving" descriptor is not included here, but it typically differs only in the xpub derivation steps, ending in `/1/*` for change addresses. ## Reference @@ -97,6 +103,7 @@ Descriptors consist of several types of expressions. The top level expression is - [WIF](https://en.bitcoin.it/wiki/Wallet_import_format) encoded private keys may be specified instead of the corresponding public key, with the same meaning. - `xpub` encoded extended public key or `xprv` encoded extended private key (as defined in [BIP 32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)). - Followed by zero or more `/NUM` unhardened and `/NUM'` hardened BIP32 derivation steps. + - No more than one of these derivation steps may be of the form `` (including hardened indicators with either or both `NUM`). If such specifiers are included, the descriptor will be parsed as multiple descriptors where the first descriptor uses all of the first `NUM` in the pair, and the second descriptor uses the second `NUM` in the pair for all `KEY` expressions, and so on. - Optionally followed by a single `/*` or `/*'` final step to denote all (direct) unhardened or hardened children. - The usage of hardened derivation steps requires providing the private key. @@ -167,9 +174,9 @@ The basic steps are: the participant's signer wallet. Avoid reusing this wallet for any purpose other than signing transactions from the corresponding multisig we are about to create. Hint: extract the wallet's xpubs using `listdescriptors` and pick the one from the `pkh` descriptor since it's least likely to be accidentally reused (legacy addresses) - 2. Create a watch-only descriptor wallet (blank, private keys disabled). Now the multisig is created by importing the two descriptors: + 2. Create a watch-only descriptor wallet (blank, private keys disabled). Now the multisig is created by importing the external and internal descriptors: `wsh(sortedmulti(,XPUB1/0/*,XPUB2/0/*,…,XPUBN/0/*))` and `wsh(sortedmulti(,XPUB1/1/*,XPUB2/1/*,…,XPUBN/1/*))` - (one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this + (one descriptor w/ `0` for receiving addresses and another w/ `1` for change). Every participant does this. All key origin information (master key fingerprint and all derivation steps) should be included with xpubs for proper support of hardware devices / external signers 3. A receiving address is generated for the multisig. As a check to ensure step 2 was done correctly, every participant should verify they get the same addresses 4. Funds are sent to the resulting address @@ -190,6 +197,14 @@ preferable in cases where there are more signers. This signing flow is also incl [The test](/test/functional/wallet_multisig_descriptor_psbt.py) is meant to be documentation as much as it is a functional test, so it is kept as simple and readable as possible. +#### Basic Miniscript-enabled "decaying" multisig example + +For an example of a multisig that starts as 4-of-4 and "decays" to 3-of-4, 2-of-4, and finally 1-of-4 at each future halvening block height, see [this functional test](/test/functional/wallet_miniscript_decaying_multisig_descriptor_psbt.py). + +This has the same "architecture" and signing flow as the above [Basic multisig example](#basic-multisig-example). The basic steps are identical aside from the descriptor that defines this wallet, which is of the form: `wsh(thresh(4,pk(XPUB1),s:pk(XPUB2),s:pk(XPUB3),s:pk(XPUB4),sln:after(t1),sln:after(t2),sln:after(t3)))`. + +[The test](/test/functional/wallet_miniscript_decaying_multisig_descriptor_psbt.py) is meant to be documentation as much as it is a functional test, so it is kept as simple and readable as possible. + ### BIP32 derived keys and chains Most modern wallet software and hardware uses keys that are derived using @@ -243,7 +258,42 @@ Often it is useful to communicate a description of scripts along with the necessary private keys. For this reason, anywhere a public key or xpub is supported, a private key in WIF format or xprv may be provided instead. This is useful when private keys are necessary for hardened derivation -steps, or for dumping wallet descriptors including private key material. +steps, for signing transactions, or for dumping wallet descriptors +including private key material. + +For example, after importing the following 2-of-3 multisig descriptor +into a wallet, one could use `signrawtransactionwithwallet` +to sign a transaction with the first key: +``` +sh(multi(2,xprv.../84'/0'/0'/0/0,xpub1...,xpub2...)) +``` +Note how the first key is an xprv private key with a specific derivation path, +while the other two are public keys. + + +### Specifying receiving and change descriptors in one descriptor + +Since receiving and change addresses are frequently derived from the same +extended key(s) but with a single derivation index changed, it is convenient +to be able to specify a descriptor that can derive at the two different +indexes. Thus a single tuple of indexes is allowed in each derivation path +following the extended key. When this descriptor is parsed, multiple descriptors +will be produced, the first one will use the first index in the tuple for all +key expressions, the second will use the second index, the third will use the +third index, and so on.. + +For example, a descriptor of the form: + + multi(2,xpub.../<0;1;2>/0/*,xpub.../<2;3;4>/*) + +will expand to the 3 descriptors + + multi(2,xpub.../0/0/*,xpub.../2/*) + multi(2,xpub.../1/0/*,xpub.../3/*) + multi(2,xpub.../2/0/*,xpub.../4/*) + +When this tuple contains only two elements, wallet implementations can use the +first descriptor for receiving addresses and the second descriptor for change addresses. ### Compatibility with old wallets @@ -267,5 +317,5 @@ roughly 1 in a trillion chance of not detecting the errors. All RPCs in Bitcoin Core will include the checksum in their output. Only certain RPCs require checksums on input, including `deriveaddresses` and -`importmulti`. The checksum for a descriptor without one can be computed +`importdescriptors`. The checksum for a descriptor without one can be computed using the `getdescriptorinfo` RPC. diff --git a/doc/design/assumeutxo.md b/doc/design/assumeutxo.md index 1492877e62..123c02ac13 100644 --- a/doc/design/assumeutxo.md +++ b/doc/design/assumeutxo.md @@ -1,11 +1,6 @@ -# assumeutxo +# Assumeutxo Design -Assumeutxo is a feature that allows fast bootstrapping of a validating bitcoind -instance with a very similar security model to assumevalid. - -The RPC commands `dumptxoutset` and `loadtxoutset` (yet to be merged) are used to -respectively generate and load UTXO snapshots. The utility script -`./contrib/devtools/utxo_snapshot.sh` may be of use. +For notes on the usage of Assumeutxo, please refer to [the usage doc](/doc/assumeutxo.md). ## General background @@ -15,18 +10,12 @@ respectively generate and load UTXO snapshots. The utility script ## Design notes -- A new block index `nStatus` flag is introduced, `BLOCK_ASSUMED_VALID`, to mark block - index entries that are required to be assumed-valid by a chainstate created - from a UTXO snapshot. This flag is used as a way to modify certain - CheckBlockIndex() logic to account for index entries that are pending validation by a - chainstate running asynchronously in the background. - - The concept of UTXO snapshots is treated as an implementation detail that lives behind the ChainstateManager interface. The external presentation of the changes required to facilitate the use of UTXO snapshots is the understanding that there are - now certain regions of the chain that can be temporarily assumed to be valid (using - the nStatus flag mentioned above). In certain cases, e.g. wallet rescanning, this is - very similar to dealing with a pruned chain. + now certain regions of the chain that can be temporarily assumed to be valid. + In certain cases, e.g. wallet rescanning, this is very similar to dealing with + a pruned chain. Logic outside ChainstateManager should try not to know about snapshots, instead preferring to work in terms of more general states like assumed-valid. @@ -49,7 +38,7 @@ data. ### "Normal" operation via initial block download `ChainstateManager` manages a single Chainstate object, for which -`m_snapshot_blockhash` is null. This chainstate is (maybe obviously) +`m_from_snapshot_blockhash` is `std::nullopt`. This chainstate is (maybe obviously) considered active. This is the "traditional" mode of operation for bitcoind. | | | @@ -109,7 +98,7 @@ sequentially. Once the tip of the background chainstate hits the base block of the snapshot chainstate, we stop use of the background chainstate by setting `m_disabled`, in -`CompleteSnapshotValidation()`, which is checked in `ActivateBestChain()`). We hash the +`MaybeCompleteSnapshotValidation()`, which is checked in `ActivateBestChain()`). We hash the background chainstate's UTXO set contents and ensure it matches the compiled value in `CMainParams::m_assumeutxo_data`. diff --git a/doc/design/libraries.md b/doc/design/libraries.md index 7cda64e713..102b92784c 100644 --- a/doc/design/libraries.md +++ b/doc/design/libraries.md @@ -4,11 +4,11 @@ |--------------------------|-------------| | *libbitcoin_cli* | RPC client functionality used by *bitcoin-cli* executable | | *libbitcoin_common* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_util*, but higher-level (see [Dependencies](#dependencies)). | -| *libbitcoin_consensus* | Stable, backwards-compatible consensus functionality used by *libbitcoin_node* and *libbitcoin_wallet* and also exposed as a [shared library](../shared-libraries.md). | -| *libbitcoinconsensus* | Shared library build of static *libbitcoin_consensus* library | -| *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node* and also exposed as a [shared library](../shared-libraries.md). | -| *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables | -| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`--enable-multiprocess`](multiprocess.md) is used. | +| *libbitcoin_consensus* | Consensus functionality used by *libbitcoin_node* and *libbitcoin_wallet*. | +| *libbitcoin_crypto* | Hardware-optimized functions for data encryption, hashing, message authentication, and key derivation. | +| *libbitcoin_kernel* | Consensus engine and support library used for validation by *libbitcoin_node*. | +| *libbitcoinqt* | GUI functionality used by *bitcoin-qt* and *bitcoin-gui* executables. | +| *libbitcoin_ipc* | IPC functionality used by *bitcoin-node*, *bitcoin-wallet*, *bitcoin-gui* executables to communicate when [`-DENABLE_IPC=ON`](multiprocess.md) is used. | | *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* and *bitcoin-qt* executables. | | *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). | | *libbitcoin_wallet* | Wallet functionality used by *bitcoind* and *bitcoin-wallet* executables. | @@ -17,9 +17,9 @@ ## Conventions -- Most libraries are internal libraries and have APIs which are completely unstable! There are few or no restrictions on backwards compatibility or rules about external dependencies. Exceptions are *libbitcoin_consensus* and *libbitcoin_kernel* which have external interfaces documented at [../shared-libraries.md](../shared-libraries.md). +- Most libraries are internal libraries and have APIs which are completely unstable! There are few or no restrictions on backwards compatibility or rules about external dependencies. An exception is *libbitcoin_kernel*, which, at some future point, will have a documented external interface. -- Generally each library should have a corresponding source directory and namespace. Source code organization is a work in progress, so it is true that some namespaces are applied inconsistently, and if you look at [`libbitcoin_*_SOURCES`](../../src/Makefile.am) lists you can see that many libraries pull in files from outside their source directory. But when working with libraries, it is good to follow a consistent pattern like: +- Generally each library should have a corresponding source directory and namespace. Source code organization is a work in progress, so it is true that some namespaces are applied inconsistently, and if you look at [`add_library(bitcoin_* ...)`](../../src/CMakeLists.txt) lists you can see that many libraries pull in files from outside their source directory. But when working with libraries, it is good to follow a consistent pattern like: - *libbitcoin_node* code lives in `src/node/` in the `node::` namespace - *libbitcoin_wallet* code lives in `src/wallet/` in the `wallet::` namespace @@ -54,13 +54,18 @@ bitcoin-wallet[bitcoin-wallet]-->libbitcoin_wallet_tool; libbitcoin_cli-->libbitcoin_util; libbitcoin_cli-->libbitcoin_common; +libbitcoin_consensus-->libbitcoin_crypto; + libbitcoin_common-->libbitcoin_consensus; +libbitcoin_common-->libbitcoin_crypto; libbitcoin_common-->libbitcoin_util; libbitcoin_kernel-->libbitcoin_consensus; +libbitcoin_kernel-->libbitcoin_crypto; libbitcoin_kernel-->libbitcoin_util; libbitcoin_node-->libbitcoin_consensus; +libbitcoin_node-->libbitcoin_crypto; libbitcoin_node-->libbitcoin_kernel; libbitcoin_node-->libbitcoin_common; libbitcoin_node-->libbitcoin_util; @@ -68,7 +73,10 @@ libbitcoin_node-->libbitcoin_util; libbitcoinqt-->libbitcoin_common; libbitcoinqt-->libbitcoin_util; +libbitcoin_util-->libbitcoin_crypto; + libbitcoin_wallet-->libbitcoin_common; +libbitcoin_wallet-->libbitcoin_crypto; libbitcoin_wallet-->libbitcoin_util; libbitcoin_wallet_tool-->libbitcoin_wallet; @@ -79,26 +87,26 @@ class bitcoin-qt,bitcoind,bitcoin-cli,bitcoin-wallet bold ``` -**Dependency graph**. Arrows show linker symbol dependencies. *Consensus* lib depends on nothing. *Util* lib is depended on by everything. *Kernel* lib depends only on consensus and util. +**Dependency graph**. Arrows show linker symbol dependencies. *Crypto* lib depends on nothing. *Util* lib is depended on by everything. *Kernel* lib depends only on consensus, crypto, and util. - The graph shows what _linker symbols_ (functions and variables) from each library other libraries can call and reference directly, but it is not a call graph. For example, there is no arrow connecting *libbitcoin_wallet* and *libbitcoin_node* libraries, because these libraries are intended to be modular and not depend on each other's internal implementation details. But wallet code is still able to call node code indirectly through the `interfaces::Chain` abstract class in [`interfaces/chain.h`](../../src/interfaces/chain.h) and node code calls wallet code through the `interfaces::ChainClient` and `interfaces::Chain::Notifications` abstract classes in the same file. In general, defining abstract classes in [`src/interfaces/`](../../src/interfaces/) can be a convenient way of avoiding unwanted direct dependencies or circular dependencies between libraries. -- *libbitcoin_consensus* should be a standalone dependency that any library can depend on, and it should not depend on any other libraries itself. +- *libbitcoin_crypto* should be a standalone dependency that any library can depend on, and it should not depend on any other libraries itself. -- *libbitcoin_util* should also be a standalone dependency that any library can depend on, and it should not depend on other internal libraries. +- *libbitcoin_consensus* should only depend on *libbitcoin_crypto*, and all other libraries besides *libbitcoin_crypto* should be allowed to depend on it. -- *libbitcoin_common* should serve a similar function as *libbitcoin_util* and be a place for miscellaneous code used by various daemon, GUI, and CLI applications and libraries to live. It should not depend on anything other than *libbitcoin_util* and *libbitcoin_consensus*. The boundary between _util_ and _common_ is a little fuzzy but historically _util_ has been used for more generic, lower-level things like parsing hex, and _common_ has been used for bitcoin-specific, higher-level things like parsing base58. The difference between util and common is mostly important because *libbitcoin_kernel* is not supposed to depend on *libbitcoin_common*, only *libbitcoin_util*. In general, if it is ever unclear whether it is better to add code to *util* or *common*, it is probably better to add it to *common* unless it is very generically useful or useful particularly to include in the kernel. +- *libbitcoin_util* should be a standalone dependency that any library can depend on, and it should not depend on other libraries except *libbitcoin_crypto*. It provides basic utilities that fill in gaps in the C++ standard library and provide lightweight abstractions over platform-specific features. Since the util library is distributed with the kernel and is usable by kernel applications, it shouldn't contain functions that external code shouldn't call, like higher level code targeted at the node or wallet. (*libbitcoin_common* is a better place for higher level code, or code that is meant to be used by internal applications only.) +- *libbitcoin_common* is a home for miscellaneous shared code used by different Bitcoin Core applications. It should not depend on anything other than *libbitcoin_util*, *libbitcoin_consensus*, and *libbitcoin_crypto*. -- *libbitcoin_kernel* should only depend on *libbitcoin_util* and *libbitcoin_consensus*. +- *libbitcoin_kernel* should only depend on *libbitcoin_util*, *libbitcoin_consensus*, and *libbitcoin_crypto*. -- The only thing that should depend on *libbitcoin_kernel* internally should be *libbitcoin_node*. GUI and wallet libraries *libbitcoinqt* and *libbitcoin_wallet* in particular should not depend on *libbitcoin_kernel* and the unneeded functionality it would pull in, like block validation. To the extent that GUI and wallet code need scripting and signing functionality, they should be get able it from *libbitcoin_consensus*, *libbitcoin_common*, and *libbitcoin_util*, instead of *libbitcoin_kernel*. +- The only thing that should depend on *libbitcoin_kernel* internally should be *libbitcoin_node*. GUI and wallet libraries *libbitcoinqt* and *libbitcoin_wallet* in particular should not depend on *libbitcoin_kernel* and the unneeded functionality it would pull in, like block validation. To the extent that GUI and wallet code need scripting and signing functionality, they should be able to get it from *libbitcoin_consensus*, *libbitcoin_common*, *libbitcoin_crypto*, and *libbitcoin_util*, instead of *libbitcoin_kernel*. -- GUI, node, and wallet code internal implementations should all be independent of each other, and the *libbitcoinqt*, *libbitcoin_node*, *libbitcoin_wallet* libraries should never reference each other's symbols. They should only call each other through [`src/interfaces/`](`../../src/interfaces/`) abstract interfaces. +- GUI, node, and wallet code internal implementations should all be independent of each other, and the *libbitcoinqt*, *libbitcoin_node*, *libbitcoin_wallet* libraries should never reference each other's symbols. They should only call each other through [`src/interfaces/`](../../src/interfaces/) abstract interfaces. ## Work in progress -- Validation code is moving from *libbitcoin_node* to *libbitcoin_kernel* as part of [The libbitcoinkernel Project #24303](https://github.com/bitcoin/bitcoin/issues/24303) -- Source code organization is discussed in general in [Library source code organization #15732](https://github.com/bitcoin/bitcoin/issues/15732) +- Validation code is moving from *libbitcoin_node* to *libbitcoin_kernel* as part of [The libbitcoinkernel Project #27587](https://github.com/bitcoin/bitcoin/issues/27587) diff --git a/doc/design/multiprocess.md b/doc/design/multiprocess.md index e3f389a6d3..11e81527ce 100644 --- a/doc/design/multiprocess.md +++ b/doc/design/multiprocess.md @@ -1,72 +1,264 @@ -# Multiprocess Bitcoin +# Multiprocess Bitcoin Design Document -On unix systems, the `--enable-multiprocess` build option can be passed to `./configure` to build new `bitcoin-node`, `bitcoin-wallet`, and `bitcoin-gui` executables alongside existing `bitcoind` and `bitcoin-qt` executables. +Guide to the design and architecture of the Bitcoin Core multiprocess feature -`bitcoin-node` is a drop-in replacement for `bitcoind`, and `bitcoin-gui` is a drop-in replacement for `bitcoin-qt`, and there are no differences in use or external behavior between the new and old executables. But internally (after [#10102](https://github.com/bitcoin/bitcoin/pull/10102)), `bitcoin-gui` will spawn a `bitcoin-node` process to run P2P and RPC code, communicating with it across a socket pair, and `bitcoin-node` will spawn `bitcoin-wallet` to run wallet code, also communicating over a socket pair. This will let node, wallet, and GUI code run in separate address spaces for better isolation, and allow future improvements like being able to start and stop components independently on different machines and environments. +_This document describes the design of the multiprocess feature. For usage information, see the top-level [multiprocess.md](../multiprocess.md) file._ -## Next steps +## Table of contents -Specific next steps after [#10102](https://github.com/bitcoin/bitcoin/pull/10102) will be: +- [Introduction](#introduction) +- [Current Architecture](#current-architecture) +- [Proposed Architecture](#proposed-architecture) +- [Component Overview: Navigating the IPC Framework](#component-overview-navigating-the-ipc-framework) +- [Design Considerations](#design-considerations) + - [Selection of Cap’n Proto](#selection-of-capn-proto) + - [Hiding IPC](#hiding-ipc) + - [Interface Definition Maintenance](#interface-definition-maintenance) + - [Interface Stability](#interface-stability) +- [Security Considerations](#security-considerations) +- [Example Use Cases and Flows](#example-use-cases-and-flows) + - [Retrieving a Block Hash](#retrieving-a-block-hash) +- [Future Enhancements](#future-enhancements) +- [Conclusion](#conclusion) +- [Appendices](#appendices) + - [Glossary of Terms](#glossary-of-terms) + - [References](#references) +- [Acknowledgements](#acknowledgements) -- [ ] Adding `-ipcbind` and `-ipcconnect` options to `bitcoin-node`, `bitcoin-wallet`, and `bitcoin-gui` executables so they can listen and connect to TCP ports and unix socket paths. This will allow separate processes to be started and stopped any time and connect to each other. -- [ ] Adding `-server` and `-rpcbind` options to the `bitcoin-wallet` executable so wallet processes can handle RPC requests directly without going through the node. -- [ ] Supporting windows, not just unix systems. The existing socket code is already cross-platform, so the only windows-specific code that needs to be written is code spawning a process and passing a socket descriptor. This can be implemented with `CreateProcess` and `WSADuplicateSocket`. Example: https://memset.wordpress.com/2010/10/13/win32-api-passing-socket-with-ipc-method/. -- [ ] Adding sandbox features, restricting subprocess access to resources and data. See [https://eklitzke.org/multiprocess-bitcoin](https://eklitzke.org/multiprocess-bitcoin). +## Introduction -## Debugging +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. -The `-debug=ipc` command line option can be used to see requests and responses between processes. +## Current Architecture -## Installation +The current system features two primary executables: `bitcoind` and `bitcoin-qt`. `bitcoind` combines a Bitcoin P2P node with an integrated JSON-RPC server, wallet, and indexes. `bitcoin-qt` extends this by incorporating a Qt-based GUI. This monolithic structure, although robust, presents challenges such as limited operational flexibility and increased security risks due to the tight integration of components. -The multiprocess feature requires [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) as dependencies. A simple way to get starting using it without installing these dependencies manually is to use the [depends system](../depends) with the `MULTIPROCESS=1` [dependency option](../depends#dependency-options) passed to make: +## Proposed Architecture +The new architecture divides the existing code into three specialized executables: + +- `bitcoin-node`: Manages the P2P node, indexes, and JSON-RPC server. +- `bitcoin-wallet`: Handles all wallet functionality. +- `bitcoin-gui`: Provides a standalone Qt-based GUI. + +This modular approach is designed to enhance security through component isolation and improve usability by allowing independent operation of each module. This allows for new use-cases, such as running the node on a dedicated machine and operating wallets and GUIs on separate machines with the flexibility to start and stop them as needed. + +This subdivision could be extended in the future. For example, indexes could be removed from the `bitcoin-node` executable and run in separate executables. And JSON-RPC servers could be added to wallet and index executables, so they can listen and respond to RPC requests on their own ports, without needing to forward RPC requests through `bitcoin-node`. + +
+ +```mermaid +flowchart LR + node[bitcoin-node] -- listens on --> socket["<datadir>/node.sock"] + wallet[bitcoin-wallet] -- connects to --> socket + gui[bitcoin-gui] -- connects to --> socket +``` + +
+Processes and socket connection. +
+ +## Component Overview: Navigating the IPC Framework + +This section describes the major components of the Inter-Process Communication (IPC) framework covering the relevant source files, generated files, tools, and libraries. + +### Abstract C++ Classes in [`src/interfaces/`](../../src/interfaces/) +- The foundation of the IPC implementation lies in the abstract C++ classes within the [`src/interfaces/`](../../src/interfaces/) directory. These classes define pure virtual methods that code in [`src/node/`](../../src/node/), [`src/wallet/`](../../src/wallet/), and [`src/qt/`](../../src/qt/) directories call to interact with each other. +- Each abstract class in this directory represents a distinct interface that the different modules (node, wallet, GUI) implement and use for cross-process communication. +- The classes are written following conventions described in [Internal Interface + Guidelines](../developer-notes.md#internal-interface-guidelines) to ensure + compatibility with Cap'n Proto. + +### Cap’n Proto Files in [`src/ipc/capnp/`](../../src/ipc/capnp/) +- Corresponding to each abstract class, there are `.capnp` files within the [`src/ipc/capnp/`](../../src/ipc/capnp/) directory. These files are used as input to the `mpgen` tool (described below) to generate C++ code. +- These Cap’n Proto files ([learn more about Cap'n Proto RPC](https://capnproto.org/rpc.html)) define the structure and format of messages that are exchanged over IPC. They serve as blueprints for generating C++ code that bridges the gap between high-level C++ interfaces and low-level socket communication. + +### The `mpgen` Code Generation Tool +- A central component of the IPC framework is the `mpgen` tool which is part of the [`libmultiprocess` project](https://github.com/bitcoin-core/libmultiprocess). This tool takes the `.capnp` files as input and generates C++ code. +- The generated code handles IPC communication, translating interface calls into socket reads and writes. + +### C++ Client Subclasses in Generated Code +- In the generated code, we have C++ client subclasses that inherit from the abstract classes in [`src/interfaces/`](../../src/interfaces/). These subclasses are the workhorses of the IPC mechanism. +- They implement all the methods of the interface, marshalling arguments into a structured format, sending them as requests to the IPC server via a UNIX socket, and handling the responses. +- These subclasses effectively mask the complexity of IPC, presenting a familiar C++ interface to developers. +- Internally, the client subclasses generated by the `mpgen` tool wrap [client classes generated by Cap'n Proto](https://capnproto.org/cxxrpc.html#clients), and use them to send IPC requests. The Cap'n Proto client classes are low-level, with non-blocking methods that use asynchronous I/O and pass request and response objects, while mpgen client subclasses provide normal C++ methods that block while executing and convert between request/response objects and arguments/return values. + +### C++ Server Classes in Generated Code +- On the server side, corresponding generated C++ classes receive IPC requests. These server classes are responsible for unmarshalling method arguments, invoking the corresponding methods in the local [`src/interfaces/`](../../src/interfaces/) objects, and creating the IPC response. +- The server classes ensure that return values (including output argument values and thrown exceptions) are marshalled and sent back to the client, completing the communication cycle. +- Internally, the server subclasses generated by the `mpgen` tool inherit from [server classes generated by Cap'n Proto](https://capnproto.org/cxxrpc.html#servers), and use them to process IPC requests. + +### The `libmultiprocess` Runtime Library +- **Core Functionality**: The `libmultiprocess` runtime library's primary function is to instantiate the generated client and server classes as needed. +- **Bootstrapping IPC Connections**: It provides functions for starting new IPC connections, specifically binding generated client and server classes for an initial `interfaces::Init` interface (defined in [`src/interfaces/init.h`](../../src/interfaces/init.h)) to a UNIX socket. This initial interface has methods returning other interfaces that different Bitcoin Core modules use to communicate after the bootstrapping phase. +- **Asynchronous I/O and Thread Management**: The library is also responsible for managing I/O and threading. Particularly, it ensures that IPC requests never block each other and that new threads on either side of a connection can always make client calls. It also manages worker threads on the server side of calls, ensuring that calls from the same client thread always execute on the same server thread (to avoid locking issues and support nested callbacks). + +### Type Hooks in [`src/ipc/capnp/*-types.h`](../../src/ipc/capnp/) +- **Custom Type Conversions**: In [`src/ipc/capnp/*-types.h`](../../src/ipc/capnp/), function overloads of `libmultiprocess` C++ functions, `mp::CustomReadField`, `mp::CustomBuildField`, `mp::CustomReadMessage` and `mp::CustomBuildMessage`, are defined. These overloads are used for customizing the conversion of specific C++ types to and from Cap’n Proto types. +- **Handling Special Cases**: The `mpgen` tool and `libmultiprocess` library can convert most C++ types to and from Cap’n Proto types automatically, including interface types, primitive C++ types, standard C++ types like `std::vector`, `std::set`, `std::map`, `std::tuple`, and `std::function`, as well as simple C++ structs that consist of aforementioned types and whose fields correspond 1:1 with Cap’n Proto struct fields. For other types, `*-types.h` files provide custom code to convert between C++ and Cap’n Proto data representations. + +### Protocol-Agnostic IPC Code in [`src/ipc/`](../../src/ipc/) +- **Broad Applicability**: Unlike the Cap’n Proto-specific code in [`src/ipc/capnp/`](../../src/ipc/capnp/), the code in the [`src/ipc/`](../../src/ipc/) directory is protocol-agnostic. This enables potential support for other protocols, such as gRPC or a custom protocol in the future. +- **Process Management and Socket Operations**: The main purpose of this component is to provide functions for spawning new processes and creating and connecting to UNIX sockets. +- **ipc::Exception Class**: This code also defines an `ipc::Exception` class which is thrown from the generated C++ client class methods when there is an unexpected IPC error, such as a disconnection. + +
+ +```mermaid +flowchart TD + capnpFile[ipc/capnp/chain.capnp] -->|Input to| mpgenTool([mpgen Tool]) + mpgenTool -->|Generates| proxyTypesH[ipc/capnp/chain.capnp.proxy-types.h] + mpgenTool --> proxyClientCpp[ipc/capnp/chain.capnp.proxy-client.c++] + mpgenTool --> proxyServerCpp[ipc/capnp/chain.capnp.proxy-server.c++] + proxyTypesH -.->|Includes| interfaces/chain.h + proxyClientCpp -.-> interfaces/chain.h + proxyServerCpp -.-> interfaces/chain.h ``` -cd -make -C depends NO_QT=1 MULTIPROCESS=1 -CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure -make -src/bitcoin-node -regtest -printtoconsole -debug=ipc -BITCOIND=bitcoin-node test/functional/test_runner.py + +
+Diagram showing generated source files and includes. +
+ +## Design Considerations + +### Selection of Cap’n Proto +The choice to use [Cap’n Proto](https://capnproto.org/) for IPC was primarily influenced by its support for passing object references and managing object lifetimes, which would have to be implemented manually with a framework that only supported plain requests and responses like [gRPC](https://grpc.io/). The support is especially helpful for passing callback objects like `std::function` and enabling bidirectional calls between processes. + +The choice to use an RPC framework at all instead of a custom protocol was necessitated by the size of Bitcoin Core internal interfaces which consist of around 150 methods that pass complex data structures and are called in complicated ways (in parallel, and from callbacks that can be nested and stored). Writing a custom protocol to wrap these complicated interfaces would be a lot more work, akin to writing a new RPC framework. + +### Hiding IPC + +The IPC mechanism is deliberately isolated from the rest of the codebase so less code has to be concerned with IPC. + +Building Bitcoin Core with IPC support is optional, and node, wallet, and GUI code can be compiled to either run in the same process or separate processes. The build system also ensures Cap’n Proto library headers can only be used within the [`src/ipc/capnp/`](../../src/ipc/capnp/) directory, not in other parts of the codebase. + +The libmultiprocess runtime is designed to place as few constraints as possible on IPC interfaces and to make IPC calls act like normal function calls. Method arguments, return values, and exceptions are automatically serialized and sent between processes. Object references and `std::function` arguments are tracked to allow invoked code to call back into invoking code at any time. And there is a 1:1 threading model where every client thread has a corresponding server thread responsible for executing incoming calls from that thread (there can be multiple calls from the same thread due to callbacks) without blocking, and holding the same thread-local variables and locks so behavior is the same whether IPC is used or not. + +### Interface Definition Maintenance + +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. + +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.) + +An alternate approach could use custom [C++ Attributes](https://en.cppreference.com/w/cpp/language/attributes) embedded in interface declarations to automatically generate `.capnp` files from C++ headers. This has not been pursued because parsing C++ headers is more complicated than parsing Cap’n Proto interface definitions, especially portably on multiple platforms. + +In the meantime, the developer guide [Internal interface guidelines](../developer-notes.md#internal-interface-guidelines) can provide guidance on keeping interfaces consistent and functional and avoiding compile errors. + +### Interface Stability + +The currently defined IPC interfaces are unstable, and can change freely with no backwards compatibility. The decision to allow this stems from the recognition that our current interfaces are still evolving and not yet ideal for external use. As these interfaces mature and become more refined, there may be an opportunity to declare them stable and use Cap’n Proto's support for protocol evolution ([Cap'n Proto - Evolving Your Protocol](https://capnproto.org/language.html#evolving-your-protocol)) to allow them to be extended while remaining backwards compatible. This could allow different versions of node, GUI, and wallet binaries to interoperate, and potentially open doors for external tools to utilize these interfaces, such as creating custom indexes through a stable indexing interface. However, for now, the priority is to improve the interfaces internally. Given their current state and the advantages of using JSON-RPC for most common tasks, it's more practical to focus on internal development rather than external applicability. + +## Security Considerations + +The integration of [Cap’n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/bitcoin-core/libmultiprocess) into the Bitcoin Core architecture increases its potential attack surface. Cap’n Proto, being a complex and substantial new dependency, introduces potential sources of vulnerability, particularly through the creation of new UNIX sockets. The inclusion of libmultiprocess, while a smaller external dependency, also contributes to this risk. However, plans are underway to incorporate libmultiprocess as a git subtree, aligning it more closely with the project's well-reviewed internal libraries. While adopting these multiprocess features does introduce some risk, it's worth noting that they can be disabled, allowing builds without these new dependencies. This flexibility ensures that users can balance functionality with security considerations as needed. + +## Example Use Cases and Flows + +### Retrieving a Block Hash + +Let’s walk through an example where the `bitcoin-wallet` process requests the hash of a block at a specific height from the `bitcoin-node` process. This example demonstrates the practical application of the IPC mechanism, specifically the interplay between C++ method calls and Cap’n Proto-generated RPC calls. + +
+ +```mermaid +sequenceDiagram + box "bitcoin-wallet process" + participant WalletCode as Wallet code + participant ChainClient as Generated Chain client class
ProxyClient + end + box "bitcoin-node process" + participant ChainServer as Generated Chain server class
ProxyServer + participant LocalChain as Chain object
node::ChainImpl + end + + WalletCode->>ChainClient: getBlockHash(height) + ChainClient->>ChainServer: Send RPC getBlockHash request + ChainServer->>LocalChain: getBlockHash(height) + LocalChain->>ChainServer: Return block hash + ChainServer->>ChainClient: Send response with block hash + ChainClient->>WalletCode: Return block hash ``` -The configure script will pick up settings and library locations from the depends directory, so there is no need to pass `--enable-multiprocess` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option). - -Alternately, you can install [Cap'n Proto](https://capnproto.org/) and [libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) packages on your system, and just run `./configure --enable-multiprocess` without using the depends system. The configure script will be able to locate the installed packages via [pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/). See [Installation](https://github.com/chaincodelabs/libmultiprocess#installation) section of the libmultiprocess readme for install steps. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies in general. - -## IPC implementation details - -Cross process Node, Wallet, and Chain interfaces are defined in -[`src/interfaces/`](../src/interfaces/). These are C++ classes which follow -[conventions](developer-notes.md#internal-interface-guidelines), like passing -serializable arguments so they can be called from different processes, and -making methods pure virtual so they can have proxy implementations that forward -calls between processes. - -When Wallet, Node, and Chain code is running in the same process, calling any -interface method invokes the implementation directly. When code is running in -different processes, calling an interface method invokes a proxy interface -implementation that communicates with a remote process and invokes the real -implementation in the remote process. The -[libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) code -generation tool internally generates proxy client classes and proxy server -classes for this purpose that are thin wrappers around Cap'n Proto -[client](https://capnproto.org/cxxrpc.html#clients) and -[server](https://capnproto.org/cxxrpc.html#servers) classes, which handle the -actual serialization and socket communication. - -As much as possible, calls between processes are meant to work the same as -calls within a single process without adding limitations or requiring extra -implementation effort. Processes communicate with each other by calling regular -[C++ interface methods](../src/interfaces/README.md). Method arguments and -return values are automatically serialized and sent between processes. Object -references and `std::function` arguments are automatically tracked and mapped -to allow invoked code to call back into invoking code at any time, and there is -a 1:1 threading model where any thread invoking a method in another process has -a corresponding thread in the invoked process responsible for executing all -method calls from the source thread, without blocking I/O or holding up another -call, and using the same thread local variables, locks, and callbacks between -calls. The forwarding, tracking, and threading is implemented inside the -[libmultiprocess](https://github.com/chaincodelabs/libmultiprocess) library -which has the design goal of making calls between processes look like calls in -the same process to the extent possible. +
+Chain::getBlockHash call diagram +
+ +1. **Initiation in bitcoin-wallet** + - The wallet process calls the `getBlockHash` method on a `Chain` object. This method is defined as a virtual method in [`src/interfaces/chain.h`](../../src/interfaces/chain.h). + +2. **Translation to Cap’n Proto RPC** + - The `Chain::getBlockHash` virtual method is overridden by the `Chain` [client subclass](#c-client-subclasses-in-generated-code) to translate the method call into a Cap’n Proto RPC call. + - The client subclass is automatically generated by the `mpgen` tool from the [`chain.capnp`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc/src/ipc/capnp/chain.capnp) file in [`src/ipc/capnp/`](../../src/ipc/capnp/). + +3. **Request Preparation and Dispatch** + - The `getBlockHash` method of the generated `Chain` client subclass in `bitcoin-wallet` populates a Cap’n Proto request with the `height` parameter, sends it to `bitcoin-node` process, and waits for a response. + +4. **Handling in bitcoin-node** + - Upon receiving the request, the Cap'n Proto dispatching code in the `bitcoin-node` process calls the `getBlockHash` method of the `Chain` [server class](#c-server-classes-in-generated-code). + - The server class is automatically generated by the `mpgen` tool from the [`chain.capnp`](https://github.com/ryanofsky/bitcoin/blob/pr/ipc/src/ipc/capnp/chain.capnp) file in [`src/ipc/capnp/`](../../src/ipc/capnp/). + - The `getBlockHash` method of the generated `Chain` server subclass in `bitcoin-wallet` receives a Cap’n Proto request object with the `height` parameter, and calls the `getBlockHash` method on its local `Chain` object with the provided `height`. + - When the call returns, it encapsulates the return value in a Cap’n Proto response, which it sends back to the `bitcoin-wallet` process. + +5. **Response and Return** + - The `getBlockHash` method of the generated `Chain` client subclass in `bitcoin-wallet` which sent the request now receives the response. + - It extracts the block hash value from the response, and returns it to the original caller. + +## Future Enhancements + +Further improvements are possible such as: + +- Separating indexes from `bitcoin-node`, and running indexing code in separate processes (see [indexes: Stop using node internal types #24230](https://github.com/bitcoin/bitcoin/pull/24230)). +- Enabling wallet processes to listen for JSON-RPC requests on their own ports instead of needing the node process to listen and forward requests to them. +- Automatically generating `.capnp` files from C++ interface definitions (see [Interface Definition Maintenance](#interface-definition-maintenance)). +- Simplifying and stabilizing interfaces (see [Interface Stability](#interface-stability)). +- Adding sandbox features, restricting subprocess access to resources and data (see [https://eklitzke.org/multiprocess-bitcoin](https://eklitzke.org/multiprocess-bitcoin)). +- Using Cap'n Proto's support for [other languages](https://capnproto.org/otherlang.html), such as [Rust](https://github.com/capnproto/capnproto-rust), to allow code written in other languages to call Bitcoin Core C++ code, and vice versa (see [How to rustify libmultiprocess? #56](https://github.com/bitcoin-core/libmultiprocess/issues/56)). + +## Conclusion + +This modularization represents an advancement in Bitcoin Core's architecture, offering enhanced security, flexibility, and maintainability. The project invites collaboration and feedback from the community. + +## Appendices + +### Glossary of Terms + +- **abstract class**: A class in C++ that consists of virtual functions. In the Bitcoin Core project, they define interfaces for inter-component communication. + +- **asynchronous I/O**: A form of input/output processing that allows a program to continue other operations while a transmission is in progress. + +- **Cap’n Proto**: A high-performance data serialization and RPC library, chosen for its support for object references and bidirectional communication. + +- **Cap’n Proto interface**: A set of methods defined in Cap’n Proto to facilitate structured communication between different software components. + +- **Cap’n Proto struct**: A structured data format used in Cap’n Proto, similar to structs in C++, for organizing and transporting data across different processes. + +- **client class (in generated code)**: A C++ class generated from a Cap’n Proto interface which inherits from a Bitcoin Core abstract class, and implements each virtual method to send IPC requests to another process. (see also [components section](#c-client-subclasses-in-generated-code)) + +- **IPC (inter-process communication)**: Mechanisms that enable processes to exchange requests and data. + +- **ipc::Exception class**: A class within Bitcoin Core's protocol-agnostic IPC code that is thrown by client class methods when there is an IPC error. + +- **libmultiprocess**: A custom library and code generation tool used for creating IPC interfaces and managing IPC connections. + +- **marshalling**: Transforming an object’s memory representation for transmission. + +- **mpgen tool**: A tool within the `libmultiprocess` suite that generates C++ code from Cap’n Proto files, facilitating IPC. + +- **protocol-agnostic code**: Generic IPC code in [`src/ipc/`](../../src/ipc/) that does not rely on Cap’n Proto and could be used with other protocols. Distinct from code in [`src/ipc/capnp/`](../../src/ipc/capnp/) which relies on Cap’n Proto. + +- **RPC (remote procedure call)**: A protocol that enables a program to request a service from another program in a different address space or network. Bitcoin Core uses [JSON-RPC](https://en.wikipedia.org/wiki/JSON-RPC) for RPC. + +- **server class (in generated code)**: A C++ class generated from a Cap’n Proto interface which handles requests sent by a _client class_ in another process. The request handled by calling a local Bitcoin Core interface method, and the return values (if any) are sent back in a response. (see also: [components section](#c-server-classes-in-generated-code)) + +- **unix socket**: Communication endpoint which is a filesystem path, used for exchanging data between processes running on the same host. + +- **virtual method**: A function or method whose behavior can be overridden within an inheriting class by a function with the same signature. + +## References + +- **Cap’n Proto RPC protocol description**: https://capnproto.org/rpc.html +- **libmultiprocess project page**: https://github.com/bitcoin-core/libmultiprocess + +## Acknowledgements + +This design doc was written by @ryanofsky, who is grateful to all the reviewers who gave feedback and tested [multiprocess PRs](https://github.com/bitcoin/bitcoin/pull/28722), and everyone else who's helped with this project. Particular thanks to @ariard who deeply reviewed IPC code and improved the design of the IPC library and initialization process. @jnewbery who championed the early refactoring PRs and helped guide them through development and review. @sjors who has reviewed and repeatedly tested multiprocess code, reporting many issues and helping debug them. @hebasto, @fanquake, and @maflcko who made significant improvements to the build system and fixed countless build issues. @vasild and @jamesob who were brave contributors to the libmultiprocess library. And Chaincode Labs for making this work possible. Also thanks to ChatGPT, who actually wrote most of this document (not @ryanofsky). diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 80353bcdd2..bb6fa215f0 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -13,7 +13,6 @@ Developer Notes - [Development tips and tricks](#development-tips-and-tricks) - [Compiling for debugging](#compiling-for-debugging) - [Show sources in debugging](#show-sources-in-debugging) - - [Compiling for gprof profiling](#compiling-for-gprof-profiling) - [`debug.log`](#debuglog) - [Signet, testnet, and regtest modes](#signet-testnet-and-regtest-modes) - [DEBUG_LOCKORDER](#debug_lockorder) @@ -113,6 +112,10 @@ code. between integer types, use functional casts such as `int(x)` or `int{x}` instead of `(int) x`. When casting between more complex types, use `static_cast`. Use `reinterpret_cast` and `const_cast` as appropriate. + - Prefer [`list initialization ({})`](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Res-list) where possible. + For example `int x{0};` instead of `int x = 0;` or `int x(0);` + - Recursion is checked by clang-tidy and thus must be made explicit. Use + `NOLINTNEXTLINE(misc-no-recursion)` to suppress the check. For function calls a namespace should be specified explicitly, unless such functions have been declared within it. Otherwise, [argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl), also known as ADL, could be @@ -138,7 +141,7 @@ int main() Block style example: ```c++ -int g_count = 0; +int g_count{0}; namespace foo { class Class @@ -150,7 +153,7 @@ public: { // Comment summarising what this section of code does for (int i = 0; i < n; ++i) { - int total_sum = 0; + int total_sum{0}; // When something fails, return early if (!Something()) return false; ... @@ -211,14 +214,13 @@ int main() To run clang-tidy on Ubuntu/Debian, install the dependencies: ```sh -apt install clang-tidy bear clang +apt install clang-tidy clang ``` -Then, pass clang as compiler to configure, and use bear to produce the `compile_commands.json`: +Configure with clang as the compiler: ```sh -./autogen.sh && ./configure CC=clang CXX=clang++ -make clean && bear --config src/.bear-tidy-config -- make -j $(nproc) +cmake -B build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ``` The output is denoised of errors from external dependencies. @@ -226,13 +228,13 @@ The output is denoised of errors from external dependencies. To run clang-tidy on all source files: ```sh -( cd ./src/ && run-clang-tidy -j $(nproc) ) +( cd ./src/ && run-clang-tidy -p ../build -j $(nproc) ) ``` To run clang-tidy on the changed source lines: ```sh -git diff | ( cd ./src/ && clang-tidy-diff -p2 -j $(nproc) ) +git diff | ( cd ./src/ && clang-tidy-diff -p2 -path ../build -j $(nproc) ) ``` Coding Style (Python) @@ -330,16 +332,17 @@ Recommendations: - Avoid linking to external documentation; links can break. - Javadoc and all valid Doxygen comments are stripped from Doxygen source code - previews (`STRIP_CODE_COMMENTS = YES` in [Doxyfile.in](doc/Doxyfile.in)). If + previews (`STRIP_CODE_COMMENTS = YES` in [Doxyfile.in](/doc/Doxyfile.in)). If you want a comment to be preserved, it must instead use `//` or `/* */`. ### Generating Documentation -The documentation can be generated with `make docs` and cleaned up with `make -clean-docs`. The resulting files are located in `doc/doxygen/html`; open -`index.html` in that directory to view the homepage. +Assuming the build directory is named `build`, +the documentation can be generated with `cmake --build build --target docs`. +The resulting files will be located in `build/doc/doxygen/html`; +open `index.html` in that directory to view the homepage. -Before running `make docs`, you'll need to install these dependencies: +Before building the `docs` target, you'll need to install these dependencies: Linux: `sudo apt install doxygen graphviz` @@ -350,27 +353,33 @@ Development tips and tricks ### Compiling for debugging -Run configure with `--enable-debug` to add additional compiler flags that -produce better debugging builds. +When using the default build configuration by running `cmake -B build`, the +`-DCMAKE_BUILD_TYPE` is set to `RelWithDebInfo`. This option adds debug symbols +but also performs some compiler optimizations that may make debugging trickier +as the code may not correspond directly to the source. + +If you need to build exclusively for debugging, set the `-DCMAKE_BUILD_TYPE` +to `Debug` (i.e. `-DCMAKE_BUILD_TYPE=Debug`). You can always check the cmake +build options of an existing build with `ccmake build`. ### Show sources in debugging If you have ccache enabled, absolute paths are stripped from debug information -with the -fdebug-prefix-map and -fmacro-prefix-map options (if supported by the +with the `-fdebug-prefix-map` and `-fmacro-prefix-map` options (if supported by the compiler). This might break source file detection in case you move binaries after compilation, debug from the directory other than the project root or use -an IDE that only supports absolute paths for debugging. +an IDE that only supports absolute paths for debugging (e.g. it won't stop at breakpoints). There are a few possible fixes: 1. Configure source file mapping. -For `gdb` create or append to `.gdbinit` file: +For `gdb` create or append to [`.gdbinit` file](https://sourceware.org/gdb/current/onlinedocs/gdb#gdbinit-man): ``` set substitute-path ./src /path/to/project/root/src ``` -For `lldb` create or append to `.lldbinit` file: +For `lldb` create or append to [`.lldbinit` file](https://lldb.llvm.org/man/lldb.html#configuration-files): ``` settings set target.source-map ./src /path/to/project/root/src ``` @@ -382,9 +391,7 @@ ln -s /path/to/project/root/src src 3. Use `debugedit` to modify debug information in the binary. -### Compiling for gprof profiling - -Run configure with the `--enable-gprof` option, then make. +4. If your IDE has an option for this, change your breakpoints to use the file name only. ### `debug.log` @@ -402,7 +409,7 @@ to see it. ### Signet, testnet, and regtest modes If you are testing multi-machine code that needs to operate across the internet, -you can run with either the `-signet` or the `-testnet` config option to test +you can run with either the `-signet` or the `-testnet4` config option to test with "play bitcoins" on a test network. If you are testing something that can run on one machine, run with the @@ -412,8 +419,8 @@ see [test/functional/](/test/functional) for tests that run in `-regtest` mode. ### DEBUG_LOCKORDER Bitcoin Core is a multi-threaded application, and deadlocks or other -multi-threading bugs can be very difficult to track down. The `--enable-debug` -configure option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts +multi-threading bugs can be very difficult to track down. The `-DCMAKE_BUILD_TYPE=Debug` +build option adds `-DDEBUG_LOCKORDER` to the compiler flags. This inserts run-time checks to keep track of which locks are held and adds warnings to the `debug.log` file if inconsistencies are detected. @@ -423,10 +430,9 @@ Defining `DEBUG_LOCKCONTENTION` adds a "lock" logging category to the logging RPC that, when enabled, logs the location and duration of each lock contention to the `debug.log` file. -The `--enable-debug` configure option adds `-DDEBUG_LOCKCONTENTION` to the -compiler flags. You may also enable it manually for a non-debug build by running -configure with `-DDEBUG_LOCKCONTENTION` added to your CPPFLAGS, -i.e. `CPPFLAGS="-DDEBUG_LOCKCONTENTION"`, then build and run bitcoind. +The `-DCMAKE_BUILD_TYPE=Debug` build option adds `-DDEBUG_LOCKCONTENTION` to the +compiler flags. You may also enable it manually by building with `-DDEBUG_LOCKCONTENTION` +added to your CPPFLAGS, i.e. `-DAPPEND_CPPFLAGS="-DDEBUG_LOCKCONTENTION"`. You can then use the `-debug=lock` configuration option at bitcoind startup or `bitcoin-cli logging '["lock"]'` at runtime to turn on lock contention logging. @@ -453,7 +459,10 @@ other input. safely continue even if the assumption is violated. In debug builds it behaves like `Assert`/`assert` to notify developers and testers about nonfatal errors. In production it doesn't warn or log anything, though the - expression is always evaluated. + expression is always evaluated. However, if the compiler can prove that + an expression inside `Assume` is side-effect-free, it may optimize the call away, + skipping its evaluation in production. This enables a lower-cost way of + making explicit statements about the code, aiding review. - For example it can be assumed that a variable is only initialized once, but a failed assumption does not result in a fatal bug. A failed assumption may or may not result in a slightly degraded user experience, @@ -468,29 +477,144 @@ which includes known Valgrind warnings in our dependencies that cannot be fixed in-tree. Example use: ```shell -$ valgrind --suppressions=contrib/valgrind.supp src/test/test_bitcoin +$ valgrind --suppressions=contrib/valgrind.supp build/bin/test_bitcoin $ valgrind --suppressions=contrib/valgrind.supp --leak-check=full \ - --show-leak-kinds=all src/test/test_bitcoin --log_level=test_suite -$ valgrind -v --leak-check=full src/bitcoind -printtoconsole -$ ./test/functional/test_runner.py --valgrind + --show-leak-kinds=all build/bin/test_bitcoin --log_level=test_suite +$ valgrind -v --leak-check=full build/bin/bitcoind -printtoconsole +$ ./build/test/functional/test_runner.py --valgrind ``` ### Compiling for test coverage -LCOV can be used to generate a test coverage report based upon `make check` +#### Using LCOV + +LCOV can be used to generate a test coverage report based upon `ctest` execution. LCOV must be installed on your system (e.g. the `lcov` package on Debian/Ubuntu). To enable LCOV report generation during test runs: ```shell -./configure --enable-lcov -make -make cov +cmake -B build -DCMAKE_BUILD_TYPE=Coverage +cmake --build build +cmake -P build/Coverage.cmake + +# A coverage report will now be accessible at `./build/test_bitcoin.coverage/index.html`, +# which covers unit tests, and `./build/total.coverage/index.html`, which covers +# unit and functional tests. +``` + +Additional LCOV options can be specified using `LCOV_OPTS`, but may be dependent +on the version of LCOV. For example, when using LCOV `2.x`, branch coverage can be +enabled by setting `LCOV_OPTS="--rc branch_coverage=1"`: + +``` +cmake -DLCOV_OPTS="--rc branch_coverage=1" -P build/Coverage.cmake +``` + +To enable test parallelism: +``` +cmake -DJOBS=$(nproc) -P build/Coverage.cmake +``` + +#### Using LLVM/Clang toolchain + +The following generates a coverage report for unit tests and functional tests. + +Configure the build with the following flags: + +> Consider building with a clean state using `rm -rf build` + +```shell +# MacOS may instead require `-DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++"` +cmake -B build -DCMAKE_C_COMPILER="clang" \ + -DCMAKE_CXX_COMPILER="clang++" \ + -DAPPEND_CFLAGS="-fprofile-instr-generate -fcoverage-mapping" \ + -DAPPEND_CXXFLAGS="-fprofile-instr-generate -fcoverage-mapping" \ + -DAPPEND_LDFLAGS="-fprofile-instr-generate -fcoverage-mapping" +cmake --build build # Use "-j N" here for N parallel jobs. +``` + +Generating the raw profile data based on `ctest` and functional tests execution: + +```shell +# Create directory for raw profile data +mkdir -p build/raw_profile_data + +# Run tests to generate profiles +LLVM_PROFILE_FILE="$(pwd)/build/raw_profile_data/%m_%p.profraw" ctest --test-dir build # Use "-j N" here for N parallel jobs. +LLVM_PROFILE_FILE="$(pwd)/build/raw_profile_data/%m_%p.profraw" build/test/functional/test_runner.py # Use "-j N" here for N parallel jobs + +# Merge all the raw profile data into a single file +find build/raw_profile_data -name "*.profraw" | xargs llvm-profdata merge -o build/coverage.profdata +``` + +> **Note:** The "counter mismatch" warning can be safely ignored, though it can be resolved by updating to Clang 19. +> The warning occurs due to version mismatches but doesn't affect the coverage report generation. + +Generating the coverage report: + +```shell +llvm-cov show \ + --object=build/bin/test_bitcoin \ + --object=build/bin/bitcoind \ + -Xdemangler=llvm-cxxfilt \ + --instr-profile=build/coverage.profdata \ + --ignore-filename-regex="src/crc32c/|src/leveldb/|src/minisketch/|src/secp256k1/|src/test/" \ + --format=html \ + --show-instantiation-summary \ + --show-line-counts-or-regions \ + --show-expansions \ + --output-dir=build/coverage_report \ + --project-title="Bitcoin Core Coverage Report" +``` + +> **Note:** The "functions have mismatched data" warning can be safely ignored, the coverage report will still be generated correctly despite this warning. +> This warning occurs due to profdata mismatch created during the merge process for shared libraries. + +The generated coverage report can be accessed at `build/coverage_report/index.html`. + +#### Compiling for Fuzz Coverage -# A coverage report will now be accessible at `./test_bitcoin.coverage/index.html`. +```shell +cmake -B build \ + -DCMAKE_C_COMPILER="clang" \ + -DCMAKE_CXX_COMPILER="clang++" \ + -DCMAKE_C_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \ + -DCMAKE_CXX_FLAGS="-fprofile-instr-generate -fcoverage-mapping" \ + -DBUILD_FOR_FUZZING=ON +cmake --build build # Use "-j N" here for N parallel jobs. ``` +Running fuzz tests with one or more targets + +```shell +# For single target run with the target of choice +LLVM_PROFILE_FILE="$(pwd)/build/raw_profile_data/txorphan.profraw" ./build/test/fuzz/test_runner.py ../qa-assets/fuzz_corpora txorphan +# If running for multiple targets +LLVM_PROFILE_FILE="$(pwd)/build/raw_profile_data/%m_%p.profraw" ./build/test/fuzz/test_runner.py ../qa-assets/fuzz_corpora +# Merge profiles +llvm-profdata merge build/raw_profile_data/*.profraw -o build/coverage.profdata +``` + +Generate report: + +```shell +llvm-cov show \ + --object=build/bin/fuzz \ + -Xdemangler=llvm-cxxfilt \ + --instr-profile=build/coverage.profdata \ + --ignore-filename-regex="src/crc32c/|src/leveldb/|src/minisketch/|src/secp256k1/|src/test/" \ + --format=html \ + --show-instantiation-summary \ + --show-line-counts-or-regions \ + --show-expansions \ + --output-dir=build/coverage_report \ + --project-title="Bitcoin Core Fuzz Coverage Report" +``` + +The generated coverage report can be accessed at `build/coverage_report/index.html`. + ### Performance profiling with perf Profiling is a good way to get a precise idea of where time is being spent in @@ -540,7 +664,7 @@ See the functional test documentation for how to invoke perf within tests. Bitcoin Core can be compiled with various "sanitizers" enabled, which add instrumentation for issues regarding things like memory safety, thread race conditions, or undefined behavior. This is controlled with the -`--with-sanitizers` configure flag, which should be a comma separated list of +`-DSANITIZERS` cmake build flag, which should be a comma separated list of sanitizers to enable. The sanitizer list should correspond to supported `-fsanitize=` options in your compiler. These sanitizers have runtime overhead, so they are most useful when testing changes or producing debugging builds. @@ -549,16 +673,16 @@ Some examples: ```bash # Enable both the address sanitizer and the undefined behavior sanitizer -./configure --with-sanitizers=address,undefined +cmake -B build -DSANITIZERS=address,undefined # Enable the thread sanitizer -./configure --with-sanitizers=thread +cmake -B build -DSANITIZERS=thread ``` If you are compiling with GCC you will typically need to install corresponding "san" libraries to actually compile with these flags, e.g. libasan for the address sanitizer, libtsan for the thread sanitizer, and libubsan for the -undefined sanitizer. If you are missing required libraries, the configure script +undefined sanitizer. If you are missing required libraries, the build will fail with a linker error when testing the sanitizer flags. The test suite should pass cleanly with the `thread` and `undefined` sanitizers. You @@ -573,15 +697,8 @@ export UBSAN_OPTIONS="suppressions=$(pwd)/test/sanitizer_suppressions/ubsan:prin See the CI config for more examples, and upstream documentation for more information about any additional options. -There are a number of known problems when using the `address` sanitizer. The -address sanitizer is known to fail in -[sha256_sse4::Transform](/src/crypto/sha256_sse4.cpp) which makes it unusable -unless you also use `--disable-asm` when running configure. We would like to fix -sanitizer issues, so please send pull requests if you can fix any errors found -by the address sanitizer (or any other sanitizer). - Not all sanitizer options can be enabled at the same time, e.g. trying to build -with `--with-sanitizers=address,thread` will fail in the configure script as +with `-DSANITIZERS=address,thread` will fail in the build as these sanitizers are mutually incompatible. Refer to your compiler manual to learn more about these options and which sanitizers are supported by your compiler. @@ -595,7 +712,6 @@ Additional resources: * [UndefinedBehaviorSanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html) * [GCC Instrumentation Options](https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html) * [Google Sanitizers Wiki](https://github.com/google/sanitizers/wiki) - * [Issue #12691: Enable -fsanitize flags in Travis](https://github.com/bitcoin/bitcoin/issues/12691) Locking/mutex usage notes ------------------------- @@ -606,7 +722,7 @@ The code is multi-threaded and uses mutexes and the Deadlocks due to inconsistent lock ordering (thread 1 locks `cs_main` and then `cs_wallet`, while thread 2 locks them in the opposite order: result, deadlock as each waits for the other to release its lock) are a problem. Compile with -`-DDEBUG_LOCKORDER` (or use `--enable-debug`) to get lock order inconsistencies +`-DDEBUG_LOCKORDER` (or use `-DCMAKE_BUILD_TYPE=Debug`) to get lock order inconsistencies reported in the `debug.log` file. Re-architecting the core code so there are better-defined interfaces @@ -723,6 +839,45 @@ General Bitcoin Core - *Explanation*: If the test suite is to be updated for a change, this has to be done first. +Logging +------- + +The macros `LogInfo`, `LogDebug`, `LogTrace`, `LogWarning` and `LogError` are available for +logging messages. They should be used as follows: + +- `LogDebug(BCLog::CATEGORY, fmt, params...)` is what you want + most of the time, and it should be used for log messages that are + useful for debugging and can reasonably be enabled on a production + system (that has sufficient free storage space). They will be logged + if the program is started with `-debug=category` or `-debug=1`. + +- `LogInfo(fmt, params...)` should only be used rarely, e.g. for startup + messages or for infrequent and important events such as a new block tip + being found or a new outbound connection being made. These log messages + are unconditional, so care must be taken that they can't be used by an + attacker to fill up storage. Note that `LogPrintf(fmt, params...)` is + a deprecated alias for `LogInfo`. + +- `LogError(fmt, params...)` should be used in place of `LogInfo` for + severe problems that require the node (or a subsystem) to shut down + entirely (e.g., insufficient storage space). + +- `LogWarning(fmt, params...)` should be used in place of `LogInfo` for + severe problems that the node admin should address, but are not + severe enough to warrant shutting down the node (e.g., system time + appears to be wrong, unknown soft fork appears to have activated). + +- `LogTrace(BCLog::CATEGORY, fmt, params...)` should be used in place of + `LogDebug` for log messages that would be unusable on a production + system, e.g. due to being too noisy in normal use, or too resource + intensive to process. These will be logged if the startup + options `-debug=category -loglevel=category:trace` or `-debug=1 + -loglevel=trace` are selected. + +Note that the format strings and parameters of `LogDebug` and `LogTrace` +are only evaluated if the logging category is enabled, so you must be +careful to avoid side-effects in those expressions. + Wallet ------- @@ -739,12 +894,6 @@ Common misconceptions are clarified in those sections: - Passing (non-)fundamental types in the [C++ Core Guideline](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-conventional). -- Assertions should not have side-effects. - - - *Rationale*: Even though the source code is set to refuse to compile - with assertions disabled, having side-effects in assertions is unexpected and - makes the code harder to understand. - - If you use the `.h`, you must link the `.cpp`. - *Rationale*: Include files define the interface for the code in implementation files. Including one but @@ -809,14 +958,14 @@ class A - *Rationale*: Easier to understand what is happening, thus easier to spot mistakes, even for those that are not language lawyers. -- Use `Span` as function argument when it can operate on any range-like container. +- Use `std::span` as function argument when it can operate on any range-like container. - *Rationale*: Compared to `Foo(const vector&)` this avoids the need for a (potentially expensive) conversion to vector if the caller happens to have the input stored in another type of container. However, be aware of the pitfalls documented in [span.h](../src/span.h). ```cpp -void Foo(Span data); +void Foo(std::span data); std::vector vec{1,2,3}; Foo(vec); @@ -859,39 +1008,7 @@ Strings and formatting buffer overflows, and surprises with `\0` characters. Also, some C string manipulations tend to act differently depending on platform, or even the user locale. -- Use `ToIntegral` from [`strencodings.h`](/src/util/strencodings.h) for number parsing. In legacy code you might also find `ParseInt*` family of functions, `ParseDouble` or `LocaleIndependentAtoi`. - - - *Rationale*: These functions do overflow checking and avoid pesky locale issues. - -- Avoid using locale dependent functions if possible. You can use the provided - [`lint-locale-dependence.py`](/test/lint/lint-locale-dependence.py) - to check for accidental use of locale dependent functions. - - - *Rationale*: Unnecessary locale dependence can cause bugs that are very tricky to isolate and fix. - - - These functions are known to be locale dependent: - `alphasort`, `asctime`, `asprintf`, `atof`, `atoi`, `atol`, `atoll`, `atoq`, - `btowc`, `ctime`, `dprintf`, `fgetwc`, `fgetws`, `fprintf`, `fputwc`, - `fputws`, `fscanf`, `fwprintf`, `getdate`, `getwc`, `getwchar`, `isalnum`, - `isalpha`, `isblank`, `iscntrl`, `isdigit`, `isgraph`, `islower`, `isprint`, - `ispunct`, `isspace`, `isupper`, `iswalnum`, `iswalpha`, `iswblank`, - `iswcntrl`, `iswctype`, `iswdigit`, `iswgraph`, `iswlower`, `iswprint`, - `iswpunct`, `iswspace`, `iswupper`, `iswxdigit`, `isxdigit`, `mblen`, - `mbrlen`, `mbrtowc`, `mbsinit`, `mbsnrtowcs`, `mbsrtowcs`, `mbstowcs`, - `mbtowc`, `mktime`, `putwc`, `putwchar`, `scanf`, `snprintf`, `sprintf`, - `sscanf`, `stoi`, `stol`, `stoll`, `strcasecmp`, `strcasestr`, `strcoll`, - `strfmon`, `strftime`, `strncasecmp`, `strptime`, `strtod`, `strtof`, - `strtoimax`, `strtol`, `strtold`, `strtoll`, `strtoq`, `strtoul`, - `strtoull`, `strtoumax`, `strtouq`, `strxfrm`, `swprintf`, `tolower`, - `toupper`, `towctrans`, `towlower`, `towupper`, `ungetwc`, `vasprintf`, - `vdprintf`, `versionsort`, `vfprintf`, `vfscanf`, `vfwprintf`, `vprintf`, - `vscanf`, `vsnprintf`, `vsprintf`, `vsscanf`, `vswprintf`, `vwprintf`, - `wcrtomb`, `wcscasecmp`, `wcscoll`, `wcsftime`, `wcsncasecmp`, `wcsnrtombs`, - `wcsrtombs`, `wcstod`, `wcstof`, `wcstoimax`, `wcstol`, `wcstold`, - `wcstoll`, `wcstombs`, `wcstoul`, `wcstoull`, `wcstoumax`, `wcswidth`, - `wcsxfrm`, `wctob`, `wctomb`, `wctrans`, `wctype`, `wcwidth`, `wprintf` - -- For `strprintf`, `LogPrint`, `LogPrintf` formatting characters don't need size specifiers. +- For `strprintf`, `LogInfo`, `LogDebug`, etc formatting characters don't need size specifiers. - *Rationale*: Bitcoin Core uses tinyformat, which is type safe. Leave them out to avoid confusion. @@ -903,7 +1020,7 @@ Strings and formatting - *Rationale*: Although this is guaranteed to be safe starting with C++11, `.data()` communicates the intent better. - - Do not use it when passing strings to `tfm::format`, `strprintf`, `LogPrint[f]`. + - Do not use it when passing strings to `tfm::format`, `strprintf`, `LogInfo`, `LogDebug`, etc. - *Rationale*: This is redundant. Tinyformat handles strings. @@ -912,7 +1029,7 @@ Strings and formatting - *Rationale*: Qt has built-in functionality for converting their string type from/to C++. No need to roll your own. - - In cases where do you call `.c_str()`, you might want to additionally check that the string does not contain embedded '\0' characters, because + - In cases where you do call `.c_str()`, you might want to additionally check that the string does not contain embedded '\0' characters, because it will (necessarily) truncate the string. This might be used to hide parts of the string from logging or to circumvent checks. If a use of strings is sensitive to this, take care to check the string for embedded NULL characters first and reject it if there are any (see `ParsePrechecks` in `strencodings.cpp` for an example). @@ -954,7 +1071,9 @@ Threads and synchronization internal to a class (private or protected) rather than public. - Combine annotations in function declarations with run-time asserts in - function definitions: + function definitions (`AssertLockNotHeld()` can be omitted if `LOCK()` is + called unconditionally after it because `LOCK()` does the same check as + `AssertLockNotHeld()` internally, for non-recursive mutexes): ```C++ // txmempool.h @@ -1014,8 +1133,8 @@ bool Chainstate::PreciousBlock(BlockValidationState& state, CBlockIndex* pindex) ``` - Build and run tests with `-DDEBUG_LOCKORDER` to verify that no potential - deadlocks are introduced. As of 0.12, this is defined by default when - configuring with `--enable-debug`. + deadlocks are introduced. This is defined by default when + building with `-DCMAKE_BUILD_TYPE=Debug`. - When using `LOCK`/`TRY_LOCK` be aware that the lock exists in the context of the current scope, so surround the statement and the code that needs the lock @@ -1148,7 +1267,7 @@ Subtrees Several parts of the repository are subtrees of software maintained elsewhere. -Some of these are maintained by active developers of Bitcoin Core, in which case +Normally, these are maintained by active developers of Bitcoin Core, in which case changes should go directly upstream without being PRed directly against the project. They will be merged back in the next subtree merge. @@ -1160,29 +1279,20 @@ should be taken upstream. There is a tool in `test/lint/git-subtree-check.sh` ([instructions](../test/lint#git-subtree-checksh)) to check a subtree directory for consistency with its upstream repository. -Current subtrees include: +The tool instructions also include a list of the subtrees managed by Bitcoin Core. + +The ultimate upstream of the few externally managed subtrees are: - src/leveldb - - Subtree at https://github.com/bitcoin-core/leveldb-subtree ; maintained by Core contributors. - Upstream at https://github.com/google/leveldb ; maintained by Google. Open - important PRs to the subtree to avoid delay. + important PRs to the Bitcoin Core subtree to avoid delay. - **Note**: Follow the instructions in [Upgrading LevelDB](#upgrading-leveldb) when merging upstream changes to the LevelDB subtree. - src/crc32c - Used by leveldb for hardware acceleration of CRC32C checksums for data integrity. - - Subtree at https://github.com/bitcoin-core/crc32c-subtree ; maintained by Core contributors. - Upstream at https://github.com/google/crc32c ; maintained by Google. -- src/secp256k1 - - Upstream at https://github.com/bitcoin-core/secp256k1/ ; maintained by Core contributors. - -- src/crypto/ctaes - - Upstream at https://github.com/bitcoin-core/ctaes ; maintained by Core contributors. - -- src/minisketch - - Upstream at https://github.com/sipa/minisketch ; maintained by Core contributors. - Upgrading LevelDB --------------------- @@ -1299,8 +1409,7 @@ Release notes should be written for any PR that: Release notes should be added to a PR-specific release note file at `/doc/release-notes-.md` to avoid conflicts between multiple PRs. -All `release-notes*` files are merged into a single -[/doc/release-notes.md](/doc/release-notes.md) file prior to the release. +All `release-notes*` files are merged into a single `release-notes-.md` file prior to the release. RPC interface guidelines -------------------------- @@ -1351,6 +1460,12 @@ A few guidelines for introducing and reviewing new RPC interfaces: to a multi-value, or due to other historical reasons. **Always** have false map to 0 and true to 1 in this case. +- For new RPC methods, if implementing a `verbosity` argument, use integer verbosity rather than boolean. + Disallow usage of boolean verbosity (see `ParseVerbosity()` in [util.h](/src/rpc/util.h)). + + - *Rationale*: Integer verbosity allows for multiple values. Undocumented boolean verbosity is deprecated + and new RPC methods should prevent its use. + - Don't forget to fill in the argument names correctly in the RPC command table. - *Rationale*: If not, the call cannot be used with name-based arguments. @@ -1408,12 +1523,18 @@ A few guidelines for introducing and reviewing new RPC interfaces: - *Rationale*: User-facing consistency. -- Use `fs::path::u8string()` and `fs::u8path()` functions when converting path +- Use `fs::path::u8string()`/`fs::path::utf8string()` and `fs::u8path()` functions when converting path to JSON strings, not `fs::PathToString` and `fs::PathFromString` - *Rationale*: JSON strings are Unicode strings, not byte strings, and RFC8259 requires JSON to be encoded as UTF-8. +A few guidelines for modifying existing RPC interfaces: + +- It's preferable to avoid changing an RPC in a backward-incompatible manner, but in that case, add an associated `-deprecatedrpc=` option to retain previous RPC behavior during the deprecation period. Backward-incompatible changes include: data type changes (e.g. from `{"warnings":""}` to `{"warnings":[]}`, changing a value from a string to a number, etc.), logical meaning changes of a value, or key name changes (e.g. `{"warning":""}` to `{"warnings":""}`). Adding a key to an object is generally considered backward-compatible. Include a release note that refers the user to the RPC help for details of feature deprecation and re-enabling previous behavior. [Example RPC help](https://github.com/bitcoin/bitcoin/blob/94f0adcc/src/rpc/blockchain.cpp#L1316-L1323). + + - *Rationale*: Changes in RPC JSON structure can break downstream application compatibility. Implementation of `deprecatedrpc` provides a grace period for downstream applications to migrate. Release notes provide notification to downstream users. + Internal interface guidelines ----------------------------- @@ -1423,8 +1544,9 @@ independent (node, wallet, GUI), are defined in there are [`interfaces::Chain`](../src/interfaces/chain.h), used by wallet to access the node's latest chain state, [`interfaces::Node`](../src/interfaces/node.h), used by the GUI to control the -node, and [`interfaces::Wallet`](../src/interfaces/wallet.h), used by the GUI -to control an individual wallet. There are also more specialized interface +node, [`interfaces::Wallet`](../src/interfaces/wallet.h), used by the GUI +to control an individual wallet and [`interfaces::Mining`](../src/interfaces/mining.h), +used by RPC to generate block templates. There are also more specialized interface types like [`interfaces::Handler`](../src/interfaces/handler.h) [`interfaces::ChainClient`](../src/interfaces/chain.h) passed to and from various interface methods. diff --git a/doc/dnsseed-policy.md b/doc/dnsseed-policy.md index 55a5c28258..99f48f2670 100644 --- a/doc/dnsseed-policy.md +++ b/doc/dnsseed-policy.md @@ -44,7 +44,7 @@ related to the DNS seed operation. If these expectations cannot be satisfied the operator should discontinue providing services and contact the active Bitcoin Core development team as well as posting on -[bitcoin-dev](https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev). +[bitcoin-dev](https://groups.google.com/g/bitcoindev). Behavior outside of these expectations may be reasonable in some situations but should be discussed in public in advance. diff --git a/doc/external-signer.md b/doc/external-signer.md index de44cdd880..c1b6b20ce0 100644 --- a/doc/external-signer.md +++ b/doc/external-signer.md @@ -14,6 +14,8 @@ Start Bitcoin Core: $ bitcoind -signer=../HWI/hwi.py ``` +`bitcoin node` can also be substituted for `bitcoind`. + ### Device setup Follow the hardware manufacturers instructions for the initial device setup, as well as their instructions for creating a backup. Alternatively, for some devices, you can use the `setup`, `restore` and `backup` commands provided by [HWI](https://github.com/bitcoin-core/HWI). @@ -40,6 +42,8 @@ Create a wallet, this automatically imports the public keys: $ bitcoin-cli createwallet "hww" true true "" true true true ``` +`bitcoin rpc` can also be substituted for `bitcoin-cli`. + ### Verify an address Display an address on the device: @@ -150,6 +154,9 @@ Example, display the first native SegWit receive address on Testnet: The command MUST be able to figure out the address type from the descriptor. +The command MUST return an object containing `{"address": "[the address]"}`. +As a sanity check, for devices that support this, it SHOULD ask the device to derive the address. + If contains a master key fingerprint, the command MUST fail if it does not match the fingerprint known by the device. If contains an xpub, the command MUST fail if it does not match the xpub known by the device. diff --git a/doc/files.md b/doc/files.md index f88d3f91a1..6951331e29 100644 --- a/doc/files.md +++ b/doc/files.md @@ -8,14 +8,14 @@ - [Multi-wallet environment](#multi-wallet-environment) - - [Berkeley DB database based wallets](#berkeley-db-database-based-wallets) - - [SQLite database based wallets](#sqlite-database-based-wallets) - [GUI settings](#gui-settings) - [Legacy subdirectories and files](#legacy-subdirectories-and-files) + - [Berkeley DB database based wallets](#berkeley-db-database-based-wallets) + - [Notes](#notes) ## Data directory location @@ -28,18 +28,19 @@ Platform | Data directory path ---------|-------------------- Linux | `$HOME/.bitcoin/` macOS | `$HOME/Library/Application Support/Bitcoin/` -Windows | `%APPDATA%\Bitcoin\` [\[1\]](#note1) +Windows | `%LOCALAPPDATA%\Bitcoin\` [\[1\]](#note1) 2. A custom data directory path can be specified with the `-datadir` option. 3. All content of the data directory, except for `bitcoin.conf` file, is chain-specific. This means the actual data directory paths for non-mainnet cases differ: -Chain option | Data directory path --------------------------------|------------------------------ -`-chain=main` (default) | *path_to_datadir*`/` -`-chain=test` or `-testnet` | *path_to_datadir*`/testnet3/` -`-chain=signet` or `-signet` | *path_to_datadir*`/signet/` -`-chain=regtest` or `-regtest` | *path_to_datadir*`/regtest/` +Chain option | Data directory path +---------------------------------|------------------------------ +`-chain=main` (default) | *path_to_datadir*`/` +`-chain=test` or `-testnet` | *path_to_datadir*`/testnet3/` +`-chain=testnet4` or `-testnet4` | *path_to_datadir*`/testnet4/` +`-chain=signet` or `-signet` | *path_to_datadir*`/signet/` +`-chain=regtest` or `-regtest` | *path_to_datadir*`/regtest/` ## Data directory layout @@ -47,8 +48,9 @@ Subdirectory | File(s) | Description -------------------|-----------------------|------------ `blocks/` | | Blocks directory; can be specified by `-blocksdir` option (except for `blocks/index/`) `blocks/index/` | LevelDB database | Block index; `-blocksdir` option does not affect this path -`blocks/` | `blkNNNNN.dat`[\[2\]](#note2) | Actual Bitcoin blocks (in network format, dumped in raw on disk, 128 MiB per file) +`blocks/` | `blkNNNNN.dat`[\[2\]](#note2) | Actual Bitcoin blocks (dumped in network format, 128 MiB per file) `blocks/` | `revNNNNN.dat`[\[2\]](#note2) | Block undo data (custom format) +`blocks/` | `xor.dat` | Rolling XOR pattern for block and undo data files `chainstate/` | LevelDB database | Blockchain state (a compact representation of all currently unspent transaction outputs (UTXOs) and metadata about the transactions they are from) `indexes/txindex/` | LevelDB database | Transaction index; *optional*, used if `-txindex=1` `indexes/blockfilter/basic/db/` | LevelDB database | Blockfilter index LevelDB database for the basic filtertype; *optional*, used if `-blockfilterindex=basic` @@ -73,7 +75,7 @@ Subdirectory | File(s) | Description ## Multi-wallet environment -Wallets are Berkeley DB (BDB) or SQLite databases. +Wallets are SQLite databases. 1. Each user-defined wallet named "wallet_name" resides in the `wallets/wallet_name/` subdirectory. @@ -86,15 +88,6 @@ Wallets are Berkeley DB (BDB) or SQLite databases. 5. Any copy or backup of the wallet should be done through a `backupwallet` call in order to update and lock the wallet, preventing any file corruption caused by updates during the copy. -### Berkeley DB database based wallets - -Subdirectory | File(s) | Description --------------|-------------------|------------- -`database/` | BDB logging files | Part of BDB environment; created at start and deleted on shutdown; a user *must keep it as safe* as personal wallet `wallet.dat` -`./` | `db.log` | BDB error file -`./` | `wallet.dat` | Personal wallet (a BDB database) with keys and transactions -`./` | `.walletlock` | BDB wallet lock file - ### SQLite database based wallets Subdirectory | File | Description @@ -105,7 +98,7 @@ Subdirectory | File | Description ## GUI settings -`bitcoin-qt` uses [`QSettings`](https://doc.qt.io/qt-5/qsettings.html) class; this implies platform-specific [locations where application settings are stored](https://doc.qt.io/qt-5/qsettings.html#locations-where-application-settings-are-stored). +`bitcoin-qt` uses [`QSettings`](https://doc.qt.io/qt-6/qsettings.html) class; this implies platform-specific [locations where application settings are stored](https://doc.qt.io/qt-6/qsettings.html#locations-where-application-settings-are-stored). ## Legacy subdirectories and files @@ -121,6 +114,15 @@ Path | Description | Repository notes `addr.dat` | Peer IP address BDB database; replaced by `peers.dat` in [0.7.0](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.7.0.md) | [PR #1198](https://github.com/bitcoin/bitcoin/pull/1198), [`928d3a01`](https://github.com/bitcoin/bitcoin/commit/928d3a011cc66c7f907c4d053f674ea77dc611cc) `onion_private_key` | Cached Tor onion service private key for `-listenonion` option. Was used for Tor v2 services; replaced by `onion_v3_private_key` in [0.21.0](https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.21.0.md) | [PR #19954](https://github.com/bitcoin/bitcoin/pull/19954) +### Berkeley DB database based wallets + +Subdirectory | File(s) | Description +-------------|-------------------|------------- +`database/` | BDB logging files | Part of BDB environment; created at start and deleted on shutdown; a user *must keep it as safe* as personal wallet `wallet.dat` +`./` | `db.log` | BDB error file +`./` | `wallet.dat` | Personal wallet (a BDB database) with keys and transactions +`./` | `.walletlock` | BDB wallet lock file + ## Notes 1. The `/` (slash, U+002F) is used as the platform-independent path component separator in this document. diff --git a/doc/fuzzing.md b/doc/fuzzing.md index a4b0198dd9..45f727a139 100644 --- a/doc/fuzzing.md +++ b/doc/fuzzing.md @@ -7,17 +7,19 @@ To quickly get started fuzzing Bitcoin Core using [libFuzzer](https://llvm.org/d ```sh $ git clone https://github.com/bitcoin/bitcoin $ cd bitcoin/ -$ ./autogen.sh -$ CC=clang CXX=clang++ ./configure --enable-fuzz --with-sanitizers=address,fuzzer,undefined +$ cmake --preset=libfuzzer # macOS users: If you have problem with this step then make sure to read "macOS hints for # libFuzzer" on https://github.com/bitcoin/bitcoin/blob/master/doc/fuzzing.md#macos-hints-for-libfuzzer -$ make -$ FUZZ=process_message src/test/fuzz/fuzz +$ cmake --build build_fuzz +$ FUZZ=process_message build_fuzz/bin/fuzz # abort fuzzing using ctrl-c ``` +One can use `--preset=libfuzzer-nosan` to do the same without common sanitizers enabled. +See [further](#run-without-sanitizers-for-increased-throughput) for more information. + There is also a runner script to execute all fuzz targets. Refer to -`./test/fuzz/test_runner.py --help` for more details. +`./build_fuzz/test/fuzz/test_runner.py --help` for more details. ## Overview of Bitcoin Core fuzzing @@ -33,7 +35,7 @@ If you specify a corpus directory then any new coverage increasing inputs will b ```sh $ mkdir -p process_message-seeded-from-thin-air/ -$ FUZZ=process_message src/test/fuzz/fuzz process_message-seeded-from-thin-air/ +$ FUZZ=process_message build_fuzz/bin/fuzz process_message-seeded-from-thin-air/ INFO: Seed: 840522292 INFO: Loaded 1 modules (424174 inline 8-bit counters): 424174 [0x55e121ef9ab8, 0x55e121f613a6), INFO: Loaded 1 PC tables (424174 PCs): 424174 [0x55e121f613a8,0x55e1225da288), @@ -77,7 +79,7 @@ of the test. Just make sure to use double-dash to distinguish them from the fuzzer's own arguments: ```sh -$ FUZZ=address_deserialize_v2 src/test/fuzz/fuzz -runs=1 fuzz_seed_corpus/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1 +$ FUZZ=address_deserialize_v2 build_fuzz/bin/fuzz -runs=1 fuzz_corpora/address_deserialize_v2 --checkaddrman=5 --printtoconsole=1 ``` ## Fuzzing corpora @@ -87,21 +89,41 @@ The project's collection of seed corpora is found in the [`bitcoin-core/qa-asset To fuzz `process_message` using the [`bitcoin-core/qa-assets`](https://github.com/bitcoin-core/qa-assets) seed corpus: ```sh -$ git clone https://github.com/bitcoin-core/qa-assets -$ FUZZ=process_message src/test/fuzz/fuzz qa-assets/fuzz_seed_corpus/process_message/ +$ git clone --depth=1 https://github.com/bitcoin-core/qa-assets +$ FUZZ=process_message build_fuzz/bin/fuzz qa-assets/fuzz_corpora/process_message/ INFO: Seed: 1346407872 INFO: Loaded 1 modules (424174 inline 8-bit counters): 424174 [0x55d8a9004ab8, 0x55d8a906c3a6), INFO: Loaded 1 PC tables (424174 PCs): 424174 [0x55d8a906c3a8,0x55d8a96e5288), -INFO: 991 files found in qa-assets/fuzz_seed_corpus/process_message/ +INFO: 991 files found in qa-assets/fuzz_corpora/process_message/ INFO: -max_len is not provided; libFuzzer will not generate inputs larger than 4096 bytes INFO: seed corpus: files: 991 min: 1b max: 1858b total: 288291b rss: 150Mb #993 INITED cov: 7063 ft: 8236 corp: 25/3821b exec/s: 0 rss: 181Mb … ``` +## Using the MemorySanitizer (MSan) + +MSan [requires](https://clang.llvm.org/docs/MemorySanitizer.html#handling-external-code) +that all linked code be instrumented. The exact steps to achieve this may vary +but involve compiling `clang` from source, using the built `clang` to compile +an instrumentalized libc++, then using it to build [Bitcoin Core dependencies +from source](../depends/README.md) and finally the Bitcoin Core fuzz binary +itself. One can use the MSan CI job as an example for how to perform these +steps. + +Valgrind is an alternative to MSan that does not require building a custom libc++. + ## Run without sanitizers for increased throughput -Fuzzing on a harness compiled with `--with-sanitizers=address,fuzzer,undefined` is good for finding bugs. However, the very slow execution even under libFuzzer will limit the ability to find new coverage. A good approach is to perform occasional long runs without the additional bug-detectors (configure `--with-sanitizers=fuzzer`) and then merge new inputs into a corpus as described in the qa-assets repo (https://github.com/bitcoin-core/qa-assets/blob/main/.github/PULL_REQUEST_TEMPLATE.md). Patience is useful; even with improved throughput, libFuzzer may need days and 10s of millions of executions to reach deep/hard targets. +Fuzzing on a harness compiled with `-DSANITIZERS=address,fuzzer,undefined` is +good for finding bugs. However, the very slow execution even under libFuzzer +will limit the ability to find new coverage. A good approach is to perform +occasional long runs without the additional bug-detectors +(`--preset=libfuzzer-nosan`) and then merge new inputs into a corpus as described in +the qa-assets repo +(https://github.com/bitcoin-core/qa-assets/blob/main/.github/PULL_REQUEST_TEMPLATE.md). +Patience is useful; even with improved throughput, libFuzzer may need days and +10s of millions of executions to reach deep/hard targets. ## Reproduce a fuzzer crash reported by the CI @@ -112,8 +134,15 @@ Fuzzing on a harness compiled with `--with-sanitizers=address,fuzzer,undefined` more slowly with sanitizers enabled, but a crash should be reproducible very quickly from a crash case) - run the fuzzer with the case number appended to the seed corpus path: - `FUZZ=process_message src/test/fuzz/fuzz - qa-assets/fuzz_seed_corpus/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6` + `FUZZ=process_message build_fuzz/bin/fuzz + qa-assets/fuzz_corpora/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6` +- If the file does not exist, make sure you are checking out the exact same commit id + for the qa-assets repo. If the file was found while running the fuzz engine in the CI, + you should be able to reproduce the crash locally with the same (or a similar input) + within a few minutes. Alternatively, you can use the base64 encoded file from the CI log, + if it exists. e.g. + `echo "Nb6Fc/97AACAAAD/ewAAgAAAAIAAAACAAAAAoA==" | + base64 --decode > qa-assets/fuzz_corpora/process_message/1bc91feec9fc00b107d97dc225a9f2cdaa078eb6` ## Submit improved coverage @@ -121,25 +150,57 @@ If you find coverage increasing inputs when fuzzing you are highly encouraged to Every single pull request submitted against the Bitcoin Core repo is automatically tested against all inputs in the [`bitcoin-core/qa-assets`](https://github.com/bitcoin-core/qa-assets) repo. Contributing new coverage increasing inputs is an easy way to help make Bitcoin Core more robust. +## Building and debugging fuzz tests + +There are 3 ways fuzz tests can be built: + +1. With `-DBUILD_FOR_FUZZING=ON` which forces on fuzz determinism (skipping + proof of work checks, disabling random number seeding, disabling clock time) + and causes `Assume()` checks to abort on failure. + + This is the normal way to run fuzz tests and generate new inputs. Because + determinism is hardcoded on in this build, only the fuzz binary can be built + and all other binaries are disabled. + +2. With `-DBUILD_FUZZ_BINARY=ON -DCMAKE_BUILD_TYPE=Debug` which causes + `Assume()` checks to abort on failure, and enables fuzz determinism, but + makes it optional. + + Determinism is turned on in the fuzz binary by default, but can be turned off + by setting the `FUZZ_NONDETERMINISM` environment variable to any value, which + may be useful for running fuzz tests with code that deterministic execution + would otherwise skip. + + Since `BUILD_FUZZ_BINARY`, unlike `BUILD_FOR_FUZZING`, does not hardcode on + determinism, this allows non-fuzz binaries to coexist in the same build, + making it possible to reproduce fuzz test failures in a normal build. + +3. With `-DBUILD_FUZZ_BINARY=ON -DCMAKE_BUILD_TYPE=Release`. In this build, the + fuzz binary will build but refuse to run, because in release builds + determinism is forced off and `Assume()` checks do not abort, so running the + tests would not be useful. This build is only useful for ensuring fuzz tests + compile and link. + ## macOS hints for libFuzzer The default Clang/LLVM version supplied by Apple on macOS does not include fuzzing libraries, so macOS users will need to install a full version, for example using `brew install llvm`. -Should you run into problems with the address sanitizer, it is possible you -may need to run `./configure` with `--disable-asm` to avoid errors -with certain assembly code from Bitcoin Core's code. See [developer notes on sanitizers](https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#sanitizers) -for more information. - You may also need to take care of giving the correct path for `clang` and `clang++`, like `CC=/path/to/clang CXX=/path/to/clang++` if the non-systems `clang` does not come first in your path. -Full configure that was tested on macOS with `brew` installed `llvm`: +Using `lld` is required due to issues with Apple's `ld` and `LLVM`. + +Full configuration step for macOS: ```sh -./configure --enable-fuzz --with-sanitizers=fuzzer,address,undefined --disable-asm CC=$(brew --prefix llvm)/bin/clang CXX=$(brew --prefix llvm)/bin/clang++ +$ brew install llvm lld +$ cmake --preset=libfuzzer \ + -DCMAKE_C_COMPILER="$(brew --prefix llvm)/bin/clang" \ + -DCMAKE_CXX_COMPILER="$(brew --prefix llvm)/bin/clang++" \ + -DCMAKE_EXE_LINKER_FLAGS="-fuse-ld=lld" ``` Read the [libFuzzer documentation](https://llvm.org/docs/LibFuzzer.html) for more information. This [libFuzzer tutorial](https://github.com/google/fuzzing/blob/master/tutorial/libFuzzerTutorial.md) might also be of interest. @@ -155,16 +216,18 @@ $ git clone https://github.com/bitcoin/bitcoin $ cd bitcoin/ $ git clone https://github.com/AFLplusplus/AFLplusplus $ make -C AFLplusplus/ source-only -$ ./autogen.sh # If afl-clang-lto is not available, see # https://github.com/AFLplusplus/AFLplusplus#a-selecting-the-best-afl-compiler-for-instrumenting-the-target -$ CC=$(pwd)/AFLplusplus/afl-clang-lto CXX=$(pwd)/AFLplusplus/afl-clang-lto++ ./configure --enable-fuzz -$ make -# For macOS you may need to ignore x86 compilation checks when running "make". If so, -# try compiling using: AFL_NO_X86=1 make +$ cmake -B build_fuzz \ + -DCMAKE_C_COMPILER="$(pwd)/AFLplusplus/afl-clang-lto" \ + -DCMAKE_CXX_COMPILER="$(pwd)/AFLplusplus/afl-clang-lto++" \ + -DBUILD_FOR_FUZZING=ON +$ cmake --build build_fuzz +# For macOS you may need to ignore x86 compilation checks when running "cmake --build". If so, +# try compiling using: AFL_NO_X86=1 cmake --build build_fuzz $ mkdir -p inputs/ outputs/ $ echo A > inputs/thin-air-input -$ FUZZ=bech32 AFLplusplus/afl-fuzz -i inputs/ -o outputs/ -- src/test/fuzz/fuzz +$ FUZZ=bech32 ./AFLplusplus/afl-fuzz -i inputs/ -o outputs/ -- build_fuzz/bin/fuzz # You may have to change a few kernel parameters to test optimally - afl-fuzz # will print an error and suggestion if so. ``` @@ -180,171 +243,30 @@ To quickly get started fuzzing Bitcoin Core using [Honggfuzz](https://github.com ```sh $ git clone https://github.com/bitcoin/bitcoin $ cd bitcoin/ -$ ./autogen.sh $ git clone https://github.com/google/honggfuzz $ cd honggfuzz/ $ make $ cd .. -$ CC=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang CXX=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ ./configure --enable-fuzz --with-sanitizers=address,undefined -$ make +$ cmake -B build_fuzz \ + -DCMAKE_C_COMPILER="$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang" \ + -DCMAKE_CXX_COMPILER="$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++" \ + -DBUILD_FOR_FUZZING=ON \ + -DSANITIZERS=address,undefined +$ cmake --build build_fuzz $ mkdir -p inputs/ -$ FUZZ=process_message honggfuzz/honggfuzz -i inputs/ -- src/test/fuzz/fuzz +$ FUZZ=process_message ./honggfuzz/honggfuzz -i inputs/ -- build_fuzz/bin/fuzz ``` Read the [Honggfuzz documentation](https://github.com/google/honggfuzz/blob/master/docs/USAGE.md) for more information. -## Fuzzing the Bitcoin Core P2P layer using Honggfuzz NetDriver - -Honggfuzz NetDriver allows for very easy fuzzing of TCP servers such as Bitcoin -Core without having to write any custom fuzzing harness. The `bitcoind` server -process is largely fuzzed without modification. - -This makes the fuzzing highly realistic: a bug reachable by the fuzzer is likely -also remotely triggerable by an untrusted peer. - -To quickly get started fuzzing the P2P layer using Honggfuzz NetDriver: - -```sh -$ mkdir bitcoin-honggfuzz-p2p/ -$ cd bitcoin-honggfuzz-p2p/ -$ git clone https://github.com/bitcoin/bitcoin -$ cd bitcoin/ -$ ./autogen.sh -$ git clone https://github.com/google/honggfuzz -$ cd honggfuzz/ -$ make -$ cd .. -$ CC=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang \ - CXX=$(pwd)/honggfuzz/hfuzz_cc/hfuzz-clang++ \ - ./configure --disable-wallet --with-gui=no \ - --with-sanitizers=address,undefined -$ git apply << "EOF" -diff --git a/src/compat/compat.h b/src/compat/compat.h -index 8195bceaec..cce2b31ff0 100644 ---- a/src/compat/compat.h -+++ b/src/compat/compat.h -@@ -90,8 +90,12 @@ typedef char* sockopt_arg_type; - // building with a binutils < 2.36 is subject to this ld bug. - #define MAIN_FUNCTION __declspec(dllexport) int main(int argc, char* argv[]) - #else -+#ifdef HFND_FUZZING_ENTRY_FUNCTION_CXX -+#define MAIN_FUNCTION HFND_FUZZING_ENTRY_FUNCTION_CXX(int argc, char* argv[]) -+#else - #define MAIN_FUNCTION int main(int argc, char* argv[]) - #endif -+#endif - - // Note these both should work with the current usage of poll, but best to be safe - // WIN32 poll is broken https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/ -diff --git a/src/net.cpp b/src/net.cpp -index 7601a6ea84..702d0f56ce 100644 ---- a/src/net.cpp -+++ b/src/net.cpp -@@ -727,7 +727,7 @@ int V1TransportDeserializer::readHeader(Span msg_bytes) - } - - // Check start string, network magic -- if (memcmp(hdr.pchMessageStart, m_chain_params.MessageStart(), CMessageHeader::MESSAGE_START_SIZE) != 0) { -+ if (false && memcmp(hdr.pchMessageStart, m_chain_params.MessageStart(), CMessageHeader::MESSAGE_START_SIZE) != 0) { // skip network magic checking - LogPrint(BCLog::NET, "Header error: Wrong MessageStart %s received, peer=%d\n", HexStr(hdr.pchMessageStart), m_node_id); - return -1; - } -@@ -788,7 +788,7 @@ CNetMessage V1TransportDeserializer::GetMessage(const std::chrono::microseconds - RandAddEvent(ReadLE32(hash.begin())); - - // Check checksum and header message type string -- if (memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != 0) { -+ if (false && memcmp(hash.begin(), hdr.pchChecksum, CMessageHeader::CHECKSUM_SIZE) != 0) { // skip checksum checking - LogPrint(BCLog::NET, "Header error: Wrong checksum (%s, %u bytes), expected %s was %s, peer=%d\n", - SanitizeString(msg.m_type), msg.m_message_size, - HexStr(Span{hash}.first(CMessageHeader::CHECKSUM_SIZE)), -EOF -$ make -C src/ bitcoind -$ mkdir -p inputs/ -$ honggfuzz/honggfuzz --exit_upon_crash --quiet --timeout 4 -n 1 -Q \ - -E HFND_TCP_PORT=18444 -f inputs/ -- \ - src/bitcoind -regtest -discover=0 -dns=0 -dnsseed=0 -listenonion=0 \ - -nodebuglogfile -bind=127.0.0.1:18444 -logthreadnames \ - -debug -``` - -# Fuzzing Bitcoin Core using Eclipser (v1.x) - -## Quickstart guide - -To quickly get started fuzzing Bitcoin Core using [Eclipser v1.x](https://github.com/SoftSec-KAIST/Eclipser/tree/v1.x): - -```sh -$ git clone https://github.com/bitcoin/bitcoin -$ cd bitcoin/ -$ sudo vim /etc/apt/sources.list # Uncomment the lines starting with 'deb-src'. -$ sudo apt-get update -$ sudo apt-get build-dep qemu -$ sudo apt-get install libtool libtool-bin wget automake autoconf bison gdb -``` - -At this point, you must install the .NET core. The process differs, depending on your Linux distribution. -See [this link](https://learn.microsoft.com/en-us/dotnet/core/install/linux) for details. -On Ubuntu 20.04, the following should work: - -```sh -$ wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -$ sudo dpkg -i packages-microsoft-prod.deb -$ rm packages-microsoft-prod.deb -$ sudo apt-get update -$ sudo apt-get install -y dotnet-sdk-2.1 -``` - -You will also want to make sure Python is installed as `python` for the Eclipser install to succeed. - -```sh -$ git clone https://github.com/SoftSec-KAIST/Eclipser.git -$ cd Eclipser -$ git checkout v1.x -$ make -$ cd .. -$ ./autogen.sh -$ ./configure --enable-fuzz -$ make -$ mkdir -p outputs/ -$ FUZZ=bech32 dotnet Eclipser/build/Eclipser.dll fuzz -p src/test/fuzz/fuzz -t 36000 -o outputs --src stdin -``` - -This will perform 10 hours of fuzzing. - -To make further use of the inputs generated by Eclipser, you -must first decode them: - -```sh -$ dotnet Eclipser/build/Eclipser.dll decode -i outputs/testcase -o decoded_outputs -``` -This will place raw inputs in the directory `decoded_outputs/decoded_stdins`. Crashes are in the `outputs/crashes` directory, and must -be decoded in the same way. - -Fuzzing with Eclipser will likely be much more effective if using an existing corpus: - -```sh -$ git clone https://github.com/bitcoin-core/qa-assets -$ FUZZ=bech32 dotnet Eclipser/build/Eclipser.dll fuzz -p src/test/fuzz/fuzz -t 36000 -i qa-assets/fuzz_seed_corpus/bech32 outputs --src stdin -``` - -Note that fuzzing with Eclipser on certain targets (those that create 'full nodes', e.g. `process_message*`) will, -for now, slowly fill `/tmp/` with improperly cleaned-up files, which will cause spurious crashes. -See [this proposed patch](https://github.com/bitcoin/bitcoin/pull/22472) for more information. - -Read the [Eclipser documentation for v1.x](https://github.com/SoftSec-KAIST/Eclipser/tree/v1.x) for more details on using Eclipser. - - # OSS-Fuzz Bitcoin Core participates in Google's [OSS-Fuzz](https://github.com/google/oss-fuzz/tree/master/projects/bitcoin-core) -program, which includes a dashboard of [publicly disclosed vulnerabilities](https://bugs.chromium.org/p/oss-fuzz/issues/list?q=bitcoin-core). -Generally, we try to disclose vulnerabilities as soon as possible after they -are fixed to give users the knowledge they need to be protected. However, -because Bitcoin is a live P2P network, and not just standalone local software, -we might not fully disclose every issue within Google's standard +program, which includes a dashboard of [publicly disclosed vulnerabilities](https://issues.oss-fuzz.com/issues?q=bitcoin-core%20status:open). + +Bitcoin Core follows its [security disclosure policy](https://bitcoincore.org/en/security-advisories/), +which may differ from Google's standard [90-day disclosure window](https://google.github.io/oss-fuzz/getting-started/bug-disclosure-guidelines/) -if a partial or delayed disclosure is important to protect users or the -function of the network. +. OSS-Fuzz also produces [a fuzzing coverage report](https://oss-fuzz.com/coverage-report/job/libfuzzer_asan_bitcoin-core/latest). diff --git a/doc/i2p.md b/doc/i2p.md index b6c07388b7..b769a74df4 100644 --- a/doc/i2p.md +++ b/doc/i2p.md @@ -79,8 +79,8 @@ one of the networks has issues. ## Persistent vs transient I2P addresses The first time Bitcoin Core connects to the I2P router, it automatically -generates a persistent I2P address and its corresponding private key by default -or if `-i2pacceptincoming=1` is set. The private key is saved in a file named +generates a persistent I2P address and its corresponding private key by default, +unless `-i2pacceptincoming=0` is set. The private key is saved in a file named `i2p_private_key` in the Bitcoin Core data directory. The persistent I2P address is used for making outbound connections and accepting inbound connections. diff --git a/doc/init.md b/doc/init.md index 7f79027718..b570fed22c 100644 --- a/doc/init.md +++ b/doc/init.md @@ -35,16 +35,18 @@ it will use a special cookie file for authentication. The cookie is generated wi content when the daemon starts, and deleted when it exits. Read access to this file controls who can access it through RPC. -By default the cookie is stored in the data directory, but it's location can be overridden -with the option '-rpccookiefile'. +By default the cookie is stored in the data directory, but its location can be +overridden with the option `-rpccookiefile`. Default file permissions for the +cookie are "owner" (i.e. user read/writeable) via default application-wide file +umask of `0077`, but these can be overridden with the `-rpccookieperms` option. This allows for running bitcoind without having to do any manual configuration. `conf`, `pid`, and `wallet` accept relative paths which are interpreted as relative to the data directory. `wallet` *only* supports relative paths. -For an example configuration file that describes the configuration settings, -see `share/examples/bitcoin.conf`. +To generate an example configuration file that describes the configuration settings, +see [contrib/devtools/README.md](../contrib/devtools/README.md#gen-bitcoin-confsh). Paths --------------------------------- diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am deleted file mode 100644 index 8f890da532..0000000000 --- a/doc/man/Makefile.am +++ /dev/null @@ -1,27 +0,0 @@ -dist_man1_MANS= - -if BUILD_BITCOIND - dist_man1_MANS+=bitcoind.1 -endif - -if ENABLE_QT - dist_man1_MANS+=bitcoin-qt.1 -endif - -if BUILD_BITCOIN_CLI - dist_man1_MANS+=bitcoin-cli.1 -endif - -if BUILD_BITCOIN_TX - dist_man1_MANS+=bitcoin-tx.1 -endif - -if BUILD_BITCOIN_UTIL - dist_man1_MANS+=bitcoin-util.1 -endif - -if ENABLE_WALLET -if BUILD_BITCOIN_WALLET - dist_man1_MANS+=bitcoin-wallet.1 -endif -endif diff --git a/doc/managing-wallets.md b/doc/managing-wallets.md index 22e006c963..0e052bd8db 100644 --- a/doc/managing-wallets.md +++ b/doc/managing-wallets.md @@ -15,12 +15,14 @@ The following command, for example, creates a descriptor wallet. More informatio $ bitcoin-cli createwallet "wallet-01" ``` +`bitcoin rpc` can also be substituted for `bitcoin-cli`. + By default, wallets are created in the `wallets` folder of the data directory, which varies by operating system, as shown below. The user can change the default by using the `-datadir` or `-walletdir` initialization parameters. | Operating System | Default wallet directory | | -----------------|:------------------------------------------------------------| | Linux | `/home//.bitcoin/wallets` | -| Windows | `C:\Users\\AppData\Roaming\Bitcoin\wallets` | +| Windows | `C:\Users\\AppData\Local\Bitcoin\wallets` | | macOS | `/Users//Library/Application Support/Bitcoin/wallets` | ### 1.2 Encrypting the Wallet @@ -82,7 +84,7 @@ In the GUI, there is no specific menu item to unlock the wallet. When the user s To backup the wallet, the `backupwallet` RPC or the `Backup Wallet` GUI menu item must be used to ensure the file is in a safe state when the copy is made. -In the RPC, the destination parameter must include the name of the file. Otherwise, the command will return an error message like "Error: Wallet backup failed!" for descriptor wallets. If it is a legacy wallet, it will be copied and a file will be created with the default file name `wallet.dat`. +In the RPC, the destination parameter must include the name of the file. Otherwise, the command will return an error message like "Error: Wallet backup failed!". ``` $ bitcoin-cli -rpcwallet="wallet-01" backupwallet /home/node01/Backups/backup-01.dat @@ -122,6 +124,22 @@ $ bitcoin-cli -rpcwallet="restored-wallet" getwalletinfo The restored wallet can also be loaded in the GUI via `File` ->`Open wallet`. +## Wallet Passphrase + +Understanding wallet security is crucial for safely storing your Bitcoin. A key aspect is the wallet passphrase, used for encryption. Let's explore its nuances, role, encryption process, and limitations. + +- **Not the Seed:** +The wallet passphrase and the seed are two separate components in wallet security. The seed, or HD seed, functions as a master key for deriving private and public keys in a hierarchical deterministic (HD) wallet. In contrast, the passphrase serves as an additional layer of security specifically designed to secure the private keys within the wallet. The passphrase serves as a safeguard, demanding an additional layer of authentication to access funds in the wallet. + +- **Protection Against Unauthorized Access:** +The passphrase serves as a protective measure, securing your funds in situations where an unauthorized user gains access to your unlocked computer or device while your wallet application is active. Without the passphrase, they would be unable to access your wallet's funds or execute transactions. However, it's essential to be aware that someone with access can potentially compromise the security of your passphrase by installing a keylogger. + +- **Doesn't Encrypt Metadata or Public Keys:** +It's important to note that the passphrase primarily secures the private keys and access to funds within the wallet. It does not encrypt metadata associated with transactions or public keys. Information about your transaction history and the public keys involved may still be visible. + +- **Risk of Fund Loss if Forgotten or Lost:** +If the wallet passphrase is too complex and is subsequently forgotten or lost, there is a risk of losing access to the funds permanently. A forgotten passphrase will result in the inability to unlock the wallet and access the funds. + ## Migrating Legacy Wallets to Descriptor Wallets Legacy wallets (traditional non-descriptor wallets) can be migrated to become Descriptor wallets diff --git a/doc/multiprocess.md b/doc/multiprocess.md new file mode 100644 index 0000000000..5a91b513de --- /dev/null +++ b/doc/multiprocess.md @@ -0,0 +1,51 @@ +# Multiprocess Bitcoin + +_This document describes usage of the multiprocess feature. For design information, see the [design/multiprocess.md](design/multiprocess.md) file._ + +## Build Option + +On Unix systems, the `-DENABLE_IPC=ON` build option can be passed to build the supplemental `bitcoin-node` and `bitcoin-gui` multiprocess executables. + +## Debugging + +The `-debug=ipc` command line option can be used to see requests and responses between processes. + +## Installation + +Specifying `-DENABLE_IPC=ON` requires [Cap'n Proto](https://capnproto.org/) to be installed. See [build-unix.md](build-unix.md) and [build-osx.md](build-osx.md) for information about installing dependencies. + +### Depends installation + +Alternately the [depends system](../depends) can be used to avoid need to install local dependencies. A simple way to get started is to pass the `MULTIPROCESS=1` [dependency option](../depends#dependency-options) to make: + +``` +cd +make -C depends NO_QT=1 MULTIPROCESS=1 +# Set host platform to output of gcc -dumpmachine or clang -dumpmachine or check the depends/ directory for the generated subdirectory name +HOST_PLATFORM="x86_64-pc-linux-gnu" +cmake -B build --toolchain=depends/$HOST_PLATFORM/toolchain.cmake +cmake --build build +build/bin/bitcoin -m node -regtest -printtoconsole -debug=ipc +BITCOIN_CMD="bitcoin -m" build/test/functional/test_runner.py +``` + +The `cmake` build will pick up settings and library locations from the depends directory, so there is no need to pass `-DENABLE_IPC=ON` as a separate flag when using the depends system (it's controlled by the `MULTIPROCESS=1` option). + +### Cross-compiling + +When cross-compiling and not using depends, native code generation tools from [libmultiprocess](https://github.com/bitcoin-core/libmultiprocess) and [Cap'n Proto](https://capnproto.org/) are required. They can be passed to the cmake build by specifying `-DMPGEN_EXECUTABLE=/path/to/mpgen -DCAPNP_EXECUTABLE=/path/to/capnp -DCAPNPC_CXX_EXECUTABLE=/path/to/capnpc-c++` options. + +### External libmultiprocess installation + +By default when `-DENABLE_IPC=ON` is enabled, the libmultiprocess sources at [../src/ipc/libmultiprocess/](../src/ipc/libmultiprocess/) are built as part of the bitcoin cmake build, but alternately an external [libmultiprocess](https://github.com/bitcoin-core/libmultiprocess/) cmake package can be used instead by following its [installation instructions](https://github.com/bitcoin-core/libmultiprocess/blob/master/doc/install.md) and specifying `-DWITH_EXTERNAL_LIBMULTIPROCESS=ON` to the bitcoin build, so it will use the external package instead of the sources. This can be useful when making changes to the upstream project. If libmultiprocess is not installed in a default system location it is possible to specify the [`CMAKE_PREFIX_PATH`](https://cmake.org/cmake/help/latest/envvar/CMAKE_PREFIX_PATH.html) environment variable to point to the installation prefix where libmultiprocess is installed. + +## Usage + +Recommended way to use multiprocess binaries is to invoke `bitcoin` CLI like `bitcoin -m node -debug=ipc` or `bitcoin -m gui -printtoconsole -debug=ipc`. + +When the `-m` (`--multiprocess`) option is used the `bitcoin` command will execute multiprocess binaries instead of monolithic ones (`bitcoin-node` instead of `bitcoind`, and `bitcoin-gui` instead of `bitcoin-qt`). The multiprocess binaries can also be invoked directly, but this is not recommended as they may change or be renamed in the future, and they are not installed in the PATH. + +The multiprocess binaries currently function the same as the monolithic binaries, except they support an `-ipcbind` option. + +In the future, after [#10102](https://github.com/bitcoin/bitcoin/pull/10102) they will have other differences. Specifically `bitcoin-gui` will spawn a `bitcoin-node` process to run P2P and RPC code, communicating with it across a socket pair, and `bitcoin-node` will spawn `bitcoin-wallet` to run wallet code, also communicating over a socket pair. This will let node, wallet, and GUI code run in separate address spaces for better isolation, and allow future improvements like being able to start and stop components independently on different machines and environments. [#19460](https://github.com/bitcoin/bitcoin/pull/19460) also adds a new `bitcoin-wallet -ipcconnect` option to allow new wallet processes to connect to an existing node process. +And [#19461](https://github.com/bitcoin/bitcoin/pull/19461) adds a new `bitcoin-gui -ipcconnect` option to allow new GUI processes to connect to an existing node process. diff --git a/doc/multisig-tutorial.md b/doc/multisig-tutorial.md index 1d2b3244bc..0c39bc6c9c 100644 --- a/doc/multisig-tutorial.md +++ b/doc/multisig-tutorial.md @@ -9,15 +9,13 @@ This tutorial uses [jq](https://github.com/stedolan/jq) JSON processor to proces Before starting this tutorial, start the bitcoin node on the signet network. ```bash -./src/bitcoind -signet -daemon +./build/bin/bitcoind -signet -daemon ``` This tutorial also uses the default WPKH derivation path to get the xpubs and does not conform to [BIP 45](https://github.com/bitcoin/bips/blob/master/bip-0045.mediawiki) or [BIP 87](https://github.com/bitcoin/bips/blob/master/bip-0087.mediawiki). At the time of writing, there is no way to extract a specific path from wallets in Bitcoin Core. For this, an external signer/xpub can be used. -[PR #22341](https://github.com/bitcoin/bitcoin/pull/22341), which is still under development, introduces a new wallet RPC `getxpub`. It takes a BIP32 path as an argument and returns the xpub, along with the master key fingerprint. - ## 1.1 Basic Multisig Workflow ### 1.1 Create the Descriptor Wallets @@ -29,10 +27,12 @@ These three wallets should not be used directly for privacy reasons (public key ```bash for ((n=1;n<=3;n++)) do - ./src/bitcoin-cli -signet createwallet "participant_${n}" + ./build/bin/bitcoin-cli -signet createwallet "participant_${n}" done ``` +`bitcoin rpc` can also be substituted for `bitcoin-cli`. + Extract the xpub of each wallet. To do this, the `listdescriptors` RPC is used. By default, Bitcoin Core single-sig wallets are created using path `m/44'/1'/0'` for PKH, `m/84'/1'/0'` for WPKH, `m/49'/1'/0'` for P2WPKH-nested-in-P2SH and `m/86'/1'/0'` for P2TR based accounts. Each of them uses the chain 0 for external addresses and chain 1 for internal ones, as shown in the example below. ``` @@ -49,9 +49,9 @@ declare -A xpubs for ((n=1;n<=3;n++)) do - xpubs["internal_xpub_${n}"]=$(./src/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/1/*"))][0] | .desc' | grep -Po '(?<=\().*(?=\))') + xpubs["internal_xpub_${n}"]=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/1/*"))][0] | .desc' | grep -Po '(?<=\().*(?=\))') - xpubs["external_xpub_${n}"]=$(./src/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/0/*") )][0] | .desc' | grep -Po '(?<=\().*(?=\))') + xpubs["external_xpub_${n}"]=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_${n}" listdescriptors | jq '.descriptors | [.[] | select(.desc | startswith("wpkh") and contains("/0/*") )][0] | .desc' | grep -Po '(?<=\().*(?=\))') done ``` @@ -73,8 +73,8 @@ Define the external and internal multisig descriptors, add the checksum and then external_desc="wsh(sortedmulti(2,${xpubs["external_xpub_1"]},${xpubs["external_xpub_2"]},${xpubs["external_xpub_3"]}))" internal_desc="wsh(sortedmulti(2,${xpubs["internal_xpub_1"]},${xpubs["internal_xpub_2"]},${xpubs["internal_xpub_3"]}))" -external_desc_sum=$(./src/bitcoin-cli -signet getdescriptorinfo $external_desc | jq '.descriptor') -internal_desc_sum=$(./src/bitcoin-cli -signet getdescriptorinfo $internal_desc | jq '.descriptor') +external_desc_sum=$(./build/bin/bitcoin-cli -signet getdescriptorinfo $external_desc | jq '.descriptor') +internal_desc_sum=$(./build/bin/bitcoin-cli -signet getdescriptorinfo $internal_desc | jq '.descriptor') multisig_ext_desc="{\"desc\": $external_desc_sum, \"active\": true, \"internal\": false, \"timestamp\": \"now\"}" multisig_int_desc="{\"desc\": $internal_desc_sum, \"active\": true, \"internal\": true, \"timestamp\": \"now\"}" @@ -84,7 +84,7 @@ multisig_desc="[$multisig_ext_desc, $multisig_int_desc]" `external_desc` and `internal_desc` specify the output type (`wsh`, in this case) and the xpubs involved. They also use BIP 67 (`sortedmulti`), so the wallet can be recreated without worrying about the order of xpubs. Conceptually, descriptors describe a list of scriptPubKey (along with information for spending from it) [[source](https://github.com/bitcoin/bitcoin/issues/21199#issuecomment-780772418)]. -Note that at least two descriptors are usually used, one for internal derivation paths and external ones. There are discussions about eliminating this redundancy, as can been seen in the issue [#17190](https://github.com/bitcoin/bitcoin/issues/17190). +Note that at least two descriptors are usually used, one for internal derivation paths and one for external ones. There are discussions about eliminating this redundancy, as can be seen in the issue [#17190](https://github.com/bitcoin/bitcoin/issues/17190). After creating the descriptors, it is necessary to add the checksum, which is required by the `importdescriptors` RPC. @@ -96,7 +96,7 @@ There are other fields that can be added to the descriptors: * `internal`: Indicates whether matching outputs should be treated as something other than incoming payments (e.g. change). * `timestamp`: Sets the time from which to start rescanning the blockchain for the descriptor, in UNIX epoch time. -Documentation for these and other parameters can be found by typing `./src/bitcoin-cli help importdescriptors`. +Documentation for these and other parameters can be found by typing `./build/bin/bitcoin-cli help importdescriptors`. `multisig_desc` concatenates external and internal descriptors in a JSON array and then it will be used to create the multisig wallet. @@ -109,17 +109,17 @@ Then import the descriptors created in the previous step using the `importdescri After that, `getwalletinfo` can be used to check if the wallet was created successfully. ```bash -./src/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true +./build/bin/bitcoin-cli -signet -named createwallet wallet_name="multisig_wallet_01" disable_private_keys=true blank=true -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc" +./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" importdescriptors "$multisig_desc" -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getwalletinfo +./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getwalletinfo ``` Once the wallets have already been created and this tutorial needs to be repeated or resumed, it is not necessary to recreate them, just load them with the command below: ```bash -for ((n=1;n<=3;n++)); do ./src/bitcoin-cli -signet loadwallet "participant_${n}"; done +for ((n=1;n<=3;n++)); do ./build/bin/bitcoin-cli -signet loadwallet "participant_${n}"; done ``` ### 1.4 Fund the wallet @@ -133,9 +133,9 @@ The url used by the script can also be accessed directly. At time of writing, th Coins received by the wallet must have at least 1 confirmation before they can be spent. It is necessary to wait for a new block to be mined before continuing. ```bash -receiving_address=$(./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress) +receiving_address=$(./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getnewaddress) -./contrib/signet/getcoins.py -c ./src/bitcoin-cli -a $receiving_address +./contrib/signet/getcoins.py -c ./build/bin/bitcoin-cli -a $receiving_address ``` To copy the receiving address onto the clipboard, use the following command. This can be useful when getting coins via the signet faucet mentioned above. @@ -147,7 +147,7 @@ echo -n "$receiving_address" | xclip -sel clip The `getbalances` RPC may be used to check the balance. Coins with `trusted` status can be spent. ```bash -./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalances +./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalances ``` ### 1.5 Create a PSBT @@ -163,13 +163,13 @@ For simplicity, the destination address is taken from the `participant_1` wallet The `walletcreatefundedpsbt` RPC is used to create and fund a transaction in the PSBT format. It is the first step in creating the PSBT. ```bash -balance=$(./src/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance) +balance=$(./build/bin/bitcoin-cli -signet -rpcwallet="multisig_wallet_01" getbalance) amount=$(echo "$balance * 0.8" | bc -l | sed -e 's/^\./0./' -e 's/^-\./-0./') -destination_addr=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress) +destination_addr=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" getnewaddress) -funded_psbt=$(./src/bitcoin-cli -signet -named -rpcwallet="multisig_wallet_01" walletcreatefundedpsbt outputs="{\"$destination_addr\": $amount}" | jq -r '.psbt') +funded_psbt=$(./build/bin/bitcoin-cli -signet -named -rpcwallet="multisig_wallet_01" walletcreatefundedpsbt outputs="{\"$destination_addr\": $amount}" | jq -r '.psbt') ``` There is also the `createpsbt` RPC, which serves the same purpose, but it has no access to the wallet or to the UTXO set. It is functionally the same as `createrawtransaction` and just drops the raw transaction into an otherwise blank PSBT. [[source](https://bitcointalk.org/index.php?topic=5131043.msg50573609#msg50573609)] In most cases, `walletcreatefundedpsbt` solves the problem. @@ -183,9 +183,9 @@ Optionally, the PSBT can be decoded to a JSON format using `decodepsbt` RPC. The `analyzepsbt` RPC analyzes and provides information about the current status of a PSBT and its inputs, e.g. missing signatures. ```bash -./src/bitcoin-cli -signet decodepsbt $funded_psbt +./build/bin/bitcoin-cli -signet decodepsbt $funded_psbt -./src/bitcoin-cli -signet analyzepsbt $funded_psbt +./build/bin/bitcoin-cli -signet analyzepsbt $funded_psbt ``` ### 1.7 Update the PSBT @@ -195,9 +195,9 @@ In the code above, two PSBTs are created. One signed by `participant_1` wallet a The `walletprocesspsbt` is used by the wallet to sign a PSBT. ```bash -psbt_1=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt') +psbt_1=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq '.psbt') -psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt') +psbt_2=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $funded_psbt | jq '.psbt') ``` ### 1.8 Combine the PSBT @@ -205,7 +205,7 @@ psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt The PSBT, if signed separately by the co-signers, must be combined into one transaction before being finalized. This is done by `combinepsbt` RPC. ```bash -combined_psbt=$(./src/bitcoin-cli -signet combinepsbt "[$psbt_1, $psbt_2]") +combined_psbt=$(./build/bin/bitcoin-cli -signet combinepsbt "[$psbt_1, $psbt_2]") ``` There is an RPC called `joinpsbts`, but it has a different purpose than `combinepsbt`. `joinpsbts` joins the inputs from multiple distinct PSBTs into one PSBT. @@ -219,9 +219,9 @@ The `finalizepsbt` RPC is used to produce a network serialized transaction which It checks that all inputs have complete scriptSigs and scriptWitnesses and, if so, encodes them into network serialized transactions. ```bash -finalized_psbt_hex=$(./src/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex') +finalized_psbt_hex=$(./build/bin/bitcoin-cli -signet finalizepsbt $combined_psbt | jq -r '.hex') -./src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex +./build/bin/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex ``` ### 1.10 Alternative Workflow (PSBT sequential signatures) @@ -231,11 +231,11 @@ Instead of each wallet signing the original PSBT and combining them later, the w After that, the rest of the process is the same: the PSBT is finalized and transmitted to the network. ```bash -psbt_1=$(./src/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt') +psbt_1=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_1" walletprocesspsbt $funded_psbt | jq -r '.psbt') -psbt_2=$(./src/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt') +psbt_2=$(./build/bin/bitcoin-cli -signet -rpcwallet="participant_2" walletprocesspsbt $psbt_1 | jq -r '.psbt') -finalized_psbt_hex=$(./src/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex') +finalized_psbt_hex=$(./build/bin/bitcoin-cli -signet finalizepsbt $psbt_2 | jq -r '.hex') -./src/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex +./build/bin/bitcoin-cli -signet sendrawtransaction $finalized_psbt_hex ``` diff --git a/doc/offline-signing-tutorial.md b/doc/offline-signing-tutorial.md new file mode 100644 index 0000000000..2b21af2441 --- /dev/null +++ b/doc/offline-signing-tutorial.md @@ -0,0 +1,258 @@ +# Offline Signing Tutorial + +This tutorial will describe how to use two instances of Bitcoin Core, one online and one offline, to greatly increase security by not having private keys reside on a networked device. + +Maintaining an air-gap between private keys and any network connections drastically reduces the opportunity for those keys to be exfiltrated from the user. + +This workflow uses [Partially Signed Bitcoin Transactions](https://github.com/bitcoin/bitcoin/blob/master/doc/psbt.md) (PSBTs) to transfer the transaction to and from the offline wallet for signing using the private keys. + +> [!NOTE] +> While this tutorial demonstrates the process using `signet` network, you should omit the `-signet` flag in the provided commands when working with `mainnet`. + +## Overview +In this tutorial we have two hosts, both running Bitcoin v25.0 + +* `offline` host which is disconnected from all networks (internet, Tor, wifi, bluetooth etc.) and does not have, or need, a copy of the blockchain. +* `online` host which is a regular online node with a synced blockchain. + +We are going to first create an `offline_wallet` on the offline host. We will then create a `watch_only_wallet` on the online host using public key descriptors exported from the `offline_wallet`. Next we will receive some coins into the wallet. In order to spend these coins we'll create an unsigned PSBT using the `watch_only_wallet`, sign the PSBT using the private keys in the `offline_wallet`, and finally broadcast the signed PSBT using the online host. + +### Requirements +- [jq](https://jqlang.github.io/jq/) installation - This tutorial uses jq to process certain fields from JSON RPC responses, but this convenience is optional. + +### Create and Prepare the `offline_wallet` + +1. On the offline machine create a wallet named `offline_wallet` secured by a wallet `passphrase`. This wallet will contain private keys and must remain unconnected to any networks at all times. + +```sh +[offline]$ ./build/bin/bitcoin-cli -signet -named createwallet \ + wallet_name="offline_wallet" \ + passphrase="** enter passphrase **" + +{ + "name": "offline_wallet" +} +``` + +`bitcoin rpc` can also be substituted for `bitcoin-cli`. + +> [!NOTE] +> The use of a passphrase is crucial to encrypt the wallet.dat file. This encryption ensures that even if an unauthorized individual gains access to the offline host, they won't be able to access the wallet's contents. Further details about securing your wallet can be found in [Managing the Wallet](https://github.com/bitcoin/bitcoin/blob/master/doc/managing-wallets.md#12-encrypting-the-wallet) + +2. Export the public key-only descriptors from the offline host to a JSON file named `descriptors.json`. We use `jq` here to extract the `.descriptors` field from the full RPC response. + +```sh +[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" listdescriptors \ + | jq -r '.descriptors' \ + >> /path/to/descriptors.json +``` + +> [!NOTE] +> The `descriptors.json` file will be transferred to the online machine (e.g. using a USB flash drive) where it can be imported to create a related watch-only wallet. + +### Create the online `watch_only_wallet` + +1. On the online machine create a blank watch-only wallet which has private keys disabled and is named `watch_only_wallet`. This is achieved by using the `createwallet` options: `disable_private_keys=true, blank=true`. + +The `watch_only_wallet` wallet will be used to track and validate incoming transactions, create unsigned PSBTs when spending coins, and broadcast signed and finalized PSBTs. + +> [!NOTE] +> `disable_private_keys` indicates that the wallet should refuse to import private keys, i.e. will be a dedicated watch-only wallet. + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -named createwallet \ + wallet_name="watch_only_wallet" \ + disable_private_keys=true \ + blank=true + +{ + "name": "watch_only_wallet" +} +``` + +2. Import the `offline_wallet`s public key descriptors to the online `watch_only_wallet` using the `descriptors.json` file created on the offline wallet. + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" importdescriptors "$(cat /path/to/descriptors.json)" + +[ + { + "success": true + }, + { + "success": true + }, + { + "success": true + }, + { + "success": true + }, + { + "success": true + }, + { + "success": true + }, + { + "success": true + }, + { + "success": true + } +] +``` +> [!NOTE] +> Multiple success values indicate that multiple descriptors, for different address types, have been successfully imported. This allows generating different address types on the `watch_only_wallet`. + +### Fund the `offline_wallet` + +At this point, it's important to understand that both the `offline_wallet` and online `watch_only_wallet` share the same public keys. As a result, they generate the same addresses. Transactions can be created using either wallet, but valid signatures can only be added by the `offline_wallet` as only it has the private keys. + +1. Generate an address to receive coins. You can use _either_ the `offline_wallet` or the online `watch_only_wallet` to generate this address, as they will produce the same addresses. For the sake of this guide, we'll use the online `watch_only_wallet` to generate the address. + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getnewaddress + +tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh +``` + +2. Visit a faucet like https://signetfaucet.com and enter your address from the previous command to receive a small amount of signet coins to this address. + +3. Confirm that coins were received using the online `watch_only_wallet`. Note that the transaction may take a few moments before being received on your local node, depending on its connectivity. Just re-run the command periodically until the transaction is received. + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listunspent + +[ + { + "txid": "0f3953dfc3eb8e753cd1633151837c5b9953992914ff32b7de08c47f1f29c762", + "vout": 1, + "address": "tb1qtu5qgc6ddhmqm5yqjvhg83qgk2t4ewajg0h6yh", + "label": "", + "scriptPubKey": "00145f2804634d6df60dd080932e83c408b2975cbbb2", + "amount": 0.01000000, + "confirmations": 4, + "spendable": true, + "solvable": true, + "desc": "wpkh([306c734f/84h/1h/0h/0/0]025932ccee7590158f7e08bb36290d135d30a0b045163da896e1cd7645ec4223a9)#xytvyr4a", + "parent_descs": [ + "wpkh([306c734f/84h/1h/0h]tpubDCJnY92ib4Zu3qd6wrBXEjG436tQdA2tDiJU2iSJYjkNS1darssPWKaBfojhjUF5vMLBcxbN2r93pmFMz2zyTEZuNx9JDo9rWqoHhATW3Uz/0/*)#7mh08dkg" + ], + "safe": true + } +] +``` + +### Create and Export an Unsigned PSBT + +1. Get a destination address for the transaction. In this tutorial we'll be sending funds to the address `tb1q9k5w0nhnhyeh78snpxh0t5t7c3lxdeg3erez32`, but if you don't need the coins for further testing you could send the coins back to the faucet. + +2. Create a funded but unsigned PSBT to the destination address with the online `watch_only_wallet` by using `send [{"address":amount},...]` and export the unsigned PSBT to a file `funded_psbt.txt` for easy portability to the `offline_wallet` for signing: + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" send \ + '{"tb1q9k5w0nhnhyeh78snpxh0t5t7c3lxdeg3erez32": 0.009}' \ + | jq -r '.psbt' \ + >> /path/to/funded_psbt.txt + +[online]$ cat /path/to/funded_psbt.txt + +cHNidP8BAHECAAAAAWLHKR9/xAjetzL/FCmZU5lbfINRMWPRPHWO68PfUzkPAQAAAAD9////AoA4AQAAAAAAFgAULajnzvO5M38eEwmu9dF+xH5m5RGs0g0AAAAAABYAFMaT0f/Wp2DCZzL6dkJ3GhWj4Y9vAAAAAAABAHECAAAAAY+dRPEBrGopkw4ugSzS9npzJDEIrE/bq1XXI0KbYnYrAQAAAAD+////ArKaXgAAAAAAFgAUwEc4LdoxSjbWo/2Ue+HS+QjwfiBAQg8AAAAAABYAFF8oBGNNbfYN0ICTLoPECLKXXLuyYW8CAAEBH0BCDwAAAAAAFgAUXygEY01t9g3QgJMug8QIspdcu7IiBgJZMszudZAVj34IuzYpDRNdMKCwRRY9qJbhzXZF7EIjqRgwbHNPVAAAgAEAAIAAAACAAAAAAAAAAAAAACICA7BlBnyAR4F2UkKuSX9MFhYCsn6j//z9i7lHDm1O0CU0GDBsc09UAACAAQAAgAAAAIABAAAAAAAAAAA= +``` +> [!NOTE] +> Leaving the `input` array empty in the above `walletcreatefundedpsbt` command is permitted and will cause the wallet to automatically select appropriate inputs for the transaction. + +### Decode and Analyze the Unsigned PSBT + +Decode and analyze the unsigned PSBT on the `offline_wallet` using the `funded_psbt.txt` file: + +```sh +[offline]$ ./build/bin/bitcoin-cli -signet decodepsbt $(cat /path/to/funded_psbt.txt) + +{ + ... +} + +[offline]$ ./build/bin/bitcoin-cli -signet analyzepsbt $(cat /path/to/funded_psbt.txt) + +{ + "inputs": [ + { + "has_utxo": true, + "is_final": false, + "next": "signer", + "missing": { + "signatures": [ + "5f2804634d6df60dd080932e83c408b2975cbbb2" + ] + } + } + ], + "estimated_vsize": 141, + "estimated_feerate": 0.00100000, + "fee": 0.00014100, + "next": "signer" +} +``` + +Notice that the analysis of the PSBT shows that "signatures" are missing and should be provided by the private key corresponding to the public key hash (hash160) "5f2804634d6df60dd080932e83c408b2975cbbb2" + +### Process and Sign the PSBT + +1. Unlock the `offline_wallet` with the Passphrase: + +Use the walletpassphrase command to unlock the `offline_wallet` with the passphrase. You should specify the passphrase and a timeout (in seconds) for how long you want the wallet to remain unlocked. + +```sh +[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" walletpassphrase "** enter passphrase **" 60 +``` + +2. Process, sign and finalize the PSBT on the `offline_wallet` using the `walletprocesspsbt` command, saving the output to a file `final_psbt.txt`. + + ```sh +[offline]$ ./build/bin/bitcoin-cli -signet -rpcwallet="offline_wallet" walletprocesspsbt \ + $(cat /path/to/funded_psbt.txt) \ + | jq -r .hex \ + >> /path/to/final_psbt.txt + ``` + +### Broadcast the Signed and Finalized PSBT +Broadcast the funded, signed and finalized PSBT `final_psbt.txt` using `sendrawtransaction` with an online node: + +```sh +[online]$ ./build/bin/bitcoin-cli -signet sendrawtransaction $(cat /path/to/final_psbt.txt) + +c2430a0e46df472b04b0ca887bbcd5c4abf7b2ce2eb71de981444a80e2b96d52 +``` + +### Confirm Wallet Balance + +Confirm the updated balance of the offline wallet using the `watch_only_wallet`. + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" getbalances + +{ + "mine": { + "trusted": 0.00085900, + "untrusted_pending": 0.00000000, + "immature": 0.00000000 + }, + "lastprocessedblock": { + "hash": "0000003065c0669fff27edb4a71928cb48e5a6cfcdf06f491a83fd86822d18a6", + "height": 159592 + } +} +``` + + +You can also show transactions related to the wallet using `listtransactions` + +```sh +[online]$ ./build/bin/bitcoin-cli -signet -rpcwallet="watch_only_wallet" listtransactions + +{ + ... +} +``` diff --git a/doc/policy/README.md b/doc/policy/README.md index 27536407e7..4392ffb610 100644 --- a/doc/policy/README.md +++ b/doc/policy/README.md @@ -2,8 +2,8 @@ **Policy** (Mempool or Transaction Relay Policy) is the node's set of validation rules, in addition to consensus, enforced for unconfirmed transactions before submitting them to the mempool. These -rules are local to the node and configurable (e.g. `-minrelaytxfee`, `-limitancestorsize`, -`-incrementalrelayfee`). Policy may include restrictions on the transaction itself, the transaction +rules are local to the node and configurable, see "Node relay options" when running `-help`. +Policy may include restrictions on the transaction itself, the transaction in relation to the current chain tip, and the transaction in relation to the node's mempool contents. Policy is *not* applied to transactions in blocks. diff --git a/doc/policy/mempool-replacements.md b/doc/policy/mempool-replacements.md index b3c4239b73..eb370672e4 100644 --- a/doc/policy/mempool-replacements.md +++ b/doc/policy/mempool-replacements.md @@ -10,13 +10,7 @@ A transaction ("replacement transaction") may replace its directly conflicting t their in-mempool descendants (together, "original transactions") if, in addition to passing all other consensus and policy rules, each of the following conditions are met: -1. The directly conflicting transactions all signal replaceability explicitly. A transaction is - signaling replaceability if any of its inputs have an nSequence number less than (0xffffffff - 1). - - *Rationale*: See [BIP125 - explanation](https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki#motivation). - Use the (`-mempoolfullrbf`) configuration option to allow transaction replacement without enforcement of the - opt-in signaling rule. +1. (Removed) 2. The replacement transaction only include an unconfirmed input if that input was included in one of the directly conflicting transactions. An unconfirmed input spends an output from a @@ -79,3 +73,7 @@ This set of rules is similar but distinct from BIP125. * Full replace-by-fee enabled as a configurable mempool policy as of **v24.0** ([PR #25353](https://github.com/bitcoin/bitcoin/pull/25353)). + +* Full replace-by-fee is the default policy as of **v28.0** ([PR #30493](https://github.com/bitcoin/bitcoin/pull/30493)). + +* Signaling for replace-by-fee is no longer required as of [PR 30592](https://github.com/bitcoin/bitcoin/pull/30592). diff --git a/doc/policy/packages.md b/doc/policy/packages.md index 2a5758318a..febdbbf13c 100644 --- a/doc/policy/packages.md +++ b/doc/policy/packages.md @@ -18,25 +18,45 @@ tip or some preceding transaction in the package. The following rules are enforced for all packages: -* Packages cannot exceed `MAX_PACKAGE_COUNT=25` count and `MAX_PACKAGE_SIZE=101KvB` total size +* Packages cannot exceed `MAX_PACKAGE_COUNT=25` count and `MAX_PACKAGE_WEIGHT=404000` total weight (#20833) - - *Rationale*: This is already enforced as mempool ancestor/descendant limits. If - transactions in a package are all related, exceeding this limit would mean that the package - can either be split up or it wouldn't pass individual mempool policy. + - *Rationale*: We want package size to be as small as possible to mitigate DoS via package + validation. However, we want to make sure that the limit does not restrict ancestor + packages that would be allowed if submitted individually. - Note that, if these mempool limits change, package limits should be reconsidered. Users may also configure their mempool limits differently. + - Note that this is transaction weight, not "virtual" size as with other limits to allow + simpler context-less checks. + * Packages must be topologically sorted. (#20833) * Packages cannot have conflicting transactions, i.e. no two transactions in a package can spend the same inputs. Packages cannot have duplicate transactions. (#20833) -* No transaction in a package can conflict with a mempool transaction. Replace By Fee is - currently disabled for packages. (#20833) +* Only limited package replacements are currently considered. (#28984) + + - Packages are 1-parent-1-child, with no in-mempool ancestors of the package. + + - All conflicting clusters (connected components of mempool transactions) must be clusters of up to size 2. + + - No more than MAX_REPLACEMENT_CANDIDATES transactions can be replaced, analogous to + regular [replacement rule](./mempool-replacements.md) 5). + + - Replacements must pay more total fees at the incremental relay fee (analogous to + regular [replacement rules](./mempool-replacements.md) 3 and 4). - - Package RBF may be enabled in the future. + - Parent feerate must be lower than package feerate. + + - Must improve [feerate diagram](https://delvingbitcoin.org/t/mempool-incentive-compatibility/553). (#29242) + + - *Rationale*: Basic support for package RBF can be used by wallets + by making chains of no longer than two, then directly conflicting + those chains when needed. Combined with TRUC transactions this can + result in more robust fee bumping. More general package RBF may be + enabled in the future. * When packages are evaluated against ancestor/descendant limits, the union of all transactions' descendants and ancestors is considered. (#21800) @@ -45,11 +65,16 @@ The following rules are enforced for all packages: heavily connected, i.e. some transaction in the package is the ancestor or descendant of all the other transactions. -The following rules are only enforced for packages to be submitted to the mempool (not enforced for -test accepts): +* [CPFP Carve Out](./mempool-limits.md#CPFP-Carve-Out) is disabled in packaged contexts. (#21800) + + - *Rationale*: This carve out cannot be accurately applied when there are multiple transactions' + ancestors and descendants being considered at the same time. + +The following rules are only enforced for packages to be submitted to the mempool (not +enforced for test accepts): * Packages must be child-with-unconfirmed-parents packages. This also means packages must contain at - least 2 transactions. (#22674) + least 1 transaction. (#31096) - *Rationale*: This allows for fee-bumping by CPFP. Allowing multiple parents makes it possible to fee-bump a batch of transactions. Restricting packages to a defined topology is easier to diff --git a/doc/productivity.md b/doc/productivity.md index e9b7bc270c..022f89259b 100644 --- a/doc/productivity.md +++ b/doc/productivity.md @@ -6,8 +6,8 @@ Table of Contents * [General](#general) * [Cache compilations with `ccache`](#cache-compilations-with-ccache) - * [Disable features with `./configure`](#disable-features-with-configure) - * [Make use of your threads with `make -j`](#make-use-of-your-threads-with-make--j) + * [Disable features when generating the build system](#disable-features-when-generating-the-build-system) + * [Make use of your threads with `-j`](#make-use-of-your-threads-with--j) * [Only build what you need](#only-build-what-you-need) * [Compile on multiple machines](#compile-on-multiple-machines) * [Multiple working directories with `git worktrees`](#multiple-working-directories-with-git-worktrees) @@ -31,9 +31,9 @@ The easiest way to faster compile times is to cache compiles. `ccache` is a way > ccache is a compiler cache. It speeds up recompilation by caching the result of previous compilations and detecting when the same compilation is being done again. Supported languages are C, C++, Objective-C and Objective-C++. -Install `ccache` through your distribution's package manager, and run `./configure` with your normal flags to pick it up. +Install `ccache` through your distribution's package manager, and run `cmake -B build` with your normal configuration options to pick it up. -To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.samba.org/manual/latest.html#_run_modes) to set it up. +To use ccache for all your C/C++ projects, follow the symlinks method [here](https://ccache.dev/manual/latest.html#_run_modes) to set it up. To get the most out of ccache, put something like this in `~/.ccache/ccache.conf`: @@ -46,38 +46,30 @@ Note: base_dir is required for ccache to share cached compiles of the same file You _must not_ set base_dir to "/", or anywhere that contains system headers (according to the ccache docs). -### Disable features with `./configure` +### Disable features when generating the build system -After running `./autogen.sh`, which generates the `./configure` file, use `./configure --help` to identify features that you can disable to save on compilation time. A few common flags: +During the generation of the build system only essential build options are enabled by default to save on compilation time. -```sh ---without-miniupnpc ---without-natpmp ---disable-bench ---disable-wallet ---without-gui -``` - -If you do need the wallet enabled, it is common for devs to add `--with-incompatible-bdb`. This uses your system bdb version for the wallet, so you don't have to find a copy of bdb 4.8. Wallets from such a build will be incompatible with any release binary (and vice versa), so use with caution on mainnet. +Run `cmake -B build -LH` to see the full list of available options. GUI tools, such as `ccmake` and `cmake-gui`, can be also helpful. -### Make use of your threads with `make -j` +### Make use of your threads with `-j` -If you have multiple threads on your machine, you can tell `make` to utilize all of them with: +If you have multiple threads on your machine, you can utilize all of them with: ```sh -make -j"$(($(nproc)+1))" +cmake --build build -j "$(($(nproc)+1))" ``` ### Only build what you need -When rebuilding during development, note that running `make`, without giving a target, will do a lot of work you probably don't need. It will build the GUI (unless you've disabled it) and all the tests (which take much longer to build than the app does). +When rebuilding during development, note that running `cmake --build build`, without giving a target, will do a lot of work you probably don't need. It will build the GUI (if you've enabled it) and all the tests (which take much longer to build than the app does). Obviously, it is important to build and run the tests at appropriate times -- but when you just want a quick compile to check your work, consider picking one or a set of build targets relevant to what you're working on, e.g.: ```sh -make src/bitcoind src/bitcoin-cli -make src/qt/bitcoin-qt -make -C src bitcoin_bench +cmake --build build --target bitcoind bitcoin-cli +cmake --build build --target bitcoin-qt +cmake --build build --target bench_bitcoin ``` (You can and should combine this with `-j`, as above, for a parallel build.) @@ -110,9 +102,9 @@ To squash in `git commit --fixup` commits without rebasing over an updated maste git rebase -i --autosquash "$(git merge-base master HEAD)" ``` -To execute `make check` on every commit since last diverged from master, but without rebasing over an updated master, we can do the following: +To execute `cmake --build build && ctest --test-dir build` on every commit since last diverged from master, but without rebasing over an updated master, we can do the following: ```sh -git rebase -i --exec "make check" "$(git merge-base master HEAD)" +git rebase -i --exec "cmake --build build && ctest --test-dir build" "$(git merge-base master HEAD)" ``` ----- @@ -202,7 +194,7 @@ You can do: git range-diff master previously-reviewed-head new-head ``` -Note that `git range-diff` also work for rebases: +Note that `git range-diff` also works for rebases: ``` P1--P2--P3--P4--P5 <-- previously-reviewed-head diff --git a/doc/psbt.md b/doc/psbt.md index 0f31cb8eba..7a885701c8 100644 --- a/doc/psbt.md +++ b/doc/psbt.md @@ -67,6 +67,10 @@ hardware implementations will typically implement multiple roles simultaneously. input a PSBT, adds UTXO, key, and script data to inputs and outputs that miss it, and optionally signs inputs. Where possible it also finalizes the partial signatures. +- **`descriptorprocesspsbt` (Updater, Signer, Finalizer)** is a node RPC that takes + as input a PSBT and a list of descriptors. It updates SegWit inputs with + information available from the UTXO set and the mempool and signs the inputs using + the provided descriptors. Where possible it also finalizes the partial signatures. - **`utxoupdatepsbt` (Updater)** is a node RPC that takes a PSBT and updates it to include information available from the UTXO set (works only for SegWit inputs). @@ -93,54 +97,3 @@ hardware implementations will typically implement multiple roles simultaneously. #### Multisig with multiple Bitcoin Core instances For a quick start see [Basic M-of-N multisig example using descriptor wallets and PSBTs](./descriptors.md#basic-multisig-example). -If you are using legacy wallets feel free to continue with the example provided here. - -Alice, Bob, and Carol want to create a 2-of-3 multisig address. They're all using -Bitcoin Core. We assume their wallets only contain the multisig funds. In case -they also have a personal wallet, this can be accomplished through the -multiwallet feature - possibly resulting in a need to add `-rpcwallet=name` to -the command line in case `bitcoin-cli` is used. - -Setup: -- All three call `getnewaddress` to create a new address; call these addresses - *Aalice*, *Abob*, and *Acarol*. -- All three call `getaddressinfo "X"`, with *X* their respective address, and - remember the corresponding public keys. Call these public keys *Kalice*, - *Kbob*, and *Kcarol*. -- All three now run `addmultisigaddress 2 ["Kalice","Kbob","Kcarol"]` to teach - their wallet about the multisig script. Call the address produced by this - command *Amulti*. They may be required to explicitly specify the same - addresstype option each, to avoid constructing different versions due to - differences in configuration. -- They also run `importaddress "Amulti" "" false` to make their wallets treat - payments to *Amulti* as contributing to the watch-only balance. -- Others can verify the produced address by running - `createmultisig 2 ["Kalice","Kbob","Kcarol"]`, and expecting *Amulti* as - output. Again, it may be necessary to explicitly specify the addresstype - in order to get a result that matches. This command won't enable them to - initiate transactions later, however. -- They can now give out *Amulti* as address others can pay to. - -Later, when *V* BTC has been received on *Amulti*, and Bob and Carol want to -move the coins in their entirety to address *Asend*, with no change. Alice -does not need to be involved. -- One of them - let's assume Carol here - initiates the creation. She runs - `walletcreatefundedpsbt [] {"Asend":V} 0 {"subtractFeeFromOutputs":[0], "includeWatching":true}`. - We call the resulting PSBT *P*. *P* does not contain any signatures. -- Carol needs to sign the transaction herself. In order to do so, she runs - `walletprocesspsbt "P"`, and gives the resulting PSBT *P2* to Bob. -- Bob inspects the PSBT using `decodepsbt "P2"` to determine if the transaction - has indeed just the expected input, and an output to *Asend*, and the fee is - reasonable. If he agrees, he calls `walletprocesspsbt "P2"` to sign. The - resulting PSBT *P3* contains both Carol's and Bob's signature. -- Now anyone can call `finalizepsbt "P3"` to extract a fully signed transaction - *T*. -- Finally anyone can broadcast the transaction using `sendrawtransaction "T"`. - -In case there are more signers, it may be advantageous to let them all sign in -parallel, rather than passing the PSBT from one signer to the next one. In the -above example this would translate to Carol handing a copy of *P* to each signer -separately. They can then all invoke `walletprocesspsbt "P"`, and end up with -their individually-signed PSBT structures. They then all send those back to -Carol (or anyone) who can combine them using `combinepsbt`. The last two steps -(`finalizepsbt` and `sendrawtransaction`) remain unchanged. diff --git a/doc/reduce-memory.md b/doc/reduce-memory.md index dbe88d45f3..cac5dc982d 100644 --- a/doc/reduce-memory.md +++ b/doc/reduce-memory.md @@ -16,7 +16,7 @@ The size of some in-memory caches can be reduced. As caches trade off memory usa - The minimum value for `-maxmempool` is 5. - A lower maximum mempool size means that transactions will be evicted sooner. This will affect any uses of `bitcoind` that process unconfirmed transactions. -- Since `0.14.0`, unused memory allocated to the mempool (default: 300MB) is shared with the UTXO cache, so when trying to reduce memory usage you should limit the mempool, with the `-maxmempool` command line argument. +- The unused memory allocated to the mempool (default: 300MB) is shared with the UTXO cache, so when trying to reduce memory usage you should limit the mempool, with the `-maxmempool` command line argument. - To disable most of the mempool functionality there is the `-blocksonly` option. This will reduce the default memory usage to 5MB and make the client opt out of receiving (and thus relaying) transactions, except from peers who have the `relay` permission set (e.g. whitelisted peers), and as part of blocks. @@ -39,11 +39,11 @@ threads take up 8MiB for the thread stack on a 64-bit system, and 4MiB in a 32-bit system. - `-par=` - the number of script verification threads, defaults to the number of cores in the system minus one. -- `-rpcthreads=` - the number of threads used for processing RPC requests, defaults to `4`. +- `-rpcthreads=` - the number of threads used for processing RPC requests, defaults to `16`. ## Linux specific -By default, glibc will create up to two heap arenas per core. This is known to cause excessive memory usage in some scenarios. To avoid this make a script that sets `MALLOC_ARENA_MAX` before starting bitcoind: +By default, glibc's implementation of `malloc` may use more than one arena. This is known to cause excessive memory usage in some scenarios. To avoid this, make a script that sets `MALLOC_ARENA_MAX` before starting bitcoind: ```bash #!/usr/bin/env bash diff --git a/doc/reduce-traffic.md b/doc/reduce-traffic.md index 86943b1f72..8926a8361a 100644 --- a/doc/reduce-traffic.md +++ b/doc/reduce-traffic.md @@ -3,10 +3,10 @@ Reduce Traffic Some node operators need to deal with bandwidth caps imposed by their ISPs. -By default, Bitcoin Core allows up to 125 connections to different peers, 10 of -which are outbound. You can therefore, have at most 115 inbound connections. -Of the 10 outbound peers, there can be 8 full-relay connections and 2 -block-relay-only ones. +By default, Bitcoin Core allows up to 125 connections to different peers, 11 of +which are outbound. You can therefore, have at most 114 inbound connections. +Of the 11 outbound peers, there can be 8 full-relay connections, 2 +block-relay-only ones and occasionally 1 short-lived feeler or an extra block-relay-only connection. The default settings can result in relatively significant traffic consumption. @@ -28,7 +28,7 @@ calculating the target. ## 2. Disable "listening" (`-listen=0`) -Disabling listening will result in fewer nodes connected (remember the maximum of 10 +Disabling listening will result in fewer nodes connected (remember the maximum of 11 outbound peers). Fewer nodes will result in less traffic usage as you are relaying blocks and transactions to fewer nodes. diff --git a/doc/release-notes-24914.md b/doc/release-notes-24914.md deleted file mode 100644 index 505d356fce..0000000000 --- a/doc/release-notes-24914.md +++ /dev/null @@ -1,9 +0,0 @@ -Wallet ------- - -- Wallet loading has changed in this release. Wallets with some corrupted records that could be - previously loaded (with warnings) may no longer load. For example, wallets with corrupted - address book entries may no longer load. If this happens, it is recommended - load the wallet in a previous version of Bitcoin Core and import the data into a new wallet. - Please also report an issue to help improve the software and make wallet loading more robust - in these cases. diff --git a/doc/release-notes-25158.md b/doc/release-notes-25158.md deleted file mode 100644 index ce8ab53ddd..0000000000 --- a/doc/release-notes-25158.md +++ /dev/null @@ -1,6 +0,0 @@ -RPC Wallet ----------- - -- The `gettransaction`, `listtransactions`, `listsinceblock` RPCs now return - the `abandoned` field for all transactions. Previously, the "abandoned" field - was only returned for sent transactions. (#25158) \ No newline at end of file diff --git a/doc/release-notes-26076.md b/doc/release-notes-26076.md deleted file mode 100644 index f95e4be0e3..0000000000 --- a/doc/release-notes-26076.md +++ /dev/null @@ -1,13 +0,0 @@ -RPC ---- - -- The `listdescriptors`, `decodepsbt` and similar RPC methods now show `h` rather than apostrophe (`'`) to indicate - hardened derivation. This does not apply when using the `private` parameter, which - matches the marker used when descriptor was generated or imported. Newly created - wallets use `h`. This change makes it easier to handle descriptor strings manually. - E.g. the `importdescriptors` RPC call is easiest to use `h` as the marker: `'["desc": ".../0h/..."]'`. - With this change `listdescriptors` will use `h`, so you can copy-paste the result, - without having to add escape characters or switch `'` to 'h' manually. - Note that this changes the descriptor checksum. - For legacy wallets the `hdkeypath` field in `getaddressinfo` is unchanged, - nor is the serialization format of wallet dumps. (#26076) diff --git a/doc/release-notes-26094.md b/doc/release-notes-26094.md deleted file mode 100644 index ba73f2707e..0000000000 --- a/doc/release-notes-26094.md +++ /dev/null @@ -1,6 +0,0 @@ -- The `getbalances` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block - hash and height at the time the balances were calculated. This result shouldn't be cached because importing new keys could invalidate it. -- The `gettransaction` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block - hash and height at the time the transaction information was generated. -- The `getwalletinfo` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block - hash and height at the time the wallet information was generated. \ No newline at end of file diff --git a/doc/release-notes-26485.md b/doc/release-notes-26485.md deleted file mode 100644 index c8df3d22fb..0000000000 --- a/doc/release-notes-26485.md +++ /dev/null @@ -1,16 +0,0 @@ -JSON-RPC ---- - -For RPC methods which accept `options` parameters ((`importmulti`, `listunspent`, `fundrawtransaction`, `bumpfee`, `send`, `sendall`, `walletcreatefundedpsbt`, `simulaterawtransaction`), it is now possible to pass the options as named parameters without the need for a nested object. (#26485) - -This means it is possible make calls like: - -```sh -src/bitcoin-cli -named bumpfee txid fee_rate=100 -``` - -instead of - -```sh -src/bitcoin-cli -named bumpfee txid options='{"fee_rate": 100}' -``` diff --git a/doc/release-notes-27213.md b/doc/release-notes-27213.md deleted file mode 100644 index 3b478f11b7..0000000000 --- a/doc/release-notes-27213.md +++ /dev/null @@ -1,8 +0,0 @@ -P2P and network changes ------- - -- Nodes with multiple reachable networks will actively try to have at least one - outbound connection to each network. This improves individual resistance to - eclipse attacks and network level resistance to partition attacks. Users no - longer need to perform active measures to ensure being connected to multiple - enabled networks. diff --git a/doc/release-notes-27302.md b/doc/release-notes-27302.md deleted file mode 100644 index e67a6c8b06..0000000000 --- a/doc/release-notes-27302.md +++ /dev/null @@ -1,4 +0,0 @@ -Configuration ---- - -- `bitcoind` and `bitcoin-qt` will now raise an error on startup if a datadir that is being used contains a bitcoin.conf file that will be ignored, which can happen when a datadir= line is used in a bitcoin.conf file. The error message is just a diagnostic intended to prevent accidental misconfiguration, and it can be disabled to restore the previous behavior of using the datadir while ignoring the bitcoin.conf contained in it. diff --git a/doc/release-notes-27501.md b/doc/release-notes-27501.md deleted file mode 100644 index 386a00fb34..0000000000 --- a/doc/release-notes-27501.md +++ /dev/null @@ -1,3 +0,0 @@ -- A new `getprioritisedtransactions` RPC has been added. It returns a map of all fee deltas created by the - user with prioritisetransaction, indexed by txid. The map also indicates whether each transaction is - present in the mempool. diff --git a/doc/release-notes-27632.md b/doc/release-notes-27632.md deleted file mode 100644 index d588247c85..0000000000 --- a/doc/release-notes-27632.md +++ /dev/null @@ -1,5 +0,0 @@ -Updated settings ----------------- - -- Passing an invalid `-debug`, `-debugexclude`, or `-loglevel` logging configuration - option now raises an error, rather than logging an easily missed warning. (#27632) diff --git a/doc/release-notes-27757.md b/doc/release-notes-27757.md deleted file mode 100644 index fb6aaa01a5..0000000000 --- a/doc/release-notes-27757.md +++ /dev/null @@ -1,8 +0,0 @@ -Wallet ------- - -- The `deprecatedrpc=walletwarningfield` configuration option has been removed. - The `createwallet`, `loadwallet`, `restorewallet` and `unloadwallet` RPCs no - longer return the "warning" string field. The same information is provided - through the "warnings" field added in v25.0, which returns a JSON array of - strings. The "warning" string field was deprecated also in v25.0. (#27757) diff --git a/doc/release-notes-27826.md b/doc/release-notes-27826.md new file mode 100644 index 0000000000..ef1dbe33f7 --- /dev/null +++ b/doc/release-notes-27826.md @@ -0,0 +1,4 @@ +- Logs now include which peer sent us a header. Additionally there are fewer + redundant header log messages. A side-effect of this change is that for + some untypical cases new headers aren't logged anymore, e.g. a direct + `BLOCK` message with a previously unknown header and `submitheader` RPC. (#27826) diff --git a/doc/release-notes-28113.md b/doc/release-notes-28113.md deleted file mode 100644 index c9f418dbbb..0000000000 --- a/doc/release-notes-28113.md +++ /dev/null @@ -1,7 +0,0 @@ -RPC Wallet ----------- - -- The `signrawtransactionwithkey`, `signrawtransactionwithwallet`, - `walletprocesspsbt` and `descriptorprocesspsbt` calls now return the more - specific RPC_INVALID_PARAMETER error instead of RPC_MISC_ERROR if their - sighashtype argument is malformed. diff --git a/doc/release-notes-28354.md b/doc/release-notes-28354.md deleted file mode 100644 index 03d421eb42..0000000000 --- a/doc/release-notes-28354.md +++ /dev/null @@ -1,6 +0,0 @@ -Tests ------ - -- Non-standard transactions are now disabled by default on testnet - for relay and mempool acceptance. The previous behaviour can be - re-enabled by setting `-acceptnonstdtxn=1`. (#28354) diff --git a/doc/release-notes-31278.md b/doc/release-notes-31278.md new file mode 100644 index 0000000000..82750dee0d --- /dev/null +++ b/doc/release-notes-31278.md @@ -0,0 +1,3 @@ +RPC and Startup Option +--- +The `-paytxfee` startup option and the `settxfee` RPC are now deprecated and will be removed in Bitcoin Core 31.0. They allowed the user to set a static fee rate for wallet transactions, which could potentially lead to overpaying or underpaying. Users should instead rely on fee estimation or specify a fee rate per transaction using the `fee_rate` argument in RPCs such as `fundrawtransaction`, `sendtoaddress`, `send`, `sendall`, and `sendmany`. (#31278) diff --git a/doc/release-notes-31375.md b/doc/release-notes-31375.md new file mode 100644 index 0000000000..e1e7f5c0af --- /dev/null +++ b/doc/release-notes-31375.md @@ -0,0 +1,11 @@ +New command line interface +-------------------------- + +A new `bitcoin` command line tool has been added to make features more +discoverable and convenient to use. The `bitcoin` tool just calls other +executables and does not implement any functionality on its own. Specifically +`bitcoin node` is a synonym for `bitcoind`, `bitcoin gui` is a synonym for +`bitcoin-qt`, and `bitcoin rpc` is a synonym for `bitcoin-cli -named`. Other +commands and options can be listed with `bitcoin help`. The new tool does not +replace other tools, so all existing commands should continue working and there +are no plans to deprecate them. diff --git a/doc/release-notes-31603.md b/doc/release-notes-31603.md new file mode 100644 index 0000000000..8192372114 --- /dev/null +++ b/doc/release-notes-31603.md @@ -0,0 +1,6 @@ +Updated RPCs +-------- + +- Any RPC in which one of the parameters are descriptors will throw an error +if the provided descriptor contains a whitespace at the beginning or the end +of the public key within a fragment - e.g. `pk( KEY)` or `pk(KEY )`. diff --git a/doc/release-notes-31953.md b/doc/release-notes-31953.md new file mode 100644 index 0000000000..74d7ecd3f2 --- /dev/null +++ b/doc/release-notes-31953.md @@ -0,0 +1,9 @@ +# RPC + +- The RPCs psbtbumpfee and bumpfee allow a replacement under fullrbf and no + longer require BIP-125 signalling. (#31953) + +# GUI + +- A transaction's fee bump is allowed under fullrbf and no longer requires + BIP-125 signalling. (#31953) diff --git a/doc/release-notes-32459.md b/doc/release-notes-32459.md new file mode 100644 index 0000000000..267096f060 --- /dev/null +++ b/doc/release-notes-32459.md @@ -0,0 +1,3 @@ +GUI changes + +- Custom column widths in the Transactions tab are reset as a side-effect of legacy wallet removal. (#32459) diff --git a/doc/release-notes-32500.md b/doc/release-notes-32500.md new file mode 100644 index 0000000000..31c0487f6b --- /dev/null +++ b/doc/release-notes-32500.md @@ -0,0 +1,3 @@ +### Updated Settings + +- The `-upnp` setting has now been fully removed. Use `-natpmp` instead. (#32500) diff --git a/doc/release-notes-empty-template.md b/doc/release-notes-empty-template.md index 887104548b..fdb0d7c8b1 100644 --- a/doc/release-notes-empty-template.md +++ b/doc/release-notes-empty-template.md @@ -35,10 +35,10 @@ wallet versions of Bitcoin Core are generally supported. Compatibility ============== -Bitcoin Core is supported and extensively tested on operating systems -using the Linux kernel, macOS 11.0+, and Windows 7 and newer. Bitcoin +Bitcoin Core is supported and tested on operating systems using the +Linux Kernel 3.17+, macOS 13+, and Windows 10+. Bitcoin Core should also work on most other Unix-like systems but is not as -frequently tested on them. It is not recommended to use Bitcoin Core on +frequently tested on them. It is not recommended to use Bitcoin Core on unsupported systems. Notable changes diff --git a/doc/release-notes/release-notes-24.2.md b/doc/release-notes/release-notes-24.2.md new file mode 100644 index 0000000000..059ab51872 --- /dev/null +++ b/doc/release-notes/release-notes-24.2.md @@ -0,0 +1,76 @@ +24.2 Release Notes +================== + +Bitcoin Core version 24.2 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 10.15+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +### Fees + +- #27622 Fee estimation: avoid serving stale fee estimate + +### RPC and other APIs + +- #27727 rpc: Fix invalid bech32 address handling + +### Build System + +- #28097 depends: xcb-proto 1.15.2 +- #28543 build, macos: Fix qt package build with new Xcode 15 linker +- #28571 depends: fix unusable memory_resource in macos qt build + +### CI + +- #27777 ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN +- #27834 ci: Nuke Android APK task, Use credits for tsan +- #27844 ci: Use podman stop over podman kill +- #27886 ci: Switch to amd64 container in "ARM" task + +### Miscellaneous +- #28452 Do not use std::vector = {} to release memory + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Abubakar Sadiq Ismail +- Hennadii Stepanov +- Marco Falke +- Michael Ford +- Pieter Wuille + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-25.1.md b/doc/release-notes/release-notes-25.1.md new file mode 100644 index 0000000000..bfdbee4e76 --- /dev/null +++ b/doc/release-notes/release-notes-25.1.md @@ -0,0 +1,108 @@ +25.1 Release Notes +================== + +Bitcoin Core version 25.1 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 10.15+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### P2P + +- #27626 Parallel compact block downloads, take 3 +- #27743 p2p: Unconditionally return when compact block status == READ_STATUS_FAILED + +### Fees + +- #27622 Fee estimation: avoid serving stale fee estimate + +### RPC + +- #27727 rpc: Fix invalid bech32 address handling + +### Rest + +- #27853 rest: fix crash error when calling /deploymentinfo +- #28551 http: bugfix: allow server shutdown in case of remote client disconnection + +### Wallet + +- #28038 wallet: address book migration bug fixes +- #28067 descriptors: do not return top-level only funcs as sub descriptors +- #28125 wallet: bugfix, disallow migration of invalid scripts +- #28542 wallet: Check for uninitialized last processed and conflicting heights in MarkConflicted + +### Build + +- #27724 build: disable boost multi index safe mode in debug mode +- #28097 depends: xcb-proto 1.15.2 +- #28543 build, macos: Fix qt package build with new Xcode 15 linker +- #28571 depends: fix unusable memory_resource in macos qt build + +### Gui + +- gui#751 macOS, do not process actions during shutdown + +### Miscellaneous + +- #28452 Do not use std::vector = {} to release memory + +### CI + +- #27777 ci: Prune dangling images on RESTART_CI_DOCKER_BEFORE_RUN +- #27834 ci: Nuke Android APK task, Use credits for tsan +- #27844 ci: Use podman stop over podman kill +- #27886 ci: Switch to amd64 container in "ARM" task + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Abubakar Sadiq Ismail +- Andrew Chow +- Bruno Garcia +- Gregory Sanders +- Hennadii Stepanov +- MacroFake +- Matias Furszyfer +- Michael Ford +- Pieter Wuille +- stickies-v +- Will Clark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). \ No newline at end of file diff --git a/doc/release-notes/release-notes-25.2.md b/doc/release-notes/release-notes-25.2.md new file mode 100644 index 0000000000..3f050ebaef --- /dev/null +++ b/doc/release-notes/release-notes-25.2.md @@ -0,0 +1,74 @@ +25.2 Release Notes +================== + +Bitcoin Core version 25.2 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 10.15+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### Gui + +- gui#774 Fix crash on selecting "Mask values" in transaction view + +### RPC + +- #29003 rpc: fix getrawtransaction segfault + +### Wallet + +- #29176 wallet: Fix use-after-free in WalletBatch::EraseRecords +- #29510 wallet: `getrawchangeaddress` and `getnewaddress` failures should not affect keypools for descriptor wallets + +### P2P and network changes + +- #29412 p2p: Don't process mutated blocks +- #29524 p2p: Don't consider blocks mutated if they don't connect to known prev block + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Martin Zumsande +- Sebastian Falbesoner +- MarcoFalke +- UdjinM6 +- dergoegge +- Greg Sanders + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-26.0.md b/doc/release-notes/release-notes-26.0.md new file mode 100644 index 0000000000..b7c7c35f65 --- /dev/null +++ b/doc/release-notes/release-notes-26.0.md @@ -0,0 +1,357 @@ +26.0 Release Notes +================== + +Bitcoin Core version 26.0 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +P2P and network changes +----------------------- + +- Experimental support for the v2 transport protocol defined in + [BIP324](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki) was added. + It is off by default, but when enabled using `-v2transport` it will be negotiated + on a per-connection basis with other peers that support it too. The existing + v1 transport protocol remains fully supported. + +- Nodes with multiple reachable networks will actively try to have at least one + outbound connection to each network. This improves individual resistance to + eclipse attacks and network level resistance to partition attacks. Users no + longer need to perform active measures to ensure being connected to multiple + enabled networks. (#27213) + +Pruning +------- + +- When using assumeutxo with `-prune`, the prune budget may be exceeded if it is set + lower than 1100MB (i.e. `MIN_DISK_SPACE_FOR_BLOCK_FILES * 2`). Prune budget is normally + split evenly across each chainstate, unless the resulting prune budget per chainstate + is beneath `MIN_DISK_SPACE_FOR_BLOCK_FILES` in which case that value will be used. (#27596) + +Updated RPCs +------------ + +- Setting `-rpcserialversion=0` is deprecated and will be removed in + a future release. It can currently still be used by also adding + the `-deprecatedrpc=serialversion` option. (#28448) + +- The `hash_serialized_2` value has been removed from `gettxoutsetinfo` since the value it + calculated contained a bug and did not take all data into account. It is superseded by + `hash_serialized_3` which provides the same functionality but serves the correctly calculated hash. (#28685) + +- New fields `transport_protocol_type` and `session_id` were added to the `getpeerinfo` RPC to indicate + whether the v2 transport protocol is in use, and if so, what the session id is. + +- A new argument `v2transport` was added to the `addnode` RPC to indicate whether a v2 transaction connection + is to be attempted with the peer. + +- [Miniscript](https://bitcoin.sipa.be/miniscript/) expressions can now be used in Taproot descriptors for all RPCs working with descriptors. (#27255) + +- `finalizepsbt` is now able to finalize a PSBT with inputs spending [Miniscript](https://bitcoin.sipa.be/miniscript/)-compatible Taproot leaves. (#27255) + +Changes to wallet related RPCs can be found in the Wallet section below. + +New RPCs +-------- + +- `loadtxoutset` has been added, which allows loading a UTXO snapshot of the format + generated by `dumptxoutset`. Once this snapshot is loaded, its contents will be + deserialized into a second chainstate data structure, which is then used to sync to + the network's tip. + + Meanwhile, the original chainstate will complete the initial block download process in + the background, eventually validating up to the block that the snapshot is based upon. + + The result is a usable bitcoind instance that is current with the network tip in a + matter of minutes rather than hours. UTXO snapshot are typically obtained via + third-party sources (HTTP, torrent, etc.) which is reasonable since their contents + are always checked by hash. + + You can find more information on this process in the `assumeutxo` design + document (). + + `getchainstates` has been added to aid in monitoring the assumeutxo sync process. + +- A new `getprioritisedtransactions` RPC has been added. It returns a map of all fee deltas created by the + user with prioritisetransaction, indexed by txid. The map also indicates whether each transaction is + present in the mempool. (#27501) + +- A new RPC, `submitpackage`, has been added. It can be used to submit a list of raw hex +transactions to the mempool to be evaluated as a package using consensus and mempool policy rules. +These policies include package CPFP, allowing a child with high fees to bump a parent below the +mempool minimum feerate (but not minimum relay feerate). (#27609) + + - Warning: successful submission does not mean the transactions will propagate throughout the + network, as package relay is not supported. + + - Not all features are available. The package is limited to a child with all of its + unconfirmed parents, and no parent may spend the output of another parent. Also, package + RBF is not supported. Refer to doc/policy/packages.md for more details on package policies + and limitations. + + - This RPC is experimental. Its interface may change. + +- A new RPC `getaddrmaninfo` has been added to view the distribution of addresses in the new and tried table of the + node's address manager across different networks(ipv4, ipv6, onion, i2p, cjdns). The RPC returns count of addresses + in new and tried table as well as their sum for all networks. (#27511) + +- A new `importmempool` RPC has been added. It loads a valid `mempool.dat` file and attempts to + add its contents to the mempool. This can be useful to import mempool data from another node + without having to modify the datadir contents and without having to restart the node. (#27460) + - Warning: Importing untrusted files is dangerous, especially if metadata from the file is taken over. + - If you want to apply fee deltas, it is recommended to use the `getprioritisedtransactions` and + `prioritisetransaction` RPCs instead of the `apply_fee_delta_priority` option to avoid + double-prioritising any already-prioritised transactions in the mempool. + +Updated settings +---------------- + +- `bitcoind` and `bitcoin-qt` will now raise an error on startup + if a datadir that is being used contains a bitcoin.conf file that + will be ignored, which can happen when a datadir= line is used in + a bitcoin.conf file. The error message is just a diagnostic intended + to prevent accidental misconfiguration, and it can be disabled to + restore the previous behavior of using the datadir while ignoring + the bitcoin.conf contained in it. (#27302) + +- Passing an invalid `-debug`, `-debugexclude`, or `-loglevel` logging configuration + option now raises an error, rather than logging an easily missed warning. (#27632) + +Changes to GUI or wallet related settings can be found in the GUI or Wallet section below. + +New settings +------------ + +Tools and Utilities +------------------- + +- A new `bitcoinconsensus_verify_script_with_spent_outputs` function is available in libconsensus which optionally accepts the spent outputs of the transaction being verified. +- A new `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_TAPROOT` flag is available in libconsensus that will verify scripts with the Taproot spending rules. + +Wallet +------ + +- Wallet loading has changed in this release. Wallets with some corrupted records that could be + previously loaded (with warnings) may no longer load. For example, wallets with corrupted + address book entries may no longer load. If this happens, it is recommended + load the wallet in a previous version of Bitcoin Core and import the data into a new wallet. + Please also report an issue to help improve the software and make wallet loading more robust + in these cases. (#24914) + +- The `createwallet` RPC will no longer create legacy (BDB) wallets when + setting `descriptors=false` without also providing the + `-deprecatedrpc=create_bdb` option. This is because the legacy wallet is + being deprecated in a future release. (#28597) + +- The `gettransaction`, `listtransactions`, `listsinceblock` RPCs now return + the `abandoned` field for all transactions. Previously, the "abandoned" field + was only returned for sent transactions. (#25158) + +- The `listdescriptors`, `decodepsbt` and similar RPC methods now show `h` rather than apostrophe (`'`) to indicate + hardened derivation. This does not apply when using the `private` parameter, which + matches the marker used when descriptor was generated or imported. Newly created + wallets use `h`. This change makes it easier to handle descriptor strings manually. + E.g. the `importdescriptors` RPC call is easiest to use `h` as the marker: `'["desc": ".../0h/..."]'`. + With this change `listdescriptors` will use `h`, so you can copy-paste the result, + without having to add escape characters or switch `'` to 'h' manually. + Note that this changes the descriptor checksum. + For legacy wallets the `hdkeypath` field in `getaddressinfo` is unchanged, + nor is the serialization format of wallet dumps. (#26076) + +- The `getbalances` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block + hash and height at the time the balances were calculated. This result shouldn't be cached because importing new keys could invalidate it. (#26094) + +- The `gettransaction` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block + hash and height at the time the transaction information was generated. (#26094) + +- The `getwalletinfo` RPC now returns a `lastprocessedblock` JSON object which contains the wallet's last processed block + hash and height at the time the wallet information was generated. (#26094) + +- Coin selection and transaction building now accounts for unconfirmed low-feerate ancestor transactions. When it is necessary to spend unconfirmed outputs, the wallet will add fees to ensure that the new transaction with its ancestors will achieve a mining score equal to the feerate requested by the user. (#26152) + +- For RPC methods which accept `options` parameters ((`importmulti`, `listunspent`, + `fundrawtransaction`, `bumpfee`, `send`, `sendall`, `walletcreatefundedpsbt`, + `simulaterawtransaction`), it is now possible to pass the options as named + parameters without the need for a nested object. (#26485) + +This means it is possible make calls like: + +```sh +src/bitcoin-cli -named bumpfee txid fee_rate=100 +``` + +instead of + +```sh +src/bitcoin-cli -named bumpfee txid options='{"fee_rate": 100}' +``` + +- The `deprecatedrpc=walletwarningfield` configuration option has been removed. + The `createwallet`, `loadwallet`, `restorewallet` and `unloadwallet` RPCs no + longer return the "warning" string field. The same information is provided + through the "warnings" field added in v25.0, which returns a JSON array of + strings. The "warning" string field was deprecated also in v25.0. (#27757) + +- The `signrawtransactionwithkey`, `signrawtransactionwithwallet`, + `walletprocesspsbt` and `descriptorprocesspsbt` calls now return the more + specific RPC_INVALID_PARAMETER error instead of RPC_MISC_ERROR if their + sighashtype argument is malformed. (#28113) + +- RPC `walletprocesspsbt`, and `descriptorprocesspsbt` return + object now includes field `hex` (if the transaction + is complete) containing the serialized transaction + suitable for RPC `sendrawtransaction`. (#28414) + +- It's now possible to use [Miniscript](https://bitcoin.sipa.be/miniscript/) inside Taproot leaves for descriptor wallets. (#27255) + +Descriptors +----------- + +- The usage of hybrid public keys in output descriptors has been removed. Hybrid + public keys are an exotic public key encoding not supported by output descriptors + (as specified in BIP380 and documented in doc/descriptors.md). Bitcoin Core would + previously incorrectly accept descriptors containing such hybrid keys. (#28587) + +GUI changes +----------- + +- The transaction list in the GUI no longer provides a special category for "payment to yourself". Now transactions that have both inputs and outputs that affect the wallet are displayed on separate lines for spending and receiving. (gui#119) + +- A new menu option allows migrating a legacy wallet based on keys and implied output script types stored in BerkeleyDB (BDB) to a modern wallet that uses descriptors stored in SQLite. (gui#738) + +- The PSBT operations dialog marks outputs paying your own wallet with "own address". (gui#740) + +- The ability to create legacy wallets is being removed. (gui#764) + +Contrib +------- + +- Bash completion files have been renamed from `bitcoin*.bash-completion` to + `bitcoin*.bash`. This means completions can be automatically loaded on demand + based on invoked commands' names when they are put into the completion + directory (found with `pkg-config --variable=completionsdir + bash-completion`) without requiring renaming. (#28507) + +Low-level changes +================= + +Tests +----- + +- Non-standard transactions are now disabled by default on testnet + for relay and mempool acceptance. The previous behaviour can be + re-enabled by setting `-acceptnonstdtxn=1`. (#28354) + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- 0xb10c +- Amiti Uttarwar +- Andrew Chow +- Andrew Toth +- Anthony Towns +- Antoine Poinsot +- Antoine Riard +- Ari +- Aurèle Oulès +- Ayush Singh +- Ben Woosley +- Brandon Odiwuor +- Brotcrunsher +- brunoerg +- Bufo +- Carl Dong +- Casey Carter +- Cory Fields +- David Álvarez Rosa +- dergoegge +- dhruv +- dimitaracev +- Erik Arvstedt +- Erik McKelvey +- Fabian Jahr +- furszy +- glozow +- Greg Sanders +- Harris +- Hennadii Stepanov +- Hernan Marino +- ishaanam +- ismaelsadeeq +- Jake Rawsthorne +- James O'Beirne +- John Moffett +- Jon Atack +- josibake +- kevkevin +- Kiminuo +- Larry Ruane +- Luke Dashjr +- MarcoFalke +- Marnix +- Martin Leitner-Ankerl +- Martin Zumsande +- Matthew Zipkin +- Michael Ford +- Michael Tidwell +- mruddy +- Murch +- ns-xvrn +- pablomartin4btc +- Pieter Wuille +- Reese Russell +- Rhythm Garg +- Ryan Ofsky +- Sebastian Falbesoner +- Sjors Provoost +- stickies-v +- stratospher +- Suhas Daftuar +- TheCharlatan +- Tim Neubauer +- Tim Ruffing +- Vasil Dimov +- virtu +- vuittont60 +- willcl-ark +- Yusuf Sahin HAMZA + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-26.1.md b/doc/release-notes/release-notes-26.1.md new file mode 100644 index 0000000000..b5c6e63007 --- /dev/null +++ b/doc/release-notes/release-notes-26.1.md @@ -0,0 +1,106 @@ +26.1 Release Notes +================== + +Bitcoin Core version 26.1 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### Wallet + +- #28994 wallet: skip BnB when SFFO is enabled +- #28920 wallet: birth time update during tx scanning +- #29176 wallet: Fix use-after-free in WalletBatch::EraseRecords +- #29510 wallet: getrawchangeaddress and getnewaddress failures should not affect keypools for descriptor wallets + +### RPC + +- #29003 rpc: fix getrawtransaction segfault +- #28784 rpc: keep .cookie file if it was not generated + +### Logs + +- #29227 log mempool loading progress + +### P2P and network changes + +- #29200 net: create I2P sessions using both ECIES-X25519 and ElGamal encryption +- #29412 p2p: Don't process mutated blocks +- #29524 p2p: Don't consider blocks mutated if they don't connect to known prev block + +### Build + +- #29127 Use hardened runtime on macOS release builds. +- #29195 build: Fix -Xclang -internal-isystem option + +### CI + +- #28992 ci: Use Ubuntu 24.04 Noble for asan,tsan,tidy,fuzz +- #29080 ci: Set HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK to avoid unrelated failures +- #29610 ci: Fix "macOS native" job + +### Miscellaneous + +- #28391 refactor: Simplify CTxMempool/BlockAssembler fields, remove some external mapTx access +- #29179 test: wallet rescan with reorged parent + IsFromMe child in mempool +- #28791 snapshots: don't core dump when running -checkblockindex after loadtxoutset +- #29357 test: Drop x modifier in fsbridge::fopen call for MinGW builds +- #29529 fuzz: restrict fopencookie usage to Linux & FreeBSD + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- dergoegge +- fanquake +- furszy +- glozow +- Greg Sanders +- Hennadii Stepanov +- Jon Atack +- MarcoFalke +- Mark Friedenbach +- Martin Zumsande +- Murch +- Roman Zeyde +- stickies-v +- UdjinM6 + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). + diff --git a/doc/release-notes/release-notes-26.2.md b/doc/release-notes/release-notes-26.2.md new file mode 100644 index 0000000000..67d8512dd0 --- /dev/null +++ b/doc/release-notes/release-notes-26.2.md @@ -0,0 +1,94 @@ +26.2 Release Notes +================== + +Bitcoin Core version 26.2 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux kernel, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### Script + +- #29853: sign: don't assume we are parsing a sane TapMiniscript + +### P2P and network changes + +- #29691: Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us +- #30085: p2p: detect addnode cjdns peers in GetAddedNodeInfo() + +### RPC + +- #29869: rpc, bugfix: Enforce maximum value for setmocktime +- #28554: bugfix: throw an error if an invalid parameter is passed to getnetworkhashps RPC +- #30094: rpc: move UniValue in blockToJSON +- #29870: rpc: Reword SighashFromStr error message + +### Build + +- #29747: depends: fix mingw-w64 Qt DEBUG=1 build +- #29985: depends: Fix build of Qt for 32-bit platforms with recent glibc +- #30151: depends: Fetch miniupnpc sources from an alternative website +- #30283: upnp: fix build with miniupnpc 2.2.8 + +### Misc + +- #29776: ThreadSanitizer: Fix #29767 +- #29856: ci: Bump s390x to ubuntu:24.04 +- #29764: doc: Suggest installing dev packages for debian/ubuntu qt5 build +- #30149: contrib: Renew Windows code signing certificate + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Antoine Poinsot +- Ava Chow +- Cory Fields +- dergoegge +- fanquake +- glozow +- Hennadii Stepanov +- Jameson Lopp +- jonatack +- laanwj +- Luke Dashjr +- MarcoFalke +- nanlour +- willcl-ark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-27.0.md b/doc/release-notes/release-notes-27.0.md new file mode 100644 index 0000000000..5060068328 --- /dev/null +++ b/doc/release-notes/release-notes-27.0.md @@ -0,0 +1,217 @@ +Bitcoin Core version 27.0 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +libbitcoinconsensus +------------------- + +- libbitcoinconsensus is deprecated and will be removed for v28. This library has + existed for nearly 10 years with very little known uptake or impact. It has + become a maintenance burden. + + The underlying functionality does not change between versions, so any users of + the library can continue to use the final release indefinitely, with the + understanding that Taproot is its final consensus update. + + In the future, libbitcoinkernel will provide a much more useful API that is + aware of the UTXO set, and therefore be able to fully validate transactions and + blocks. (#29189) + +mempool.dat compatibility +------------------------- + +- The `mempool.dat` file created by -persistmempool or the savemempool RPC will + be written in a new format. This new format includes the XOR'ing of transaction + contents to mitigate issues where external programs (such as anti-virus) attempt + to interpret and potentially modify the file. + + This new format can not be read by previous software releases. To allow for a + downgrade, a temporary setting `-persistmempoolv1` has been added to fall back + to the legacy format. (#28207) + +P2P and network changes +----------------------- + +- BIP324 v2 transport is now enabled by default. It remains possible to disable v2 + by running with `-v2transport=0`. (#29347) +- Manual connection options (`-connect`, `-addnode` and `-seednode`) will + now follow `-v2transport` to connect with v2 by default. They will retry with + v1 on failure. (#29058) + +- Network-adjusted time has been removed from consensus code. It is replaced + with (unadjusted) system time. The warning for a large median time offset + (70 minutes or more) is kept. This removes the implicit security assumption of + requiring an honest majority of outbound peers, and increases the importance + of the node operator ensuring their system time is (and stays) correct to not + fall out of consensus with the network. (#28956) + +Mempool Policy Changes +---------------------- + +- Opt-in Topologically Restricted Until Confirmation (TRUC) Transactions policy + (aka v3 transaction policy) is available for use on test networks when + `-acceptnonstdtxn=1` is set. By setting the transaction version number to 3, TRUC transactions + request the application of limits on spending of their unconfirmed outputs. These + restrictions simplify the assessment of incentive compatibility of accepting or + replacing TRUC transactions, thus ensuring any replacements are more profitable for + the node and making fee-bumping more reliable. TRUC transactions are currently + nonstandard and can only be used on test networks where the standardness rules are + relaxed or disabled (e.g. with `-acceptnonstdtxn=1`). (#28948) + +External Signing +---------------- + +- Support for external signing on Windows has been disabled. It will be re-enabled + once the underlying dependency (Boost Process), has been replaced with a different + library. (#28967) + +Updated RPCs +------------ + +- The addnode RPC now follows the `-v2transport` option (now on by default, see above) for making connections. + It remains possible to specify the transport type manually with the v2transport argument of addnode. (#29239) + +Build System +------------ + +- A C++20 capable compiler is now required to build Bitcoin Core. (#28349) +- MacOS releases are configured to use the hardened runtime libraries (#29127) + +Wallet +------ + +- The CoinGrinder coin selection algorithm has been introduced to mitigate unnecessary + large input sets and lower transaction costs at high feerates. CoinGrinder + searches for the input set with minimal weight. Solutions found by + CoinGrinder will produce a change output. CoinGrinder is only active at + elevated feerates (default: 30+ sat/vB, based on `-consolidatefeerate`×3). (#27877) +- The Branch And Bound coin selection algorithm will be disabled when the subtract fee + from outputs feature is used. (#28994) +- If the birth time of a descriptor is detected to be later than the first transaction + involving that descriptor, the birth time will be reset to the earlier time. (#28920) + +Low-level changes +================= + +Pruning +------- + +- When pruning during initial block download, more blocks will be pruned at each + flush in order to speed up the syncing of such nodes. (#20827) + +Init +---- + +- Various fixes to prevent issues where subsequent instances of Bitcoin Core would + result in deletion of files in use by an existing instance. (#28784, #28946) +- Improved handling of empty `settings.json` files. (#29144) + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- 22388o⚡️ +- Aaron Clauson +- Amiti Uttarwar +- Andrew Toth +- Anthony Towns +- Antoine Poinsot +- Ava Chow +- Brandon Odiwuor +- brunoerg +- Chris Stewart +- Cory Fields +- dergoegge +- djschnei21 +- Fabian Jahr +- fanquake +- furszy +- Gloria Zhao +- Greg Sanders +- Hennadii Stepanov +- Hernan Marino +- iamcarlos94 +- ismaelsadeeq +- Jameson Lopp +- Jesse Barton +- John Moffett +- Jon Atack +- josibake +- jrakibi +- Justin Dhillon +- Kashif Smith +- kevkevin +- Kristaps Kaupe +- L0la L33tz +- Luke Dashjr +- Lőrinc +- marco +- MarcoFalke +- Mark Friedenbach +- Marnix +- Martin Leitner-Ankerl +- Martin Zumsande +- Max Edwards +- Murch +- muxator +- naiyoma +- Nikodemas Tuckus +- ns-xvrn +- pablomartin4btc +- Peter Todd +- Pieter Wuille +- Richard Myers +- Roman Zeyde +- Russell Yanofsky +- Ryan Ofsky +- Sebastian Falbesoner +- Sergi Delgado Segura +- Sjors Provoost +- stickies-v +- stratospher +- Supachai Kheawjuy +- TheCharlatan +- UdjinM6 +- Vasil Dimov +- w0xlt +- willcl-ark + + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-27.1.md b/doc/release-notes/release-notes-27.1.md new file mode 100644 index 0000000000..b19d70da33 --- /dev/null +++ b/doc/release-notes/release-notes-27.1.md @@ -0,0 +1,114 @@ +27.1 Release Notes +===================== + +Bitcoin Core version 27.1 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### Miniscript + +- #29853 sign: don't assume we are parsing a sane TapMiniscript + +### RPC + +- #29869 rpc, bugfix: Enforce maximum value for setmocktime +- #29870 rpc: Reword SighashFromStr error message +- #30094 rpc: move UniValue in blockToJSON + +### Index + +- #29776 Fix #29767, set m_synced = true after Commit() + +### Gui + +- #gui812 Fix create unsigned transaction fee bump +- #gui813 Don't permit port in proxy IP option + +### Test + +- #29892 test: Fix failing univalue float test + +### P2P + +- #30085 p2p: detect addnode cjdns peers in GetAddedNodeInfo() + +### Build + +- #29747 depends: fix mingw-w64 Qt DEBUG=1 build +- #29859 build: Fix false positive CHECK_ATOMIC test +- #29985 depends: Fix build of Qt for 32-bit platforms with recent glibc +- #30097 crypto: disable asan for sha256_sse4 with clang and -O0 +- #30151 depends: Fetch miniupnpc sources from an alternative website +- #30216 build: Fix building fuzz binary on on SunOS / illumos +- #30217 depends: Update Boost download link + +### Doc + +- #29934 doc: add LLVM instruction for macOS < 13 + +### CI + +- #29856 ci: Bump s390x to ubuntu:24.04 + +### Misc + +- #29691 Change Luke Dashjr seed to dashjr-list-of-p2p-nodes.us +- #30149 contrib: Renew Windows code signing certificate + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Antoine Poinsot +- Ava Chow +- Cory Fields +- dergoegge +- fanquake +- furszy +- Hennadii Stepanov +- Jon Atack +- laanwj +- Luke Dashjr +- MarcoFalke +- nanlour +- Sjors Provoost +- willcl-ark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-27.2.md b/doc/release-notes/release-notes-27.2.md new file mode 100644 index 0000000000..85bf57c500 --- /dev/null +++ b/doc/release-notes/release-notes-27.2.md @@ -0,0 +1,92 @@ +27.2 Release Notes +===================== + +Bitcoin Core version 27.2 is now available from: + + + +This release includes various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### P2P + +- #30394 net: fix race condition in self-connect detection + +### Init + +- #30435 init: change shutdown order of load block thread and scheduler + +### RPC + +- #30357 Fix cases of calls to FillPSBT errantly returning complete=true + +### PSBT + +- #29855 psbt: Check non witness utxo outpoint early + +### Test + +- #30552 test: fix constructor of msg_tx + +### Doc + +- #30504 doc: use proper doxygen formatting for CTxMemPool::cs + +### Build + +- #30283 upnp: fix build with miniupnpc 2.2.8 +- #30633 Fixes for GCC 15 compatibility + +### CI + +- #30193 ci: move ASan job to GitHub Actions from Cirrus CI +- #30299 ci: remove unused bcc variable from workflow + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- Ava Chow +- Cory Fields +- Martin Zumsande +- Matt Whitlock +- Max Edwards +- Sebastian Falbesoner +- Vasil Dimov +- willcl-ark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-28.0.md b/doc/release-notes/release-notes-28.0.md new file mode 100644 index 0000000000..d9e6a34d0f --- /dev/null +++ b/doc/release-notes/release-notes-28.0.md @@ -0,0 +1,371 @@ +Bitcoin Core version 28.0 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Running Bitcoin Core binaries on macOS requires self signing. +``` +cd /path/to/bitcoin-28.0/bin +xattr -d com.apple.quarantine bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin +codesign -s - bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin +``` + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other UNIX-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +Testnet4/BIP94 support +----- + +Support for Testnet4 as specified in [BIP94](https://github.com/bitcoin/bips/blob/master/bip-0094.mediawiki) +has been added. The network can be selected with the `-testnet4` option and +the section header is also named `[testnet4]`. + +While the intention is to phase out support for Testnet3 in an upcoming +version, support for it is still available via the known options in this +release. (#29775) + +Windows Data Directory +---------------------- + +The default data directory on Windows has been moved from `C:\Users\Username\AppData\Roaming\Bitcoin` +to `C:\Users\Username\AppData\Local\Bitcoin`. Bitcoin Core will check the existence +of the old directory first and continue to use that directory for backwards +compatibility if it is present. (#27064) + +JSON-RPC 2.0 Support +-------------------- + +The JSON-RPC server now recognizes JSON-RPC 2.0 requests and responds with +strict adherence to the [specification](https://www.jsonrpc.org/specification). +See [JSON-RPC-interface.md](https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-11-vs-20) for details. (#27101) + +JSON-RPC clients may need to be updated to be compatible with the JSON-RPC server. +Please open an issue on GitHub if any compatibility issues are found. + +libbitcoinconsensus Removal +--------------------------- + +The libbitcoin-consensus library was deprecated in 27.0 and is now completely removed. (#29648) + +P2P and Network Changes +----------------------- + +- Previously if Bitcoin Core was listening for P2P connections, either using + default settings or via `bind=addr:port` it would always also bind to + `127.0.0.1:8334` to listen for Tor connections. It was not possible to switch + this off, even if the node didn't use Tor. This has been changed and now + `bind=addr:port` results in binding on `addr:port` only. The default behavior + of binding to `0.0.0.0:8333` and `127.0.0.1:8334` has not been changed. + + If you are using a `bind=...` configuration without `bind=...=onion` and rely + on the previous implied behavior to accept incoming Tor connections at + `127.0.0.1:8334`, you need to now make this explicit by using + `bind=... bind=127.0.0.1:8334=onion`. (#22729) + +- Bitcoin Core will now fail to start up if any of its P2P binds fail, rather + than the previous behaviour where it would only abort startup if all P2P + binds had failed. (#22729) + +- UNIX domain sockets can now be used for proxy connections. Set `-onion` or `-proxy` + to the local socket path with the prefix `unix:` (e.g. `-onion=unix:/home/me/torsocket`). + (#27375) + +- UNIX socket paths are now accepted for `-zmqpubrawblock` and `-zmqpubrawtx` with + the format `-zmqpubrawtx=unix:/path/to/file` (#27679) + +- Additional "in" and "out" flags have been added to `-whitelist` to control whether + permissions apply to inbound connections and/or manual ones (default: inbound only). (#27114) + +- Transactions having a feerate that is too low will be opportunistically paired with + their child transactions and submitted as a package, thus enabling the node to download + 1-parent-1-child packages using the existing transaction relay protocol. Combined with + other mempool policies, this change allows limited "package relay" when a parent transaction + is below the mempool minimum feerate. Topologically Restricted Until Confirmation (TRUC) + parents are additionally allowed to be below the minimum relay feerate (i.e., pay 0 fees). + Use the `submitpackage` RPC to submit packages directly to the node. Warning: this P2P + feature is limited (unlike the `submitpackage` interface, a child with multiple unconfirmed + parents is not supported) and not yet reliable under adversarial conditions. (#28970) + +Mempool Policy Changes +---------------------- + +- Transactions with version number set to 3 are now treated as standard on all networks (#29496), + subject to opt-in Topologically Restricted Until Confirmation (TRUC) transaction policy as + described in [BIP 431](https://github.com/bitcoin/bips/blob/master/bip-0431.mediawiki). The + policy includes limits on spending unconfirmed outputs (#28948), eviction of a previous descendant + if a more incentive-compatible one is submitted (#29306), and a maximum transaction size of 10,000vB + (#29873). These restrictions simplify the assessment of incentive compatibility of accepting or + replacing TRUC transactions, thus ensuring any replacements are more profitable for the node and + making fee-bumping more reliable. + +- Pay To Anchor (P2A) is a new standard witness output type for spending, + a newly recognised output template. This allows for key-less anchor + outputs, with compact spending conditions for additional efficiencies on + top of an equivalent `sh(OP_TRUE)` output, in addition to the txid stability + of the spending transaction. + N.B. propagation of this output spending on the network will be limited + until a sufficient number of nodes on the network adopt this upgrade. (#30352) + +- Limited package RBF is now enabled, where the proposed conflicting package would result in + a connected component, aka cluster, of size 2 in the mempool. All clusters being conflicted + against must be of size 2 or lower. (#28984) + +- The default value of the `-mempoolfullrbf` configuration option has been changed from 0 to 1, + i.e. `mempoolfullrbf=1`. (#30493) + +Updated RPCs +------------ + +- The `dumptxoutset` RPC now returns the UTXO set dump in a new and + improved format. Correspondingly, the `loadtxoutset` RPC now expects + this new format in the dumps it tries to load. Dumps with the old + format are no longer supported and need to be recreated using the + new format to be usable. (#29612) + +- AssumeUTXO mainnet parameters have been added for height 840,000. + This means the `loadtxoutset` RPC can now be used on mainnet with + the matching UTXO set from that height. (#28553) + +- The `warnings` field in `getblockchaininfo`, `getmininginfo` and + `getnetworkinfo` now returns all the active node warnings as an array + of strings, instead of a single warning. The current behaviour + can be temporarily restored by running Bitcoin Core with the configuration + option `-deprecatedrpc=warnings`. (#29845) + +- Previously when using the `sendrawtransaction` RPC and specifying outputs + that are already in the UTXO set, an RPC error code of `-27` with the + message "Transaction already in block chain" was returned in response. + The error message has been changed to "Transaction outputs already in utxo set" + to more accurately describe the source of the issue. (#30212) + +- The default mode for the `estimatesmartfee` RPC has been updated from `conservative` to `economical`, + which is expected to reduce over-estimation for many users, particularly if Replace-by-Fee is an option. + For users that require high confidence in their fee estimates at the cost of potentially over-estimating, + the `conservative` mode remains available. (#30275) + +- RPC `scantxoutset` now returns 2 new fields in the "unspents" JSON array: `blockhash` and `confirmations`. + See the scantxoutset help for details. (#30515) + +- RPC `submitpackage` now allows 2 new arguments to be passed: `maxfeerate` and `maxburnamount`. See the + subtmitpackage help for details. (#28950) + +Changes to wallet-related RPCs can be found in the Wallet section below. + +Updated REST APIs +----------------- +- Parameter validation for `/rest/getutxos` has been improved by rejecting + truncated or overly large txids and malformed outpoint indices via raising + an HTTP_BAD_REQUEST "Parse error". These requests were previously handled + silently. (#30482, #30444) + +Build System +------------ + +- GCC 11.1 or later, or Clang 16.0 or later, +are now required to compile Bitcoin Core. (#29091, #30263) + +- The minimum required glibc to run Bitcoin Core is now +2.31. This means that RHEL 8 and Ubuntu 18.04 (Bionic) +are no-longer supported. (#29987) + +- `--enable-lcov-branch-coverage` has been removed, given +incompatibilities between lcov version 1 & 2. `LCOV_OPTS` +should be used to set any options instead. (#30192) + +Updated Settings +---------------- + +- When running with `-alertnotify`, an alert can now be raised multiple +times instead of just once. Previously, it was only raised when unknown +new consensus rules were activated. Its scope has now been increased to +include all kernel warnings. Specifically, alerts will now also be raised +when an invalid chain with a large amount of work has been detected. +Additional warnings may be added in the future. (#30058) + +Changes to GUI or wallet related settings can be found in the GUI or Wallet section below. + +Wallet +------ + +- The wallet now detects when wallet transactions conflict with the mempool. Mempool-conflicting + transactions can be seen in the `"mempoolconflicts"` field of `gettransaction`. The inputs + of mempool-conflicted transactions can now be respent without manually abandoning the + transactions when the parent transaction is dropped from the mempool, which can cause wallet + balances to appear higher. (#27307) + +- A new `max_tx_weight` option has been added to the RPCs `fundrawtransaction`, `walletcreatefundedpsbt`, and `send`. +It specifies the maximum transaction weight. If the limit is exceeded during funding, the transaction will not be built. +The default value is 4,000,000 WU. (#29523) + +- A new `createwalletdescriptor` RPC allows users to add new automatically generated + descriptors to their wallet. This can be used to upgrade wallets created prior to the + introduction of a new standard descriptor, such as taproot. (#29130) + +- A new RPC `gethdkeys` lists all of the BIP32 HD keys in use by all of the descriptors in the wallet. + These keys can be used in conjunction with `createwalletdescriptor` to create and add single key + descriptors to the wallet for a particular key that the wallet already knows. (#29130) + +- The `sendall` RPC can now spend unconfirmed change and will include additional fees as necessary + for the resulting transaction to bump the unconfirmed transactions' feerates to the specified feerate. (#28979) + +- In RPC `bumpfee`, if a `fee_rate` is specified, the feerate is no longer restricted + to following the wallet's incremental feerate of 5 sat/vb. The feerate must still be + at least the sum of the original fee and the mempool's incremental feerate. (#27969) + +GUI Changes +----------- + +- The "Migrate Wallet" menu allows users to migrate any legacy wallet in their wallet +directory, regardless of the wallets loaded. (gui#824) + +- The "Information" window now displays the maximum mempool size along with the +mempool usage. (gui#825) + +Low-level Changes +================= + +Tests +----- + +- The BIP94 timewarp attack mitigation is now active on the `regtest` network. (#30681) + +- A new `-testdatadir` option has been added to `test_bitcoin` to allow specifying the + location of unit test data directories. (#26564) + +Blockstorage +------------ + +- Block files are now XOR'd by default with a key stored in the blocksdir. +Previous releases of Bitcoin Core or previous external software will not be able to read the blocksdir with a non-zero XOR-key. +Refer to the `-blocksxor` help for more details. (#28052) + +Chainstate +---------- + +- The chainstate database flushes that occur when blocks are pruned will no longer +empty the database cache. The cache will remain populated longer, which significantly +reduces the time for initial block download to complete. (#28280) + +Dependencies +------------ + +- The dependency on Boost.Process has been replaced with cpp-subprocess, which is contained in source. +Builders will no longer need Boost.Process to build with external signer support. (#28981) + +Credits +======= + +Thanks to everyone who directly contributed to this release: +- 0xb10c +- Alfonso Roman Zubeldia +- Andrew Toth +- AngusP +- Anthony Towns +- Antoine Poinsot +- Anton A +- Ava Chow +- Ayush Singh +- Ben Westgate +- Brandon Odiwuor +- brunoerg +- bstin +- Charlie +- Christopher Bergqvist +- Cory Fields +- crazeteam +- Daniela Brozzoni +- David Gumberg +- dergoegge +- Edil Medeiros +- Epic Curious +- Fabian Jahr +- fanquake +- furszy +- glozow +- Greg Sanders +- hanmz +- Hennadii Stepanov +- Hernan Marino +- Hodlinator +- ishaanam +- ismaelsadeeq +- Jadi +- Jon Atack +- josibake +- jrakibi +- kevkevin +- kevkevinpal +- Konstantin Akimov +- laanwj +- Larry Ruane +- Lőrinc +- Luis Schwab +- Luke Dashjr +- MarcoFalke +- marcofleon +- Marnix +- Martin Saposnic +- Martin Zumsande +- Matt Corallo +- Matthew Zipkin +- Matt Whitlock +- Max Edwards +- Michael Dietz +- Murch +- nanlour +- pablomartin4btc +- Peter Todd +- Pieter Wuille +- @RandyMcMillan +- RoboSchmied +- Roman Zeyde +- Ryan Ofsky +- Sebastian Falbesoner +- Sergi Delgado Segura +- Sjors Provoost +- spicyzboss +- StevenMia +- stickies-v +- stratospher +- Suhas Daftuar +- sunerok +- tdb3 +- TheCharlatan +- umiumi +- Vasil Dimov +- virtu +- willcl-ark + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-28.1.md b/doc/release-notes/release-notes-28.1.md new file mode 100644 index 0000000000..de3b8c5a06 --- /dev/null +++ b/doc/release-notes/release-notes-28.1.md @@ -0,0 +1,107 @@ +Bitcoin Core version 28.1 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Running Bitcoin Core binaries on macOS requires self signing. +``` +cd /path/to/bitcoin-28.x/bin +xattr -d com.apple.quarantine bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin +codesign -s - bitcoin-cli bitcoin-qt bitcoin-tx bitcoin-util bitcoin-wallet bitcoind test_bitcoin +``` + +Compatibility +============== + +Bitcoin Core is supported and extensively tested on operating systems +using the Linux Kernel 3.17+, macOS 11.0+, and Windows 7 and newer. Bitcoin +Core should also work on most other UNIX-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### P2P + +- When the `-port` configuration option is used, the default onion listening port will now + be derived to be that port + 1 instead of being set to a fixed value (8334 on mainnet). + This re-allows setups with multiple local nodes using different `-port` and not using `-bind`, + which would lead to a startup failure in v28.0 due to a port collision. + + Note that a `HiddenServicePort` manually configured in `torrc` may need adjustment if used in + connection with the `-port` option. + For example, if you are using `-port=5555` with a non-standard value and not using `-bind=...=onion`, + previously Bitcoin Core would listen for incoming Tor connections on `127.0.0.1:8334`. + Now it would listen on `127.0.0.1:5556` (`-port` plus one). If you configured the hidden service manually + in torrc now you have to change it from `HiddenServicePort 8333 127.0.0.1:8334` to `HiddenServicePort 8333 + 127.0.0.1:5556`, or configure bitcoind with `-bind=127.0.0.1:8334=onion` to get the previous behavior. + (#31223) +- #30568 addrman: change internal id counting to int64_t + +### Key + +- #31166 key: clear out secret data in DecodeExtKey + +### Build + +- #31013 depends: For mingw cross compile use `-gcc-posix` to prevent library conflict +- #31502 depends: Fix CXXFLAGS on NetBSD + +### Test + +- #31016 test: add missing sync to feature_fee_estimation.py +- #31448 fuzz: add cstdlib to FuzzedDataProvider +- #31419 test: fix MIN macro redefinition +- #31563 rpc: Extend scope of validation mutex in generateblock + +### Doc + +- #31007 doc: add testnet4 section header for config file + +### CI + +- #30961 ci: add LLVM_SYMBOLIZER_PATH to Valgrind fuzz job + +### Misc + +- #31267 refactor: Drop deprecated space in `operator""_mst` +- #31431 util: use explicit cast in MultiIntBitSet::Fill() + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- fanquake +- Hennadii Stepanov +- laanwj +- MarcoFalke +- Martin Zumsande +- Marnix +- Sebastian Falbesoner + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-notes/release-notes-29.0.md b/doc/release-notes/release-notes-29.0.md new file mode 100644 index 0000000000..582cc7e885 --- /dev/null +++ b/doc/release-notes/release-notes-29.0.md @@ -0,0 +1,261 @@ +Bitcoin Core version 29.0 is now available from: + + + +This release includes new features, various bug fixes and performance +improvements, as well as updated translations. + +Please report bugs using the issue tracker at GitHub: + + + +To receive security and update notifications, please subscribe to: + + + +How to Upgrade +============== + +If you are running an older version, shut it down. Wait until it has completely +shut down (which might take a few minutes in some cases), then run the +installer (on Windows) or just copy over `/Applications/Bitcoin-Qt` (on macOS) +or `bitcoind`/`bitcoin-qt` (on Linux). + +Upgrading directly from a version of Bitcoin Core that has reached its EOL is +possible, but it might take some time if the data directory needs to be migrated. Old +wallet versions of Bitcoin Core are generally supported. + +Compatibility +============== + +Bitcoin Core is supported and tested on operating systems using the +Linux Kernel 3.17+, macOS 13+, and Windows 10+. Bitcoin +Core should also work on most other Unix-like systems but is not as +frequently tested on them. It is not recommended to use Bitcoin Core on +unsupported systems. + +Notable changes +=============== + +### P2P and Network Changes + +- Support for UPnP was dropped. If you want to open a port automatically, consider using the `-natpmp` +option instead, which uses PCP or NAT-PMP depending on router support. (#31130) + +- libnatpmp was replaced with a built-in implementation of PCP and NAT-PMP (still enabled using the `-natpmp` option). This supports automatic IPv4 port forwarding as well as IPv6 pinholing. (#30043) + +- When the `-port` configuration option is used, the default onion listening port will now +be derived to be that port + 1 instead of being set to a fixed value (8334 on mainnet). +This re-allows setups with multiple local nodes using different `-port` and not using `-bind`, +which would lead to a startup failure in v28.0 due to a port collision. +Note that a `HiddenServicePort` manually configured in `torrc` may need adjustment if used in +connection with the `-port` option. +For example, if you are using `-port=5555` with a non-standard value and not using `-bind=...=onion`, +previously Bitcoin Core would listen for incoming Tor connections on `127.0.0.1:8334`. +Now it would listen on `127.0.0.1:5556` (`-port` plus one). If you configured the hidden service manually +in torrc now you have to change it from `HiddenServicePort 8333 127.0.0.1:8334` to `HiddenServicePort 8333 +127.0.0.1:5556`, or configure bitcoind with `-bind=127.0.0.1:8334=onion` to get the previous behavior. +(#31223) + +- Upon receiving an orphan transaction (an unconfirmed transaction that spends unknown inputs), the node will attempt to download missing parents from all peers who announced the orphan. This change may increase bandwidth usage but make orphan-handling more reliable. (#31397) + +### Mempool Policy and Mining Changes + +- Ephemeral dust is a new concept that allows a single +dust output in a transaction, provided the transaction +is zero fee. In order to spend any unconfirmed outputs +from this transaction, the spender must also spend +this dust in addition to any other desired outputs. +In other words, this type of transaction +should be created in a transaction package where +the dust is both created and spent simultaneously. (#30239) + +- Due to a bug, the default block reserved weight (`4,000 WU`) for fixed-size block header, transactions count, and coinbase transaction was reserved twice and could not be lowered. As a result the total reserved weight was always `8,000 WU`, meaning that even when specifying a `-blockmaxweight` higher than the default (even to the max of `4,000,000 WU`), the actual block size will never exceed `3,992,000 WU`. +The fix consolidates the reservation into a single place and introduces a new startup option, `-blockreservedweight` which specifies the reserved weight directly. The default value of `-blockreservedweight` is set to `8,000 WU` to ensure backward compatibility for users who relied on the previous behavior of `-blockmaxweight`. +The minimum value of `-blockreservedweight` is set to `2,000 WU`. Users setting `-blockreservedweight` below the default should ensure that the total weight of their block header, transaction count, and coinbase transaction does not exceed the reduced value or they may risk mining an invalid block. (#31384) + +### Updated RPCs + +- The RPC `testmempoolaccept` response now includes a `reject-details` field in some cases, +similar to the complete error messages returned by `sendrawtransaction` (#28121) + +- Duplicate blocks submitted with `submitblock` will now persist their block data +even if it was previously pruned. If pruning is activated, the data will be +pruned again eventually once the block file it is persisted in is selected for +pruning. This is consistent with the behaviour of `getblockfrompeer` where the +block is persisted as well even when pruning. (#31175) + +- `getmininginfo` now returns `nBits` and the current target in the `target` field. It also returns a `next` object which specifies the `height`, `nBits`, `difficulty`, and `target` for the next block. (#31583) + +- `getblock` and `getblockheader` now return the current target in the `target` field (#31583) + +- `getblockchaininfo` and `getchainstates` now return `nBits` and the current target in the `target` field (#31583) + +- the `getblocktemplate` RPC `curtime` (BIP22) and `mintime` (BIP23) fields now + account for the timewarp fix proposed in BIP94 on all networks. This ensures + that, in the event a timewarp fix softfork activates on mainnet, un-upgraded + miners will not accidentally violate the timewarp rule. (#31376, #31600) +As a reminder, it's important that any software which uses the `getblocktemplate` +RPC takes these values into account (either `curtime` or `mintime` is fine). +Relying only on a clock can lead to invalid blocks under some circumstances, +especially once a timewarp fix is deployed. (#31600) + +### New RPCs + +- `getdescriptoractivity` can be used to find all spend/receive activity relevant to + a given set of descriptors within a set of specified blocks. This call can be used with + `scanblocks` to lessen the need for additional indexing programs. (#30708) + +### Updated REST APIs + +- `GET /rest/block/.json` and `GET /rest/headers/.json` now return the current target in the `target` field + +### Updated Settings + +- The maximum allowed value for the `-dbcache` configuration option has been + dropped due to recent UTXO set growth. Note that before this change, large `-dbcache` + values were automatically reduced to 16 GiB (1 GiB on 32 bit systems). (#28358) + +- Handling of negated `-noseednode`, `-nobind`, `-nowhitebind`, `-norpcbind`, `-norpcallowip`, `-norpcwhitelist`, `-notest`, `-noasmap`, `-norpcwallet`, `-noonlynet`, and `-noexternalip` options has changed. Previously negating these options had various confusing and undocumented side effects. Now negating them just resets the settings and restores default behaviors, as if the options were not specified. + +- Starting with v28.0, the `-mempoolfullrbf` startup option was set to +default to `1`. With widespread adoption of this policy, users no longer +benefit from disabling it, so the option has been removed, making full +replace-by-fee the standard behavior. (#30592) + +- Setting `-upnp` will now log a warning and be interpreted as `-natpmp`. Consider using `-natpmp` directly instead. (#31130, #31916) + +- As a safety check, Bitcoin core will **fail to start** when `-blockreservedweight` init parameter value is lower than `2000` weight units. Bitcoin Core will also **fail to start** if the `-blockmaxweight` or `-blockreservedweight` init parameter exceeds consensus limit of `4,000,000 WU`. + +- Passing `-debug=0` or `-debug=none` now behaves like `-nodebug`: previously set debug categories will be cleared, but subsequent `-debug` options will still be applied. + +- The default for `-rpcthreads` has been changed from 4 to 16, and the default for `-rpcworkqueue` has been changed from 16 to 64. (#31215). + +### Build System + +The build system has been migrated from Autotools to CMake: + +1. The minimum required CMake version is 3.22. +2. In-source builds are not allowed. When using a subdirectory within the root source tree as a build directory, it is recommended that its name includes the substring "build". +3. CMake variables may be used to configure the build system. **Some defaults have changed.** For example, you will now need to add `-DWITH_ZMQ=ON` to build with zmq and `-DBUILD_GUI=ON` to build `bitcoin-qt`. See [Autotools to CMake Options Mapping](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/Autotools-to-CMake-Options-Mapping) for details. +4. For single-configuration generators, the default build configuration (`CMAKE_BUILD_TYPE`) is "RelWithDebInfo". However, for the "Release" configuration, CMake defaults to the compiler optimization flag `-O3`, which has not been extensively tested with Bitcoin Core. Therefore, the build system replaces it with `-O2`. +5. By default, the built executables and libraries are located in the `bin/` and `lib/` subdirectories of the build directory. +6. The build system supports component‐based installation. The names of the installable components coincide with the build target names. For example: +``` +cmake -B build +cmake --build build --target bitcoind +cmake --install build --component bitcoind +``` + +7. If any of the `CPPFLAGS`, `CFLAGS`, `CXXFLAGS` or `LDFLAGS` environment variables were used in your Autotools-based build process, you should instead use the corresponding CMake variables (`APPEND_CPPFLAGS`, `APPEND_CFLAGS`, `APPEND_CXXFLAGS` and `APPEND_LDFLAGS`). Alternatively, if you opt to use the dedicated `CMAKE_<...>_FLAGS` variables, you must ensure that the resulting compiler or linker invocations are as expected. + +For more detailed guidance on configuring and using CMake, please refer to the official [CMake documentation](https://cmake.org/cmake/help/latest/) and [CMake’s User Interaction Guide](https://cmake.org/cmake/help/latest/guide/user-interaction/index.html). Additionally, consult platform-specific `doc/build-*.md` build guides for instructions tailored to your operating system. + +## Low-Level Changes + +### Tools and Utilities + +- A new tool [`utxo_to_sqlite.py`](https://github.com/bitcoin/bitcoin/blob/v29.0/contrib/utxo-tools/utxo_to_sqlite.py) + converts a compact-serialized UTXO snapshot (as created with the + `dumptxoutset` RPC) to a SQLite3 database. Refer to the script's `--help` + output for more details. (#27432) + +### Tests + +- The BIP94 timewarp attack mitigation (designed for testnet4) is no longer active on the regtest network. (#31156) + +### Dependencies + +- MiniUPnPc and libnatpmp have been removed as dependencies (#31130, #30043). + +Credits +======= + +Thanks to everyone who directly contributed to this release: + +- 0xb10c +- Adlai Chandrasekhar +- Afanti +- Alfonso Roman Zubeldia +- am-sq +- Andre +- Andre Alves +- Anthony Towns +- Antoine Poinsot +- Ash Manning +- Ava Chow +- Boris Nagaev +- Brandon Odiwuor +- brunoerg +- Chris Stewart +- Cory Fields +- costcould +- Daniel Pfeifer +- Daniela Brozzoni +- David Gumberg +- dergoegge +- epysqyli +- espi3 +- Eval EXEC +- Fabian Jahr +- fanquake +- furszy +- Gabriele Bocchi +- glozow +- Greg Sanders +- Gutflo +- Hennadii Stepanov +- Hodlinator +- i-am-yuvi +- ion- +- ismaelsadeeq +- Jadi +- James O'Beirne +- Jeremy Rand +- Jon Atack +- jurraca +- Kay +- kevkevinpal +- l0rinc +- laanwj +- Larry Ruane +- Lőrinc +- Maciej S. Szmigiero +- Mackain +- MarcoFalke +- marcofleon +- Marnix +- Martin Leitner-Ankerl +- Martin Saposnic +- Martin Zumsande +- Matthew Zipkin +- Max Edwards +- Michael Dietz +- naiyoma +- Nicola Leonardo Susca +- omahs +- pablomartin4btc +- Pieter Wuille +- Randall Naar +- RiceChuan +- rkrux +- Roman Zeyde +- Ryan Ofsky +- Sebastian Falbesoner +- secp512k2 +- Sergi Delgado Segura +- Simon +- Sjors Provoost +- stickies-v +- Suhas Daftuar +- tdb3 +- TheCharlatan +- tianzedavid +- Torkel Rogstad +- Vasil Dimov +- wgyt +- willcl-ark +- yancy + +As well as to everyone that helped with translations on +[Transifex](https://www.transifex.com/bitcoin/bitcoin/). diff --git a/doc/release-process.md b/doc/release-process.md index c7a8998b8b..1c5810d023 100644 --- a/doc/release-process.md +++ b/doc/release-process.md @@ -5,30 +5,31 @@ Release Process ### Before every release candidate -* Update translations see [translation_process.md](https://github.com/bitcoin/bitcoin/blob/master/doc/translation_process.md#synchronising-translations). -* Update release candidate version in `configure.ac` (`CLIENT_VERSION_RC`). -* Update manpages (after rebuilding the binaries), see [gen-manpages.py](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/README.md#gen-manpagespy). -* Update bitcoin.conf and commit, see [gen-bitcoin-conf.sh](https://github.com/bitcoin/bitcoin/blob/master/contrib/devtools/README.md#gen-bitcoin-confsh). +* Update release candidate version in `CMakeLists.txt` (`CLIENT_VERSION_RC`). +* Update manpages (after rebuilding the binaries), see [gen-manpages.py](/contrib/devtools/README.md#gen-manpagespy). +* Update bitcoin.conf and commit changes if they exist, see [gen-bitcoin-conf.sh](/contrib/devtools/README.md#gen-bitcoin-confsh). ### Before every major and minor release * Update [bips.md](bips.md) to account for changes since the last release. -* Update version in `configure.ac` (don't forget to set `CLIENT_VERSION_RC` to `0`). +* Update version in `CMakeLists.txt` (don't forget to set `CLIENT_VERSION_RC` to `0`). * Update manpages (see previous section) -* Write release notes (see "Write the release notes" below). +* Write release notes (see "Write the release notes" below) in doc/release-notes.md. If necessary, + archive the previous release notes as doc/release-notes/release-notes-${VERSION}.md. ### Before every major release * On both the master branch and the new release branch: - - update `CLIENT_VERSION_MAJOR` in [`configure.ac`](../configure.ac) -* On the new release branch in [`configure.ac`](../configure.ac)(see [this commit](https://github.com/bitcoin/bitcoin/commit/742f7dd)): + - update `CLIENT_VERSION_MAJOR` in [`CMakeLists.txt`](../CMakeLists.txt) +* On the new release branch in [`CMakeLists.txt`](../CMakeLists.txt)(see [this commit](https://github.com/bitcoin/bitcoin/commit/742f7dd)): - set `CLIENT_VERSION_MINOR` to `0` - set `CLIENT_VERSION_BUILD` to `0` - set `CLIENT_VERSION_IS_RELEASE` to `true` #### Before branch-off -* Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/bitcoin/bitcoin/pull/7415) for an example. +* Update translations see [translation_process.md](/doc/translation_process.md#synchronising-translations). +* Update hardcoded [seeds](/contrib/seeds/README.md), see [this pull request](https://github.com/bitcoin/bitcoin/pull/27488) for an example. * Update the following variables in [`src/kernel/chainparams.cpp`](/src/kernel/chainparams.cpp) for mainnet, testnet, and signet: - `m_assumed_blockchain_size` and `m_assumed_chain_state_size` with the current size plus some overhead (see [this](#how-to-calculate-assumed-blockchain-and-chain-state-size) for information on how to calculate them). @@ -36,13 +37,23 @@ Release Process that causes rejection of blocks in the past history. - `chainTxData` with statistics about the transaction count and rate. Use the output of the `getchaintxstats` RPC with an `nBlocks` of 4096 (28 days) and a `bestblockhash` of RPC `getbestblockhash`; see - [this pull request](https://github.com/bitcoin/bitcoin/pull/20263) for an example. Reviewers can verify the results by running + [this pull request](https://github.com/bitcoin/bitcoin/pull/28591) for an example. Reviewers can verify the results by running `getchaintxstats ` with the `window_block_count` and `window_final_block_hash` from your output. - `defaultAssumeValid` with the output of RPC `getblockhash` using the `height` of `window_final_block_height` above (and update the block height comment with that height), taking into account the following: - On mainnet, the selected value must not be orphaned, so it may be useful to set the height two blocks back from the tip. - Testnet should be set with a height some tens of thousands back from the tip, due to reorgs there. - `nMinimumChainWork` with the "chainwork" value of RPC `getblockheader` using the same height as that selected for the previous step. + - `m_assumeutxo_data` array should be appended to with the values returned by calling `bitcoin-cli -rpcclienttimeout=0 -named dumptxoutset utxo.dat rollback=` + The same height considerations for `defaultAssumeValid` apply. +* Consider updating the headers synchronization tuning parameters to account for the chainparams updates. + The optimal values change very slowly, so this isn't strictly necessary every release, but doing so doesn't hurt. + - Update configuration variables in [`contrib/devtools/headerssync-params.py`](/contrib/devtools/headerssync-params.py): + - Set `TIME` to the software's expected supported lifetime -- after this time, its ability to defend against a high bandwidth timewarp attacker will begin to degrade. + - Set `MINCHAINWORK_HEADERS` to the height used for the `nMinimumChainWork` calculation above. + - Check that the other variables still look reasonable. + - Run the script. It works fine in CPython, but PyPy is much faster (seconds instead of minutes): `pypy3 contrib/devtools/headerssync-params.py`. + - Paste the output defining `HEADER_COMMITMENT_PERIOD` and `REDOWNLOAD_BUFFER_SIZE` into the top of [`src/headerssync.cpp`](/src/headerssync.cpp). - Clear the release notes and move them to the wiki (see "Write the release notes" below). - Translations on Transifex: - Pull translations from Transifex into the master branch. @@ -66,7 +77,9 @@ Release Process #### Before final release - Merge the release notes from [the wiki](https://github.com/bitcoin-core/bitcoin-devwiki/wiki/) into the branch. -- Ensure the "Needs release note" label is removed from all relevant pull requests and issues. +- Ensure the "Needs release note" label is removed from all relevant pull + requests and issues: + https://github.com/bitcoin/bitcoin/issues?q=label%3A%22Needs+release+note%22 #### Tagging a release (candidate) @@ -123,7 +136,7 @@ git -C ./guix.sigs pull ### Create the macOS SDK tarball (first time, or when SDK version changes) Create the macOS SDK tarball, see the [macdeploy -instructions](/contrib/macdeploy/README.md#deterministic-macos-dmg-notes) for +instructions](/contrib/macdeploy/README.md#sdk-extraction) for details. ### Build and attest to build outputs @@ -151,32 +164,40 @@ Then open a Pull Request to the [guix.sigs repository](https://github.com/bitcoi ### macOS codesigner only: Create detached macOS signatures (assuming [signapple](https://github.com/achow101/signapple/) is installed and up to date with master branch) - tar xf bitcoin-osx-unsigned.tar.gz - ./detached-sig-create.sh /path/to/codesign.p12 +In the `guix-build-${VERSION}/output/x86_64-apple-darwin` and `guix-build-${VERSION}/output/arm64-apple-darwin` directories: + + tar xf bitcoin-${VERSION}-${ARCH}-apple-darwin-codesigning.tar.gz + ./detached-sig-create.sh /path/to/codesign.p12 /path/to/AuthKey_foo.p8 uuid Enter the keychain password and authorize the signature signature-osx.tar.gz will be created ### Windows codesigner only: Create detached Windows signatures - tar xf bitcoin-win-unsigned.tar.gz - ./detached-sig-create.sh -key /path/to/codesign.key +In the `guix-build-${VERSION}/output/x86_64-w64-mingw32` directory: + + tar xf bitcoin-${VERSION}-win64-codesigning.tar.gz + ./detached-sig-create.sh /path/to/codesign.key Enter the passphrase for the key when prompted signature-win.tar.gz will be created ### Windows and macOS codesigners only: test code signatures It is advised to test that the code signature attaches properly prior to tagging by performing the `guix-codesign` step. -However if this is done, once the release has been tagged in the bitcoin-detached-sigs repo, the `guix-codesign` step must be performed again in order for the guix attestation to be valid when compared against the attestations of non-codesigner builds. +However if this is done, once the release has been tagged in the bitcoin-detached-sigs repo, the `guix-codesign` step must be performed again in order for the guix attestation to be valid when compared against the attestations of non-codesigner builds. The directories created by `guix-codesign` will need to be cleared prior to running `guix-codesign` again. ### Windows and macOS codesigners only: Commit the detached codesign payloads ```sh pushd ./bitcoin-detached-sigs -# checkout the appropriate branch for this release series -rm -rf ./* +# checkout or create the appropriate branch for this release series +git checkout --orphan +# if you are the macOS codesigner +rm -rf osx tar xf signature-osx.tar.gz +# if you are the windows codesigner +rm -rf win tar xf signature-win.tar.gz git add -A -git commit -m "point to ${VERSION}" +git commit -m ": {osx,win} signature for {rc,final}" git tag -s "v${VERSION}" HEAD git push the current branch and new tag popd @@ -206,45 +227,36 @@ popd Then open a Pull Request to the [guix.sigs repository](https://github.com/bitcoin-core/guix.sigs). -## After 3 or more people have guix-built and their results match +## After 6 or more people have guix-built and their results match -Combine the `all.SHA256SUMS.asc` file from all signers into `SHA256SUMS.asc`: +After verifying signatures, combine the `all.SHA256SUMS.asc` file from all signers into `SHA256SUMS.asc`: ```bash cat "$VERSION"/*/all.SHA256SUMS.asc > SHA256SUMS.asc ``` -- Upload to the bitcoincore.org server (`/var/www/bin/bitcoin-core-${VERSION}/`): - 1. The contents of each `./bitcoin/guix-build-${VERSION}/output/${HOST}/` directory, except for - `*-debug*` files. +- Upload to the bitcoincore.org server: + 1. The contents of each `./bitcoin/guix-build-${VERSION}/output/${HOST}/` directory. Guix will output all of the results into host subdirectories, but the SHA256SUMS file does not include these subdirectories. In order for downloads via torrent to verify without directory structure modification, all of the uploaded files need to be in the same directory as the SHA256SUMS file. - The `*-debug*` files generated by the guix build contain debug symbols - for troubleshooting by developers. It is assumed that anyone that is - interested in debugging can run guix to generate the files for - themselves. To avoid end-user confusion about which file to pick, as well - as save storage space *do not upload these to the bitcoincore.org server, - nor put them in the torrent*. - - ```sh - find guix-build-${VERSION}/output/ -maxdepth 2 -type f -not -name "SHA256SUMS.part" -and -not -name "*debug*" -exec scp {} user@bitcoincore.org:/var/www/bin/bitcoin-core-${VERSION} \; - ``` + Wait until all of these files have finished uploading before uploading the SHA256SUMS(.asc) files. 2. The `SHA256SUMS` file - 3. The `SHA256SUMS.asc` combined signature file you just created + 3. The `SHA256SUMS.asc` combined signature file you just created. + +- After uploading release candidate binaries, notify the bitcoin-core-dev mailing list and + bitcoin-dev group that a release candidate is available for testing. Include a link to the release + notes draft. -- Create a torrent of the `/var/www/bin/bitcoin-core-${VERSION}` directory such - that at the top level there is only one file: the `bitcoin-core-${VERSION}` - directory containing everything else. Name the torrent - `bitcoin-${VERSION}.torrent` (note that there is no `-core-` in this name). +- The server will automatically create an OpenTimestamps file and torrent of the directory. - Optionally help seed this torrent. To get the `magnet:` URI use: +- Optionally help seed this torrent. To get the `magnet:` URI use: ```sh transmission-show -m @@ -255,32 +267,33 @@ cat "$VERSION"/*/all.SHA256SUMS.asc > SHA256SUMS.asc Also put it into the `optional_magnetlink:` slot in the YAML file for bitcoincore.org. -- Update other repositories and websites for new version +- Archive the release notes for the new version to `doc/release-notes/release-notes-${VERSION}.md` + (branch `master` and branch of the release). - - bitcoincore.org blog post +- Update the bitcoincore.org website - - bitcoincore.org maintained versions update: - [table](https://github.com/bitcoin-core/bitcoincore.org/commits/master/_includes/posts/maintenance-table.md) + - blog post - - Delete post-EOL [release branches](https://github.com/bitcoin/bitcoin/branches/all) and create a tag `v${branch_name}-final`. - - - Delete ["Needs backport" labels](https://github.com/bitcoin/bitcoin/labels?q=backport) for non-existing branches. + - maintained versions [table](https://github.com/bitcoin-core/bitcoincore.org/commits/master/_includes/posts/maintenance-table.md) - - bitcoincore.org RPC documentation update + - RPC documentation update - See https://github.com/bitcoin-core/bitcoincore.org/blob/master/contrib/doc-gen/ + +- Update repositories + + - Delete post-EOL [release branches](https://github.com/bitcoin/bitcoin/branches/all) and create a tag `v${branch_name}-final`. + + - Delete ["Needs backport" labels](https://github.com/bitcoin/bitcoin/labels?q=backport) for non-existing branches. + - Update packaging repo - Push the flatpak to flathub, e.g. https://github.com/flathub/org.bitcoincore.bitcoin-qt/pull/2 - Push the snap, see https://github.com/bitcoin-core/packaging/blob/main/snap/local/build.md - - This repo - - - Archive the release notes for the new version to `doc/release-notes/` (branch `master` and branch of the release) - - - Create a [new GitHub release](https://github.com/bitcoin/bitcoin/releases/new) with a link to the archived release notes + - Create a [new GitHub release](https://github.com/bitcoin/bitcoin/releases/new) with a link to the archived release notes - Announce the release: @@ -300,13 +313,15 @@ Both variables are used as a guideline for how much space the user needs on thei Note that all values should be taken from a **fully synced** node and have an overhead of 5-10% added on top of its base value. To calculate `m_assumed_blockchain_size`, take the size in GiB of these directories: -- For `mainnet` -> the data directory, excluding the `/testnet3`, `/signet`, and `/regtest` directories and any overly large files, e.g. a huge `debug.log` +- For `mainnet` -> the data directory, excluding the `/testnet3`, `/testnet4`, `/signet`, and `/regtest` directories and any overly large files, e.g. a huge `debug.log` - For `testnet` -> `/testnet3` +- For `testnet4` -> `/testnet4` - For `signet` -> `/signet` To calculate `m_assumed_chain_state_size`, take the size in GiB of these directories: - For `mainnet` -> `/chainstate` - For `testnet` -> `/testnet3/chainstate` +- For `testnet4` -> `/testnet4/chainstate` - For `signet` -> `/signet/chainstate` Notes: diff --git a/doc/shared-libraries.md b/doc/shared-libraries.md deleted file mode 100644 index 147e223711..0000000000 --- a/doc/shared-libraries.md +++ /dev/null @@ -1,50 +0,0 @@ -Shared Libraries -================ - -## bitcoinconsensus - -The purpose of this library is to make the verification functionality that is critical to Bitcoin's consensus available to other applications, e.g. to language bindings. - -### API - -The interface is defined in the C header `bitcoinconsensus.h` located in `src/script/bitcoinconsensus.h`. - -#### Version - -`bitcoinconsensus_version` returns an `unsigned int` with the API version *(currently `1`)*. - -#### Script Validation - -`bitcoinconsensus_verify_script` returns an `int` with the status of the verification. It will be `1` if the input script correctly spends the previous output `scriptPubKey`. - -##### Parameters -- `const unsigned char *scriptPubKey` - The previous output script that encumbers spending. -- `unsigned int scriptPubKeyLen` - The number of bytes for the `scriptPubKey`. -- `const unsigned char *txTo` - The transaction with the input that is spending the previous output. -- `unsigned int txToLen` - The number of bytes for the `txTo`. -- `unsigned int nIn` - The index of the input in `txTo` that spends the `scriptPubKey`. -- `unsigned int flags` - The script validation flags *(see below)*. -- `bitcoinconsensus_error* err` - Will have the error/success code for the operation *(see below)*. - -##### Script Flags -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NONE` -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_P2SH` - Evaluate P2SH ([BIP16](https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki)) subscripts -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_DERSIG` - Enforce strict DER ([BIP66](https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki)) compliance -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_NULLDUMMY` - Enforce NULLDUMMY ([BIP147](https://github.com/bitcoin/bips/blob/master/bip-0147.mediawiki)) -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKLOCKTIMEVERIFY` - Enable CHECKLOCKTIMEVERIFY ([BIP65](https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki)) -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_CHECKSEQUENCEVERIFY` - Enable CHECKSEQUENCEVERIFY ([BIP112](https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki)) -- `bitcoinconsensus_SCRIPT_FLAGS_VERIFY_WITNESS` - Enable WITNESS ([BIP141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki)) - -##### Errors -- `bitcoinconsensus_ERR_OK` - No errors with input parameters *(see the return value of `bitcoinconsensus_verify_script` for the verification status)* -- `bitcoinconsensus_ERR_TX_INDEX` - An invalid index for `txTo` -- `bitcoinconsensus_ERR_TX_SIZE_MISMATCH` - `txToLen` did not match with the size of `txTo` -- `bitcoinconsensus_ERR_DESERIALIZE` - An error deserializing `txTo` -- `bitcoinconsensus_ERR_AMOUNT_REQUIRED` - Input amount is required if WITNESS is used -- `bitcoinconsensus_ERR_INVALID_FLAGS` - Script verification `flags` are invalid (i.e. not part of the libconsensus interface) - -### Example Implementations -- [NBitcoin](https://github.com/MetacoSA/NBitcoin/blob/5e1055cd7c4186dee4227c344af8892aea54faec/NBitcoin/Script.cs#L979-#L1031) (.NET Bindings) -- [node-libbitcoinconsensus](https://github.com/bitpay/node-libbitcoinconsensus) (Node.js Bindings) -- [java-libbitcoinconsensus](https://github.com/dexX7/java-libbitcoinconsensus) (Java Bindings) -- [bitcoinconsensus-php](https://github.com/Bit-Wasp/bitcoinconsensus-php) (PHP Bindings) diff --git a/doc/tor.md b/doc/tor.md index 65aa3ece02..13a4db2024 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -27,6 +27,8 @@ e.g. for `-onlynet=onion`. You can use the `getnodeaddresses` RPC to fetch a number of onion peers known to your node; run `bitcoin-cli help getnodeaddresses` for details. +`bitcoin rpc` can also be substituted for `bitcoin-cli`. + ## 1. Run Bitcoin Core behind a Tor proxy The first step is running Bitcoin Core behind a Tor proxy. This will already anonymize all @@ -62,7 +64,9 @@ outgoing connections, but more is possible. In a typical situation, this suffices to run behind a Tor proxy: - ./bitcoind -proxy=127.0.0.1:9050 + bitcoind -proxy=127.0.0.1:9050 + +`bitcoin node` or `bitcoin gui` can also be substituted for `bitcoind`. ## 2. Automatically create a Bitcoin Core onion service @@ -187,25 +191,25 @@ should be equal to binding address and port for inbound Tor connections (127.0.0 In a typical situation, where you're only reachable via Tor, this should suffice: - ./bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen + bitcoind -proxy=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -listen (obviously, replace the .onion address with your own). It should be noted that you still listen on all devices and another node could establish a clearnet connection, when knowing your address. To mitigate this, additionally bind the address of your Tor proxy: - ./bitcoind ... -bind=127.0.0.1 + bitcoind ... -bind=127.0.0.1:8334=onion If you don't care too much about hiding your node, and want to be reachable on IPv4 as well, use `discover` instead: - ./bitcoind ... -discover + bitcoind ... -discover -and open port 8333 on your firewall (or use port mapping, i.e., `-upnp` or `-natpmp`). +and open port 8333 on your firewall (or use port mapping, i.e., `-natpmp`). If you only want to use Tor to reach .onion addresses, but not use it as a proxy for normal IPv4/IPv6 communication, use: - ./bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover + bitcoind -onion=127.0.0.1:9050 -externalip=7zvj7a2imdgkdbg4f2dryd5rgtrn7upivr5eeij4cicjh65pooxeshid.onion -discover ## 4. Privacy recommendations diff --git a/doc/tracing.md b/doc/tracing.md index 0e3414205a..b932358922 100644 --- a/doc/tracing.md +++ b/doc/tracing.md @@ -45,7 +45,7 @@ The two main eBPF front-ends with support for USDT are [bpftrace] and `bpftrace` is preferred for one-liners and shorter scripts. Examples for both can be found in [contrib/tracing]. -[bpftrace]: https://github.com/iovisor/bpftrace +[bpftrace]: https://github.com/bpftrace/bpftrace [BPF Compiler Collection (BCC)]: https://github.com/iovisor/bcc [contrib/tracing]: ../contrib/tracing/ @@ -55,6 +55,9 @@ The currently available tracepoints are listed here. ### Context `net` +[^address-length]: An Onion v3 address with a `:` and a five digit port has 68 + chars. However, addresses of peers added with host names might be longer. + #### Tracepoint `net:inbound_message` Is called when a message is received from a peer over the P2P network. Passes @@ -62,7 +65,7 @@ information about our peer, the connection and the message as arguments. Arguments passed: 1. Peer ID as `int64` -2. Peer Address and Port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (max. length 68 characters) +2. Peer Address and Port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) 3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) 4. Message Type (inv, ping, getdata, addrv2, ...) as `pointer to C-style String` (max. length 20 characters) 5. Message Size in bytes as `uint64` @@ -70,7 +73,7 @@ Arguments passed: Note: The message is passed to the tracepoint in full, however, due to space limitations in the eBPF kernel VM it might not be possible to pass the message -to user-space in full. Messages longer than a 32kb might be cut off. This can +to user-space in full. Messages longer than 32kb might be cut off. This can be detected in tracing scripts by comparing the message size to the length of the passed message. @@ -81,7 +84,7 @@ information about our peer, the connection and the message as arguments. Arguments passed: 1. Peer ID as `int64` -2. Peer Address and Port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (max. length 68 characters) +2. Peer Address and Port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) 3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) 4. Message Type (inv, ping, getdata, addrv2, ...) as `pointer to C-style String` (max. length 20 characters) 5. Message Size in bytes as `uint64` @@ -89,10 +92,66 @@ Arguments passed: Note: The message is passed to the tracepoint in full, however, due to space limitations in the eBPF kernel VM it might not be possible to pass the message -to user-space in full. Messages longer than a 32kb might be cut off. This can +to user-space in full. Messages longer than 32kb might be cut off. This can be detected in tracing scripts by comparing the message size to the length of the passed message. +#### Tracepoint `net:inbound_connection` + +Is called when a new inbound connection is opened to us. Passes information about +the peer and the number of inbound connections including the newly opened connection. + +Arguments passed: +1. Peer ID as `int64` +2. Peer address and port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) +3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) +4. Network the peer connects from as `uint32` (1 = IPv4, 2 = IPv6, 3 = Onion, 4 = I2P, 5 = CJDNS). See `Network` enum in `netaddress.h`. +5. Number of existing inbound connections as `uint64` including the newly opened inbound connection. + +#### Tracepoint `net:outbound_connection` + +Is called when a new outbound connection is opened by us. Passes information about +the peer and the number of outbound connections including the newly opened connection. + +Arguments passed: +1. Peer ID as `int64` +2. Peer address and port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) +3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) +4. Network of the peer as `uint32` (1 = IPv4, 2 = IPv6, 3 = Onion, 4 = I2P, 5 = CJDNS). See `Network` enum in `netaddress.h`. +5. Number of existing outbound connections as `uint64` including the newly opened outbound connection. + +#### Tracepoint `net:evicted_inbound_connection` + +Is called when an inbound connection is evicted by us. Passes information about the evicted peer and the time at connection establishment. + +Arguments passed: +1. Peer ID as `int64` +2. Peer address and port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) +3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) +4. Network the peer connects from as `uint32` (1 = IPv4, 2 = IPv6, 3 = Onion, 4 = I2P, 5 = CJDNS). See `Network` enum in `netaddress.h`. +5. Connection established UNIX epoch timestamp in seconds as `uint64`. + +#### Tracepoint `net:misbehaving_connection` + +Is called when a connection is misbehaving. Passes the peer id and a +reason for the peers misbehavior. + +Arguments passed: +1. Peer ID as `int64`. +2. Reason why the peer is misbehaving as `pointer to C-style String` (max. length 128 characters). + +#### Tracepoint `net:closed_connection` + +Is called when a connection is closed. Passes information about the closed peer +and the time at connection establishment. + +Arguments passed: +1. Peer ID as `int64` +2. Peer address and port (IPv4, IPv6, Tor v3, I2P, ...) as `pointer to C-style String` (normally up to 68 characters[^address-length]) +3. Connection Type (inbound, feeler, outbound-full-relay, ...) as `pointer to C-style String` (max. length 20 characters) +4. Network the peer connects from as `uint32` (1 = IPv4, 2 = IPv6, 3 = Onion, 4 = I2P, 5 = CJDNS). See `Network` enum in `netaddress.h`. +5. Connection established UNIX epoch timestamp in seconds as `uint64`. + ### Context `validation` #### Tracepoint `validation:block_connected` @@ -106,7 +165,7 @@ Arguments passed: 3. Transactions in the Block as `uint64` 4. Inputs spend in the Block as `int32` 5. SigOps in the Block (excluding coinbase SigOps) `uint64` -6. Time it took to connect the Block in microseconds (µs) as `uint64` +6. Time it took to connect the Block in nanoseconds (ns) as `uint64` ### Context `utxocache` @@ -245,14 +304,15 @@ Arguments passed: 2. Replaced transaction virtual size as `int32` 3. Replaced transaction fee as `int64` 4. Replaced transaction mempool entry time (epoch) as `uint64` -5. Replacement transaction ID (hash) as `pointer to unsigned chars` (i.e. 32 bytes in little-endian) +5. Replacement transaction ID or package hash as `pointer to unsigned chars` (i.e. 32 bytes in little-endian) 6. Replacement transaction virtual size as `int32` 7. Replacement transaction fee as `int64` +8. `bool` indicating if the argument 5. is a transaction ID or package hash (true if it's a transaction ID) -Note: In cases where a single replacement transaction replaces multiple +Note: In cases where a replacement transaction or package replaces multiple existing transactions in the mempool, the tracepoint is called once for each -replaced transaction, with data of the replacement transaction being the same -in each call. +replaced transaction, with data of the replacement transaction or package +being the same in each call. #### Tracepoint `mempool:rejected` @@ -265,42 +325,52 @@ Arguments passed: ## Adding tracepoints to Bitcoin Core -To add a new tracepoint, `#include ` in the compilation unit where -the tracepoint is inserted. Use one of the `TRACEx` macros listed below -depending on the number of arguments passed to the tracepoint. Up to 12 -arguments can be provided. The `context` and `event` specify the names by which -the tracepoint is referred to. Please use `snake_case` and try to make sure that -the tracepoint names make sense even without detailed knowledge of the -implementation details. Do not forget to update the tracepoint list in this -document. - -```c -#define TRACE(context, event) -#define TRACE1(context, event, a) -#define TRACE2(context, event, a, b) -#define TRACE3(context, event, a, b, c) -#define TRACE4(context, event, a, b, c, d) -#define TRACE5(context, event, a, b, c, d, e) -#define TRACE6(context, event, a, b, c, d, e, f) -#define TRACE7(context, event, a, b, c, d, e, f, g) -#define TRACE8(context, event, a, b, c, d, e, f, g, h) -#define TRACE9(context, event, a, b, c, d, e, f, g, h, i) -#define TRACE10(context, event, a, b, c, d, e, f, g, h, i, j) -#define TRACE11(context, event, a, b, c, d, e, f, g, h, i, j, k) -#define TRACE12(context, event, a, b, c, d, e, f, g, h, i, j, k, l) -``` +Use the `TRACEPOINT` macro to add a new tracepoint. If not yet included, include +`util/trace.h` (defines the tracepoint macros) with `#include `. +Each tracepoint needs a `context` and an `event`. Please use `snake_case` and +try to make sure that the tracepoint names make sense even without detailed +knowledge of the implementation details. You can pass zero to twelve arguments +to the tracepoint. Each tracepoint also needs a global semaphore. The semaphore +gates the tracepoint arguments from being processed if we are not attached to +the tracepoint. Add a `TRACEPOINT_SEMAPHORE(context, event)` with the `context` +and `event` of your tracepoint in the top-level namespace at the beginning of +the file. Do not forget to update the tracepoint list in this document. -For example: +For example, the `net:outbound_message` tracepoint in `src/net.cpp` with six +arguments. ```C++ -TRACE6(net, inbound_message, - pnode->GetId(), - pnode->m_addr_name.c_str(), - pnode->ConnectionTypeAsString().c_str(), - sanitizedType.c_str(), - msg.data.size(), - msg.data.data() -); +// src/net.cpp +TRACEPOINT_SEMAPHORE(net, outbound_message); +… +void CConnman::PushMessage(…) { + … + TRACEPOINT(net, outbound_message, + pnode->GetId(), + pnode->m_addr_name.c_str(), + pnode->ConnectionTypeAsString().c_str(), + sanitizedType.c_str(), + msg.data.size(), + msg.data.data() + ); + … +} +``` +If needed, an extra `if (TRACEPOINT_ACTIVE(context, event)) {...}` check can be +used to prepare somewhat expensive arguments right before the tracepoint. While +the tracepoint arguments are only prepared when we attach something to the +tracepoint, an argument preparation should never hang the process. Hashing and +serialization of data structures is probably fine, a `sleep(10s)` not. + +```C++ +// An example tracepoint with an expensive argument. + +TRACEPOINT_SEMAPHORE(example, gated_expensive_argument); +… +if (TRACEPOINT_ACTIVE(example, gated_expensive_argument)) { + expensive_argument = expensive_calulation(); + TRACEPOINT(example, gated_expensive_argument, expensive_argument); +} ``` ### Guidelines and best practices @@ -318,12 +388,6 @@ the tracepoint. See existing examples in [contrib/tracing/]. [contrib/tracing/]: ../contrib/tracing/ -#### No expensive computations for tracepoints -Data passed to the tracepoint should be inexpensive to compute. Although the -tracepoint itself only has overhead when enabled, the code to compute arguments -is always run - even if the tracepoint is not used. For example, avoid -serialization and parsing. - #### Semi-stable API Tracepoints should have a semi-stable API. Users should be able to rely on the tracepoints for scripting. This means tracepoints need to be documented, and the @@ -347,7 +411,7 @@ first six argument fields. Binary data can be placed in later arguments. The BCC supports reading from all 12 arguments. #### Strings as C-style String -Generally, strings should be passed into the `TRACEx` macros as pointers to +Generally, strings should be passed into the `TRACEPOINT` macros as pointers to C-style strings (a null-terminated sequence of characters). For C++ `std::strings`, [`c_str()`] can be used. It's recommended to document the maximum expected string size if known. @@ -366,13 +430,13 @@ USDT support. To list probes in Bitcoin Core, use `info probes` in `gdb`: ``` -$ gdb ./src/bitcoind +$ gdb ./build/bin/bitcoind … (gdb) info probes Type Provider Name Where Semaphore Object -stap net inbound_message 0x000000000014419e /src/bitcoind -stap net outbound_message 0x0000000000107c05 /src/bitcoind -stap validation block_connected 0x00000000002fb10c /src/bitcoind +stap net inbound_message 0x000000000014419e 0x0000000000d29bd2 /build/bin/bitcoind +stap net outbound_message 0x0000000000107c05 0x0000000000d29bd0 /build/bin/bitcoind +stap validation block_connected 0x00000000002fb10c 0x0000000000d29bd8 /build/bin/bitcoind … ``` @@ -382,13 +446,13 @@ The `readelf` tool can be used to display the USDT tracepoints in Bitcoin Core. Look for the notes with the description `NT_STAPSDT`. ``` -$ readelf -n ./src/bitcoind | grep NT_STAPSDT -A 4 -B 2 +$ readelf -n ./build/bin/bitcoind | grep NT_STAPSDT -A 4 -B 2 Displaying notes found in: .note.stapsdt Owner Data size Description stapsdt 0x0000005d NT_STAPSDT (SystemTap probe descriptors) Provider: net Name: outbound_message - Location: 0x0000000000107c05, Base: 0x0000000000579c90, Semaphore: 0x0000000000000000 + Location: 0x0000000000107c05, Base: 0x0000000000579c90, Semaphore: 0x0000000000d29bd0 Arguments: -8@%r12 8@%rbx 8@%rdi 8@192(%rsp) 8@%rax 8@%rdx … ``` @@ -406,8 +470,8 @@ between distributions. For example, on [ubuntu binary]: https://github.com/iovisor/bcc/blob/master/INSTALL.md#ubuntu---binary ``` -$ tplist -l ./src/bitcoind -v -b'net':b'outbound_message' [sema 0x0] +$ tplist -l ./build/bin/bitcoind -v +b'net':b'outbound_message' [sema 0xd29bd0] 1 location(s) 6 argument(s) … diff --git a/doc/translation_process.md b/doc/translation_process.md index 97a8fbfff2..2f113fe5b5 100644 --- a/doc/translation_process.md +++ b/doc/translation_process.md @@ -8,7 +8,7 @@ Transifex is setup to monitor the GitHub repo for updates, and when code contain Multiple language support is critical in assisting Bitcoin’s global adoption, and growth. One of Bitcoin’s greatest strengths is cross-border money transfers, any help making that easier is greatly appreciated. -See the [Transifex Bitcoin project](https://www.transifex.com/bitcoin/bitcoin/) to assist in translations. You should also join the translation mailing list for announcements - see details below. +See the [Transifex Bitcoin project](https://explore.transifex.com/bitcoin/bitcoin/) to assist in translations. You should also join the translation mailing list for announcements - see details below. ### Writing code with translations We use automated scripts to help extract translations in both Qt, and non-Qt source files. It is rarely necessary to manually edit the files in `src/qt/locale/`. The translation source files must adhere to the following format: @@ -18,8 +18,8 @@ We use automated scripts to help extract translations in both Qt, and non-Qt sou To automatically regenerate the `bitcoin_en.ts` file, run the following commands: ```sh -cd src/ -make translate +cmake --preset dev-mode -DWITH_USDT=OFF -DENABLE_IPC=OFF +cmake --build build_dev_mode --target translate ``` **Example Qt translation** @@ -39,26 +39,12 @@ git commit ``` ### Creating a Transifex account -Visit the [Transifex Signup](https://www.transifex.com/signup/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool. +Visit the [Transifex Signup](https://app.transifex.com/signup/open-source/) page to create an account. Take note of your username and password, as they will be required to configure the command-line tool. -You can find the Bitcoin translation project at [https://www.transifex.com/bitcoin/bitcoin/](https://www.transifex.com/bitcoin/bitcoin/). +You can find the Bitcoin translation project at [https://www.transifex.com/bitcoin/bitcoin/](https://explore.transifex.com/bitcoin/bitcoin/). ### Installing the Transifex client command-line tool -The client is used to fetch updated translations. If you are having problems, or need more details, see [https://docs.transifex.com/client/installing-the-client](https://docs.transifex.com/client/installing-the-client) - -`pip install transifex-client` - -Setup your Transifex client config as follows. Please *ignore the token field*. - -```ini -nano ~/.transifexrc - -[https://www.transifex.com] -hostname = https://www.transifex.com -password = PASSWORD -token = -username = USERNAME -``` +The client is used to fetch updated translations. Please check installation instructions and any other details at https://developers.transifex.com/docs/cli. The Transifex Bitcoin project config file is included as part of the repo. It can be found at `.tx/config`, however you shouldn’t need to change anything. diff --git a/doc/translation_strings_policy.md b/doc/translation_strings_policy.md index 1931302dda..4aa4969209 100644 --- a/doc/translation_strings_policy.md +++ b/doc/translation_strings_policy.md @@ -1,10 +1,8 @@ -Translation Strings Policy -=========================== +# Translation Strings Policy This document provides guidelines for internationalization of the Bitcoin Core software. -How to translate? ------------------- +## How to translate? To mark a message as translatable @@ -14,8 +12,7 @@ To mark a message as translatable No internationalization is used for e.g. developer scripts outside `src`. -Strings to be translated -------------------------- +## Strings to be translated On a high level, these strings are to be translated: @@ -27,8 +24,7 @@ Do not translate technical or extremely rare errors. Anything else that appears to the user in the GUI is to be translated. This includes labels, menu items, button texts, tooltips and window titles. This includes messages passed to the GUI through the UI interface through `InitMessage`, `ThreadSafeMessageBox` or `ShowProgress`. -General recommendations ------------------------- +## General recommendations ### Avoid unnecessary translation strings @@ -97,4 +93,4 @@ The second example reduces the number of pluralized words that translators have During a string freeze (often before a major release), no translation strings are to be added, modified or removed. -This can be checked by executing `make translate` in the `src` directory, then verifying that `bitcoin_en.ts` remains unchanged. +This can be checked by building the `translate` target with `cmake` ([instructions](translation_process.md)), then verifying that `bitcoin_en.ts` remains unchanged. diff --git a/doc/zmq.md b/doc/zmq.md index 4055505d74..cb15444a48 100644 --- a/doc/zmq.md +++ b/doc/zmq.md @@ -46,11 +46,10 @@ operation. ## Enabling -By default, the ZeroMQ feature is automatically compiled in if the -necessary prerequisites are found. To disable, use --disable-zmq -during the *configure* step of building bitcoind: +By default, the ZeroMQ feature is not automatically compiled. +To enable, use `-DWITH_ZMQ=ON` when configuring the build system: - $ ./configure --disable-zmq (other options) + $ cmake -B build -DWITH_ZMQ=ON To actually enable operation, one must set the appropriate options on the command line or in the configuration file. @@ -88,43 +87,74 @@ For instance: -zmqpubrawtx=ipc:///tmp/bitcoind.tx.raw \ -zmqpubhashtxhwm=10000 -Each PUB notification has a topic and body, where the header -corresponds to the notification type. For instance, for the -notification `-zmqpubhashtx` the topic is `hashtx` (no null -terminator). These options can also be provided in bitcoin.conf. +`bitcoin node` or `bitcoin gui` can also be substituted for `bitcoind`. -The topics are: +Notification types correspond to message topics (details in next section). For instance, +for the notification `-zmqpubhashtx` the topic is `hashtx`. These options can also be +provided in bitcoin.conf. -`sequence`: the body is structured as the following based on the type of message: +### Message format - <32-byte hash>C : Blockhash connected - <32-byte hash>D : Blockhash disconnected - <32-byte hash>R<8-byte LE uint> : Transactionhash removed from mempool for non-block inclusion reason - <32-byte hash>A<8-byte LE uint> : Transactionhash added mempool +All ZMQ messages share the same structure with three parts: _topic_ string, +message _body_, and _message sequence number_: -Where the 8-byte uints correspond to the mempool sequence number. + | topic | body | message sequence number | + |-----------+------------------------------------------------------+--------------------------| + | rawtx | | <4-byte LE uint> | + | hashtx | | <4-byte LE uint> | + | rawblock | | <4-byte LE uint> | + | hashblock | | <4-byte LE uint> | + | sequence | C | <4-byte LE uint> | + | sequence | D | <4-byte LE uint> | + | sequence | R<8-byte LE uint> | <4-byte LE uint> | + | sequence | A<8-byte LE uint> | <4-byte LE uint> | -`rawtx`: Notifies about all transactions, both when they are added to mempool or when a new block arrives. This means a transaction could be published multiple times. First, when it enters the mempool and then again in each block that includes it. The messages are ZMQ multipart messages with three parts. The first part is the topic (`rawtx`), the second part is the serialized transaction, and the last part is a sequence number (representing the message count to detect lost messages). +where: - | rawtx | | + - message sequence number represents message count to detect lost messages, distinct for each topic + - all transaction and block hashes are in _reversed byte order_ (i. e. with bytes + produced by hashing function reversed), the same format as the RPC interface and block + explorers use to display transaction and block hashes -`hashtx`: Notifies about all transactions, both when they are added to mempool or when a new block arrives. This means a transaction could be published multiple times. First, when it enters the mempool and then again in each block that includes it. The messages are ZMQ multipart messages with three parts. The first part is the topic (`hashtx`), the second part is the 32-byte transaction hash, and the last part is a sequence number (representing the message count to detect lost messages). +#### rawtx - | hashtx | <32-byte transaction hash in Little Endian> | +Notifies about all transactions, both when they are added to mempool or when a new block +arrives. This means a transaction could be published multiple times: first when it enters +mempool and then again in each block that includes it. The body part of the message is the +serialized transaction. +#### hashtx -`rawblock`: Notifies when the chain tip is updated. Messages are ZMQ multipart messages with three parts. The first part is the topic (`rawblock`), the second part is the serialized block, and the last part is a sequence number (representing the message count to detect lost messages). +Notifies about all transactions, both when they are added to mempool or when a new block +arrives. This means a transaction could be published multiple times: first when it enters +mempool and then again in each block that includes it. The body part of the message is the +32-byte transaction hash in reversed byte order. - | rawblock | | +#### rawblock -`hashblock`: Notifies when the chain tip is updated. Messages are ZMQ multipart messages with three parts. The first part is the topic (`hashblock`), the second part is the 32-byte block hash, and the last part is a sequence number (representing the message count to detect lost messages). +Notifies when the chain tip is updated. When assumeutxo is in use, this notification will +not be issued for historical blocks connected to the background validation chainstate. The +body part of the message is the serialized block. - | hashblock | <32-byte block hash in Little Endian> | +#### hashblock -**_NOTE:_** Note that the 32-byte hashes are in Little Endian and not in the Big Endian format that the RPC interface and block explorers use to display transaction and block hashes. +Notifies when the chain tip is updated. When assumeutxo is in use, this notification will +not be issued for historical blocks connected to the background validation chainstate. The +body part of the message is the 32-byte block hash in reversed byte order. + +#### sequence + +The 8-byte LE uints correspond to _mempool sequence number_ and the types of bodies are: + + - `C` : block with this hash connected + - `D` : block with this hash disconnected + - `R` : transaction with this hash removed from mempool for non-block inclusion reason + - `A` : transaction with this hash added to mempool + +### Implementing ZMQ client ZeroMQ endpoint specifiers for TCP (and others) are documented in the -[ZeroMQ API](http://api.zeromq.org/4-0:_start). +[ZeroMQ API](https://libzmq.readthedocs.io/en/zeromq4-x/). Client side, then, the ZeroMQ subscriber socket must have the ZMQ_SUBSCRIBE option set to one or either of these prefixes (for @@ -139,7 +169,7 @@ operating system configuration and must be configured prior to connection establ For example, when running on GNU/Linux, one might use the following to lower the keepalive setting to 10 minutes: -sudo sysctl -w net.ipv4.tcp_keepalive_time=600 + sudo sysctl -w net.ipv4.tcp_keepalive_time=600 Setting the keepalive values appropriately for your operating environment may improve connectivity in situations where long-lived connections are silently @@ -163,7 +193,7 @@ Note that for `*block` topics, when the block chain tip changes, a reorganisation may occur and just the tip will be notified. It is up to the subscriber to retrieve the chain from the last known block to the new tip. Also note that no notification will occur if the tip -was in the active chain--as would be the case after calling invalidateblock RPC. +was in the active chain, as would be the case after calling the `invalidateblock` RPC. In contrast, the `sequence` topic publishes all block connections and disconnections. diff --git a/libbitcoinconsensus.pc.in b/libbitcoinconsensus.pc.in deleted file mode 100644 index 1ceab280bb..0000000000 --- a/libbitcoinconsensus.pc.in +++ /dev/null @@ -1,10 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ - -Name: @PACKAGE_NAME@ consensus library -Description: Library for the Bitcoin consensus protocol. -Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lbitcoinconsensus -Cflags: -I${includedir} diff --git a/libbitcoinkernel.pc.in b/libbitcoinkernel.pc.in new file mode 100644 index 0000000000..6b622c926b --- /dev/null +++ b/libbitcoinkernel.pc.in @@ -0,0 +1,11 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ +includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + +Name: @CLIENT_NAME@ kernel library +Description: Experimental library for the @CLIENT_NAME@ validation engine. +Version: @CLIENT_VERSION_STRING@ +Libs: -L${libdir} -lbitcoinkernel +Libs.private: -L${libdir} @LIBS_PRIVATE@ +Cflags: -I${includedir} diff --git a/share/genbuild.sh b/share/genbuild.sh deleted file mode 100755 index ecc96160e6..0000000000 --- a/share/genbuild.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# Copyright (c) 2012-2021 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C -if [ $# -gt 1 ]; then - cd "$2" || exit 1 -fi -if [ $# -gt 0 ]; then - FILE="$1" - shift - if [ -f "$FILE" ]; then - INFO="$(head -n 1 "$FILE")" - fi -else - echo "Usage: $0 " - exit 1 -fi - -GIT_TAG="" -GIT_COMMIT="" -if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then - # clean 'dirty' status of touched files that haven't been modified - git diff >/dev/null 2>/dev/null - - # if latest commit is tagged and not dirty, then override using the tag name - RAWDESC=$(git describe --abbrev=0 2>/dev/null) - if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 "$RAWDESC" 2>/dev/null)" ]; then - git diff-index --quiet HEAD -- && GIT_TAG=$RAWDESC - fi - - # otherwise generate suffix from git, i.e. string like "59887e8-dirty" - GIT_COMMIT=$(git rev-parse --short=12 HEAD) - git diff-index --quiet HEAD -- || GIT_COMMIT="$GIT_COMMIT-dirty" -fi - -if [ -n "$GIT_TAG" ]; then - NEWINFO="#define BUILD_GIT_TAG \"$GIT_TAG\"" -elif [ -n "$GIT_COMMIT" ]; then - NEWINFO="#define BUILD_GIT_COMMIT \"$GIT_COMMIT\"" -else - NEWINFO="// No build information available" -fi - -# only update build.h if necessary -if [ "$INFO" != "$NEWINFO" ]; then - echo "$NEWINFO" >"$FILE" -fi diff --git a/share/qt/Info.plist.in b/share/qt/Info.plist.in index b4e6f6a150..5ff736152f 100644 --- a/share/qt/Info.plist.in +++ b/share/qt/Info.plist.in @@ -3,7 +3,7 @@ LSMinimumSystemVersion - 11 + 13 LSArchitecturePriority diff --git a/share/qt/extract_strings_qt.py b/share/qt/extract_strings_qt.py index 39acec8942..4297143023 100755 --- a/share/qt/extract_strings_qt.py +++ b/share/qt/extract_strings_qt.py @@ -56,7 +56,7 @@ def parse_po(text): XGETTEXT=os.getenv('XGETTEXT', 'xgettext') if not XGETTEXT: print('Cannot extract strings: xgettext utility is not installed or not configured.',file=sys.stderr) - print('Please install package "gettext" and re-run \'./configure\'.',file=sys.stderr) + print('Please install package "gettext" and re-run \'cmake -B build\'.',file=sys.stderr) sys.exit(1) child = Popen([XGETTEXT,'--output=-','--from-code=utf-8','-n','--keyword=_'] + files, stdout=PIPE) (out, err) = child.communicate() diff --git a/share/rpcauth/README.md b/share/rpcauth/README.md index 6f627b867b..1b3acb1dac 100644 --- a/share/rpcauth/README.md +++ b/share/rpcauth/README.md @@ -15,4 +15,5 @@ positional arguments: optional arguments: -h, --help show this help message and exit + -j, --json output data in json format ``` diff --git a/share/rpcauth/rpcauth.py b/share/rpcauth/rpcauth.py index cc7bba1f8b..506fcf9d91 100755 --- a/share/rpcauth/rpcauth.py +++ b/share/rpcauth/rpcauth.py @@ -7,6 +7,7 @@ from getpass import getpass from secrets import token_hex, token_urlsafe import hmac +import json def generate_salt(size): """Create size byte hex salt""" @@ -24,6 +25,7 @@ def main(): parser = ArgumentParser(description='Create login credentials for a JSON-RPC user') parser.add_argument('username', help='the username for authentication') parser.add_argument('password', help='leave empty to generate a random password or specify "-" to prompt for password', nargs='?') + parser.add_argument("-j", "--json", help="output to json instead of plain-text", action='store_true') args = parser.parse_args() if not args.password: @@ -35,9 +37,13 @@ def main(): salt = generate_salt(16) password_hmac = password_to_hmac(salt, args.password) - print('String to be appended to bitcoin.conf:') - print(f'rpcauth={args.username}:{salt}${password_hmac}') - print(f'Your password:\n{args.password}') + if args.json: + odict={'username':args.username, 'password':args.password, 'rpcauth':f'{args.username}:{salt}${password_hmac}'} + print(json.dumps(odict)) + else: + print('String to be appended to bitcoin.conf:') + print(f'rpcauth={args.username}:{salt}${password_hmac}') + print(f'Your password:\n{args.password}') if __name__ == '__main__': main() diff --git a/share/setup.nsi.in b/share/setup.nsi.in index 2ce798bd2d..2160cc05a1 100644 --- a/share/setup.nsi.in +++ b/share/setup.nsi.in @@ -1,4 +1,4 @@ -Name "@PACKAGE_NAME@ (64-bit)" +Name "@CLIENT_NAME@" RequestExecutionLevel highest SetCompressor /SOLID lzma @@ -11,8 +11,8 @@ Unicode true # General Symbol Definitions !define REGKEY "SOFTWARE\$(^Name)" -!define COMPANY "@PACKAGE_NAME@ project" -!define URL @PACKAGE_URL@ +!define COMPANY "@CLIENT_NAME@ project" +!define URL @CLIENT_URL@ # MUI Symbol Definitions !define MUI_ICON "@abs_top_srcdir@/share/pixmaps/bitcoin.ico" @@ -24,7 +24,7 @@ Unicode true !define MUI_STARTMENUPAGE_REGISTRY_ROOT HKLM !define MUI_STARTMENUPAGE_REGISTRY_KEY ${REGKEY} !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME StartMenuGroup -!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@PACKAGE_NAME@" +!define MUI_STARTMENUPAGE_DEFAULTFOLDER "@CLIENT_NAME@" !define MUI_FINISHPAGE_RUN "$WINDIR\explorer.exe" !define MUI_FINISHPAGE_RUN_PARAMETERS $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\modern-uninstall.ico" @@ -58,12 +58,12 @@ XPStyle on BrandingText " " ShowInstDetails show VIProductVersion @CLIENT_VERSION_MAJOR@.@CLIENT_VERSION_MINOR@.@CLIENT_VERSION_BUILD@.0 -VIAddVersionKey ProductName "@PACKAGE_NAME@" -VIAddVersionKey ProductVersion "@PACKAGE_VERSION@" +VIAddVersionKey ProductName "@CLIENT_NAME@" +VIAddVersionKey ProductVersion "@CLIENT_VERSION_STRING@" VIAddVersionKey CompanyName "${COMPANY}" VIAddVersionKey CompanyWebsite "${URL}" -VIAddVersionKey FileVersion "@PACKAGE_VERSION@" -VIAddVersionKey FileDescription "Installer for @PACKAGE_NAME@" +VIAddVersionKey FileVersion "@CLIENT_VERSION_STRING@" +VIAddVersionKey FileDescription "Installer for @CLIENT_NAME@" VIAddVersionKey LegalCopyright "Copyright (C) 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@" InstallDirRegKey HKCU "${REGKEY}" Path ShowUninstDetails show @@ -73,6 +73,7 @@ Section -Main SEC0000 SetOutPath $INSTDIR SetOverwrite on File @abs_top_builddir@/release/@BITCOIN_GUI_NAME@@EXEEXT@ + File @abs_top_builddir@/release/@BITCOIN_WRAPPER_NAME@@EXEEXT@ File /oname=COPYING.txt @abs_top_srcdir@/COPYING File /oname=readme.txt @abs_top_srcdir@/doc/README_windows.txt File @abs_top_srcdir@/share/examples/bitcoin.conf @@ -95,21 +96,23 @@ Section -post SEC0001 !insertmacro MUI_STARTMENU_WRITE_BEGIN Application CreateDirectory $SMPROGRAMS\$StartMenuGroup CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ - CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet, 64-bit).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 1 + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 1 + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (test signet).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-signet" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 2 + CreateShortcut "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet4).lnk" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "-testnet4" "$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" 3 CreateShortcut "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" $INSTDIR\uninstall.exe !insertmacro MUI_STARTMENU_WRITE_END WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)" - WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "@PACKAGE_VERSION@" + WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "@CLIENT_VERSION_STRING@" WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}" WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}" WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\bitcoin-qt.exe WriteRegStr HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\uninstall.exe WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1 WriteRegDWORD HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1 - WriteRegStr HKCR "@PACKAGE_TARNAME@" "URL Protocol" "" - WriteRegStr HKCR "@PACKAGE_TARNAME@" "" "URL:Bitcoin" - WriteRegStr HKCR "@PACKAGE_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ - WriteRegStr HKCR "@PACKAGE_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"' + WriteRegStr HKCR "@CLIENT_TARNAME@" "URL Protocol" "" + WriteRegStr HKCR "@CLIENT_TARNAME@" "" "URL:Bitcoin" + WriteRegStr HKCR "@CLIENT_TARNAME@\DefaultIcon" "" $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ + WriteRegStr HKCR "@CLIENT_TARNAME@\shell\open\command" "" '"$INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@" "%1"' SectionEnd # Macro for selecting uninstaller sections @@ -127,6 +130,7 @@ done${UNSECTION_ID}: # Uninstaller sections Section /o -un.Main UNSEC0000 + Delete /REBOOTOK $INSTDIR\@BITCOIN_WRAPPER_NAME@@EXEEXT@ Delete /REBOOTOK $INSTDIR\@BITCOIN_GUI_NAME@@EXEEXT@ Delete /REBOOTOK $INSTDIR\COPYING.txt Delete /REBOOTOK $INSTDIR\readme.txt @@ -140,7 +144,9 @@ Section -un.post UNSEC0001 DeleteRegKey HKCU "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\Uninstall $(^Name).lnk" Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^Name).lnk" - Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@PACKAGE_NAME@ (testnet, 64-bit).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (testnet4).lnk" + Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\@CLIENT_NAME@ (test signet).lnk" Delete /REBOOTOK "$SMSTARTUP\Bitcoin.lnk" Delete /REBOOTOK $INSTDIR\uninstall.exe Delete /REBOOTOK $INSTDIR\debug.log @@ -149,7 +155,7 @@ Section -un.post UNSEC0001 DeleteRegValue HKCU "${REGKEY}" Path DeleteRegKey /IfEmpty HKCU "${REGKEY}\Components" DeleteRegKey /IfEmpty HKCU "${REGKEY}" - DeleteRegKey HKCR "@PACKAGE_TARNAME@" + DeleteRegKey HKCR "@CLIENT_TARNAME@" RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup RmDir /REBOOTOK $INSTDIR Push $R0 diff --git a/src/.bear-tidy-config b/src/.bear-tidy-config deleted file mode 100644 index 9b6b9d2cf7..0000000000 --- a/src/.bear-tidy-config +++ /dev/null @@ -1,19 +0,0 @@ -{ - "output": { - "content": { - "include_only_existing_source": true, - "paths_to_include": [], - "paths_to_exclude": [ - "src/crc32c", - "src/crypto/ctaes", - "src/leveldb", - "src/minisketch", - "src/secp256k1" - ] - }, - "format": { - "command_as_array": true, - "drop_output_field": false - } - } -} diff --git a/src/.clang-format b/src/.clang-format index 791b3b8f9f..f20e5ee2d4 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -43,5 +43,7 @@ SpacesInAngles: false SpacesInContainerLiterals: true SpacesInCStyleCastParentheses: false SpacesInParentheses: false -Standard: c++17 +BreakBeforeConceptDeclarations: Always +RequiresExpressionIndentation: OuterScope +Standard: c++20 UseTab: Never diff --git a/src/.clang-tidy b/src/.clang-tidy index 4deb5a85a5..1cf270833a 100644 --- a/src/.clang-tidy +++ b/src/.clang-tidy @@ -2,12 +2,22 @@ Checks: ' -*, bitcoin-*, bugprone-argument-comment, +bugprone-move-forwarding-reference, +bugprone-string-constructor, bugprone-use-after-move, +bugprone-lambda-function-name, +bugprone-unhandled-self-assignment, misc-unused-using-decls, +misc-no-recursion, modernize-use-default-member-init, +modernize-use-emplace, +modernize-use-equals-default, modernize-use-noexcept, modernize-use-nullptr, +modernize-use-starts-ends-with, performance-*, +-performance-avoid-endl, +-performance-enum-size, -performance-inefficient-string-concatenation, -performance-no-int-to-ptr, -performance-noexcept-move-constructor, @@ -16,8 +26,10 @@ readability-const-return-type, readability-redundant-declaration, readability-redundant-string-init, ' +HeaderFilterRegex: '.' WarningsAsErrors: '*' CheckOptions: - key: performance-move-const-arg.CheckTriviallyCopyableMove value: false -HeaderFilterRegex: '.' + - key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField + value: false diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..9d4a5d5fe6 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,487 @@ +# Copyright (c) 2023-present The Bitcoin Core developers +# Distributed under the MIT software license, see the accompanying +# file COPYING or https://opensource.org/license/mit/. + +include(AddWindowsResources) + +configure_file(${PROJECT_SOURCE_DIR}/cmake/bitcoin-build-config.h.in bitcoin-build-config.h USE_SOURCE_PERMISSIONS @ONLY) +include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) + +#============================= +# Subprojects +#============================= +# Subprojects include subdirectories that do or could have tests +# and/or benchmark binaries, such as all subtrees and univalue. +# These need to be included before CMAKE_*_OUTPUT_DIRECTORY variables +# are set, so output locations of subproject tests and libraries are +# not overridden. +include(../cmake/crc32c.cmake) +include(../cmake/leveldb.cmake) +include(../cmake/minisketch.cmake) +add_subdirectory(univalue) +if (ENABLE_IPC AND NOT WITH_EXTERNAL_LIBMULTIPROCESS) + include(../cmake/libmultiprocess.cmake) + add_libmultiprocess(ipc/libmultiprocess) +endif() +#============================= +# secp256k1 subtree +#============================= +message("") +message("Configuring secp256k1 subtree...") +set(SECP256K1_DISABLE_SHARED ON CACHE BOOL "" FORCE) +set(SECP256K1_ENABLE_MODULE_ECDH OFF CACHE BOOL "" FORCE) +set(SECP256K1_ENABLE_MODULE_RECOVERY ON CACHE BOOL "" FORCE) +set(SECP256K1_ENABLE_MODULE_MUSIG OFF CACHE BOOL "" FORCE) +set(SECP256K1_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE) +set(SECP256K1_BUILD_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE) +set(SECP256K1_BUILD_EXHAUSTIVE_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE) +if(NOT BUILD_TESTS) + # Always skip the ctime tests, if we are building no other tests. + # Otherwise, they are built if Valgrind is available. See SECP256K1_VALGRIND. + set(SECP256K1_BUILD_CTIME_TESTS ${BUILD_TESTS} CACHE BOOL "" FORCE) +endif() +set(SECP256K1_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) +include(GetTargetInterface) +# -fsanitize and related flags apply to both C++ and C, +# so we can pass them down to libsecp256k1 as CFLAGS and LDFLAGS. +get_target_interface(SECP256K1_APPEND_CFLAGS "" sanitize_interface COMPILE_OPTIONS) +string(STRIP "${SECP256K1_APPEND_CFLAGS} ${APPEND_CPPFLAGS}" SECP256K1_APPEND_CFLAGS) +string(STRIP "${SECP256K1_APPEND_CFLAGS} ${APPEND_CFLAGS}" SECP256K1_APPEND_CFLAGS) +set(SECP256K1_APPEND_CFLAGS ${SECP256K1_APPEND_CFLAGS} CACHE STRING "" FORCE) +get_target_interface(SECP256K1_APPEND_LDFLAGS "" sanitize_interface LINK_OPTIONS) +string(STRIP "${SECP256K1_APPEND_LDFLAGS} ${APPEND_LDFLAGS}" SECP256K1_APPEND_LDFLAGS) +set(SECP256K1_APPEND_LDFLAGS ${SECP256K1_APPEND_LDFLAGS} CACHE STRING "" FORCE) +# We want to build libsecp256k1 with the most tested RelWithDebInfo configuration. +enable_language(C) +foreach(config IN LISTS CMAKE_BUILD_TYPE CMAKE_CONFIGURATION_TYPES) + if(config STREQUAL "") + continue() + endif() + string(TOUPPER "${config}" config) + set(CMAKE_C_FLAGS_${config} "${CMAKE_C_FLAGS_RELWITHDEBINFO}") +endforeach() +# If the CFLAGS environment variable is defined during building depends +# and configuring this build system, its content might be duplicated. +if(DEFINED ENV{CFLAGS}) + deduplicate_flags(CMAKE_C_FLAGS) +endif() +set(CMAKE_EXPORT_COMPILE_COMMANDS OFF) +add_subdirectory(secp256k1) +set_target_properties(secp256k1 PROPERTIES + EXCLUDE_FROM_ALL TRUE +) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +# Set top-level target output locations. +if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +endif() +if(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() +if(NOT CMAKE_ARCHIVE_OUTPUT_DIRECTORY) + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) +endif() + +add_custom_target(generate_build_info + BYPRODUCTS ${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h + COMMAND ${CMAKE_COMMAND} -DBUILD_INFO_HEADER_PATH=${PROJECT_BINARY_DIR}/src/bitcoin-build-info.h -DSOURCE_DIR=${PROJECT_SOURCE_DIR} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateBuildInfo.cmake + COMMENT "Generating bitcoin-build-info.h" + VERBATIM +) +add_library(bitcoin_clientversion STATIC EXCLUDE_FROM_ALL + clientversion.cpp +) +target_link_libraries(bitcoin_clientversion + PRIVATE + core_interface +) +add_dependencies(bitcoin_clientversion generate_build_info) + +add_subdirectory(crypto) +add_subdirectory(util) +if(ENABLE_IPC) + add_subdirectory(ipc) +endif() + +add_library(bitcoin_consensus STATIC EXCLUDE_FROM_ALL + arith_uint256.cpp + consensus/merkle.cpp + consensus/tx_check.cpp + hash.cpp + primitives/block.cpp + primitives/transaction.cpp + pubkey.cpp + script/interpreter.cpp + script/script.cpp + script/script_error.cpp + uint256.cpp +) +target_link_libraries(bitcoin_consensus + PRIVATE + core_interface + bitcoin_crypto + secp256k1 +) + +if(WITH_ZMQ) + add_subdirectory(zmq) +endif() + +# Home for common functionality shared by different executables and libraries. +# Similar to `bitcoin_util` library, but higher-level. +add_library(bitcoin_common STATIC EXCLUDE_FROM_ALL + addresstype.cpp + base58.cpp + bech32.cpp + chain.cpp + chainparams.cpp + chainparamsbase.cpp + coins.cpp + common/args.cpp + common/bloom.cpp + common/config.cpp + common/init.cpp + common/interfaces.cpp + common/messages.cpp + common/netif.cpp + common/pcp.cpp + common/run_command.cpp + common/settings.cpp + common/signmessage.cpp + common/system.cpp + common/url.cpp + compressor.cpp + core_read.cpp + core_write.cpp + deploymentinfo.cpp + external_signer.cpp + init/common.cpp + kernel/chainparams.cpp + key.cpp + key_io.cpp + merkleblock.cpp + net_permissions.cpp + net_types.cpp + netaddress.cpp + netbase.cpp + outputtype.cpp + policy/feerate.cpp + policy/policy.cpp + pow.cpp + protocol.cpp + psbt.cpp + rpc/rawtransaction_util.cpp + rpc/request.cpp + rpc/util.cpp + scheduler.cpp + script/descriptor.cpp + script/miniscript.cpp + script/parsing.cpp + script/sign.cpp + script/signingprovider.cpp + script/solver.cpp +) +target_link_libraries(bitcoin_common + PRIVATE + core_interface + bitcoin_consensus + bitcoin_util + univalue + secp256k1 + Boost::headers + $ + $<$:ws2_32> +) + +include(InstallBinaryComponent) + +if(ENABLE_WALLET) + add_subdirectory(wallet) + + if(BUILD_WALLET_TOOL) + add_executable(bitcoin-wallet + bitcoin-wallet.cpp + init/bitcoin-wallet.cpp + wallet/wallettool.cpp + ) + add_windows_resources(bitcoin-wallet bitcoin-wallet-res.rc) + add_windows_application_manifest(bitcoin-wallet) + target_link_libraries(bitcoin-wallet + core_interface + bitcoin_wallet + bitcoin_common + bitcoin_util + Boost::headers + ) + install_binary_component(bitcoin-wallet HAS_MANPAGE) + endif() +endif() + + +# P2P and RPC server functionality used by `bitcoind` and `bitcoin-qt` executables. +add_library(bitcoin_node STATIC EXCLUDE_FROM_ALL + addrdb.cpp + addrman.cpp + banman.cpp + bip324.cpp + blockencodings.cpp + blockfilter.cpp + consensus/tx_verify.cpp + dbwrapper.cpp + deploymentstatus.cpp + flatfile.cpp + headerssync.cpp + httprpc.cpp + httpserver.cpp + i2p.cpp + index/base.cpp + index/blockfilterindex.cpp + index/coinstatsindex.cpp + index/txindex.cpp + init.cpp + kernel/chain.cpp + kernel/checks.cpp + kernel/coinstats.cpp + kernel/context.cpp + kernel/cs_main.cpp + kernel/disconnected_transactions.cpp + kernel/mempool_removal_reason.cpp + mapport.cpp + net.cpp + net_processing.cpp + netgroup.cpp + node/abort.cpp + node/blockmanager_args.cpp + node/blockstorage.cpp + node/caches.cpp + node/chainstate.cpp + node/chainstatemanager_args.cpp + node/coin.cpp + node/coins_view_args.cpp + node/connection_types.cpp + node/context.cpp + node/database_args.cpp + node/eviction.cpp + node/interface_ui.cpp + node/interfaces.cpp + node/kernel_notifications.cpp + node/mempool_args.cpp + node/mempool_persist.cpp + node/mempool_persist_args.cpp + node/miner.cpp + node/mini_miner.cpp + node/minisketchwrapper.cpp + node/peerman_args.cpp + node/psbt.cpp + node/timeoffsets.cpp + node/transaction.cpp + node/txdownloadman_impl.cpp + node/txreconciliation.cpp + node/utxo_snapshot.cpp + node/warnings.cpp + noui.cpp + policy/ephemeral_policy.cpp + policy/fees.cpp + policy/fees_args.cpp + policy/packages.cpp + policy/rbf.cpp + policy/settings.cpp + policy/truc_policy.cpp + rest.cpp + rpc/blockchain.cpp + rpc/external_signer.cpp + rpc/fees.cpp + rpc/mempool.cpp + rpc/mining.cpp + rpc/net.cpp + rpc/node.cpp + rpc/output_script.cpp + rpc/rawtransaction.cpp + rpc/server.cpp + rpc/server_util.cpp + rpc/signmessage.cpp + rpc/txoutproof.cpp + script/sigcache.cpp + signet.cpp + torcontrol.cpp + txdb.cpp + txgraph.cpp + txmempool.cpp + txorphanage.cpp + txrequest.cpp + validation.cpp + validationinterface.cpp + versionbits.cpp + $<$:wallet/init.cpp> + $<$>:dummywallet.cpp> +) +target_link_libraries(bitcoin_node + PRIVATE + core_interface + bitcoin_common + bitcoin_util + $ + leveldb + minisketch + univalue + Boost::headers + $ + $ + $ + $ +) + +# Bitcoin wrapper executable that can call other executables. +if(BUILD_BITCOIN_BIN) + add_executable(bitcoin bitcoin.cpp) + add_windows_resources(bitcoin bitcoin-res.rc) + add_windows_application_manifest(bitcoin) + target_link_libraries(bitcoin core_interface bitcoin_util) + install_binary_component(bitcoin) +endif() + +# Bitcoin Core bitcoind. +if(BUILD_DAEMON) + add_executable(bitcoind + bitcoind.cpp + init/bitcoind.cpp + ) + add_windows_resources(bitcoind bitcoind-res.rc) + add_windows_application_manifest(bitcoind) + target_link_libraries(bitcoind + core_interface + bitcoin_node + $ + ) + install_binary_component(bitcoind HAS_MANPAGE) +endif() +if(ENABLE_IPC AND BUILD_DAEMON) + add_executable(bitcoin-node + bitcoind.cpp + init/bitcoin-node.cpp + ) + target_link_libraries(bitcoin-node + core_interface + bitcoin_node + bitcoin_ipc + $ + ) + install_binary_component(bitcoin-node) +endif() + +if(ENABLE_IPC AND BUILD_TESTS) + # bitcoin_ipc_test library target is defined here in src/CMakeLists.txt + # instead of src/test/CMakeLists.txt so capnp files in src/test/ are able to + # reference capnp files in src/ipc/capnp/ by relative path. The Cap'n Proto + # compiler only allows importing by relative path when the importing and + # imported files are underneath the same compilation source prefix, so the + # source prefix must be src/, not src/test/ + add_library(bitcoin_ipc_test STATIC EXCLUDE_FROM_ALL + test/ipc_test.cpp + ) + target_capnp_sources(bitcoin_ipc_test ${PROJECT_SOURCE_DIR} + test/ipc_test.capnp + ) + add_dependencies(bitcoin_ipc_test bitcoin_ipc_headers) +endif() + + +add_library(bitcoin_cli STATIC EXCLUDE_FROM_ALL + compat/stdin.cpp + rpc/client.cpp +) +target_link_libraries(bitcoin_cli + PUBLIC + core_interface + univalue +) + + +# Bitcoin Core RPC client +if(BUILD_CLI) + add_executable(bitcoin-cli bitcoin-cli.cpp) + add_windows_resources(bitcoin-cli bitcoin-cli-res.rc) + add_windows_application_manifest(bitcoin-cli) + target_link_libraries(bitcoin-cli + core_interface + bitcoin_cli + bitcoin_common + bitcoin_util + libevent::core + libevent::extra + ) + install_binary_component(bitcoin-cli HAS_MANPAGE) +endif() + + +if(BUILD_TX) + add_executable(bitcoin-tx bitcoin-tx.cpp) + add_windows_resources(bitcoin-tx bitcoin-tx-res.rc) + add_windows_application_manifest(bitcoin-tx) + target_link_libraries(bitcoin-tx + core_interface + bitcoin_common + bitcoin_util + univalue + ) + install_binary_component(bitcoin-tx HAS_MANPAGE) +endif() + + +if(BUILD_UTIL) + add_executable(bitcoin-util bitcoin-util.cpp) + add_windows_resources(bitcoin-util bitcoin-util-res.rc) + add_windows_application_manifest(bitcoin-util) + target_link_libraries(bitcoin-util + core_interface + bitcoin_common + bitcoin_util + ) + install_binary_component(bitcoin-util HAS_MANPAGE) +endif() + + +if(BUILD_GUI) + add_subdirectory(qt) + add_subdirectory(qml) +endif() + + +if(BUILD_KERNEL_LIB) + add_subdirectory(kernel) +endif() + +if(BUILD_UTIL_CHAINSTATE) + add_executable(bitcoin-chainstate + bitcoin-chainstate.cpp + ) + # TODO: The `SKIP_BUILD_RPATH` property setting can be deleted + # in the future after reordering Guix script commands to + # perform binary checks after the installation step. + # Relevant discussions: + # - https://github.com/hebasto/bitcoin/pull/236#issuecomment-2183120953 + # - https://github.com/bitcoin/bitcoin/pull/30312#issuecomment-2191235833 + set_target_properties(bitcoin-chainstate PROPERTIES + SKIP_BUILD_RPATH OFF + ) + target_link_libraries(bitcoin-chainstate + PRIVATE + core_interface + bitcoinkernel + ) +endif() + + +add_subdirectory(test/util) +if(BUILD_BENCH) + add_subdirectory(bench) +endif() + +if(BUILD_TESTS) + add_subdirectory(test) +endif() + +if(BUILD_FUZZ_BINARY) + add_subdirectory(test/fuzz) +endif() diff --git a/src/Makefile.am b/src/Makefile.am deleted file mode 100644 index feed4a0061..0000000000 --- a/src/Makefile.am +++ /dev/null @@ -1,1150 +0,0 @@ -# Copyright (c) 2013-2016 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -# Pattern rule to print variables, e.g. make print-top_srcdir -print-%: FORCE - @echo '$*'='$($*)' - -DIST_SUBDIRS = secp256k1 - -AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(LTO_LDFLAGS) $(CORE_LDFLAGS) -AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(LTO_CXXFLAGS) $(CORE_CXXFLAGS) -AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS) -AM_LIBTOOLFLAGS = --preserve-dup-deps -PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) -EXTRA_LIBRARIES = - -lib_LTLIBRARIES = -noinst_LTLIBRARIES = - -bin_PROGRAMS = -noinst_PROGRAMS = -check_PROGRAMS = -TESTS = -BENCHMARKS = - -BITCOIN_INCLUDES=-I$(builddir) -I$(srcdir)/$(MINISKETCH_INCLUDE_DIR_INT) -I$(srcdir)/secp256k1/include -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) - -LIBBITCOIN_NODE=libbitcoin_node.a -LIBBITCOIN_COMMON=libbitcoin_common.a -LIBBITCOIN_CONSENSUS=libbitcoin_consensus.a -LIBBITCOIN_CLI=libbitcoin_cli.a -LIBBITCOIN_UTIL=libbitcoin_util.a -LIBBITCOIN_CRYPTO_BASE=crypto/libbitcoin_crypto_base.la -LIBBITCOINQT=qt/libbitcoinqt.a -LIBSECP256K1=secp256k1/libsecp256k1.la - -if ENABLE_ZMQ -LIBBITCOIN_ZMQ=libbitcoin_zmq.a -endif -if BUILD_BITCOIN_LIBS -LIBBITCOINCONSENSUS=libbitcoinconsensus.la -endif -if BUILD_BITCOIN_KERNEL_LIB -LIBBITCOINKERNEL=libbitcoinkernel.la -endif -if ENABLE_WALLET -LIBBITCOIN_WALLET=libbitcoin_wallet.a -LIBBITCOIN_WALLET_TOOL=libbitcoin_wallet_tool.a -endif - -LIBBITCOIN_CRYPTO = $(LIBBITCOIN_CRYPTO_BASE) -if ENABLE_SSE41 -LIBBITCOIN_CRYPTO_SSE41 = crypto/libbitcoin_crypto_sse41.la -LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_SSE41) -endif -if ENABLE_AVX2 -LIBBITCOIN_CRYPTO_AVX2 = crypto/libbitcoin_crypto_avx2.la -LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_AVX2) -endif -if ENABLE_X86_SHANI -LIBBITCOIN_CRYPTO_X86_SHANI = crypto/libbitcoin_crypto_x86_shani.la -LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_X86_SHANI) -endif -if ENABLE_ARM_SHANI -LIBBITCOIN_CRYPTO_ARM_SHANI = crypto/libbitcoin_crypto_arm_shani.la -LIBBITCOIN_CRYPTO += $(LIBBITCOIN_CRYPTO_ARM_SHANI) -endif -noinst_LTLIBRARIES += $(LIBBITCOIN_CRYPTO) - -$(LIBSECP256K1): $(wildcard secp256k1/src/*.h) $(wildcard secp256k1/src/*.c) $(wildcard secp256k1/include/*) - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C $(@D) $(@F) - -# Make is not made aware of per-object dependencies to avoid limiting building parallelization -# But to build the less dependent modules first, we manually select their order here: -EXTRA_LIBRARIES += \ - $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_NODE) \ - $(LIBBITCOIN_CLI) \ - $(LIBBITCOIN_IPC) \ - $(LIBBITCOIN_WALLET) \ - $(LIBBITCOIN_WALLET_TOOL) \ - $(LIBBITCOIN_ZMQ) - -if BUILD_BITCOIND - bin_PROGRAMS += bitcoind -endif - -if BUILD_BITCOIN_NODE - bin_PROGRAMS += bitcoin-node -endif - -if BUILD_BITCOIN_CLI - bin_PROGRAMS += bitcoin-cli -endif - -if BUILD_BITCOIN_TX - bin_PROGRAMS += bitcoin-tx -endif - -if ENABLE_WALLET -if BUILD_BITCOIN_WALLET - bin_PROGRAMS += bitcoin-wallet -endif -endif - -if BUILD_BITCOIN_UTIL - bin_PROGRAMS += bitcoin-util -endif - -if BUILD_BITCOIN_CHAINSTATE - bin_PROGRAMS += bitcoin-chainstate -endif - -.PHONY: FORCE check-symbols check-security -# bitcoin core # -BITCOIN_CORE_H = \ - addresstype.h \ - addrdb.h \ - addrman.h \ - addrman_impl.h \ - attributes.h \ - banman.h \ - base58.h \ - bech32.h \ - bip324.h \ - blockencodings.h \ - blockfilter.h \ - chain.h \ - chainparams.h \ - chainparamsbase.h \ - chainparamsseeds.h \ - checkqueue.h \ - clientversion.h \ - coins.h \ - common/args.h \ - common/bloom.h \ - common/init.h \ - common/run_command.h \ - common/url.h \ - compat/assumptions.h \ - compat/byteswap.h \ - compat/compat.h \ - compat/cpuid.h \ - compat/endian.h \ - common/settings.h \ - common/system.h \ - compressor.h \ - consensus/consensus.h \ - consensus/tx_check.h \ - consensus/tx_verify.h \ - core_io.h \ - core_memusage.h \ - cuckoocache.h \ - dbwrapper.h \ - deploymentinfo.h \ - deploymentstatus.h \ - external_signer.h \ - flatfile.h \ - headerssync.h \ - httprpc.h \ - httpserver.h \ - i2p.h \ - index/base.h \ - index/blockfilterindex.h \ - index/coinstatsindex.h \ - index/disktxpos.h \ - index/txindex.h \ - indirectmap.h \ - init.h \ - init/common.h \ - interfaces/chain.h \ - interfaces/echo.h \ - interfaces/handler.h \ - interfaces/init.h \ - interfaces/ipc.h \ - interfaces/node.h \ - interfaces/wallet.h \ - kernel/blockmanager_opts.h \ - kernel/chain.h \ - kernel/chainparams.h \ - kernel/chainstatemanager_opts.h \ - kernel/checks.h \ - kernel/coinstats.h \ - kernel/context.h \ - kernel/cs_main.h \ - kernel/mempool_entry.h \ - kernel/mempool_limits.h \ - kernel/mempool_options.h \ - kernel/mempool_persist.h \ - kernel/mempool_removal_reason.h \ - kernel/notifications_interface.h \ - kernel/validation_cache_sizes.h \ - key.h \ - key_io.h \ - logging.h \ - logging/timer.h \ - mapport.h \ - memusage.h \ - merkleblock.h \ - net.h \ - net_permissions.h \ - net_processing.h \ - net_types.h \ - netaddress.h \ - netbase.h \ - netgroup.h \ - netmessagemaker.h \ - node/abort.h \ - node/blockmanager_args.h \ - node/blockstorage.h \ - node/caches.h \ - node/chainstate.h \ - node/chainstatemanager_args.h \ - node/coin.h \ - node/coins_view_args.h \ - node/connection_types.h \ - node/context.h \ - node/database_args.h \ - node/eviction.h \ - node/interface_ui.h \ - node/kernel_notifications.h \ - node/mempool_args.h \ - node/mempool_persist_args.h \ - node/miner.h \ - node/mini_miner.h \ - node/minisketchwrapper.h \ - node/peerman_args.h \ - node/psbt.h \ - node/transaction.h \ - node/txreconciliation.h \ - node/utxo_snapshot.h \ - node/validation_cache_args.h \ - noui.h \ - outputtype.h \ - policy/feerate.h \ - policy/fees.h \ - policy/fees_args.h \ - policy/packages.h \ - policy/policy.h \ - policy/rbf.h \ - policy/settings.h \ - pow.h \ - protocol.h \ - psbt.h \ - random.h \ - randomenv.h \ - rest.h \ - reverse_iterator.h \ - rpc/blockchain.h \ - rpc/client.h \ - rpc/mempool.h \ - rpc/mining.h \ - rpc/protocol.h \ - rpc/rawtransaction_util.h \ - rpc/register.h \ - rpc/request.h \ - rpc/server.h \ - rpc/server_util.h \ - rpc/util.h \ - scheduler.h \ - script/descriptor.h \ - script/keyorigin.h \ - script/miniscript.h \ - script/sigcache.h \ - script/sign.h \ - script/signingprovider.h \ - script/solver.h \ - shutdown.h \ - signet.h \ - streams.h \ - support/allocators/pool.h \ - support/allocators/secure.h \ - support/allocators/zeroafterfree.h \ - support/cleanse.h \ - support/events.h \ - support/lockedpool.h \ - sync.h \ - threadsafety.h \ - timedata.h \ - torcontrol.h \ - txdb.h \ - txmempool.h \ - txorphanage.h \ - txrequest.h \ - undo.h \ - util/any.h \ - util/asmap.h \ - util/batchpriority.h \ - util/bip32.h \ - util/bitdeque.h \ - util/bytevectorhash.h \ - util/chaintype.h \ - util/check.h \ - util/epochguard.h \ - util/error.h \ - util/exception.h \ - util/fastrange.h \ - util/fees.h \ - util/fs.h \ - util/fs_helpers.h \ - util/getuniquepath.h \ - util/golombrice.h \ - util/hash_type.h \ - util/hasher.h \ - util/insert.h \ - util/macros.h \ - util/message.h \ - util/moneystr.h \ - util/overflow.h \ - util/overloaded.h \ - util/rbf.h \ - util/readwritefile.h \ - util/result.h \ - util/serfloat.h \ - util/signalinterrupt.h \ - util/sock.h \ - util/spanparsing.h \ - util/string.h \ - util/syserror.h \ - util/thread.h \ - util/threadinterrupt.h \ - util/threadnames.h \ - util/time.h \ - util/tokenpipe.h \ - util/trace.h \ - util/translation.h \ - util/types.h \ - util/ui_change_type.h \ - util/vector.h \ - validation.h \ - validationinterface.h \ - versionbits.h \ - wallet/bdb.h \ - wallet/coincontrol.h \ - wallet/coinselection.h \ - wallet/context.h \ - wallet/crypter.h \ - wallet/db.h \ - wallet/dump.h \ - wallet/external_signer_scriptpubkeyman.h \ - wallet/feebumper.h \ - wallet/fees.h \ - wallet/load.h \ - wallet/receive.h \ - wallet/rpc/util.h \ - wallet/rpc/wallet.h \ - wallet/salvage.h \ - wallet/scriptpubkeyman.h \ - wallet/spend.h \ - wallet/sqlite.h \ - wallet/transaction.h \ - wallet/types.h \ - wallet/wallet.h \ - wallet/walletdb.h \ - wallet/wallettool.h \ - wallet/walletutil.h \ - walletinitinterface.h \ - warnings.h \ - zmq/zmqabstractnotifier.h \ - zmq/zmqnotificationinterface.h \ - zmq/zmqpublishnotifier.h \ - zmq/zmqrpc.h \ - zmq/zmqutil.h - - -obj/build.h: FORCE - @$(MKDIR_P) $(builddir)/obj - $(AM_V_GEN) $(top_srcdir)/share/genbuild.sh "$(abs_top_builddir)/src/obj/build.h" \ - "$(abs_top_srcdir)" -libbitcoin_util_a-clientversion.$(OBJEXT): obj/build.h - -# node # -libbitcoin_node_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(LEVELDB_CPPFLAGS) $(BOOST_CPPFLAGS) $(MINIUPNPC_CPPFLAGS) $(NATPMP_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) -libbitcoin_node_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_node_a_SOURCES = \ - addrdb.cpp \ - addrman.cpp \ - banman.cpp \ - bip324.cpp \ - blockencodings.cpp \ - blockfilter.cpp \ - chain.cpp \ - consensus/tx_verify.cpp \ - dbwrapper.cpp \ - deploymentstatus.cpp \ - flatfile.cpp \ - headerssync.cpp \ - httprpc.cpp \ - httpserver.cpp \ - i2p.cpp \ - index/base.cpp \ - index/blockfilterindex.cpp \ - index/coinstatsindex.cpp \ - index/txindex.cpp \ - init.cpp \ - kernel/chain.cpp \ - kernel/checks.cpp \ - kernel/coinstats.cpp \ - kernel/context.cpp \ - kernel/cs_main.cpp \ - kernel/mempool_persist.cpp \ - kernel/mempool_removal_reason.cpp \ - mapport.cpp \ - net.cpp \ - net_processing.cpp \ - netgroup.cpp \ - node/abort.cpp \ - node/blockmanager_args.cpp \ - node/blockstorage.cpp \ - node/caches.cpp \ - node/chainstate.cpp \ - node/chainstatemanager_args.cpp \ - node/coin.cpp \ - node/coins_view_args.cpp \ - node/connection_types.cpp \ - node/context.cpp \ - node/database_args.cpp \ - node/eviction.cpp \ - node/interface_ui.cpp \ - node/interfaces.cpp \ - node/kernel_notifications.cpp \ - node/mempool_args.cpp \ - node/mempool_persist_args.cpp \ - node/miner.cpp \ - node/mini_miner.cpp \ - node/minisketchwrapper.cpp \ - node/peerman_args.cpp \ - node/psbt.cpp \ - node/transaction.cpp \ - node/txreconciliation.cpp \ - node/utxo_snapshot.cpp \ - node/validation_cache_args.cpp \ - noui.cpp \ - policy/fees.cpp \ - policy/fees_args.cpp \ - policy/packages.cpp \ - policy/rbf.cpp \ - policy/settings.cpp \ - pow.cpp \ - rest.cpp \ - rpc/blockchain.cpp \ - rpc/fees.cpp \ - rpc/mempool.cpp \ - rpc/mining.cpp \ - rpc/net.cpp \ - rpc/node.cpp \ - rpc/output_script.cpp \ - rpc/rawtransaction.cpp \ - rpc/server.cpp \ - rpc/server_util.cpp \ - rpc/signmessage.cpp \ - rpc/txoutproof.cpp \ - script/sigcache.cpp \ - shutdown.cpp \ - signet.cpp \ - timedata.cpp \ - torcontrol.cpp \ - txdb.cpp \ - txmempool.cpp \ - txorphanage.cpp \ - txrequest.cpp \ - validation.cpp \ - validationinterface.cpp \ - versionbits.cpp \ - $(BITCOIN_CORE_H) - -if ENABLE_WALLET -libbitcoin_node_a_SOURCES += wallet/init.cpp -libbitcoin_node_a_CPPFLAGS += $(BDB_CPPFLAGS) -endif -if !ENABLE_WALLET -libbitcoin_node_a_SOURCES += dummywallet.cpp -endif -# - -# zmq # -if ENABLE_ZMQ -libbitcoin_zmq_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(ZMQ_CFLAGS) -libbitcoin_zmq_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_zmq_a_SOURCES = \ - zmq/zmqabstractnotifier.cpp \ - zmq/zmqnotificationinterface.cpp \ - zmq/zmqpublishnotifier.cpp \ - zmq/zmqrpc.cpp \ - zmq/zmqutil.cpp -endif -# - -# wallet # -libbitcoin_wallet_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(BDB_CPPFLAGS) $(SQLITE_CFLAGS) -libbitcoin_wallet_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_wallet_a_SOURCES = \ - wallet/coincontrol.cpp \ - wallet/context.cpp \ - wallet/crypter.cpp \ - wallet/db.cpp \ - wallet/dump.cpp \ - wallet/external_signer_scriptpubkeyman.cpp \ - wallet/feebumper.cpp \ - wallet/fees.cpp \ - wallet/interfaces.cpp \ - wallet/load.cpp \ - wallet/receive.cpp \ - wallet/rpc/addresses.cpp \ - wallet/rpc/backup.cpp \ - wallet/rpc/coins.cpp \ - wallet/rpc/encrypt.cpp \ - wallet/rpc/spend.cpp \ - wallet/rpc/signmessage.cpp \ - wallet/rpc/transactions.cpp \ - wallet/rpc/util.cpp \ - wallet/rpc/wallet.cpp \ - wallet/scriptpubkeyman.cpp \ - wallet/spend.cpp \ - wallet/transaction.cpp \ - wallet/wallet.cpp \ - wallet/walletdb.cpp \ - wallet/walletutil.cpp \ - wallet/coinselection.cpp \ - $(BITCOIN_CORE_H) - -if USE_SQLITE -libbitcoin_wallet_a_SOURCES += wallet/sqlite.cpp -endif -if USE_BDB -libbitcoin_wallet_a_SOURCES += wallet/bdb.cpp wallet/salvage.cpp -endif -# - -# wallet tool # -libbitcoin_wallet_tool_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -libbitcoin_wallet_tool_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_wallet_tool_a_SOURCES = \ - wallet/wallettool.cpp \ - $(BITCOIN_CORE_H) -# - -# crypto # -crypto_libbitcoin_crypto_base_la_CPPFLAGS = $(AM_CPPFLAGS) - -# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a -# static version of this library. We don't need a dynamic version, and a dynamic -# version can't be used on windows anyway because the library doesn't currently -# export DLL symbols. -crypto_libbitcoin_crypto_base_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crypto_libbitcoin_crypto_base_la_LDFLAGS = $(AM_LDFLAGS) -static - -crypto_libbitcoin_crypto_base_la_SOURCES = \ - crypto/aes.cpp \ - crypto/aes.h \ - crypto/chacha20.h \ - crypto/chacha20.cpp \ - crypto/chacha20poly1305.h \ - crypto/chacha20poly1305.cpp \ - crypto/common.h \ - crypto/hkdf_sha256_32.cpp \ - crypto/hkdf_sha256_32.h \ - crypto/hmac_sha256.cpp \ - crypto/hmac_sha256.h \ - crypto/hmac_sha512.cpp \ - crypto/hmac_sha512.h \ - crypto/poly1305.h \ - crypto/poly1305.cpp \ - crypto/muhash.h \ - crypto/muhash.cpp \ - crypto/ripemd160.cpp \ - crypto/ripemd160.h \ - crypto/sha1.cpp \ - crypto/sha1.h \ - crypto/sha256.cpp \ - crypto/sha256.h \ - crypto/sha3.cpp \ - crypto/sha3.h \ - crypto/sha512.cpp \ - crypto/sha512.h \ - crypto/siphash.cpp \ - crypto/siphash.h - -if USE_ASM -crypto_libbitcoin_crypto_base_la_SOURCES += crypto/sha256_sse4.cpp -endif - -# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and -# CXXFLAGS above -crypto_libbitcoin_crypto_sse41_la_LDFLAGS = $(AM_LDFLAGS) -static -crypto_libbitcoin_crypto_sse41_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crypto_libbitcoin_crypto_sse41_la_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_sse41_la_CXXFLAGS += $(SSE41_CXXFLAGS) -crypto_libbitcoin_crypto_sse41_la_CPPFLAGS += -DENABLE_SSE41 -crypto_libbitcoin_crypto_sse41_la_SOURCES = crypto/sha256_sse41.cpp - -# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and -# CXXFLAGS above -crypto_libbitcoin_crypto_avx2_la_LDFLAGS = $(AM_LDFLAGS) -static -crypto_libbitcoin_crypto_avx2_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crypto_libbitcoin_crypto_avx2_la_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_avx2_la_CXXFLAGS += $(AVX2_CXXFLAGS) -crypto_libbitcoin_crypto_avx2_la_CPPFLAGS += -DENABLE_AVX2 -crypto_libbitcoin_crypto_avx2_la_SOURCES = crypto/sha256_avx2.cpp - -# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and -# CXXFLAGS above -crypto_libbitcoin_crypto_x86_shani_la_LDFLAGS = $(AM_LDFLAGS) -static -crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_x86_shani_la_CXXFLAGS += $(X86_SHANI_CXXFLAGS) -crypto_libbitcoin_crypto_x86_shani_la_CPPFLAGS += -DENABLE_X86_SHANI -crypto_libbitcoin_crypto_x86_shani_la_SOURCES = crypto/sha256_x86_shani.cpp - -# See explanation for -static in crypto_libbitcoin_crypto_base_la's LDFLAGS and -# CXXFLAGS above -crypto_libbitcoin_crypto_arm_shani_la_LDFLAGS = $(AM_LDFLAGS) -static -crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS = $(AM_CPPFLAGS) -crypto_libbitcoin_crypto_arm_shani_la_CXXFLAGS += $(ARM_SHANI_CXXFLAGS) -crypto_libbitcoin_crypto_arm_shani_la_CPPFLAGS += -DENABLE_ARM_SHANI -crypto_libbitcoin_crypto_arm_shani_la_SOURCES = crypto/sha256_arm_shani.cpp -# - -# consensus # -libbitcoin_consensus_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -libbitcoin_consensus_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_consensus_a_SOURCES = \ - arith_uint256.cpp \ - arith_uint256.h \ - consensus/amount.h \ - consensus/merkle.cpp \ - consensus/merkle.h \ - consensus/params.h \ - consensus/tx_check.cpp \ - consensus/validation.h \ - hash.cpp \ - hash.h \ - prevector.h \ - primitives/block.cpp \ - primitives/block.h \ - primitives/transaction.cpp \ - primitives/transaction.h \ - pubkey.cpp \ - pubkey.h \ - script/bitcoinconsensus.cpp \ - script/interpreter.cpp \ - script/interpreter.h \ - script/script.cpp \ - script/script.h \ - script/script_error.cpp \ - script/script_error.h \ - serialize.h \ - span.h \ - tinyformat.h \ - uint256.cpp \ - uint256.h \ - util/strencodings.cpp \ - util/strencodings.h \ - version.h -# - -# common # -libbitcoin_common_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -libbitcoin_common_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_common_a_SOURCES = \ - addresstype.cpp \ - base58.cpp \ - bech32.cpp \ - chainparams.cpp \ - coins.cpp \ - common/args.cpp \ - common/bloom.cpp \ - common/config.cpp \ - common/init.cpp \ - common/interfaces.cpp \ - common/run_command.cpp \ - common/settings.cpp \ - common/system.cpp \ - compressor.cpp \ - core_read.cpp \ - core_write.cpp \ - deploymentinfo.cpp \ - external_signer.cpp \ - init/common.cpp \ - kernel/chainparams.cpp \ - key.cpp \ - key_io.cpp \ - merkleblock.cpp \ - net_types.cpp \ - netaddress.cpp \ - netbase.cpp \ - net_permissions.cpp \ - outputtype.cpp \ - policy/feerate.cpp \ - policy/policy.cpp \ - protocol.cpp \ - psbt.cpp \ - rpc/external_signer.cpp \ - rpc/rawtransaction_util.cpp \ - rpc/request.cpp \ - rpc/util.cpp \ - scheduler.cpp \ - script/descriptor.cpp \ - script/miniscript.cpp \ - script/sign.cpp \ - script/signingprovider.cpp \ - script/solver.cpp \ - warnings.cpp \ - $(BITCOIN_CORE_H) - -if USE_LIBEVENT -libbitcoin_common_a_CPPFLAGS += $(EVENT_CFLAGS) -libbitcoin_common_a_SOURCES += common/url.cpp -endif -# - -# util # -libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_util_a_SOURCES = \ - support/lockedpool.cpp \ - chainparamsbase.cpp \ - clientversion.cpp \ - logging.cpp \ - random.cpp \ - randomenv.cpp \ - streams.cpp \ - support/cleanse.cpp \ - sync.cpp \ - util/asmap.cpp \ - util/batchpriority.cpp \ - util/bip32.cpp \ - util/bytevectorhash.cpp \ - util/chaintype.cpp \ - util/check.cpp \ - util/error.cpp \ - util/exception.cpp \ - util/fees.cpp \ - util/fs.cpp \ - util/fs_helpers.cpp \ - util/getuniquepath.cpp \ - util/hasher.cpp \ - util/sock.cpp \ - util/syserror.cpp \ - util/message.cpp \ - util/moneystr.cpp \ - util/rbf.cpp \ - util/readwritefile.cpp \ - util/signalinterrupt.cpp \ - util/thread.cpp \ - util/threadinterrupt.cpp \ - util/threadnames.cpp \ - util/serfloat.cpp \ - util/spanparsing.cpp \ - util/strencodings.cpp \ - util/string.cpp \ - util/time.cpp \ - util/tokenpipe.cpp \ - $(BITCOIN_CORE_H) -# - -# cli # -libbitcoin_cli_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -libbitcoin_cli_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libbitcoin_cli_a_SOURCES = \ - compat/stdin.h \ - compat/stdin.cpp \ - rpc/client.cpp \ - $(BITCOIN_CORE_H) - -nodist_libbitcoin_util_a_SOURCES = $(srcdir)/obj/build.h -# - -# bitcoind & bitcoin-node binaries # -bitcoin_daemon_sources = bitcoind.cpp -bitcoin_bin_cppflags = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoin_bin_cxxflags = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_bin_ldflags = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) - -if TARGET_WINDOWS -bitcoin_daemon_sources += bitcoind-res.rc -endif - -bitcoin_bin_ldadd = \ - $(LIBBITCOIN_WALLET) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBUNIVALUE) \ - $(LIBBITCOIN_ZMQ) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBLEVELDB) \ - $(LIBMEMENV) \ - $(LIBSECP256K1) - -bitcoin_bin_ldadd += $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(ZMQ_LIBS) $(SQLITE_LIBS) - -bitcoind_SOURCES = $(bitcoin_daemon_sources) init/bitcoind.cpp -bitcoind_CPPFLAGS = $(bitcoin_bin_cppflags) -bitcoind_CXXFLAGS = $(bitcoin_bin_cxxflags) -bitcoind_LDFLAGS = $(bitcoin_bin_ldflags) -bitcoind_LDADD = $(LIBBITCOIN_NODE) $(bitcoin_bin_ldadd) - -bitcoin_node_SOURCES = $(bitcoin_daemon_sources) init/bitcoin-node.cpp -bitcoin_node_CPPFLAGS = $(bitcoin_bin_cppflags) -bitcoin_node_CXXFLAGS = $(bitcoin_bin_cxxflags) -bitcoin_node_LDFLAGS = $(bitcoin_bin_ldflags) -bitcoin_node_LDADD = $(LIBBITCOIN_NODE) $(bitcoin_bin_ldadd) $(LIBBITCOIN_IPC) $(LIBMULTIPROCESS_LIBS) - -# bitcoin-cli binary # -bitcoin_cli_SOURCES = bitcoin-cli.cpp -bitcoin_cli_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(EVENT_CFLAGS) -bitcoin_cli_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_cli_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) - -if TARGET_WINDOWS -bitcoin_cli_SOURCES += bitcoin-cli-res.rc -endif - -bitcoin_cli_LDADD = \ - $(LIBBITCOIN_CLI) \ - $(LIBUNIVALUE) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CRYPTO) - -bitcoin_cli_LDADD += $(EVENT_LIBS) -# - -# bitcoin-tx binary # -bitcoin_tx_SOURCES = bitcoin-tx.cpp -bitcoin_tx_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoin_tx_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_tx_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) - -if TARGET_WINDOWS -bitcoin_tx_SOURCES += bitcoin-tx-res.rc -endif - -bitcoin_tx_LDADD = \ - $(LIBUNIVALUE) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBSECP256K1) -# - -# bitcoin-wallet binary # -bitcoin_wallet_SOURCES = bitcoin-wallet.cpp -bitcoin_wallet_SOURCES += init/bitcoin-wallet.cpp -bitcoin_wallet_CPPFLAGS = $(bitcoin_bin_cppflags) -bitcoin_wallet_CXXFLAGS = $(bitcoin_bin_cxxflags) -bitcoin_wallet_LDFLAGS = $(bitcoin_bin_ldflags) -bitcoin_wallet_LDADD = \ - $(LIBBITCOIN_WALLET_TOOL) \ - $(LIBBITCOIN_WALLET) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBUNIVALUE) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBSECP256K1) \ - $(BDB_LIBS) \ - $(SQLITE_LIBS) - -if TARGET_WINDOWS -bitcoin_wallet_SOURCES += bitcoin-wallet-res.rc -endif -# - -# bitcoin-util binary # -bitcoin_util_SOURCES = bitcoin-util.cpp -bitcoin_util_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -bitcoin_util_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bitcoin_util_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) - -if TARGET_WINDOWS -bitcoin_util_SOURCES += bitcoin-util-res.rc -endif - -bitcoin_util_LDADD = \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBUNIVALUE) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBSECP256K1) -# - -# bitcoin-chainstate binary # -bitcoin_chainstate_SOURCES = bitcoin-chainstate.cpp -bitcoin_chainstate_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -bitcoin_chainstate_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) - -bitcoin_chainstate_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(PTHREAD_FLAGS) $(LIBTOOL_APP_LDFLAGS) -static -bitcoin_chainstate_LDADD = $(LIBBITCOINKERNEL) - -# libtool is unable to calculate this indirect dependency, presumably because it's a subproject. -# libsecp256k1 only needs to be linked in when libbitcoinkernel is static. -bitcoin_chainstate_LDADD += $(LIBSECP256K1) -# - -# bitcoinkernel library # -if BUILD_BITCOIN_KERNEL_LIB -lib_LTLIBRARIES += $(LIBBITCOINKERNEL) - -libbitcoinkernel_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) $(PTHREAD_FLAGS) -libbitcoinkernel_la_LIBADD = $(LIBBITCOIN_CRYPTO) $(LIBLEVELDB) $(LIBMEMENV) $(LIBSECP256K1) -libbitcoinkernel_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL $(BOOST_CPPFLAGS) $(LEVELDB_CPPFLAGS) - -# libbitcoinkernel requires default symbol visibility, explicitly specify that -# here so that things still work even when user configures with -# --enable-reduce-exports -# -# Note this is a quick hack that will be removed as we incrementally define what -# to export from the library. -libbitcoinkernel_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -fvisibility=default - -# TODO: libbitcoinkernel is a work in progress consensus engine library, as more -# and more modules are decoupled from the consensus engine, this list will -# shrink to only those which are absolutely necessary. -libbitcoinkernel_la_SOURCES = \ - kernel/bitcoinkernel.cpp \ - arith_uint256.cpp \ - chain.cpp \ - clientversion.cpp \ - coins.cpp \ - compressor.cpp \ - consensus/merkle.cpp \ - consensus/tx_check.cpp \ - consensus/tx_verify.cpp \ - core_read.cpp \ - dbwrapper.cpp \ - deploymentinfo.cpp \ - deploymentstatus.cpp \ - flatfile.cpp \ - hash.cpp \ - kernel/chain.cpp \ - kernel/checks.cpp \ - kernel/chainparams.cpp \ - kernel/coinstats.cpp \ - kernel/context.cpp \ - kernel/cs_main.cpp \ - kernel/mempool_persist.cpp \ - kernel/mempool_removal_reason.cpp \ - key.cpp \ - logging.cpp \ - node/blockstorage.cpp \ - node/chainstate.cpp \ - node/utxo_snapshot.cpp \ - policy/feerate.cpp \ - policy/fees.cpp \ - policy/packages.cpp \ - policy/policy.cpp \ - policy/rbf.cpp \ - policy/settings.cpp \ - pow.cpp \ - primitives/block.cpp \ - primitives/transaction.cpp \ - pubkey.cpp \ - random.cpp \ - randomenv.cpp \ - scheduler.cpp \ - script/interpreter.cpp \ - script/script.cpp \ - script/script_error.cpp \ - script/sigcache.cpp \ - script/solver.cpp \ - signet.cpp \ - streams.cpp \ - support/cleanse.cpp \ - support/lockedpool.cpp \ - sync.cpp \ - txdb.cpp \ - txmempool.cpp \ - uint256.cpp \ - util/batchpriority.cpp \ - util/chaintype.cpp \ - util/check.cpp \ - util/exception.cpp \ - util/fs.cpp \ - util/fs_helpers.cpp \ - util/getuniquepath.cpp \ - util/hasher.cpp \ - util/moneystr.cpp \ - util/rbf.cpp \ - util/serfloat.cpp \ - util/signalinterrupt.cpp \ - util/strencodings.cpp \ - util/string.cpp \ - util/syserror.cpp \ - util/thread.cpp \ - util/threadnames.cpp \ - util/time.cpp \ - util/tokenpipe.cpp \ - validation.cpp \ - validationinterface.cpp \ - versionbits.cpp \ - warnings.cpp - -# Required for obj/build.h to be generated first. -# More details: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html -libbitcoinkernel_la-clientversion.l$(OBJEXT): obj/build.h -endif # BUILD_BITCOIN_KERNEL_LIB -# - -# bitcoinconsensus library # -if BUILD_BITCOIN_LIBS -lib_LTLIBRARIES += $(LIBBITCOINCONSENSUS) - -include_HEADERS = script/bitcoinconsensus.h -libbitcoinconsensus_la_SOURCES = support/cleanse.cpp $(crypto_libbitcoin_crypto_base_la_SOURCES) $(libbitcoin_consensus_a_SOURCES) - -libbitcoinconsensus_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined $(RELDFLAGS) -libbitcoinconsensus_la_LIBADD = $(LIBSECP256K1) -libbitcoinconsensus_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(builddir)/obj -I$(srcdir)/secp256k1/include -DBUILD_BITCOIN_INTERNAL -libbitcoinconsensus_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) - -endif -# - -CTAES_DIST = crypto/ctaes/bench.c -CTAES_DIST += crypto/ctaes/ctaes.c -CTAES_DIST += crypto/ctaes/ctaes.h -CTAES_DIST += crypto/ctaes/README.md -CTAES_DIST += crypto/ctaes/test.c - -CLEANFILES = $(EXTRA_LIBRARIES) - -CLEANFILES += *.gcda *.gcno -CLEANFILES += compat/*.gcda compat/*.gcno -CLEANFILES += consensus/*.gcda consensus/*.gcno -CLEANFILES += crc32c/src/*.gcda crc32c/src/*.gcno -CLEANFILES += crypto/*.gcda crypto/*.gcno -CLEANFILES += index/*.gcda index/*.gcno -CLEANFILES += interfaces/*.gcda interfaces/*.gcno -CLEANFILES += node/*.gcda node/*.gcno -CLEANFILES += policy/*.gcda policy/*.gcno -CLEANFILES += primitives/*.gcda primitives/*.gcno -CLEANFILES += rpc/*.gcda rpc/*.gcno -CLEANFILES += script/*.gcda script/*.gcno -CLEANFILES += support/*.gcda support/*.gcno -CLEANFILES += univalue/*.gcda univalue/*.gcno -CLEANFILES += util/*.gcda util/*.gcno -CLEANFILES += wallet/*.gcda wallet/*.gcno -CLEANFILES += wallet/test/*.gcda wallet/test/*.gcno -CLEANFILES += zmq/*.gcda zmq/*.gcno -CLEANFILES += obj/build.h - -EXTRA_DIST = $(CTAES_DIST) - - -config/bitcoin-config.h: config/stamp-h1 - @$(MAKE) -C $(top_builddir) $(subdir)/$(@) -config/stamp-h1: $(top_srcdir)/$(subdir)/config/bitcoin-config.h.in $(top_builddir)/config.status - $(AM_V_at)$(MAKE) -C $(top_builddir) $(subdir)/$(@) -$(top_srcdir)/$(subdir)/config/bitcoin-config.h.in: $(am__configure_deps) - $(AM_V_at)$(MAKE) -C $(top_srcdir) $(subdir)/config/bitcoin-config.h.in - -clean-local: - -$(MAKE) -C secp256k1 clean - -rm -f leveldb/*/*.gcda leveldb/*/*.gcno leveldb/helpers/memenv/*.gcda leveldb/helpers/memenv/*.gcno - -rm -f config.h - -rm -rf test/__pycache__ - -.rc.o: - @test -f $(WINDRES) || (echo "windres $(WINDRES) not found, but is required to compile windows resource files"; exit 1) - ## FIXME: How to get the appropriate modulename_CPPFLAGS in here? - $(AM_V_GEN) $(WINDRES) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(CPPFLAGS) -DWINDRES_PREPROC -i $< -o $@ - -check-symbols: $(bin_PROGRAMS) - @echo "Running symbol and dynamic library checks..." - $(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/symbol-check.py $(bin_PROGRAMS) - -check-security: $(bin_PROGRAMS) -if HARDEN - @echo "Checking binary security..." - $(AM_V_at) $(PYTHON) $(top_srcdir)/contrib/devtools/security-check.py $(bin_PROGRAMS) -endif - -libbitcoin_ipc_mpgen_input = \ - ipc/capnp/echo.capnp \ - ipc/capnp/init.capnp -EXTRA_DIST += $(libbitcoin_ipc_mpgen_input) -%.capnp: - -# Explicitly list dependencies on generated headers as described in -# https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually -ipc/capnp/libbitcoin_ipc_a-protocol.$(OBJEXT): $(libbitcoin_ipc_mpgen_input:=.h) - -if BUILD_MULTIPROCESS -LIBBITCOIN_IPC=libbitcoin_ipc.a -libbitcoin_ipc_a_SOURCES = \ - ipc/capnp/context.h \ - ipc/capnp/init-types.h \ - ipc/capnp/protocol.cpp \ - ipc/capnp/protocol.h \ - ipc/context.h \ - ipc/exception.h \ - ipc/interfaces.cpp \ - ipc/process.cpp \ - ipc/process.h \ - ipc/protocol.h -libbitcoin_ipc_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) -libbitcoin_ipc_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(LIBMULTIPROCESS_CFLAGS) - -include $(MPGEN_PREFIX)/include/mpgen.mk -libbitcoin_ipc_mpgen_output = \ - $(libbitcoin_ipc_mpgen_input:=.c++) \ - $(libbitcoin_ipc_mpgen_input:=.h) \ - $(libbitcoin_ipc_mpgen_input:=.proxy-client.c++) \ - $(libbitcoin_ipc_mpgen_input:=.proxy-server.c++) \ - $(libbitcoin_ipc_mpgen_input:=.proxy-types.c++) \ - $(libbitcoin_ipc_mpgen_input:=.proxy-types.h) \ - $(libbitcoin_ipc_mpgen_input:=.proxy.h) -nodist_libbitcoin_ipc_a_SOURCES = $(libbitcoin_ipc_mpgen_output) -CLEANFILES += $(libbitcoin_ipc_mpgen_output) -endif - -%.raw.h: %.raw - @$(MKDIR_P) $(@D) - $(AM_V_GEN) { \ - echo "static unsigned const char $(*F)_raw[] = {" && \ - $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \ - echo "};"; \ - } > "$@.new" && mv -f "$@.new" "$@" - -include Makefile.minisketch.include - -include Makefile.crc32c.include -include Makefile.leveldb.include - -include Makefile.test_util.include -include Makefile.test_fuzz.include - -include Makefile.test.include - -if ENABLE_BENCH -include Makefile.bench.include -endif - -if ENABLE_QT -include Makefile.qt.include -endif - -if ENABLE_QT_TESTS -include Makefile.qttest.include -endif - -include Makefile.univalue.include diff --git a/src/Makefile.bench.include b/src/Makefile.bench.include deleted file mode 100644 index 934e9a1fae..0000000000 --- a/src/Makefile.bench.include +++ /dev/null @@ -1,103 +0,0 @@ -# Copyright (c) 2015-2016 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -bin_PROGRAMS += bench/bench_bitcoin -BENCH_SRCDIR = bench -BENCH_BINARY = bench/bench_bitcoin$(EXEEXT) - -RAW_BENCH_FILES = \ - bench/data/block413567.raw -GENERATED_BENCH_FILES = $(RAW_BENCH_FILES:.raw=.raw.h) - -bench_bench_bitcoin_SOURCES = \ - $(RAW_BENCH_FILES) \ - bench/addrman.cpp \ - bench/base58.cpp \ - bench/bech32.cpp \ - bench/bench.cpp \ - bench/bench.h \ - bench/bench_bitcoin.cpp \ - bench/bip324_ecdh.cpp \ - bench/block_assemble.cpp \ - bench/ccoins_caching.cpp \ - bench/chacha20.cpp \ - bench/checkblock.cpp \ - bench/checkqueue.cpp \ - bench/crypto_hash.cpp \ - bench/data.cpp \ - bench/data.h \ - bench/descriptors.cpp \ - bench/duplicate_inputs.cpp \ - bench/ellswift.cpp \ - bench/examples.cpp \ - bench/gcs_filter.cpp \ - bench/hashpadding.cpp \ - bench/load_external.cpp \ - bench/lockedpool.cpp \ - bench/logging.cpp \ - bench/mempool_eviction.cpp \ - bench/mempool_stress.cpp \ - bench/merkle_root.cpp \ - bench/nanobench.cpp \ - bench/nanobench.h \ - bench/peer_eviction.cpp \ - bench/poly1305.cpp \ - bench/pool.cpp \ - bench/prevector.cpp \ - bench/rollingbloom.cpp \ - bench/rpc_blockchain.cpp \ - bench/rpc_mempool.cpp \ - bench/streams_findbyte.cpp \ - bench/strencodings.cpp \ - bench/util_time.cpp \ - bench/verify_script.cpp \ - bench/xor.cpp - -nodist_bench_bench_bitcoin_SOURCES = $(GENERATED_BENCH_FILES) - -bench_bench_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS) $(EVENT_PTHREADS_CFLAGS) -I$(builddir)/bench/ -bench_bench_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -bench_bench_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -bench_bench_bitcoin_LDADD = \ - $(LIBTEST_UTIL) \ - $(LIBBITCOIN_NODE) \ - $(LIBBITCOIN_WALLET) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBLEVELDB) \ - $(LIBMEMENV) \ - $(LIBSECP256K1) \ - $(LIBUNIVALUE) \ - $(EVENT_PTHREADS_LIBS) \ - $(EVENT_LIBS) \ - $(MINIUPNPC_LIBS) \ - $(NATPMP_LIBS) - -if ENABLE_ZMQ -bench_bench_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) -endif - -if ENABLE_WALLET -bench_bench_bitcoin_SOURCES += bench/coin_selection.cpp -bench_bench_bitcoin_SOURCES += bench/wallet_balance.cpp -bench_bench_bitcoin_SOURCES += bench/wallet_loading.cpp -bench_bench_bitcoin_SOURCES += bench/wallet_create_tx.cpp -bench_bench_bitcoin_LDADD += $(BDB_LIBS) $(SQLITE_LIBS) -endif - -CLEAN_BITCOIN_BENCH = bench/*.gcda bench/*.gcno $(GENERATED_BENCH_FILES) - -CLEANFILES += $(CLEAN_BITCOIN_BENCH) - -bench/data.cpp: bench/data/block413567.raw.h - -bitcoin_bench: $(BENCH_BINARY) - -bench: $(BENCH_BINARY) FORCE - $(BENCH_BINARY) - -bitcoin_bench_clean : FORCE - rm -f $(CLEAN_BITCOIN_BENCH) $(bench_bench_bitcoin_OBJECTS) $(BENCH_BINARY) diff --git a/src/Makefile.crc32c.include b/src/Makefile.crc32c.include deleted file mode 100644 index c4dd84991d..0000000000 --- a/src/Makefile.crc32c.include +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright (c) 2019 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -LIBCRC32C_INT = crc32c/libcrc32c.la - -noinst_LTLIBRARIES += $(LIBCRC32C_INT) - -LIBCRC32C = $(LIBCRC32C_INT) - -CRC32C_CPPFLAGS_INT = -CRC32C_CPPFLAGS_INT += -I$(srcdir)/crc32c/include -CRC32C_CPPFLAGS_INT += -DHAVE_BUILTIN_PREFETCH=@HAVE_BUILTIN_PREFETCH@ -CRC32C_CPPFLAGS_INT += -DHAVE_MM_PREFETCH=@HAVE_MM_PREFETCH@ -CRC32C_CPPFLAGS_INT += -DHAVE_STRONG_GETAUXVAL=@HAVE_STRONG_GETAUXVAL@ -CRC32C_CPPFLAGS_INT += -DCRC32C_TESTS_BUILT_WITH_GLOG=0 - -if ENABLE_SSE42 -CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=1 -else -CRC32C_CPPFLAGS_INT += -DHAVE_SSE42=0 -endif - -if ENABLE_ARM_CRC -CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=1 -else -CRC32C_CPPFLAGS_INT += -DHAVE_ARM64_CRC32C=0 -endif - -if WORDS_BIGENDIAN -CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=1 -else -CRC32C_CPPFLAGS_INT += -DBYTE_ORDER_BIG_ENDIAN=0 -endif - -crc32c_libcrc32c_la_CPPFLAGS = $(AM_CPPFLAGS) $(CRC32C_CPPFLAGS_INT) $(CRC32C_CPPFLAGS) - -# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a -# static version of this library. We don't need a dynamic version, and a dynamic -# version can't be used on windows anyway because the library doesn't currently -# export DLL symbols. -crc32c_libcrc32c_la_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -static -crc32c_libcrc32c_la_LDFLAGS = $(AM_LDFLAGS) -static - -crc32c_libcrc32c_la_SOURCES = -crc32c_libcrc32c_la_SOURCES += crc32c/include/crc32c/crc32c.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_arm64_check.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_internal.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_prefetch.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_read_le.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_round_up.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42_check.h -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_sse42.h - -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c.cc -crc32c_libcrc32c_la_SOURCES += crc32c/src/crc32c_portable.cc - -if ENABLE_SSE42 -LIBCRC32C_SSE42_INT = crc32c/libcrc32c_sse42.la -noinst_LTLIBRARIES += $(LIBCRC32C_SSE42_INT) -LIBCRC32C += $(LIBCRC32C_SSE42_INT) - -crc32c_libcrc32c_sse42_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS) -crc32c_libcrc32c_sse42_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(SSE42_CXXFLAGS) -crc32c_libcrc32c_sse42_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS) - -crc32c_libcrc32c_sse42_la_SOURCES = crc32c/src/crc32c_sse42.cc -endif - -if ENABLE_ARM_CRC -LIBCRC32C_ARM_CRC_INT = crc32c/libcrc32c_arm_crc.la -noinst_LTLIBRARIES += $(LIBCRC32C_ARM_CRC_INT) -LIBCRC32C += $(LIBCRC32C_ARM_CRC_INT) - -crc32c_libcrc32c_arm_crc_la_CPPFLAGS = $(crc32c_libcrc32c_la_CPPFLAGS) -crc32c_libcrc32c_arm_crc_la_CXXFLAGS = $(crc32c_libcrc32c_la_CXXFLAGS) $(ARM_CRC_CXXFLAGS) -crc32c_libcrc32c_arm_crc_la_LDFLAGS = $(crc32c_libcrc32c_la_LDFLAGS) - -crc32c_libcrc32c_arm_crc_la_SOURCES = crc32c/src/crc32c_arm64.cc -endif diff --git a/src/Makefile.leveldb.include b/src/Makefile.leveldb.include deleted file mode 100644 index bf14fe206b..0000000000 --- a/src/Makefile.leveldb.include +++ /dev/null @@ -1,153 +0,0 @@ -# Copyright (c) 2016 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -LIBLEVELDB_INT = leveldb/libleveldb.la -LIBMEMENV_INT = leveldb/libmemenv.la - -noinst_LTLIBRARIES += $(LIBLEVELDB_INT) -noinst_LTLIBRARIES += $(LIBMEMENV_INT) - -LIBLEVELDB = $(LIBLEVELDB_INT) $(LIBCRC32C) -LIBMEMENV = $(LIBMEMENV_INT) - -LEVELDB_CPPFLAGS = -LEVELDB_CPPFLAGS += -I$(srcdir)/leveldb/include - -LEVELDB_CPPFLAGS_INT = -LEVELDB_CPPFLAGS_INT += -I$(srcdir)/leveldb -LEVELDB_CPPFLAGS_INT += -I$(srcdir)/crc32c/include -LEVELDB_CPPFLAGS_INT += -D__STDC_LIMIT_MACROS -LEVELDB_CPPFLAGS_INT += -DHAVE_SNAPPY=0 -DHAVE_CRC32C=1 -LEVELDB_CPPFLAGS_INT += -DHAVE_FDATASYNC=@HAVE_FDATASYNC@ -LEVELDB_CPPFLAGS_INT += -DHAVE_FULLFSYNC=@HAVE_FULLFSYNC@ -LEVELDB_CPPFLAGS_INT += -DHAVE_O_CLOEXEC=@HAVE_O_CLOEXEC@ -LEVELDB_CPPFLAGS_INT += -DFALLTHROUGH_INTENDED=[[fallthrough]] - -if WORDS_BIGENDIAN -LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=1 -else -LEVELDB_CPPFLAGS_INT += -DLEVELDB_IS_BIG_ENDIAN=0 -endif - -if TARGET_WINDOWS -LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_WINDOWS -D_UNICODE -DUNICODE -D__USE_MINGW_ANSI_STDIO=1 -else -LEVELDB_CPPFLAGS_INT += -DLEVELDB_PLATFORM_POSIX -endif - -leveldb_libleveldb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LEVELDB_CPPFLAGS_INT) $(LEVELDB_CPPFLAGS) - -# Specify -static in both CXXFLAGS and LDFLAGS so libtool will only build a -# static version of this library. We don't need a dynamic version, and a dynamic -# version can't be used on windows anyway because the library doesn't currently -# export DLL symbols. -leveldb_libleveldb_la_CXXFLAGS = $(filter-out -Wconditional-uninitialized -Werror=conditional-uninitialized -Wsuggest-override -Werror=suggest-override, $(AM_CXXFLAGS)) $(PIE_FLAGS) -static -leveldb_libleveldb_la_LDFLAGS = $(AM_LDFLAGS) -static - -leveldb_libleveldb_la_SOURCES= -leveldb_libleveldb_la_SOURCES += leveldb/port/port_stdcxx.h -leveldb_libleveldb_la_SOURCES += leveldb/port/port.h -leveldb_libleveldb_la_SOURCES += leveldb/port/thread_annotations.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/db.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/options.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/comparator.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/filter_policy.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/slice.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/table_builder.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/env.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/export.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/c.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/iterator.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/cache.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/dumpfile.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/table.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/write_batch.h -leveldb_libleveldb_la_SOURCES += leveldb/include/leveldb/status.h -leveldb_libleveldb_la_SOURCES += leveldb/db/log_format.h -leveldb_libleveldb_la_SOURCES += leveldb/db/memtable.h -leveldb_libleveldb_la_SOURCES += leveldb/db/version_set.h -leveldb_libleveldb_la_SOURCES += leveldb/db/write_batch_internal.h -leveldb_libleveldb_la_SOURCES += leveldb/db/filename.h -leveldb_libleveldb_la_SOURCES += leveldb/db/version_edit.h -leveldb_libleveldb_la_SOURCES += leveldb/db/dbformat.h -leveldb_libleveldb_la_SOURCES += leveldb/db/builder.h -leveldb_libleveldb_la_SOURCES += leveldb/db/log_writer.h -leveldb_libleveldb_la_SOURCES += leveldb/db/db_iter.h -leveldb_libleveldb_la_SOURCES += leveldb/db/skiplist.h -leveldb_libleveldb_la_SOURCES += leveldb/db/db_impl.h -leveldb_libleveldb_la_SOURCES += leveldb/db/table_cache.h -leveldb_libleveldb_la_SOURCES += leveldb/db/snapshot.h -leveldb_libleveldb_la_SOURCES += leveldb/db/log_reader.h -leveldb_libleveldb_la_SOURCES += leveldb/table/filter_block.h -leveldb_libleveldb_la_SOURCES += leveldb/table/block_builder.h -leveldb_libleveldb_la_SOURCES += leveldb/table/block.h -leveldb_libleveldb_la_SOURCES += leveldb/table/two_level_iterator.h -leveldb_libleveldb_la_SOURCES += leveldb/table/merger.h -leveldb_libleveldb_la_SOURCES += leveldb/table/format.h -leveldb_libleveldb_la_SOURCES += leveldb/table/iterator_wrapper.h -leveldb_libleveldb_la_SOURCES += leveldb/util/crc32c.h -leveldb_libleveldb_la_SOURCES += leveldb/util/env_posix_test_helper.h -leveldb_libleveldb_la_SOURCES += leveldb/util/env_windows_test_helper.h -leveldb_libleveldb_la_SOURCES += leveldb/util/arena.h -leveldb_libleveldb_la_SOURCES += leveldb/util/random.h -leveldb_libleveldb_la_SOURCES += leveldb/util/posix_logger.h -leveldb_libleveldb_la_SOURCES += leveldb/util/hash.h -leveldb_libleveldb_la_SOURCES += leveldb/util/histogram.h -leveldb_libleveldb_la_SOURCES += leveldb/util/coding.h -leveldb_libleveldb_la_SOURCES += leveldb/util/testutil.h -leveldb_libleveldb_la_SOURCES += leveldb/util/mutexlock.h -leveldb_libleveldb_la_SOURCES += leveldb/util/logging.h -leveldb_libleveldb_la_SOURCES += leveldb/util/no_destructor.h -leveldb_libleveldb_la_SOURCES += leveldb/util/testharness.h -leveldb_libleveldb_la_SOURCES += leveldb/util/windows_logger.h - -leveldb_libleveldb_la_SOURCES += leveldb/db/builder.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/c.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/dbformat.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/db_impl.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/db_iter.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/dumpfile.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/filename.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/log_reader.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/log_writer.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/memtable.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/repair.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/table_cache.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/version_edit.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/version_set.cc -leveldb_libleveldb_la_SOURCES += leveldb/db/write_batch.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/block_builder.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/block.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/filter_block.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/format.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/iterator.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/merger.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/table_builder.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/table.cc -leveldb_libleveldb_la_SOURCES += leveldb/table/two_level_iterator.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/arena.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/bloom.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/cache.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/coding.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/comparator.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/crc32c.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/env.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/filter_policy.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/hash.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/histogram.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/logging.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/options.cc -leveldb_libleveldb_la_SOURCES += leveldb/util/status.cc - -if TARGET_WINDOWS -leveldb_libleveldb_la_SOURCES += leveldb/util/env_windows.cc -else -leveldb_libleveldb_la_SOURCES += leveldb/util/env_posix.cc -endif - -leveldb_libmemenv_la_CPPFLAGS = $(leveldb_libleveldb_la_CPPFLAGS) -leveldb_libmemenv_la_CXXFLAGS = $(leveldb_libleveldb_la_CXXFLAGS) -leveldb_libmemenv_la_LDFLAGS = $(leveldb_libleveldb_la_LDFLAGS) -leveldb_libmemenv_la_SOURCES = leveldb/helpers/memenv/memenv.cc -leveldb_libmemenv_la_SOURCES += leveldb/helpers/memenv/memenv.h diff --git a/src/Makefile.minisketch.include b/src/Makefile.minisketch.include deleted file mode 100644 index 1363bec34e..0000000000 --- a/src/Makefile.minisketch.include +++ /dev/null @@ -1,43 +0,0 @@ -include minisketch/sources.mk - -LIBMINISKETCH_CPPFLAGS= -LIBMINISKETCH_CPPFLAGS += -DDISABLE_DEFAULT_FIELDS -DENABLE_FIELD_32 - -LIBMINISKETCH = minisketch/libminisketch.a -MINISKETCH_LIBS = $(LIBMINISKETCH) - -if ENABLE_CLMUL -LIBMINISKETCH_CLMUL = minisketch/libminisketch_clmul.a -LIBMINISKETCH_CPPFLAGS += -DHAVE_CLMUL -MINISKETCH_LIBS += $(LIBMINISKETCH_CLMUL) -endif - -if HAVE_CLZ -LIBMINISKETCH_CPPFLAGS += -DHAVE_CLZ -endif - -EXTRA_LIBRARIES += $(MINISKETCH_LIBS) - -minisketch_libminisketch_clmul_a_SOURCES = $(MINISKETCH_FIELD_CLMUL_SOURCES_INT) $(MINISKETCH_FIELD_CLMUL_HEADERS_INT) -minisketch_libminisketch_clmul_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) $(CLMUL_CXXFLAGS) -minisketch_libminisketch_clmul_a_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMINISKETCH_CPPFLAGS) - -minisketch_libminisketch_a_SOURCES = $(MINISKETCH_FIELD_GENERIC_SOURCES_INT) $(MINISKETCH_LIB_SOURCES_INT) -minisketch_libminisketch_a_SOURCES += $(MINISKETCH_FIELD_GENERIC_HEADERS_INT) $(MINISKETCH_LIB_HEADERS_INT) $(MINISKETCH_DIST_HEADERS_INT) -minisketch_libminisketch_a_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMINISKETCH_CPPFLAGS) -minisketch_libminisketch_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) - -if ENABLE_TESTS -if !ENABLE_FUZZ -MINISKETCH_TEST = minisketch/test -TESTS += $(MINISKETCH_TEST) -check_PROGRAMS += $(MINISKETCH_TEST) - -minisketch_test_SOURCES = $(MINISKETCH_TEST_SOURCES_INT) -minisketch_test_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMINISKETCH_CPPFLAGS) -minisketch_test_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -minisketch_test_LDADD = $(MINISKETCH_LIBS) -minisketch_test_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) - -endif -endif diff --git a/src/Makefile.qt.include b/src/Makefile.qt.include index 7852d1a2fa..749ab2c614 100644 --- a/src/Makefile.qt.include +++ b/src/Makefile.qt.include @@ -35,6 +35,9 @@ QT_FORMS_UI = \ qt/forms/transactiondescdialog.ui QT_MOC_CPP = \ + qml/moc_appmode.cpp \ + qml/moc_nodemodel.cpp \ + qml/moc_options_model.cpp \ qt/moc_addressbookpage.cpp \ qt/moc_addresstablemodel.cpp \ qt/moc_askpassphrasedialog.cpp \ @@ -106,6 +109,12 @@ QT_QRC_LOCALE_CPP = qt/qrc_bitcoin_locale.cpp QT_QRC_LOCALE = qt/bitcoin_locale.qrc BITCOIN_QT_H = \ + qml/appmode.h \ + qml/bitcoin.h \ + qml/imageprovider.h \ + qml/nodemodel.h \ + qml/options_model.h \ + qml/util.h \ qt/addressbookpage.h \ qt/addresstablemodel.h \ qt/askpassphrasedialog.h \ @@ -280,6 +289,77 @@ BITCOIN_QT_WALLET_CPP = \ qt/walletmodeltransaction.cpp \ qt/walletview.cpp +BITCOIN_QML_BASE_CPP = \ + qml/bitcoin.cpp \ + qml/imageprovider.cpp \ + qml/nodemodel.cpp \ + qml/options_model.cpp \ + qml/util.cpp + +QML_RES_FONTS = \ + qml/res/fonts/Inter-Regular.otf \ + qml/res/fonts/Inter-SemiBold.otf + +QML_RES_ICONS = \ + qml/res/icons/arrow-down.png \ + qml/res/icons/arrow-up.png \ + qml/res/icons/bitcoin-circle.png \ + qml/res/icons/blocktime-dark.png \ + qml/res/icons/blocktime-light.png \ + qml/res/icons/caret-left.png \ + qml/res/icons/caret-right.png \ + qml/res/icons/check.png \ + qml/res/icons/cross.png \ + qml/res/icons/export.png \ + qml/res/icons/gear.png \ + qml/res/icons/info.png \ + qml/res/icons/network-dark.png \ + qml/res/icons/network-light.png \ + qml/res/icons/storage-dark.png \ + qml/res/icons/storage-light.png + +QML_QRC_CPP = qml/qrc_bitcoin.cpp +QML_QRC = qml/bitcoin_qml.qrc +QML_RES_QML = \ + qml/components/AboutOptions.qml \ + qml/components/BlockCounter.qml \ + qml/components/ConnectionOptions.qml \ + qml/components/ConnectionSettings.qml \ + qml/components/DeveloperOptions.qml \ + qml/components/StorageLocations.qml \ + qml/components/StorageOptions.qml \ + qml/components/StorageSettings.qml \ + qml/controls/ContinueButton.qml \ + qml/controls/ExternalLink.qml \ + qml/controls/Header.qml \ + qml/controls/InformationPage.qml \ + qml/controls/NavButton.qml \ + qml/controls/PageIndicator.qml \ + qml/controls/NavigationBar.qml \ + qml/controls/OptionButton.qml \ + qml/controls/OptionSwitch.qml \ + qml/controls/OutlineButton.qml \ + qml/controls/ProgressIndicator.qml \ + qml/controls/qmldir \ + qml/controls/Setting.qml \ + qml/controls/TextButton.qml \ + qml/controls/Theme.qml \ + qml/controls/ValueInput.qml \ + qml/pages/initerrormessage.qml \ + qml/pages/main.qml \ + qml/pages/node/NodeRunner.qml \ + qml/pages/node/NodeSettings.qml \ + qml/pages/onboarding/OnboardingBlockclock.qml \ + qml/pages/onboarding/OnboardingConnection.qml \ + qml/pages/onboarding/OnboardingCover.qml \ + qml/pages/onboarding/OnboardingStorageAmount.qml \ + qml/pages/onboarding/OnboardingStorageLocation.qml \ + qml/pages/onboarding/OnboardingStrengthen.qml \ + qml/pages/settings/SettingsAbout.qml \ + qml/pages/settings/SettingsConnection.qml \ + qml/pages/settings/SettingsDeveloper.qml \ + qml/pages/settings/SettingsStorage.qml + BITCOIN_QT_CPP = $(BITCOIN_QT_BASE_CPP) if TARGET_WINDOWS BITCOIN_QT_CPP += $(BITCOIN_QT_WINDOWS_CPP) @@ -307,6 +387,11 @@ endif nodist_qt_libbitcoinqt_a_SOURCES = $(QT_MOC_CPP) $(QT_MOC) $(QT_QRC_CPP) $(QT_QRC_LOCALE_CPP) +if BUILD_WITH_QML + qt_libbitcoinqt_a_SOURCES += $(BITCOIN_QML_BASE_CPP) $(QML_QRC) $(QML_RES_FONTS) $(QML_RES_ICONS) $(QML_RES_QML) + nodist_qt_libbitcoinqt_a_SOURCES += $(QML_QRC_CPP) +endif # BUILD_WITH_QML + # forms/foo.h -> forms/ui_foo.h QT_FORMS_H=$(join $(dir $(QT_FORMS_UI)),$(addprefix ui_, $(notdir $(QT_FORMS_UI:.ui=.h)))) @@ -371,15 +456,21 @@ translate: $(srcdir)/qt/bitcoinstrings.cpp $(QT_FORMS_UI) $(QT_FORMS_UI) $(BITCO @rm -f $(srcdir)/qt/locale/bitcoin_en.xlf.old $(QT_QRC_LOCALE_CPP): $(QT_QRC_LOCALE) $(QT_QM) - @test -f $(RCC) || (echo "rcc $(RCC) not found, but is required for generating qrc cpp files"; exit 1) + @test -f $(RCC) @cp -f $< $(@D)/temp_$( $@ @rm $(@D)/temp_$( $@ +if BUILD_WITH_QML +$(QML_QRC_CPP): $(QML_QRC) $(QML_RES_FONTS) $(QML_RES_ICONS) $(QML_RES_QML) + @test -f $(RCC) + $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(RCC) --name bitcoin_qml --format-version 1 $< > $@ +endif # BUILD_WITH_QML + CLEAN_QT = $(nodist_qt_libbitcoinqt_a_SOURCES) $(QT_QM) $(QT_FORMS_H) qt/*.gcda qt/*.gcno qt/temp_bitcoin_locale.qrc CLEANFILES += $(CLEAN_QT) @@ -404,7 +495,7 @@ bitcoin_qt_apk: FORCE cd qt/android && ./gradlew build ui_%.h: %.ui - @test -f $(UIC) || (echo "uic $(UIC) not found, but is required for generating ui headers"; exit 1) + @test -f $(UIC) @$(MKDIR_P) $(@D) $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(UIC) -o $@ $< || (echo "Error creating $@"; false) @@ -415,6 +506,6 @@ moc_%.cpp: %.h $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(MOC) $(DEFAULT_INCLUDES) $(QT_INCLUDES_UNSUPPRESSED) $(MOC_DEFS) $< > $@ %.qm: %.ts - @test -f $(LRELEASE) || (echo "lrelease $(LRELEASE) not found, but is required for generating translations"; exit 1) + @test -f $(LRELEASE) @$(MKDIR_P) $(@D) $(AM_V_GEN) QT_SELECT=$(QT_SELECT) $(LRELEASE) -silent $< -qm $@ diff --git a/src/Makefile.qt_locale.include b/src/Makefile.qt_locale.include deleted file mode 100644 index c44cf61a1a..0000000000 --- a/src/Makefile.qt_locale.include +++ /dev/null @@ -1,100 +0,0 @@ -QT_TS = \ - qt/locale/bitcoin_am.ts \ - qt/locale/bitcoin_ar.ts \ - qt/locale/bitcoin_az.ts \ - qt/locale/bitcoin_be.ts \ - qt/locale/bitcoin_bg.ts \ - qt/locale/bitcoin_bn.ts \ - qt/locale/bitcoin_bs.ts \ - qt/locale/bitcoin_ca.ts \ - qt/locale/bitcoin_cs.ts \ - qt/locale/bitcoin_cy.ts \ - qt/locale/bitcoin_da.ts \ - qt/locale/bitcoin_de.ts \ - qt/locale/bitcoin_el.ts \ - qt/locale/bitcoin_en.ts \ - qt/locale/bitcoin_eo.ts \ - qt/locale/bitcoin_es.ts \ - qt/locale/bitcoin_es_CL.ts \ - qt/locale/bitcoin_es_CO.ts \ - qt/locale/bitcoin_es_DO.ts \ - qt/locale/bitcoin_es_MX.ts \ - qt/locale/bitcoin_es_VE.ts \ - qt/locale/bitcoin_et.ts \ - qt/locale/bitcoin_eu.ts \ - qt/locale/bitcoin_fa.ts \ - qt/locale/bitcoin_fi.ts \ - qt/locale/bitcoin_fil.ts \ - qt/locale/bitcoin_fr.ts \ - qt/locale/bitcoin_ga.ts \ - qt/locale/bitcoin_gd.ts \ - qt/locale/bitcoin_gl.ts \ - qt/locale/bitcoin_gl_ES.ts \ - qt/locale/bitcoin_gu.ts \ - qt/locale/bitcoin_ha.ts \ - qt/locale/bitcoin_he.ts \ - qt/locale/bitcoin_hr.ts \ - qt/locale/bitcoin_hu.ts \ - qt/locale/bitcoin_id.ts \ - qt/locale/bitcoin_is.ts \ - qt/locale/bitcoin_it.ts \ - qt/locale/bitcoin_ja.ts \ - qt/locale/bitcoin_ka.ts \ - qt/locale/bitcoin_kk.ts \ - qt/locale/bitcoin_kl.ts \ - qt/locale/bitcoin_km.ts \ - qt/locale/bitcoin_ko.ts \ - qt/locale/bitcoin_ku.ts \ - qt/locale/bitcoin_ku_IQ.ts \ - qt/locale/bitcoin_ky.ts \ - qt/locale/bitcoin_la.ts \ - qt/locale/bitcoin_lt.ts \ - qt/locale/bitcoin_lv.ts \ - qt/locale/bitcoin_mk.ts \ - qt/locale/bitcoin_ml.ts \ - qt/locale/bitcoin_mn.ts \ - qt/locale/bitcoin_mr_IN.ts \ - qt/locale/bitcoin_ms.ts \ - qt/locale/bitcoin_my.ts \ - qt/locale/bitcoin_nb.ts \ - qt/locale/bitcoin_ne.ts \ - qt/locale/bitcoin_nl.ts \ - qt/locale/bitcoin_no.ts \ - qt/locale/bitcoin_pa.ts \ - qt/locale/bitcoin_pam.ts \ - qt/locale/bitcoin_pl.ts \ - qt/locale/bitcoin_pt.ts \ - qt/locale/bitcoin_pt_BR.ts \ - qt/locale/bitcoin_ro.ts \ - qt/locale/bitcoin_ru.ts \ - qt/locale/bitcoin_sc.ts \ - qt/locale/bitcoin_si.ts \ - qt/locale/bitcoin_sk.ts \ - qt/locale/bitcoin_sl.ts \ - qt/locale/bitcoin_sn.ts \ - qt/locale/bitcoin_sq.ts \ - qt/locale/bitcoin_sr.ts \ - qt/locale/bitcoin_sr@latin.ts \ - qt/locale/bitcoin_sv.ts \ - qt/locale/bitcoin_sw.ts \ - qt/locale/bitcoin_szl.ts \ - qt/locale/bitcoin_ta.ts \ - qt/locale/bitcoin_te.ts \ - qt/locale/bitcoin_th.ts \ - qt/locale/bitcoin_tk.ts \ - qt/locale/bitcoin_tl.ts \ - qt/locale/bitcoin_tr.ts \ - qt/locale/bitcoin_ug.ts \ - qt/locale/bitcoin_uk.ts \ - qt/locale/bitcoin_ur.ts \ - qt/locale/bitcoin_uz.ts \ - qt/locale/bitcoin_uz@Cyrl.ts \ - qt/locale/bitcoin_uz@Latn.ts \ - qt/locale/bitcoin_vi.ts \ - qt/locale/bitcoin_yo.ts \ - qt/locale/bitcoin_zh-Hans.ts \ - qt/locale/bitcoin_zh.ts \ - qt/locale/bitcoin_zh_CN.ts \ - qt/locale/bitcoin_zh_HK.ts \ - qt/locale/bitcoin_zh_TW.ts \ - qt/locale/bitcoin_zu.ts diff --git a/src/Makefile.qttest.include b/src/Makefile.qttest.include deleted file mode 100644 index 89c659d4b9..0000000000 --- a/src/Makefile.qttest.include +++ /dev/null @@ -1,74 +0,0 @@ -# Copyright (c) 2013-2016 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -bin_PROGRAMS += qt/test/test_bitcoin-qt -TESTS += qt/test/test_bitcoin-qt - -TEST_QT_MOC_CPP = \ - qt/test/moc_apptests.cpp \ - qt/test/moc_optiontests.cpp \ - qt/test/moc_rpcnestedtests.cpp \ - qt/test/moc_uritests.cpp - -if ENABLE_WALLET -TEST_QT_MOC_CPP += \ - qt/test/moc_addressbooktests.cpp \ - qt/test/moc_wallettests.cpp -endif # ENABLE_WALLET - -TEST_QT_H = \ - qt/test/addressbooktests.h \ - qt/test/apptests.h \ - qt/test/optiontests.h \ - qt/test/rpcnestedtests.h \ - qt/test/uritests.h \ - qt/test/util.h \ - qt/test/wallettests.h - -qt_test_test_bitcoin_qt_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BITCOIN_QT_INCLUDES) \ - $(QT_INCLUDES) $(QT_TEST_INCLUDES) $(BOOST_CPPFLAGS) - -qt_test_test_bitcoin_qt_SOURCES = \ - init/bitcoin-qt.cpp \ - qt/test/apptests.cpp \ - qt/test/optiontests.cpp \ - qt/test/rpcnestedtests.cpp \ - qt/test/test_main.cpp \ - qt/test/uritests.cpp \ - qt/test/util.cpp \ - $(TEST_QT_H) -if ENABLE_WALLET -qt_test_test_bitcoin_qt_SOURCES += \ - qt/test/addressbooktests.cpp \ - qt/test/wallettests.cpp \ - wallet/test/wallet_test_fixture.cpp -endif # ENABLE_WALLET - -nodist_qt_test_test_bitcoin_qt_SOURCES = $(TEST_QT_MOC_CPP) - -qt_test_test_bitcoin_qt_LDADD = $(LIBBITCOINQT) $(LIBBITCOIN_NODE) $(LIBTEST_UTIL) -if ENABLE_WALLET -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_UTIL) $(LIBBITCOIN_WALLET) -endif -if ENABLE_ZMQ -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) -endif -qt_test_test_bitcoin_qt_LDADD += $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) $(LIBLEVELDB) \ - $(LIBMEMENV) $(QT_LIBS) $(QT_DBUS_LIBS) $(QT_TEST_LIBS) \ - $(QR_LIBS) $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(LIBSECP256K1) \ - $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(SQLITE_LIBS) -qt_test_test_bitcoin_qt_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(QT_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -qt_test_test_bitcoin_qt_CXXFLAGS = $(AM_CXXFLAGS) $(QT_PIE_FLAGS) - -CLEAN_BITCOIN_QT_TEST = $(TEST_QT_MOC_CPP) qt/test/*.gcda qt/test/*.gcno - -CLEANFILES += $(CLEAN_BITCOIN_QT_TEST) - -test_bitcoin_qt : qt/test/test_bitcoin-qt$(EXEEXT) - -test_bitcoin_qt_check : qt/test/test_bitcoin-qt$(EXEEXT) FORCE - $(MAKE) check-TESTS TESTS=$^ - -test_bitcoin_qt_clean: FORCE - rm -f $(CLEAN_BITCOIN_QT_TEST) $(qt_test_test_bitcoin_qt_OBJECTS) diff --git a/src/Makefile.test.include b/src/Makefile.test.include deleted file mode 100644 index 5dc20d4fab..0000000000 --- a/src/Makefile.test.include +++ /dev/null @@ -1,436 +0,0 @@ -# Copyright (c) 2013-2016 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -if ENABLE_FUZZ_BINARY -noinst_PROGRAMS += test/fuzz/fuzz -endif - -if ENABLE_TESTS -bin_PROGRAMS += test/test_bitcoin -endif - -TEST_SRCDIR = test -TEST_BINARY=test/test_bitcoin$(EXEEXT) -FUZZ_BINARY=test/fuzz/fuzz$(EXEEXT) - -JSON_TEST_FILES = \ - test/data/script_tests.json \ - test/data/bip341_wallet_vectors.json \ - test/data/base58_encode_decode.json \ - test/data/blockfilters.json \ - test/data/key_io_valid.json \ - test/data/key_io_invalid.json \ - test/data/script_tests.json \ - test/data/sighash.json \ - test/data/tx_invalid.json \ - test/data/tx_valid.json - -RAW_TEST_FILES = \ - test/data/asmap.raw - -GENERATED_TEST_FILES = $(JSON_TEST_FILES:.json=.json.h) $(RAW_TEST_FILES:.raw=.raw.h) - -BITCOIN_TEST_SUITE = \ - test/main.cpp \ - $(TEST_UTIL_H) - -FUZZ_SUITE_LD_COMMON = \ - $(LIBTEST_UTIL) \ - $(LIBTEST_FUZZ) \ - $(LIBBITCOIN_NODE) \ - $(LIBBITCOIN_WALLET) \ - $(LIBBITCOIN_COMMON) \ - $(LIBBITCOIN_UTIL) \ - $(LIBBITCOIN_CONSENSUS) \ - $(LIBBITCOIN_CRYPTO) \ - $(LIBBITCOIN_CLI) \ - $(LIBUNIVALUE) \ - $(LIBLEVELDB) \ - $(LIBMEMENV) \ - $(LIBSECP256K1) \ - $(MINISKETCH_LIBS) \ - $(EVENT_LIBS) \ - $(EVENT_PTHREADS_LIBS) - -if USE_UPNP -FUZZ_SUITE_LD_COMMON += $(MINIUPNPC_LIBS) -endif - -if USE_NATPMP -FUZZ_SUITE_LD_COMMON += $(NATPMP_LIBS) -endif - -# test_bitcoin binary # -BITCOIN_TESTS =\ - test/addrman_tests.cpp \ - test/allocator_tests.cpp \ - test/amount_tests.cpp \ - test/argsman_tests.cpp \ - test/arith_uint256_tests.cpp \ - test/banman_tests.cpp \ - test/base32_tests.cpp \ - test/base58_tests.cpp \ - test/base64_tests.cpp \ - test/bech32_tests.cpp \ - test/bip32_tests.cpp \ - test/bip324_tests.cpp \ - test/blockchain_tests.cpp \ - test/blockencodings_tests.cpp \ - test/blockfilter_index_tests.cpp \ - test/blockfilter_tests.cpp \ - test/blockmanager_tests.cpp \ - test/bloom_tests.cpp \ - test/bswap_tests.cpp \ - test/checkqueue_tests.cpp \ - test/coins_tests.cpp \ - test/coinstatsindex_tests.cpp \ - test/compilerbug_tests.cpp \ - test/compress_tests.cpp \ - test/crypto_tests.cpp \ - test/cuckoocache_tests.cpp \ - test/dbwrapper_tests.cpp \ - test/denialofservice_tests.cpp \ - test/descriptor_tests.cpp \ - test/flatfile_tests.cpp \ - test/fs_tests.cpp \ - test/getarg_tests.cpp \ - test/hash_tests.cpp \ - test/headers_sync_chainwork_tests.cpp \ - test/httpserver_tests.cpp \ - test/i2p_tests.cpp \ - test/interfaces_tests.cpp \ - test/key_io_tests.cpp \ - test/key_tests.cpp \ - test/logging_tests.cpp \ - test/mempool_tests.cpp \ - test/merkle_tests.cpp \ - test/merkleblock_tests.cpp \ - test/miner_tests.cpp \ - test/miniminer_tests.cpp \ - test/miniscript_tests.cpp \ - test/minisketch_tests.cpp \ - test/multisig_tests.cpp \ - test/net_peer_eviction_tests.cpp \ - test/net_tests.cpp \ - test/netbase_tests.cpp \ - test/orphanage_tests.cpp \ - test/pmt_tests.cpp \ - test/policy_fee_tests.cpp \ - test/policyestimator_tests.cpp \ - test/pool_tests.cpp \ - test/pow_tests.cpp \ - test/prevector_tests.cpp \ - test/raii_event_tests.cpp \ - test/random_tests.cpp \ - test/rbf_tests.cpp \ - test/rest_tests.cpp \ - test/result_tests.cpp \ - test/reverselock_tests.cpp \ - test/rpc_tests.cpp \ - test/sanity_tests.cpp \ - test/scheduler_tests.cpp \ - test/script_p2sh_tests.cpp \ - test/script_parse_tests.cpp \ - test/script_segwit_tests.cpp \ - test/script_standard_tests.cpp \ - test/script_tests.cpp \ - test/scriptnum10.h \ - test/scriptnum_tests.cpp \ - test/serfloat_tests.cpp \ - test/serialize_tests.cpp \ - test/settings_tests.cpp \ - test/sighash_tests.cpp \ - test/sigopcount_tests.cpp \ - test/skiplist_tests.cpp \ - test/sock_tests.cpp \ - test/streams_tests.cpp \ - test/sync_tests.cpp \ - test/system_tests.cpp \ - test/timedata_tests.cpp \ - test/torcontrol_tests.cpp \ - test/transaction_tests.cpp \ - test/translation_tests.cpp \ - test/txindex_tests.cpp \ - test/txpackage_tests.cpp \ - test/txreconciliation_tests.cpp \ - test/txrequest_tests.cpp \ - test/txvalidation_tests.cpp \ - test/txvalidationcache_tests.cpp \ - test/uint256_tests.cpp \ - test/util_tests.cpp \ - test/util_threadnames_tests.cpp \ - test/validation_block_tests.cpp \ - test/validation_chainstate_tests.cpp \ - test/validation_chainstatemanager_tests.cpp \ - test/validation_flush_tests.cpp \ - test/validation_tests.cpp \ - test/validationinterface_tests.cpp \ - test/versionbits_tests.cpp \ - test/xoroshiro128plusplus_tests.cpp - -if ENABLE_WALLET -BITCOIN_TESTS += \ - wallet/test/feebumper_tests.cpp \ - wallet/test/psbt_wallet_tests.cpp \ - wallet/test/spend_tests.cpp \ - wallet/test/wallet_tests.cpp \ - wallet/test/walletdb_tests.cpp \ - wallet/test/wallet_crypto_tests.cpp \ - wallet/test/wallet_transaction_tests.cpp \ - wallet/test/coinselector_tests.cpp \ - wallet/test/init_tests.cpp \ - wallet/test/ismine_tests.cpp \ - wallet/test/rpc_util_tests.cpp \ - wallet/test/scriptpubkeyman_tests.cpp \ - wallet/test/walletload_tests.cpp \ - wallet/test/group_outputs_tests.cpp - -FUZZ_SUITE_LD_COMMON +=\ - $(SQLITE_LIBS) \ - $(BDB_LIBS) - -if USE_BDB -BITCOIN_TESTS += wallet/test/db_tests.cpp -endif - -FUZZ_WALLET_SRC = \ - wallet/test/fuzz/coincontrol.cpp \ - wallet/test/fuzz/coinselection.cpp \ - wallet/test/fuzz/fees.cpp \ - wallet/test/fuzz/parse_iso8601.cpp - -if USE_SQLITE -FUZZ_WALLET_SRC += \ - wallet/test/fuzz/notifications.cpp -endif # USE_SQLITE - -BITCOIN_TEST_SUITE += \ - wallet/test/wallet_test_fixture.cpp \ - wallet/test/wallet_test_fixture.h \ - wallet/test/init_test_fixture.cpp \ - wallet/test/init_test_fixture.h -endif # ENABLE_WALLET - -test_test_bitcoin_SOURCES = $(BITCOIN_TEST_SUITE) $(BITCOIN_TESTS) $(JSON_TEST_FILES) $(RAW_TEST_FILES) -test_test_bitcoin_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(TESTDEFS) $(BOOST_CPPFLAGS) $(EVENT_CFLAGS) -test_test_bitcoin_LDADD = $(LIBTEST_UTIL) -if ENABLE_WALLET -test_test_bitcoin_LDADD += $(LIBBITCOIN_WALLET) -test_test_bitcoin_CPPFLAGS += $(BDB_CPPFLAGS) -endif - -test_test_bitcoin_LDADD += $(LIBBITCOIN_NODE) $(LIBBITCOIN_CLI) $(LIBBITCOIN_COMMON) $(LIBBITCOIN_UTIL) $(LIBBITCOIN_CONSENSUS) $(LIBBITCOIN_CRYPTO) $(LIBUNIVALUE) \ - $(LIBLEVELDB) $(LIBMEMENV) $(LIBSECP256K1) $(EVENT_LIBS) $(EVENT_PTHREADS_LIBS) $(MINISKETCH_LIBS) -test_test_bitcoin_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) - -test_test_bitcoin_LDADD += $(BDB_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS) -test_test_bitcoin_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) -static - -if ENABLE_ZMQ -test_test_bitcoin_LDADD += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) -FUZZ_SUITE_LD_COMMON += $(LIBBITCOIN_ZMQ) $(ZMQ_LIBS) -endif - -if ENABLE_FUZZ_BINARY -test_fuzz_fuzz_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -test_fuzz_fuzz_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -test_fuzz_fuzz_LDADD = $(FUZZ_SUITE_LD_COMMON) -test_fuzz_fuzz_LDFLAGS = $(RELDFLAGS) $(AM_LDFLAGS) $(LIBTOOL_APP_LDFLAGS) $(PTHREAD_FLAGS) $(RUNTIME_LDFLAGS) -test_fuzz_fuzz_SOURCES = \ - $(FUZZ_WALLET_SRC) \ - test/fuzz/addition_overflow.cpp \ - test/fuzz/addrman.cpp \ - test/fuzz/asmap.cpp \ - test/fuzz/asmap_direct.cpp \ - test/fuzz/autofile.cpp \ - test/fuzz/banman.cpp \ - test/fuzz/base_encode_decode.cpp \ - test/fuzz/bech32.cpp \ - test/fuzz/bip324.cpp \ - test/fuzz/bitdeque.cpp \ - test/fuzz/block.cpp \ - test/fuzz/block_header.cpp \ - test/fuzz/blockfilter.cpp \ - test/fuzz/bloom_filter.cpp \ - test/fuzz/buffered_file.cpp \ - test/fuzz/chain.cpp \ - test/fuzz/checkqueue.cpp \ - test/fuzz/coins_view.cpp \ - test/fuzz/coinscache_sim.cpp \ - test/fuzz/connman.cpp \ - test/fuzz/crypto.cpp \ - test/fuzz/crypto_aes256.cpp \ - test/fuzz/crypto_aes256cbc.cpp \ - test/fuzz/crypto_chacha20.cpp \ - test/fuzz/crypto_common.cpp \ - test/fuzz/crypto_diff_fuzz_chacha20.cpp \ - test/fuzz/crypto_hkdf_hmac_sha256_l32.cpp \ - test/fuzz/crypto_poly1305.cpp \ - test/fuzz/cuckoocache.cpp \ - test/fuzz/decode_tx.cpp \ - test/fuzz/descriptor_parse.cpp \ - test/fuzz/deserialize.cpp \ - test/fuzz/eval_script.cpp \ - test/fuzz/fee_rate.cpp \ - test/fuzz/fees.cpp \ - test/fuzz/flatfile.cpp \ - test/fuzz/float.cpp \ - test/fuzz/golomb_rice.cpp \ - test/fuzz/headerssync.cpp \ - test/fuzz/hex.cpp \ - test/fuzz/http_request.cpp \ - test/fuzz/i2p.cpp \ - test/fuzz/integer.cpp \ - test/fuzz/key.cpp \ - test/fuzz/key_io.cpp \ - test/fuzz/kitchen_sink.cpp \ - test/fuzz/load_external_block_file.cpp \ - test/fuzz/locale.cpp \ - test/fuzz/merkleblock.cpp \ - test/fuzz/message.cpp \ - test/fuzz/miniscript.cpp \ - test/fuzz/minisketch.cpp \ - test/fuzz/mini_miner.cpp \ - test/fuzz/muhash.cpp \ - test/fuzz/multiplication_overflow.cpp \ - test/fuzz/net.cpp \ - test/fuzz/net_permissions.cpp \ - test/fuzz/netaddress.cpp \ - test/fuzz/netbase_dns_lookup.cpp \ - test/fuzz/node_eviction.cpp \ - test/fuzz/p2p_transport_serialization.cpp \ - test/fuzz/parse_hd_keypath.cpp \ - test/fuzz/parse_numbers.cpp \ - test/fuzz/parse_script.cpp \ - test/fuzz/parse_univalue.cpp \ - test/fuzz/partially_downloaded_block.cpp \ - test/fuzz/policy_estimator.cpp \ - test/fuzz/policy_estimator_io.cpp \ - test/fuzz/poolresource.cpp \ - test/fuzz/pow.cpp \ - test/fuzz/prevector.cpp \ - test/fuzz/primitives_transaction.cpp \ - test/fuzz/process_message.cpp \ - test/fuzz/process_messages.cpp \ - test/fuzz/protocol.cpp \ - test/fuzz/psbt.cpp \ - test/fuzz/random.cpp \ - test/fuzz/rbf.cpp \ - test/fuzz/rolling_bloom_filter.cpp \ - test/fuzz/rpc.cpp \ - test/fuzz/script.cpp \ - test/fuzz/script_assets_test_minimizer.cpp \ - test/fuzz/script_bitcoin_consensus.cpp \ - test/fuzz/script_descriptor_cache.cpp \ - test/fuzz/script_flags.cpp \ - test/fuzz/script_format.cpp \ - test/fuzz/script_interpreter.cpp \ - test/fuzz/script_ops.cpp \ - test/fuzz/script_sigcache.cpp \ - test/fuzz/script_sign.cpp \ - test/fuzz/scriptnum_ops.cpp \ - test/fuzz/secp256k1_ec_seckey_import_export_der.cpp \ - test/fuzz/secp256k1_ecdsa_signature_parse_der_lax.cpp \ - test/fuzz/signature_checker.cpp \ - test/fuzz/signet.cpp \ - test/fuzz/socks5.cpp \ - test/fuzz/span.cpp \ - test/fuzz/spanparsing.cpp \ - test/fuzz/string.cpp \ - test/fuzz/strprintf.cpp \ - test/fuzz/system.cpp \ - test/fuzz/timedata.cpp \ - test/fuzz/torcontrol.cpp \ - test/fuzz/transaction.cpp \ - test/fuzz/tx_in.cpp \ - test/fuzz/tx_out.cpp \ - test/fuzz/tx_pool.cpp \ - test/fuzz/txorphan.cpp \ - test/fuzz/txrequest.cpp \ - test/fuzz/utxo_snapshot.cpp \ - test/fuzz/utxo_total_supply.cpp \ - test/fuzz/validation_load_mempool.cpp \ - test/fuzz/versionbits.cpp -endif # ENABLE_FUZZ_BINARY - -nodist_test_test_bitcoin_SOURCES = $(GENERATED_TEST_FILES) - -$(BITCOIN_TESTS): $(GENERATED_TEST_FILES) - -CLEAN_BITCOIN_TEST = test/*.gcda test/*.gcno test/fuzz/*.gcda test/fuzz/*.gcno test/util/*.gcda test/util/*.gcno $(GENERATED_TEST_FILES) $(addsuffix .log,$(basename $(BITCOIN_TESTS))) - -CLEANFILES += $(CLEAN_BITCOIN_TEST) - -if TARGET_WINDOWS -bitcoin_test: $(TEST_BINARY) -else -if ENABLE_BENCH -bitcoin_test: $(TEST_BINARY) $(BENCH_BINARY) -else -bitcoin_test: $(TEST_BINARY) -endif -endif - -bitcoin_test_check: $(TEST_BINARY) FORCE - $(MAKE) check-TESTS TESTS=$^ - -bitcoin_test_clean : FORCE - rm -f $(CLEAN_BITCOIN_TEST) $(test_test_bitcoin_OBJECTS) $(TEST_BINARY) - -check-local: $(BITCOIN_TESTS:.cpp=.cpp.test) -if BUILD_BITCOIN_TX - @echo "Running test/util/test_runner.py..." - $(PYTHON) $(top_builddir)/test/util/test_runner.py -endif - @echo "Running test/util/rpcauth-test.py..." - $(PYTHON) $(top_builddir)/test/util/rpcauth-test.py -if TARGET_WINDOWS -else -if ENABLE_BENCH - @echo "Running bench/bench_bitcoin (one iteration sanity check, only high priority)..." - $(BENCH_BINARY) -sanity-check -priority-level=high -endif -endif - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check - -if ENABLE_TESTS -UNIVALUE_TESTS = univalue/test/object univalue/test/unitester -noinst_PROGRAMS += $(UNIVALUE_TESTS) -TESTS += $(UNIVALUE_TESTS) - -univalue_test_unitester_SOURCES = $(UNIVALUE_TEST_UNITESTER_INT) -univalue_test_unitester_LDADD = $(LIBUNIVALUE) -univalue_test_unitester_CPPFLAGS = -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) -DJSON_TEST_SRC=\"$(srcdir)/$(UNIVALUE_TEST_DATA_DIR_INT)\" -univalue_test_unitester_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) - -univalue_test_object_SOURCES = $(UNIVALUE_TEST_OBJECT_INT) -univalue_test_object_LDADD = $(LIBUNIVALUE) -univalue_test_object_CPPFLAGS = -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) -univalue_test_object_LDFLAGS = -static $(LIBTOOL_APP_LDFLAGS) -endif - -%.cpp.test: %.cpp - @echo Running tests: $$(\ - cat $< | \ - grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \ - cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\ - ) from $< - $(AM_V_at)export TEST_LOGFILE=$(abs_builddir)/$$(\ - echo $< | grep -E -o "(wallet/test/.*\.cpp|test/.*\.cpp)" | $(SED) -e s/\.cpp/.log/ \ - ) && \ - $(TEST_BINARY) --catch_system_errors=no -l test_suite -t "$$(\ - cat $< | \ - grep -E "(BOOST_FIXTURE_TEST_SUITE\\(|BOOST_AUTO_TEST_SUITE\\()" | \ - cut -d '(' -f 2 | cut -d ',' -f 1 | cut -d ')' -f 1\ - )" -- DEBUG_LOG_OUT > "$$TEST_LOGFILE" 2>&1 || (cat "$$TEST_LOGFILE" && false) - -%.json.h: %.json - @$(MKDIR_P) $(@D) - $(AM_V_GEN) { \ - echo "#include " && \ - echo "namespace json_tests{" && \ - echo "static const std::string $(*F){" && \ - $(HEXDUMP) -v -e '8/1 "0x%02x, "' -e '"\n"' $< | $(SED) -e 's/0x ,//g' && \ - echo "};};"; \ - } > "$@.new" && mv -f "$@.new" "$@" diff --git a/src/Makefile.test_fuzz.include b/src/Makefile.test_fuzz.include deleted file mode 100644 index aa9c052750..0000000000 --- a/src/Makefile.test_fuzz.include +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2013-2020 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -LIBTEST_FUZZ=libtest_fuzz.a - -EXTRA_LIBRARIES += \ - $(LIBTEST_FUZZ) - -TEST_FUZZ_H = \ - test/fuzz/fuzz.h \ - test/fuzz/FuzzedDataProvider.h \ - test/fuzz/util.h \ - test/fuzz/util/mempool.h \ - test/fuzz/util/net.h - -libtest_fuzz_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -libtest_fuzz_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libtest_fuzz_a_SOURCES = \ - test/fuzz/fuzz.cpp \ - test/fuzz/util.cpp \ - test/fuzz/util/mempool.cpp \ - test/fuzz/util/net.cpp \ - $(TEST_FUZZ_H) diff --git a/src/Makefile.test_util.include b/src/Makefile.test_util.include deleted file mode 100644 index 6a1fd712bd..0000000000 --- a/src/Makefile.test_util.include +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2013-2019 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -LIBTEST_UTIL=libtest_util.a - -EXTRA_LIBRARIES += \ - $(LIBTEST_UTIL) - -TEST_UTIL_H = \ - test/util/blockfilter.h \ - test/util/chainstate.h \ - test/util/coins.h \ - test/util/index.h \ - test/util/json.h \ - test/util/logging.h \ - test/util/mining.h \ - test/util/net.h \ - test/util/poolresourcetester.h \ - test/util/random.h \ - test/util/script.h \ - test/util/setup_common.h \ - test/util/str.h \ - test/util/transaction_utils.h \ - test/util/txmempool.h \ - test/util/validation.h \ - test/util/xoroshiro128plusplus.h - -if ENABLE_WALLET -TEST_UTIL_H += wallet/test/util.h -endif # ENABLE_WALLET - -libtest_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES) $(BOOST_CPPFLAGS) -libtest_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS) -libtest_util_a_SOURCES = \ - test/util/blockfilter.cpp \ - test/util/coins.cpp \ - test/util/index.cpp \ - test/util/json.cpp \ - test/util/logging.cpp \ - test/util/mining.cpp \ - test/util/net.cpp \ - test/util/random.cpp \ - test/util/script.cpp \ - test/util/setup_common.cpp \ - test/util/str.cpp \ - test/util/transaction_utils.cpp \ - test/util/txmempool.cpp \ - test/util/validation.cpp - -if ENABLE_WALLET -libtest_util_a_SOURCES += wallet/test/util.cpp -endif # ENABLE_WALLET - -libtest_util_a_SOURCES += $(TEST_UTIL_H) diff --git a/src/Makefile.univalue.include b/src/Makefile.univalue.include deleted file mode 100644 index 3644e36368..0000000000 --- a/src/Makefile.univalue.include +++ /dev/null @@ -1,6 +0,0 @@ -include univalue/sources.mk - -LIBUNIVALUE = libunivalue.la -noinst_LTLIBRARIES += $(LIBUNIVALUE) -libunivalue_la_SOURCES = $(UNIVALUE_LIB_SOURCES_INT) $(UNIVALUE_DIST_HEADERS_INT) $(UNIVALUE_LIB_HEADERS_INT) $(UNIVALUE_TEST_FILES_INT) -libunivalue_la_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/$(UNIVALUE_INCLUDE_DIR_INT) diff --git a/src/addrdb.cpp b/src/addrdb.cpp index 0fcb5ed5c9..889f7b3859 100644 --- a/src/addrdb.cpp +++ b/src/addrdb.cpp @@ -3,6 +3,8 @@ // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. +#include // IWYU pragma: keep + #include #include @@ -40,27 +42,29 @@ bool SerializeDB(Stream& stream, const Data& data) hashwriter << Params().MessageStart() << data; stream << hashwriter.GetHash(); } catch (const std::exception& e) { - return error("%s: Serialize or I/O error - %s", __func__, e.what()); + LogError("%s: Serialize or I/O error - %s\n", __func__, e.what()); + return false; } return true; } template -bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data, int version) +bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data& data) { // Generate random temporary filename - const uint16_t randv{GetRand()}; + const uint16_t randv{FastRandomContext().rand()}; std::string tmpfn = strprintf("%s.%04x", prefix, randv); - // open temp output file, and associate with CAutoFile + // open temp output file fs::path pathTmp = gArgs.GetDataDirNet() / fs::u8path(tmpfn); FILE *file = fsbridge::fopen(pathTmp, "wb"); - CAutoFile fileout(file, SER_DISK, version); + AutoFile fileout{file}; if (fileout.IsNull()) { fileout.fclose(); remove(pathTmp); - return error("%s: Failed to open file %s", __func__, fs::PathToString(pathTmp)); + LogError("%s: Failed to open file %s\n", __func__, fs::PathToString(pathTmp)); + return false; } // Serialize @@ -69,31 +73,33 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data remove(pathTmp); return false; } - if (!FileCommit(fileout.Get())) { + if (!fileout.Commit()) { fileout.fclose(); remove(pathTmp); - return error("%s: Failed to flush file %s", __func__, fs::PathToString(pathTmp)); + LogError("%s: Failed to flush file %s\n", __func__, fs::PathToString(pathTmp)); + return false; } fileout.fclose(); // replace existing file, if any, with new file if (!RenameOver(pathTmp, path)) { remove(pathTmp); - return error("%s: Rename-into-place failed", __func__); + LogError("%s: Rename-into-place failed\n", __func__); + return false; } return true; } template -void DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true) +void DeserializeDB(Stream& stream, Data&& data, bool fCheckSum = true) { - CHashVerifier verifier(&stream); + HashVerifier verifier{stream}; // de-serialize file header (network specific magic number) and .. - unsigned char pchMsgTmp[4]; + MessageStartChars pchMsgTmp; verifier >> pchMsgTmp; // ... verify the network matches ours - if (memcmp(pchMsgTmp, Params().MessageStart(), sizeof(pchMsgTmp))) { + if (pchMsgTmp != Params().MessageStart()) { throw std::runtime_error{"Invalid network magic number"}; } @@ -111,11 +117,10 @@ void DeserializeDB(Stream& stream, Data& data, bool fCheckSum = true) } template -void DeserializeFileDB(const fs::path& path, Data& data, int version) +void DeserializeFileDB(const fs::path& path, Data&& data) { - // open input file, and associate with CAutoFile FILE* file = fsbridge::fopen(path, "rb"); - CAutoFile filein(file, SER_DISK, version); + AutoFile filein{file}; if (filein.IsNull()) { throw DbNotFoundError{}; } @@ -137,7 +142,7 @@ bool CBanDB::Write(const banmap_t& banSet) } for (const auto& err : errors) { - error("%s", err); + LogError("%s\n", err); } return false; } @@ -145,7 +150,7 @@ bool CBanDB::Write(const banmap_t& banSet) bool CBanDB::Read(banmap_t& banSet) { if (fs::exists(m_banlist_dat)) { - LogPrintf("banlist.dat ignored because it can only be read by " PACKAGE_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat))); + LogPrintf("banlist.dat ignored because it can only be read by " CLIENT_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat))); } // If the JSON banlist does not exist, then recreate it if (!fs::exists(m_banlist_json)) { @@ -175,10 +180,10 @@ bool CBanDB::Read(banmap_t& banSet) bool DumpPeerAddresses(const ArgsManager& args, const AddrMan& addr) { const auto pathAddr = args.GetDataDirNet() / "peers.dat"; - return SerializeFileDB("peers", pathAddr, addr, CLIENT_VERSION); + return SerializeFileDB("peers", pathAddr, addr); } -void ReadFromStream(AddrMan& addr, CDataStream& ssPeers) +void ReadFromStream(AddrMan& addr, DataStream& ssPeers) { DeserializeDB(ssPeers, addr, false); } @@ -186,16 +191,18 @@ void ReadFromStream(AddrMan& addr, CDataStream& ssPeers) util::Result> LoadAddrman(const NetGroupManager& netgroupman, const ArgsManager& args) { auto check_addrman = std::clamp(args.GetIntArg("-checkaddrman", DEFAULT_ADDRMAN_CONSISTENCY_CHECKS), 0, 1000000); - auto addrman{std::make_unique(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman)}; + bool deterministic = HasTestOption(args, "addrman"); // use a deterministic addrman only for tests + + auto addrman{std::make_unique(netgroupman, deterministic, /*consistency_check_ratio=*/check_addrman)}; const auto start{SteadyClock::now()}; const auto path_addr{args.GetDataDirNet() / "peers.dat"}; try { - DeserializeFileDB(path_addr, *addrman, CLIENT_VERSION); + DeserializeFileDB(path_addr, *addrman); LogPrintf("Loaded %i addresses from peers.dat %dms\n", addrman->Size(), Ticks(SteadyClock::now() - start)); } catch (const DbNotFoundError&) { // Addrman can be in an inconsistent state after failure, reset it - addrman = std::make_unique(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman); + addrman = std::make_unique(netgroupman, deterministic, /*consistency_check_ratio=*/check_addrman); LogPrintf("Creating peers.dat because the file was not found (%s)\n", fs::quoted(fs::PathToString(path_addr))); DumpPeerAddresses(args, *addrman); } catch (const InvalidAddrManVersionError&) { @@ -203,28 +210,27 @@ util::Result> LoadAddrman(const NetGroupManager& netgro return util::Error{strprintf(_("Failed to rename invalid peers.dat file. Please move or delete it and try again."))}; } // Addrman can be in an inconsistent state after failure, reset it - addrman = std::make_unique(netgroupman, /*deterministic=*/false, /*consistency_check_ratio=*/check_addrman); + addrman = std::make_unique(netgroupman, deterministic, /*consistency_check_ratio=*/check_addrman); LogPrintf("Creating new peers.dat because the file version was not compatible (%s). Original backed up to peers.dat.bak\n", fs::quoted(fs::PathToString(path_addr))); DumpPeerAddresses(args, *addrman); } catch (const std::exception& e) { return util::Error{strprintf(_("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start."), - e.what(), PACKAGE_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))}; + e.what(), CLIENT_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))}; } - return {std::move(addrman)}; // std::move should be unnecessary but is temporarily needed to work around clang bug - // (https://github.com/bitcoin/bitcoin/pull/25977#issuecomment-1561270092) + return addrman; } void DumpAnchors(const fs::path& anchors_db_path, const std::vector& anchors) { LOG_TIME_SECONDS(strprintf("Flush %d outbound block-relay-only peer addresses to anchors.dat", anchors.size())); - SerializeFileDB("anchors", anchors_db_path, anchors, CLIENT_VERSION | ADDRV2_FORMAT); + SerializeFileDB("anchors", anchors_db_path, CAddress::V2_DISK(anchors)); } std::vector ReadAnchors(const fs::path& anchors_db_path) { std::vector anchors; try { - DeserializeFileDB(anchors_db_path, anchors, CLIENT_VERSION | ADDRV2_FORMAT); + DeserializeFileDB(anchors_db_path, CAddress::V2_DISK(anchors)); LogPrintf("Loaded %i addresses from %s\n", anchors.size(), fs::quoted(fs::PathToString(anchors_db_path.filename()))); } catch (const std::exception&) { anchors.clear(); diff --git a/src/addrdb.h b/src/addrdb.h index 0037495d18..cc3014dce2 100644 --- a/src/addrdb.h +++ b/src/addrdb.h @@ -16,12 +16,13 @@ class ArgsManager; class AddrMan; class CAddress; -class CDataStream; +class DataStream; class NetGroupManager; -bool DumpPeerAddresses(const ArgsManager& args, const AddrMan& addr); /** Only used by tests. */ -void ReadFromStream(AddrMan& addr, CDataStream& ssPeers); +void ReadFromStream(AddrMan& addr, DataStream& ssPeers); + +bool DumpPeerAddresses(const ArgsManager& args, const AddrMan& addr); /** Access to the banlist database (banlist.json) */ class CBanDB diff --git a/src/addresstype.cpp b/src/addresstype.cpp index 2454cfb5d9..67e643943d 100644 --- a/src/addresstype.cpp +++ b/src/addresstype.cpp @@ -54,11 +54,12 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) switch (whichType) { case TxoutType::PUBKEY: { CPubKey pubKey(vSolutions[0]); - if (!pubKey.IsValid()) - return false; - - addressRet = PKHash(pubKey); - return true; + if (!pubKey.IsValid()) { + addressRet = CNoDestination(scriptPubKey); + } else { + addressRet = PubKeyDestination(pubKey); + } + return false; } case TxoutType::PUBKEYHASH: { addressRet = PKHash(uint160(vSolutions[0])); @@ -86,17 +87,18 @@ bool ExtractDestination(const CScript& scriptPubKey, CTxDestination& addressRet) addressRet = tap; return true; } + case TxoutType::ANCHOR: { + addressRet = PayToAnchor(); + return true; + } case TxoutType::WITNESS_UNKNOWN: { - WitnessUnknown unk; - unk.version = vSolutions[0][0]; - std::copy(vSolutions[1].begin(), vSolutions[1].end(), unk.program); - unk.length = vSolutions[1].size(); - addressRet = unk; + addressRet = WitnessUnknown{vSolutions[0][0], vSolutions[1]}; return true; } case TxoutType::MULTISIG: case TxoutType::NULL_DATA: case TxoutType::NONSTANDARD: + addressRet = CNoDestination(scriptPubKey); return false; } // no default case, so the compiler can warn about missing cases assert(false); @@ -108,7 +110,12 @@ class CScriptVisitor public: CScript operator()(const CNoDestination& dest) const { - return CScript(); + return dest.GetScript(); + } + + CScript operator()(const PubKeyDestination& dest) const + { + return CScript() << ToByteVector(dest.GetPubKey()) << OP_CHECKSIG; } CScript operator()(const PKHash& keyID) const @@ -138,9 +145,22 @@ class CScriptVisitor CScript operator()(const WitnessUnknown& id) const { - return CScript() << CScript::EncodeOP_N(id.version) << std::vector(id.program, id.program + id.length); + return CScript() << CScript::EncodeOP_N(id.GetWitnessVersion()) << id.GetWitnessProgram(); } }; + +class ValidDestinationVisitor +{ +public: + bool operator()(const CNoDestination& dest) const { return false; } + bool operator()(const PubKeyDestination& dest) const { return false; } + bool operator()(const PKHash& dest) const { return true; } + bool operator()(const ScriptHash& dest) const { return true; } + bool operator()(const WitnessV0KeyHash& dest) const { return true; } + bool operator()(const WitnessV0ScriptHash& dest) const { return true; } + bool operator()(const WitnessV1Taproot& dest) const { return true; } + bool operator()(const WitnessUnknown& dest) const { return true; } +}; } // namespace CScript GetScriptForDestination(const CTxDestination& dest) @@ -149,5 +169,5 @@ CScript GetScriptForDestination(const CTxDestination& dest) } bool IsValidDestination(const CTxDestination& dest) { - return dest.index() != 0; + return std::visit(ValidDestinationVisitor(), dest); } diff --git a/src/addresstype.h b/src/addresstype.h index 6b651e9014..78d3126d85 100644 --- a/src/addresstype.h +++ b/src/addresstype.h @@ -5,18 +5,43 @@ #ifndef BITCOIN_ADDRESSTYPE_H #define BITCOIN_ADDRESSTYPE_H +#include #include #include