diff --git a/CMakeLists.txt b/CMakeLists.txt index 788f0adfc946..a56a4db40547 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,11 +114,6 @@ option(REDUCE_EXPORTS "Attempt to reduce exported symbols in the resulting execu option(CMAKE_COMPILE_WARNING_AS_ERROR "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_EMBEDDED_ASMAP "Embed default ASMap data." ON) option(WITH_USDT "Enable tracepoints for Userspace, Statically Defined Tracing." OFF) @@ -178,7 +173,6 @@ if(BUILD_FOR_FUZZING) set(BUILD_UTIL_CHAINSTATE OFF) set(BUILD_KERNEL_LIB OFF) set(BUILD_KERNEL_TEST OFF) - set(WITH_ZMQ OFF) set(WITH_EMBEDDED_ASMAP OFF) set(BUILD_TESTS OFF) set(BUILD_BENCH OFF) @@ -585,7 +579,6 @@ message(" bitcoin-chainstate (experimental) ... ${BUILD_UTIL_CHAINSTATE}") message(" libbitcoinkernel (experimental) ..... ${BUILD_KERNEL_LIB}") message(" kernel-test (experimental) .......... ${BUILD_KERNEL_TEST}") message("Optional features:") -message(" ZeroMQ .............................. ${WITH_ZMQ}") message(" Embedded ASMap ...................... ${WITH_EMBEDDED_ASMAP}") message(" USDT tracing ........................ ${WITH_USDT}") message("Tests:") diff --git a/CMakePresets.json b/CMakePresets.json index 90a2c4f5da85..06ce4438ea2c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -13,8 +13,7 @@ "architecture": "x64", "toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows", - "WITH_ZMQ": "ON" + "VCPKG_TARGET_TRIPLET": "x64-windows" } }, { @@ -29,8 +28,7 @@ "architecture": "x64", "toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake", "cacheVariables": { - "VCPKG_TARGET_TRIPLET": "x64-windows-static", - "WITH_ZMQ": "ON" + "VCPKG_TARGET_TRIPLET": "x64-windows-static" } }, { @@ -74,8 +72,7 @@ "BUILD_UTIL": "ON", "BUILD_UTIL_CHAINSTATE": "ON", "ENABLE_IPC": "ON", - "WITH_USDT": "ON", - "WITH_ZMQ": "ON" + "WITH_USDT": "ON" } } ] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e95276f7b0be..c8892cc21891 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,7 +147,7 @@ the pull request affects. Valid areas are: - `mining` for changes to the mining code - `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 + - `rpc` or `rest` for changes to the RPC or REST APIs - `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 diff --git a/ci/lint/requirements.txt b/ci/lint/requirements.txt index e8abf041dc76..62a3a33da1d1 100644 --- a/ci/lint/requirements.txt +++ b/ci/lint/requirements.txt @@ -1,3 +1,2 @@ lief==0.17.5 mypy==1.19.1 -pyzmq==27.1.0 diff --git a/ci/test/00_setup_env_arm.sh b/ci/test/00_setup_env_arm.sh index db83cf7b3506..407f836ab9f1 100755 --- a/ci/test/00_setup_env_arm.sh +++ b/ci/test/00_setup_env_arm.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export HOST=arm-linux-gnueabihf export DPKG_ADD_ARCH="armhf" -export PACKAGES="python3-zmq g++-arm-linux-gnueabihf libc6:armhf libstdc++6:armhf" +export PACKAGES="g++-arm-linux-gnueabihf libc6:armhf libstdc++6:armhf" export CONTAINER_NAME=ci_arm_linux export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # Check that https://packages.debian.org/trixie/g++-arm-linux-gnueabihf (version 14.x, similar to guix) can cross-compile export CI_IMAGE_PLATFORM="linux/arm64" diff --git a/ci/test/00_setup_env_mac_native.sh b/ci/test/00_setup_env_mac_native.sh index a762b6bcdc5b..a8bac8ba93c2 100755 --- a/ci/test/00_setup_env_mac_native.sh +++ b/ci/test/00_setup_env_mac_native.sh @@ -7,7 +7,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME="ci_mac_native" # macos does not use a container, but the env var is needed for logging -export PIP_PACKAGES="--break-system-packages pycapnp zmq" +export PIP_PACKAGES="--break-system-packages pycapnp" export GOAL="install" export CMAKE_GENERATOR="Ninja" export CI_OS_NAME="macos" diff --git a/ci/test/00_setup_env_native_alpine_musl.sh b/ci/test/00_setup_env_native_alpine_musl.sh index 3ab56159a3a2..fbb7d68beb88 100755 --- a/ci/test/00_setup_env_native_alpine_musl.sh +++ b/ci/test/00_setup_env_native_alpine_musl.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_alpine_musl export CI_IMAGE_NAME_TAG="mirror.gcr.io/alpine:3.23" export CI_BASE_PACKAGES="build-base musl-dev pkgconf curl ccache make ninja git python3-dev py3-pip which patch xz procps rsync util-linux bison e2fsprogs cmake dash linux-headers" -export PIP_PACKAGES="--break-system-packages pyzmq pycapnp" +export PIP_PACKAGES="--break-system-packages pycapnp" export DEP_OPTS="DEBUG=1" export GOAL="install" export BITCOIN_CONFIG="\ diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index b1b42f333916..7d631761503e 100755 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -20,7 +20,7 @@ fi export CONTAINER_NAME=ci_native_asan export APT_LLVM_V="22" -export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev mold python3-zmq libevent-dev libboost-dev libzmq3-dev ${BPFCC_PACKAGE} libcapnp-dev capnproto python3-pip" +export PACKAGES="systemtap-sdt-dev clang-${APT_LLVM_V} llvm-${APT_LLVM_V} libclang-rt-${APT_LLVM_V}-dev mold libevent-dev libboost-dev ${BPFCC_PACKAGE} libcapnp-dev capnproto python3-pip" export PIP_PACKAGES="--break-system-packages pycapnp" export NO_DEPENDS=1 export GOAL="install" diff --git a/ci/test/00_setup_env_native_chimera_lto.sh b/ci/test/00_setup_env_native_chimera_lto.sh index 1a8c31ce77f2..1bca07a8a809 100755 --- a/ci/test/00_setup_env_native_chimera_lto.sh +++ b/ci/test/00_setup_env_native_chimera_lto.sh @@ -12,7 +12,7 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_chimera_musl export CI_IMAGE_NAME_TAG="mirror.gcr.io/chimeralinux/chimera" export CI_BASE_PACKAGES="ccache chimerautils chimerautils-extra clang cmake curl e2fsprogs git gmake gtar linux-headers ninja pkgconf procps python-devel python-pip rsync util-linux util-linux-lscpu xz" -export PIP_PACKAGES="--break-system-packages pyzmq pycapnp" +export PIP_PACKAGES="--break-system-packages pycapnp" export DEP_OPTS="build_CC=clang build_CXX=clang++ build_TAR=gtar AR=llvm-ar CC=clang CXX=clang++ NM=llvm-nm RANLIB=llvm-ranlib STRIP=llvm-strip" export GOAL="install" export BITCOIN_CONFIG="\ diff --git a/ci/test/00_setup_env_native_iwyu.sh b/ci/test/00_setup_env_native_iwyu.sh index fc4dc2c37dc5..52cb3f35b770 100755 --- a/ci/test/00_setup_env_native_iwyu.sh +++ b/ci/test/00_setup_env_native_iwyu.sh @@ -10,7 +10,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" # To build codegen, CMak export CONTAINER_NAME=ci_native_iwyu export IWYU_LLVM_V="22" export APT_LLVM_V="${IWYU_LLVM_V}" -export PACKAGES="clang-${IWYU_LLVM_V} clang-format-${IWYU_LLVM_V} libclang-${IWYU_LLVM_V}-dev llvm-${IWYU_LLVM_V}-dev jq libevent-dev libboost-dev libzmq3-dev systemtap-sdt-dev libcapnp-dev capnproto" +export PACKAGES="clang-${IWYU_LLVM_V} clang-format-${IWYU_LLVM_V} libclang-${IWYU_LLVM_V}-dev llvm-${IWYU_LLVM_V}-dev jq libevent-dev libboost-dev systemtap-sdt-dev libcapnp-dev capnproto" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false diff --git a/ci/test/00_setup_env_native_previous_releases.sh b/ci/test/00_setup_env_native_previous_releases.sh index d6af52c4bf31..4eee435a3e15 100755 --- a/ci/test/00_setup_env_native_previous_releases.sh +++ b/ci/test/00_setup_env_native_previous_releases.sh @@ -9,7 +9,7 @@ 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-12, see doc/dependencies.md -export PACKAGES="gcc-12 g++-12 python3-zmq" +export PACKAGES="gcc-12 g++-12" export DEP_OPTS="CC=gcc-12 CXX=g++-12" export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash export GOAL="install" diff --git a/ci/test/00_setup_env_native_tidy.sh b/ci/test/00_setup_env_native_tidy.sh index 6234d596520d..8f7d6f9841f0 100755 --- a/ci/test/00_setup_env_native_tidy.sh +++ b/ci/test/00_setup_env_native_tidy.sh @@ -10,7 +10,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export CONTAINER_NAME=ci_native_tidy export TIDY_LLVM_V="22" 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 libcapnp-dev capnproto" +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 systemtap-sdt-dev libcapnp-dev capnproto" export NO_DEPENDS=1 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index c36821a95101..e82e391c53eb 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -11,7 +11,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04" export APT_LLVM_V="22" LIBCXX_DIR="/cxx_build/" LIBCXX_FLAGS="-fsanitize=thread -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 PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev python3-zmq python3-pip" +export PACKAGES="clang-${APT_LLVM_V} llvm-${APT_LLVM_V} llvm-${APT_LLVM_V}-dev libclang-${APT_LLVM_V}-dev libclang-rt-${APT_LLVM_V}-dev python3-pip" export PIP_PACKAGES="--break-system-packages pycapnp" export DEP_OPTS="CC=clang CXX=clang++ CXXFLAGS='${LIBCXX_FLAGS}'" export GOAL="install" diff --git a/ci/test/00_setup_env_native_valgrind.sh b/ci/test/00_setup_env_native_valgrind.sh index 3c997f24b36c..fbb4bb5c2eac 100755 --- a/ci/test/00_setup_env_native_valgrind.sh +++ b/ci/test/00_setup_env_native_valgrind.sh @@ -8,7 +8,7 @@ export LC_ALL=C.UTF-8 export CI_IMAGE_NAME_TAG="mirror.gcr.io/debian:trixie" export CONTAINER_NAME=ci_native_valgrind -export PACKAGES="clang llvm libclang-rt-dev valgrind python3-zmq libevent-dev libboost-dev libzmq3-dev libcapnp-dev capnproto python3-pip" +export PACKAGES="clang llvm libclang-rt-dev valgrind libevent-dev libboost-dev libcapnp-dev capnproto python3-pip" export PIP_PACKAGES="--break-system-packages pycapnp" export USE_VALGRIND=1 export NO_DEPENDS=1 diff --git a/ci/test/00_setup_env_s390x.sh b/ci/test/00_setup_env_s390x.sh index d1e34070ca99..507ba652f95a 100755 --- a/ci/test/00_setup_env_s390x.sh +++ b/ci/test/00_setup_env_s390x.sh @@ -7,7 +7,6 @@ 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="mirror.gcr.io/debian:trixie" export CI_IMAGE_PLATFORM="linux/s390x" diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 4824665c3ca5..8e38bef6ac9c 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -203,7 +203,7 @@ fi if [[ "${RUN_IWYU}" == true ]]; then # TODO: Consider enforcing IWYU across the entire codebase. - FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|univalue/(lib|test)|util|zmq)/.*|bench/(block_assemble|connectblock)|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)" + FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|univalue/(lib|test)|util)/.*|bench/(block_assemble|connectblock)|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)" jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json" jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json" diff --git a/cmake/module/FindZeroMQ.cmake b/cmake/module/FindZeroMQ.cmake deleted file mode 100644 index eecd9b245362..000000000000 --- a/cmake/module/FindZeroMQ.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# 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/contrib/zmq/zmq_sub.py b/contrib/zmq/zmq_sub.py deleted file mode 100755 index 59639c45151f..000000000000 --- a/contrib/zmq/zmq_sub.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2014-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. - -""" - ZMQ example using python3's asyncio - - Bitcoin should be started with the command line arguments: - bitcoind -testnet4 -daemon \ - -zmqpubrawtx=tcp://127.0.0.1:28332 \ - -zmqpubrawblock=tcp://127.0.0.1:28332 \ - -zmqpubhashtx=tcp://127.0.0.1:28332 \ - -zmqpubhashblock=tcp://127.0.0.1:28332 \ - -zmqpubsequence=tcp://127.0.0.1:28332 - - We use the asyncio library here. `self.handle()` installs itself as a - future at the end of the function. Since it never returns with the event - loop having an empty stack of futures, this creates an infinite loop. An - alternative is to wrap the contents of `handle` inside `while True`. - - A blocking example using python 2.7 can be obtained from the git history: - https://github.com/bitcoin/bitcoin/blob/37a7fe9e440b83e2364d5498931253937abe9294/contrib/zmq/zmq_sub.py -""" - -import asyncio -import zmq -import zmq.asyncio -import signal -import struct -import sys - -if (sys.version_info.major, sys.version_info.minor) < (3, 5): - print("This example only works with Python 3.5 and greater") - sys.exit(1) - -port = 28332 - -class ZMQHandler(): - def __init__(self): - self.loop = asyncio.get_event_loop() - self.zmqContext = zmq.asyncio.Context() - - self.zmqSubSocket = self.zmqContext.socket(zmq.SUB) - self.zmqSubSocket.setsockopt(zmq.RCVHWM, 0) - self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "hashblock") - self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "hashtx") - self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "rawblock") - self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "rawtx") - self.zmqSubSocket.setsockopt_string(zmq.SUBSCRIBE, "sequence") - self.zmqSubSocket.connect("tcp://127.0.0.1:%i" % port) - - async def handle(self) : - topic, body, seq = await self.zmqSubSocket.recv_multipart() - sequence = "Unknown" - if len(seq) == 4: - sequence = str(struct.unpack(' $@ diff --git a/depends/README.md b/depends/README.md index 41c27a5aec42..ab3f661a9085 100644 --- a/depends/README.md +++ b/depends/README.md @@ -78,7 +78,6 @@ The following can be set when running make: `make FOO=bar` - `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_ZMQ`: Don’t download/build/cache packages needed for enabling ZeroMQ - `NO_USDT`: Don’t download/build/cache packages needed for enabling USDT tracepoints - `DEBUG`: Disable some optimizations and enable more runtime checking - `HOST_ID_SALT`: Optional salt to use when generating host package ids @@ -88,7 +87,7 @@ The following can be set when running make: `make FOO=bar` 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 (e.g. `make NO_ZMQ=1`), the appropriate CMake cache +If some packages are not built (e.g. `make NO_BOOST=1`), the appropriate CMake cache variables will be set when generating the Bitcoin Core buildsystem. ## Compiler Configuration diff --git a/depends/packages/packages.mk b/depends/packages/packages.mk index 66a49d3fb4bd..7f8f35a895a6 100644 --- a/depends/packages/packages.mk +++ b/depends/packages/packages.mk @@ -2,8 +2,6 @@ packages:= boost_packages = boost -zmq_packages=zeromq - ipc_packages = capnp multiprocess_native_packages = native_libmultiprocess native_capnp diff --git a/depends/packages/zeromq.mk b/depends/packages/zeromq.mk deleted file mode 100644 index 8bf84b1f1cba..000000000000 --- a/depends/packages/zeromq.mk +++ /dev/null @@ -1,49 +0,0 @@ -package=zeromq -$(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=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 := -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)/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 - $($(package)_cmake) -S .. -B . -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 && \ - rm -rf lib/pkgconfig -endef diff --git a/depends/patches/zeromq/builtin_sha1.patch b/depends/patches/zeromq/builtin_sha1.patch deleted file mode 100644 index 5481c9dbddef..000000000000 --- a/depends/patches/zeromq/builtin_sha1.patch +++ /dev/null @@ -1,17 +0,0 @@ -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 deleted file mode 100644 index 02bd2a5fe5d5..000000000000 --- a/depends/patches/zeromq/cacheline_undefined.patch +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index d6b6b5fae7ba..000000000000 --- a/depends/patches/zeromq/cmake_minimum.patch +++ /dev/null @@ -1,18 +0,0 @@ -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 deleted file mode 100644 index e77ef31adfae..000000000000 --- a/depends/patches/zeromq/fix_have_windows.patch +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100644 index c703abcd718e..000000000000 --- a/depends/patches/zeromq/macos_mktemp_check.patch +++ /dev/null @@ -1,16 +0,0 @@ -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/no_librt.patch b/depends/patches/zeromq/no_librt.patch deleted file mode 100644 index b63854c95b28..000000000000 --- a/depends/patches/zeromq/no_librt.patch +++ /dev/null @@ -1,54 +0,0 @@ -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 deleted file mode 100644 index 7000e209fe46..000000000000 --- a/depends/patches/zeromq/openbsd_kqueue_headers.patch +++ /dev/null @@ -1,24 +0,0 @@ -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/toolchain.cmake.in b/depends/toolchain.cmake.in index cdad98996f70..820d6cd8e925 100644 --- a/depends/toolchain.cmake.in +++ b/depends/toolchain.cmake.in @@ -129,12 +129,6 @@ endif() # 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("@zmq_packages@" MATCHES "^[ ]*$") - set(WITH_ZMQ OFF CACHE BOOL "") -else() - set(WITH_ZMQ ON CACHE BOOL "") -endif() - if("@usdt_packages@" MATCHES "^[ ]*$") set(WITH_USDT OFF CACHE BOOL "") else() diff --git a/doc/README.md b/doc/README.md index 8af8d4129766..f8339d2021e0 100644 --- a/doc/README.md +++ b/doc/README.md @@ -77,7 +77,6 @@ The Bitcoin repo's [root README](/README.md) contains relevant information on th - [Reduce Traffic](reduce-traffic.md) - [Tor Support](tor.md) - [Transaction Relay Policy](policy/README.md) -- [ZMQ](zmq.md) License --------------------- diff --git a/doc/build-freebsd.md b/doc/build-freebsd.md index 7d49aea864ff..7f848ed5b7ef 100644 --- a/doc/build-freebsd.md +++ b/doc/build-freebsd.md @@ -23,20 +23,12 @@ git clone https://github.com/bitcoin/bitcoin.git ### 3. Install Optional Dependencies -#### Notifications -###### ZeroMQ - -Bitcoin Core can provide notifications via ZeroMQ. To compile ZMQ support, install the following dependency and pass `-DWITH_ZMQ=ON` when configuring. -```bash -pkg install libzmq4 -``` - #### 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: ```bash -pkg install python3 net/py-pyzmq +pkg install python3 ``` --- diff --git a/doc/build-netbsd.md b/doc/build-netbsd.md index d7d9db5667c6..f702a927632b 100644 --- a/doc/build-netbsd.md +++ b/doc/build-netbsd.md @@ -42,21 +42,13 @@ git clone https://github.com/bitcoin/bitcoin.git ### 3. Install Optional Dependencies -#### Notifications -###### ZeroMQ - -Bitcoin Core can provide notifications via ZeroMQ. To compile ZMQ support, install the following dependency and pass `-DWITH_ZMQ=ON` when configuring. -```bash -pkgin install zeromq -``` - #### 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: ```bash -pkgin install python313 py313-zmq +pkgin install python313 ``` ## Building Bitcoin Core diff --git a/doc/build-openbsd.md b/doc/build-openbsd.md index 4391c09656af..6bdc93c3c047 100644 --- a/doc/build-openbsd.md +++ b/doc/build-openbsd.md @@ -23,20 +23,12 @@ git clone https://github.com/bitcoin/bitcoin.git ### 3. Install Optional Dependencies -#### Notifications -###### ZeroMQ - -Bitcoin Core can provide notifications via ZeroMQ. To compile ZMQ support, install the following dependency and pass `-DWITH_ZMQ=ON` when configuring. -```bash -pkg_add zeromq -``` - #### 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: ```bash -pkg_add python py3-zmq # Select the newest version of the python package if necessary. +pkg_add python # Select the newest version of the python package if necessary. ``` ## Building Bitcoin Core diff --git a/doc/build-osx.md b/doc/build-osx.md index fe3adf1354a0..2097777aa63f 100644 --- a/doc/build-osx.md +++ b/doc/build-osx.md @@ -67,21 +67,6 @@ git clone https://github.com/bitcoin/bitcoin.git #### GUI Dependencies -#### ZMQ Dependencies - -Support for ZMQ notifications requires the following dependency. -Skip if you do not need ZMQ functionality. - -``` bash -brew install zeromq -``` - -Check out the [further configuration](#further-configuration) section for more information. - -For more information on ZMQ, see: [zmq.md](zmq.md) - ---- - #### Test Suite Dependencies There is an included test suite that is useful for testing code changes when developing. diff --git a/doc/build-unix.md b/doc/build-unix.md index f559b8a45f55..4b823566f762 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -58,10 +58,6 @@ Now, you can either build from self-compiled [depends](#dependencies) or install sudo apt-get install libboost-dev libcapnp-dev capnproto -ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency: - - sudo apt-get install libzmq3-dev - User-Space, Statically Defined Tracing (USDT) dependencies: sudo apt install systemtap-sdt-dev @@ -79,10 +75,6 @@ Now, you can either build from self-compiled [depends](#dependencies) or install sudo dnf install boost-devel capnproto capnproto-devel -ZMQ-enabled binaries are compiled with `-DWITH_ZMQ=ON` and require the following dependency: - - sudo dnf install zeromq-devel - User-Space, Statically Defined Tracing (USDT) dependencies: sudo dnf install systemtap-sdt-devel @@ -100,10 +92,6 @@ Now, you can either build from self-compiled [depends](#dependencies) or install apk add boost-dev capnproto capnproto-dev -ZMQ dependencies (provides ZMQ API): - - apk add zeromq-dev - User-Space, Statically Defined Tracing (USDT) is not supported or tested on Alpine Linux at this time. ## Dependencies diff --git a/doc/build-windows-msvc.md b/doc/build-windows-msvc.md index eb551bf13720..8293f5f9a07a 100644 --- a/doc/build-windows-msvc.md +++ b/doc/build-windows-msvc.md @@ -119,7 +119,7 @@ cmake -B build --preset vs2026-static -DVCPKG_INSTALLED_DIR="C:\path_without_spa One can skip vcpkg manifest default features to speed up the configuration step. For example, the following invocation will skip all features except for "tests" and their dependencies: ```powershell -cmake -B build --preset vs2026 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="tests" -DWITH_ZMQ=OFF +cmake -B build --preset vs2026 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="tests" ``` Available features are listed in the [`vcpkg.json`](/vcpkg.json) file. diff --git a/doc/dependencies.md b/doc/dependencies.md index dded02b9c4b4..005b6d285b36 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -40,5 +40,4 @@ Bitcoin Core requires one of the following compilers. | --- | --- | --- | | Python (scripts, tests) | [link](https://www.python.org) | [3.10](https://github.com/bitcoin/bitcoin/pull/30527) | | [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 | diff --git a/doc/design/libraries.md b/doc/design/libraries.md index 4aacfe4d0a57..ec87530f1b93 100644 --- a/doc/design/libraries.md +++ b/doc/design/libraries.md @@ -10,7 +10,6 @@ | *libbitcoin_ipc* | IPC functionality used by *bitcoin-node* and *bitcoin-cli* executables. | | *libbitcoin_node* | P2P and RPC server functionality used by *bitcoind* executable. | | *libbitcoin_util* | Home for common functionality shared by different executables and libraries. Similar to *libbitcoin_common*, but lower-level (see [Dependencies](#dependencies)). | -| *libbitcoin_zmq* | [ZeroMQ](../zmq.md) functionality used by *bitcoind* executable. | ## Conventions diff --git a/doc/developer-notes.md b/doc/developer-notes.md index 3df109bf5865..f3bbf6add1a3 100644 --- a/doc/developer-notes.md +++ b/doc/developer-notes.md @@ -1401,11 +1401,6 @@ downstream users and applications time to migrate. - Deprecated REST endpoints or behaviors should be documented in `doc/REST-interface.md` with the version they were deprecated. -### ZMQ - -- Deprecated ZMQ topics or behaviors should be documented in `doc/zmq.md` with the version - they were deprecated. - ## Internal interface guidelines Internal interfaces between parts of the codebase that are meant to be diff --git a/doc/release-notes/release-notes-0.12.0.md b/doc/release-notes/release-notes-0.12.0.md index bc0d5ea3b0d9..f834b963c8d9 100644 --- a/doc/release-notes/release-notes-0.12.0.md +++ b/doc/release-notes/release-notes-0.12.0.md @@ -254,7 +254,7 @@ Bitcoind can now (optionally) asynchronously notify clients through a ZMQ-based PUB socket of the arrival of new transactions and blocks. This feature requires installation of the ZMQ C API library 4.x and configuring its use through the command line or configuration file. -Please see [docs/zmq.md](/doc/zmq.md) for details of operation. +Please see docs/zmq.md for details of operation. Wallet: Transaction fees ------------------------ diff --git a/doc/zmq.md b/doc/zmq.md deleted file mode 100644 index b88c93a6bfce..000000000000 --- a/doc/zmq.md +++ /dev/null @@ -1,208 +0,0 @@ -# Block and Transaction Broadcasting with ZeroMQ - -[ZeroMQ](https://zeromq.org/) is a lightweight wrapper around TCP -connections, inter-process communication, and shared-memory, -providing various message-oriented semantics such as publish/subscribe, -request/reply, and push/pull. - -The Bitcoin Core daemon can be configured to act as a trusted "border -router", implementing the bitcoin wire protocol and relay, making -consensus decisions, maintaining the local blockchain database, -broadcasting locally generated transactions into the network, and -providing a queryable RPC interface to interact on a polled basis for -requesting blockchain related data. However, there exists only a -limited service to notify external software of events like the arrival -of new blocks or transactions. - -The ZeroMQ facility implements a notification interface through a set -of specific notifiers. Currently there are notifiers that publish -blocks and transactions. This read-only facility requires only the -connection of a corresponding ZeroMQ subscriber port in receiving -software; it is not authenticated nor is there any two-way protocol -involvement. Therefore, subscribers should validate the received data -since it may be out of date, incomplete or even invalid. - -ZeroMQ sockets are self-connecting and self-healing; that is, -connections made between two endpoints will be automatically restored -after an outage, and either end may be freely started or stopped in -any order. - -Because ZeroMQ is message oriented, subscribers receive transactions -and blocks all-at-once and do not need to implement any sort of -buffering or reassembly. - -## Prerequisites - -The ZeroMQ feature in Bitcoin Core requires the ZeroMQ API >= 4.0.0 -[libzmq](https://github.com/zeromq/libzmq/releases). -For version information, see [dependencies.md](dependencies.md). -Typically, it is packaged by distributions as something like -*libzmq3-dev*. The C++ wrapper for ZeroMQ is *not* needed. - -In order to run the example Python client scripts in the `contrib/zmq/` -directory, one must also install [PyZMQ](https://github.com/zeromq/pyzmq) -(generally with `pip install pyzmq`), though this is not necessary for daemon -operation. - -## Enabling - -By default, the ZeroMQ feature is not automatically compiled. -To enable, use `-DWITH_ZMQ=ON` when configuring the build system: - - $ 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. - -## Usage - -Currently, the following notifications are supported: - - -zmqpubhashtx=address - -zmqpubhashblock=address - -zmqpubrawblock=address - -zmqpubrawtx=address - -zmqpubsequence=address - -The socket type is PUB and the address must be a valid ZeroMQ socket -address. The same address can be used in more than one notification. -The same notification can be specified more than once. - -The option to set the PUB socket's outbound message high water mark -(SNDHWM) may be set individually for each notification: - - -zmqpubhashtxhwm=n - -zmqpubhashblockhwm=n - -zmqpubrawblockhwm=n - -zmqpubrawtxhwm=n - -zmqpubsequencehwm=n - -The high water mark value must be an integer greater than or equal to 0. - -For instance: - - $ bitcoind -zmqpubhashtx=tcp://127.0.0.1:28332 \ - -zmqpubhashtx=tcp://192.168.1.2:28332 \ - -zmqpubhashblock="tcp://[::1]:28333" \ - -zmqpubrawtx=unix:/tmp/bitcoind.tx.raw \ - -zmqpubhashtxhwm=10000 - -`bitcoin node` or `bitcoin gui` can also be substituted for `bitcoind`. - -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. - -### Message format - -All ZMQ messages share the same structure with three parts: _topic_ string, -message _body_, and _message 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> | - -where: - - - 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 - -#### 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 -mempool and then again in each block that includes it. The body part of the message is the -serialized transaction. - -#### 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 -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 - -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 - -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](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 -instance, just `hash`); without doing so will result in no messages -arriving. Please see [`contrib/zmq/zmq_sub.py`](/contrib/zmq/zmq_sub.py) for a working example. - -The ZMQ_PUB socket's ZMQ_TCP_KEEPALIVE option is enabled. This means that -the underlying SO_KEEPALIVE option is enabled when using a TCP transport. -The effective TCP keepalive values are managed through the underlying -operating system configuration and must be configured prior to connection establishment. - -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 - -Setting the keepalive values appropriately for your operating environment may -improve connectivity in situations where long-lived connections are silently -dropped by network middle boxes. - -Also, the socket's ZMQ_IPV6 option is enabled to accept connections from IPv6 -hosts as well. If needed, this option has to be set on the client side too. - -## Remarks - -From the perspective of bitcoind, the ZeroMQ socket is write-only; PUB -sockets don't even have a read function. Thus, there is no state -introduced into bitcoind directly. Furthermore, no information is -broadcast that wasn't already received from the public P2P network. - -No authentication or authorization is done on connecting clients; it -is assumed that the ZeroMQ port is exposed only to trusted entities, -using other means such as firewalling. - -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 the `invalidateblock` RPC. -In contrast, the `sequence` topic publishes all block connections and -disconnections. - -There are several possibilities that ZMQ notification can get lost -during transmission depending on the communication type you are -using. Bitcoind appends an up-counting sequence number to each -notification which allows listeners to detect lost notifications. - -The `sequence` topic refers specifically to the mempool sequence -number, which is also published along with all mempool events. This -is a different sequence value than in ZMQ itself in order to allow a total -ordering of mempool events to be constructed. diff --git a/src/.clang-format b/src/.clang-format index 72a202280172..2b74e40b41dc 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -108,9 +108,6 @@ IncludeCategories: - Regex: '^$' - Priority: 2 - CaseSensitive: true - Regex: '^<[^>.]*>' Priority: 3 CaseSensitive: false diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 93ef5b3c9e5d..1ecc40b367fb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -82,10 +82,6 @@ target_link_libraries(bitcoin_consensus 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 @@ -236,7 +232,6 @@ target_link_libraries(bitcoin_node core_interface bitcoin_common bitcoin_util - $ leveldb minisketch Boost::headers diff --git a/src/bitcoind.cpp b/src/bitcoind.cpp index 472ff381a82f..778fdadc7f97 100644 --- a/src/bitcoind.cpp +++ b/src/bitcoind.cpp @@ -149,7 +149,7 @@ static bool ProcessInitCommands(interfaces::Init& init, ArgsManager& args) } else { strUsage += "\n" "The " CLIENT_NAME " daemon (bitcoind) is a headless program that connects to the Bitcoin network to validate and relay transactions and blocks, as well as relaying addresses.\n\n" - "It provides the backbone of the Bitcoin network and its RPC, REST and ZMQ services can provide various transaction, block and address-related services.\n\n" + "It provides the backbone of the Bitcoin network and its RPC and REST services can provide various transaction, block and address-related services.\n\n" "There is an optional wallet component which provides transaction services.\n\n" "It can be used in a headless environment or as part of a server setup.\n" "\n" diff --git a/src/common/args.cpp b/src/common/args.cpp index 12e0f26ed214..f89197983aeb 100644 --- a/src/common/args.cpp +++ b/src/common/args.cpp @@ -678,9 +678,6 @@ std::string ArgsManager::GetHelpMessage() const case OptionsCategory::CONNECTION: usage += HelpMessageGroup("Connection options:"); break; - case OptionsCategory::ZMQ: - usage += HelpMessageGroup("ZeroMQ notification options:"); - break; case OptionsCategory::DEBUG_TEST: usage += HelpMessageGroup("Debugging/Testing options:"); break; diff --git a/src/common/args.h b/src/common/args.h index de323d3c4909..7bee590f45a6 100644 --- a/src/common/args.h +++ b/src/common/args.h @@ -55,7 +55,6 @@ enum class OptionsCategory { CONNECTION, WALLET, WALLET_DEBUG_TEST, - ZMQ, DEBUG_TEST, CHAINPARAMS, NODE_RELAY, diff --git a/src/init.cpp b/src/init.cpp index beee32d6254f..694f24777c63 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -121,11 +121,6 @@ #include #endif -#ifdef ENABLE_ZMQ -#include -#include -#endif - #ifdef ENABLE_EMBEDDED_ASMAP #include #endif @@ -368,13 +363,6 @@ void Shutdown(NodeContext& node) ipc->disconnectIncoming(); } -#ifdef ENABLE_ZMQ - if (g_zmq_notification_interface) { - if (node.validation_signals) node.validation_signals->UnregisterValidationInterface(g_zmq_notification_interface.get()); - g_zmq_notification_interface.reset(); - } -#endif - if (node.validation_signals) { node.validation_signals->UnregisterAllValidationInterfaces(); } @@ -577,30 +565,6 @@ void SetupServerArgs(ArgsManager& argsman, bool can_listen_ipc) "Additional flags \"in\" and \"out\" control whether permissions apply to incoming connections and/or manual (default: incoming only). " "Can be specified multiple times.", ArgsManager::ALLOW_ANY, OptionsCategory::CONNECTION); -#ifdef ENABLE_ZMQ - argsman.AddArg("-zmqpubhashblock=
", "Enable publish hash block in
", ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubhashtx=
", "Enable publish hash transaction in
", ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubrawblock=
", "Enable publish raw block in
", ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubrawtx=
", "Enable publish raw transaction in
", ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubsequence=
", "Enable publish hash block and tx sequence in
", ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubhashblockhwm=", strprintf("Set publish hash block outbound message high water mark (default: %d)", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM), ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubhashtxhwm=", strprintf("Set publish hash transaction outbound message high water mark (default: %d)", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM), ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubrawblockhwm=", strprintf("Set publish raw block outbound message high water mark (default: %d)", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM), ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubrawtxhwm=", strprintf("Set publish raw transaction outbound message high water mark (default: %d)", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM), ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); - argsman.AddArg("-zmqpubsequencehwm=", strprintf("Set publish hash sequence message high water mark (default: %d)", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM), ArgsManager::ALLOW_ANY, OptionsCategory::ZMQ); -#else - hidden_args.emplace_back("-zmqpubhashblock=
"); - hidden_args.emplace_back("-zmqpubhashtx=
"); - hidden_args.emplace_back("-zmqpubrawblock=
"); - hidden_args.emplace_back("-zmqpubrawtx=
"); - hidden_args.emplace_back("-zmqpubsequence="); - hidden_args.emplace_back("-zmqpubhashblockhwm="); - hidden_args.emplace_back("-zmqpubhashtxhwm="); - hidden_args.emplace_back("-zmqpubrawblockhwm="); - hidden_args.emplace_back("-zmqpubrawtxhwm="); - hidden_args.emplace_back("-zmqpubsequencehwm="); -#endif - argsman.AddArg("-checkblocks=", strprintf("How many blocks to check at startup (default: %u, 0 = all)", DEFAULT_CHECKBLOCKS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-checklevel=", strprintf("How thorough the block verification of -checkblocks is: %s (0-4, default: %u)", Join(CHECKLEVEL_DOC, ", "), DEFAULT_CHECKLEVEL), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-checkblockindex", strprintf("Do a consistency check for the block tree, chainstate, and other validation data structures every operations. Use 0 to disable. (default: %u, regtest: %u)", defaultChainParams->DefaultConsistencyChecks(), regtestChainParams->DefaultConsistencyChecks()), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); @@ -1123,11 +1087,6 @@ bool CheckHostPortOptions(const ArgsManager& args) { {"-rpcbind", false, false}, {"-torcontrol", false, false}, {"-whitebind", false, false}, - {"-zmqpubhashblock", true, false}, - {"-zmqpubhashtx", true, false}, - {"-zmqpubrawblock", true, false}, - {"-zmqpubrawtx", true, false}, - {"-zmqpubsequence", true, false}, }) { for (const std::string& param_value : args.GetArgs(param_name)) { const std::string param_value_hostport{ @@ -1652,22 +1611,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) return InitError(ResolveErrMsg("externalip", strAddr)); } -#ifdef ENABLE_ZMQ - g_zmq_notification_interface = CZMQNotificationInterface::Create( - [&chainman = node.chainman](std::vector& block, const CBlockIndex& index) { - assert(chainman); - if (auto ret{chainman->m_blockman.ReadRawBlock(WITH_LOCK(cs_main, return index.GetBlockPos()))}) { - block = std::move(*ret); - return true; - } - return false; - }); - - if (g_zmq_notification_interface) { - validation_signals.RegisterValidationInterface(g_zmq_notification_interface.get()); - } -#endif - // ********************************************************* Step 7: load block chain // cache size calculations diff --git a/src/logging.cpp b/src/logging.cpp index 543254756777..be88e8d235d6 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -182,7 +182,6 @@ static const std::map> LOG_CATEGORIES_ {"mempool", BCLog::MEMPOOL}, {"http", BCLog::HTTP}, {"bench", BCLog::BENCH}, - {"zmq", BCLog::ZMQ}, {"walletdb", BCLog::WALLETDB}, {"rpc", BCLog::RPC}, {"estimatefee", BCLog::ESTIMATEFEE}, diff --git a/src/logging/categories.h b/src/logging/categories.h index 397a9d1eca54..0aad879dd8dc 100644 --- a/src/logging/categories.h +++ b/src/logging/categories.h @@ -18,7 +18,6 @@ enum LogFlags : CategoryMask { MEMPOOL = (CategoryMask{1} << 2), HTTP = (CategoryMask{1} << 3), BENCH = (CategoryMask{1} << 4), - ZMQ = (CategoryMask{1} << 5), WALLETDB = (CategoryMask{1} << 6), RPC = (CategoryMask{1} << 7), ESTIMATEFEE = (CategoryMask{1} << 8), diff --git a/src/test/fuzz/system.cpp b/src/test/fuzz/system.cpp index 12c70c7a10ba..ac649eee3ef0 100644 --- a/src/test/fuzz/system.cpp +++ b/src/test/fuzz/system.cpp @@ -59,7 +59,7 @@ FUZZ_TARGET(system, .init = initialize_system) args_manager.SoftSetBoolArg(str_arg, f_value); }, [&] { - const OptionsCategory options_category = fuzzed_data_provider.PickValueInArray({OptionsCategory::OPTIONS, OptionsCategory::CONNECTION, OptionsCategory::WALLET, OptionsCategory::WALLET_DEBUG_TEST, OptionsCategory::ZMQ, OptionsCategory::DEBUG_TEST, OptionsCategory::CHAINPARAMS, OptionsCategory::NODE_RELAY, OptionsCategory::BLOCK_CREATION, OptionsCategory::RPC, OptionsCategory::GUI, OptionsCategory::COMMANDS, OptionsCategory::REGISTER_COMMANDS, OptionsCategory::CLI_COMMANDS, OptionsCategory::IPC, OptionsCategory::HIDDEN}); + const OptionsCategory options_category = fuzzed_data_provider.PickValueInArray({OptionsCategory::OPTIONS, OptionsCategory::CONNECTION, OptionsCategory::WALLET, OptionsCategory::WALLET_DEBUG_TEST, OptionsCategory::DEBUG_TEST, OptionsCategory::CHAINPARAMS, OptionsCategory::NODE_RELAY, OptionsCategory::BLOCK_CREATION, OptionsCategory::RPC, OptionsCategory::GUI, OptionsCategory::COMMANDS, OptionsCategory::REGISTER_COMMANDS, OptionsCategory::CLI_COMMANDS, OptionsCategory::IPC, OptionsCategory::HIDDEN}); // Avoid hitting: // common/args.cpp:563: void ArgsManager::AddArg(const std::string &, const std::string &, unsigned int, const OptionsCategory &): Assertion `ret.second' failed. const std::string argument_name = GetArgumentName(fuzzed_data_provider.ConsumeRandomLengthString(16)); diff --git a/src/zmq/CMakeLists.txt b/src/zmq/CMakeLists.txt deleted file mode 100644 index 4c2ccaec0f08..000000000000 --- a/src/zmq/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -# 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/. - -add_library(bitcoin_zmq STATIC EXCLUDE_FROM_ALL - zmqabstractnotifier.cpp - zmqnotificationinterface.cpp - zmqpublishnotifier.cpp - zmqutil.cpp -) -target_compile_definitions(bitcoin_zmq - INTERFACE - ENABLE_ZMQ=1 -) -target_link_libraries(bitcoin_zmq - PRIVATE - core_interface - univalue - zeromq -) diff --git a/src/zmq/zmqabstractnotifier.cpp b/src/zmq/zmqabstractnotifier.cpp deleted file mode 100644 index 081a2a2c74d1..000000000000 --- a/src/zmq/zmqabstractnotifier.cpp +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2015-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. - -#include - -#include - -const int CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM; - -CZMQAbstractNotifier::~CZMQAbstractNotifier() -{ - assert(!psocket); -} - -bool CZMQAbstractNotifier::NotifyBlock(const CBlockIndex * /*CBlockIndex*/) -{ - return true; -} - -bool CZMQAbstractNotifier::NotifyTransaction(const CTransaction &/*transaction*/) -{ - return true; -} - -bool CZMQAbstractNotifier::NotifyBlockConnect(const CBlockIndex * /*CBlockIndex*/) -{ - return true; -} - -bool CZMQAbstractNotifier::NotifyBlockDisconnect(const CBlockIndex * /*CBlockIndex*/) -{ - return true; -} - -bool CZMQAbstractNotifier::NotifyTransactionAcceptance(const CTransaction &/*transaction*/, uint64_t mempool_sequence) -{ - return true; -} - -bool CZMQAbstractNotifier::NotifyTransactionRemoval(const CTransaction &/*transaction*/, uint64_t mempool_sequence) -{ - return true; -} diff --git a/src/zmq/zmqabstractnotifier.h b/src/zmq/zmqabstractnotifier.h deleted file mode 100644 index 77d478a10f71..000000000000 --- a/src/zmq/zmqabstractnotifier.h +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2015-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. - -#ifndef BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H -#define BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H - -#include -#include -#include -#include - -class CBlockIndex; -class CTransaction; -class CZMQAbstractNotifier; - -using CZMQNotifierFactory = std::function()>; - -class CZMQAbstractNotifier -{ -public: - static const int DEFAULT_ZMQ_SNDHWM {1000}; - - virtual ~CZMQAbstractNotifier(); - - template - static std::unique_ptr Create() - { - return std::make_unique(); - } - - std::string GetType() const { return type; } - void SetType(const std::string &t) { type = t; } - std::string GetAddress() const { return address; } - void SetAddress(const std::string &a) { address = a; } - int GetOutboundMessageHighWaterMark() const { return outbound_message_high_water_mark; } - void SetOutboundMessageHighWaterMark(const int sndhwm) { - if (sndhwm >= 0) { - outbound_message_high_water_mark = sndhwm; - } - } - - virtual bool Initialize(void *pcontext) = 0; - virtual void Shutdown() = 0; - - // Notifies of ConnectTip result, i.e., new active tip only - virtual bool NotifyBlock(const CBlockIndex *pindex); - // Notifies of every block connection - virtual bool NotifyBlockConnect(const CBlockIndex *pindex); - // Notifies of every block disconnection - virtual bool NotifyBlockDisconnect(const CBlockIndex *pindex); - // Notifies of every mempool acceptance - virtual bool NotifyTransactionAcceptance(const CTransaction &transaction, uint64_t mempool_sequence); - // Notifies of every mempool removal, except inclusion in blocks - virtual bool NotifyTransactionRemoval(const CTransaction &transaction, uint64_t mempool_sequence); - // Notifies of transactions added to mempool or appearing in blocks - virtual bool NotifyTransaction(const CTransaction &transaction); - -protected: - void* psocket{nullptr}; - std::string type; - std::string address; - int outbound_message_high_water_mark{DEFAULT_ZMQ_SNDHWM}; // aka SNDHWM -}; - -#endif // BITCOIN_ZMQ_ZMQABSTRACTNOTIFIER_H diff --git a/src/zmq/zmqnotificationinterface.cpp b/src/zmq/zmqnotificationinterface.cpp deleted file mode 100644 index aa312bf477d8..000000000000 --- a/src/zmq/zmqnotificationinterface.cpp +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) 2015-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. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include - - -CZMQNotificationInterface::CZMQNotificationInterface() = default; - -CZMQNotificationInterface::~CZMQNotificationInterface() -{ - Shutdown(); -} - -std::list CZMQNotificationInterface::GetActiveNotifiers() const -{ - std::list result; - for (const auto& n : notifiers) { - result.push_back(n.get()); - } - return result; -} - -std::unique_ptr CZMQNotificationInterface::Create(std::function&, const CBlockIndex&)> get_block_by_index) -{ - std::map factories; - factories["pubhashblock"] = CZMQAbstractNotifier::Create; - factories["pubhashtx"] = CZMQAbstractNotifier::Create; - factories["pubrawblock"] = [&get_block_by_index]() -> std::unique_ptr { - return std::make_unique(get_block_by_index); - }; - factories["pubrawtx"] = CZMQAbstractNotifier::Create; - factories["pubsequence"] = CZMQAbstractNotifier::Create; - - std::list> notifiers; - for (const auto& entry : factories) - { - std::string arg("-zmq" + entry.first); - const auto& factory = entry.second; - for (std::string& address : gArgs.GetArgs(arg)) { - // libzmq uses prefix "ipc://" for UNIX domain sockets - if (address.starts_with(ADDR_PREFIX_UNIX)) { - address.replace(0, ADDR_PREFIX_UNIX.length(), ADDR_PREFIX_IPC); - } - - std::unique_ptr notifier = factory(); - notifier->SetType(entry.first); - notifier->SetAddress(address); - notifier->SetOutboundMessageHighWaterMark(static_cast(gArgs.GetIntArg(arg + "hwm", CZMQAbstractNotifier::DEFAULT_ZMQ_SNDHWM))); - notifiers.push_back(std::move(notifier)); - } - } - - if (!notifiers.empty()) - { - std::unique_ptr notificationInterface(new CZMQNotificationInterface()); - notificationInterface->notifiers = std::move(notifiers); - - if (notificationInterface->Initialize()) { - return notificationInterface; - } - } - - return nullptr; -} - -// Called at startup to conditionally set up ZMQ socket(s) -bool CZMQNotificationInterface::Initialize() -{ - int major = 0, minor = 0, patch = 0; - zmq_version(&major, &minor, &patch); - LogDebug(BCLog::ZMQ, "version %d.%d.%d\n", major, minor, patch); - - LogDebug(BCLog::ZMQ, "Initialize notification interface\n"); - assert(!pcontext); - - pcontext = zmq_ctx_new(); - - if (!pcontext) - { - zmqError("Unable to initialize context"); - return false; - } - - for (auto& notifier : notifiers) { - if (notifier->Initialize(pcontext)) { - LogDebug(BCLog::ZMQ, "Notifier %s ready (address = %s)\n", notifier->GetType(), notifier->GetAddress()); - } else { - LogDebug(BCLog::ZMQ, "Notifier %s failed (address = %s)\n", notifier->GetType(), notifier->GetAddress()); - return false; - } - } - - return true; -} - -// Called during shutdown sequence -void CZMQNotificationInterface::Shutdown() -{ - LogDebug(BCLog::ZMQ, "Shutdown notification interface\n"); - if (pcontext) - { - for (auto& notifier : notifiers) { - LogDebug(BCLog::ZMQ, "Shutdown notifier %s at %s\n", notifier->GetType(), notifier->GetAddress()); - notifier->Shutdown(); - } - zmq_ctx_term(pcontext); - - pcontext = nullptr; - } -} - -namespace { - -template -void TryForEachAndRemoveFailed(std::list>& notifiers, const Function& func) -{ - for (auto i = notifiers.begin(); i != notifiers.end(); ) { - CZMQAbstractNotifier* notifier = i->get(); - if (func(notifier)) { - ++i; - } else { - notifier->Shutdown(); - i = notifiers.erase(i); - } - } -} - -} // anonymous namespace - -void CZMQNotificationInterface::UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) -{ - if (fInitialDownload || pindexNew == pindexFork) // In IBD or blocks were disconnected without any new ones - return; - - TryForEachAndRemoveFailed(notifiers, [pindexNew](CZMQAbstractNotifier* notifier) { - return notifier->NotifyBlock(pindexNew); - }); -} - -void CZMQNotificationInterface::TransactionAddedToMempool(const NewMempoolTransactionInfo& ptx, uint64_t mempool_sequence) -{ - const CTransaction& tx = *(ptx.info.m_tx); - - TryForEachAndRemoveFailed(notifiers, [&tx, mempool_sequence](CZMQAbstractNotifier* notifier) { - return notifier->NotifyTransaction(tx) && notifier->NotifyTransactionAcceptance(tx, mempool_sequence); - }); -} - -void CZMQNotificationInterface::TransactionRemovedFromMempool(const CTransactionRef& ptx, MemPoolRemovalReason reason, uint64_t mempool_sequence) -{ - // Called for all non-block inclusion reasons - const CTransaction& tx = *ptx; - - TryForEachAndRemoveFailed(notifiers, [&tx, mempool_sequence](CZMQAbstractNotifier* notifier) { - return notifier->NotifyTransactionRemoval(tx, mempool_sequence); - }); -} - -void CZMQNotificationInterface::BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected) -{ - for (const CTransactionRef& ptx : pblock->vtx) { - const CTransaction& tx = *ptx; - TryForEachAndRemoveFailed(notifiers, [&tx](CZMQAbstractNotifier* notifier) { - return notifier->NotifyTransaction(tx); - }); - } - - // Next we notify BlockConnect listeners for *all* blocks - TryForEachAndRemoveFailed(notifiers, [pindexConnected](CZMQAbstractNotifier* notifier) { - return notifier->NotifyBlockConnect(pindexConnected); - }); -} - -void CZMQNotificationInterface::BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected) -{ - for (const CTransactionRef& ptx : pblock->vtx) { - const CTransaction& tx = *ptx; - TryForEachAndRemoveFailed(notifiers, [&tx](CZMQAbstractNotifier* notifier) { - return notifier->NotifyTransaction(tx); - }); - } - - // Next we notify BlockDisconnect listeners for *all* blocks - TryForEachAndRemoveFailed(notifiers, [pindexDisconnected](CZMQAbstractNotifier* notifier) { - return notifier->NotifyBlockDisconnect(pindexDisconnected); - }); -} - -std::unique_ptr g_zmq_notification_interface; diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h deleted file mode 100644 index 0f8347fcf682..000000000000 --- a/src/zmq/zmqnotificationinterface.h +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2015-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. - -#ifndef BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H -#define BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H - -#include -#include - -#include -#include -#include -#include -#include -#include - -class CBlockIndex; -class CZMQAbstractNotifier; - -class CZMQNotificationInterface final : public CValidationInterface -{ -public: - ~CZMQNotificationInterface(); - - std::list GetActiveNotifiers() const; - - static std::unique_ptr Create(std::function&, const CBlockIndex&)> get_block_by_index); - -protected: - bool Initialize(); - void Shutdown(); - - // CValidationInterface - void TransactionAddedToMempool(const NewMempoolTransactionInfo& tx, uint64_t mempool_sequence) override; - void TransactionRemovedFromMempool(const CTransactionRef& tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) override; - void BlockConnected(const std::shared_ptr& pblock, const CBlockIndex* pindexConnected) override; - void BlockDisconnected(const std::shared_ptr& pblock, const CBlockIndex* pindexDisconnected) override; - void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override; - -private: - CZMQNotificationInterface(); - - void* pcontext{nullptr}; - std::list> notifiers; -}; - -extern std::unique_ptr g_zmq_notification_interface; - -#endif // BITCOIN_ZMQ_ZMQNOTIFICATIONINTERFACE_H diff --git a/src/zmq/zmqpublishnotifier.cpp b/src/zmq/zmqpublishnotifier.cpp deleted file mode 100644 index 61b65a1317af..000000000000 --- a/src/zmq/zmqpublishnotifier.cpp +++ /dev/null @@ -1,293 +0,0 @@ -// Copyright (c) 2015-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. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -static std::multimap mapPublishNotifiers; - -static const char *MSG_HASHBLOCK = "hashblock"; -static const char *MSG_HASHTX = "hashtx"; -static const char *MSG_RAWBLOCK = "rawblock"; -static const char *MSG_RAWTX = "rawtx"; -static const char *MSG_SEQUENCE = "sequence"; - -// Internal function to send multipart message -static int zmq_send_multipart(void *sock, const void* data, size_t size, ...) -{ - va_list args; - va_start(args, size); - - while (1) - { - zmq_msg_t msg; - - int rc = zmq_msg_init_size(&msg, size); - if (rc != 0) - { - zmqError("Unable to initialize ZMQ msg"); - va_end(args); - return -1; - } - - void *buf = zmq_msg_data(&msg); - memcpy(buf, data, size); - - data = va_arg(args, const void*); - - rc = zmq_msg_send(&msg, sock, data ? ZMQ_SNDMORE : 0); - if (rc == -1) - { - zmqError("Unable to send ZMQ msg"); - zmq_msg_close(&msg); - va_end(args); - return -1; - } - - zmq_msg_close(&msg); - - if (!data) - break; - - size = va_arg(args, size_t); - } - va_end(args); - return 0; -} - -static bool IsZMQAddressIPV6(const std::string &zmq_address) -{ - const std::string tcp_prefix = "tcp://"; - const size_t tcp_index = zmq_address.rfind(tcp_prefix); - const size_t colon_index = zmq_address.rfind(':'); - if (tcp_index == 0 && colon_index != std::string::npos) { - const std::string ip = zmq_address.substr(tcp_prefix.length(), colon_index - tcp_prefix.length()); - const std::optional addr{LookupHost(ip, false)}; - if (addr.has_value() && addr.value().IsIPv6()) return true; - } - return false; -} - -bool CZMQAbstractPublishNotifier::Initialize(void *pcontext) -{ - assert(!psocket); - - // check if address is being used by other publish notifier - std::multimap::iterator i = mapPublishNotifiers.find(address); - - if (i==mapPublishNotifiers.end()) - { - psocket = zmq_socket(pcontext, ZMQ_PUB); - if (!psocket) - { - zmqError("Failed to create socket"); - return false; - } - - LogDebug(BCLog::ZMQ, "Outbound message high water mark for %s at %s is %d\n", type, address, outbound_message_high_water_mark); - - int rc = zmq_setsockopt(psocket, ZMQ_SNDHWM, &outbound_message_high_water_mark, sizeof(outbound_message_high_water_mark)); - if (rc != 0) - { - zmqError("Failed to set outbound message high water mark"); - zmq_close(psocket); - return false; - } - - const int so_keepalive_option {1}; - rc = zmq_setsockopt(psocket, ZMQ_TCP_KEEPALIVE, &so_keepalive_option, sizeof(so_keepalive_option)); - if (rc != 0) { - zmqError("Failed to set SO_KEEPALIVE"); - zmq_close(psocket); - return false; - } - - // On some systems (e.g. OpenBSD) the ZMQ_IPV6 must not be enabled, if the address to bind isn't IPv6 - const int enable_ipv6 { IsZMQAddressIPV6(address) ? 1 : 0}; - rc = zmq_setsockopt(psocket, ZMQ_IPV6, &enable_ipv6, sizeof(enable_ipv6)); - if (rc != 0) { - zmqError("Failed to set ZMQ_IPV6"); - zmq_close(psocket); - return false; - } - - rc = zmq_bind(psocket, address.c_str()); - if (rc != 0) - { - zmqError("Failed to bind address"); - zmq_close(psocket); - return false; - } - - // register this notifier for the address, so it can be reused for other publish notifier - mapPublishNotifiers.insert(std::make_pair(address, this)); - return true; - } - else - { - LogDebug(BCLog::ZMQ, "Reusing socket for address %s\n", address); - LogDebug(BCLog::ZMQ, "Outbound message high water mark for %s at %s is %d\n", type, address, outbound_message_high_water_mark); - - psocket = i->second->psocket; - mapPublishNotifiers.insert(std::make_pair(address, this)); - - return true; - } -} - -void CZMQAbstractPublishNotifier::Shutdown() -{ - // Early return if Initialize was not called - if (!psocket) return; - - int count = mapPublishNotifiers.count(address); - - // remove this notifier from the list of publishers using this address - typedef std::multimap::iterator iterator; - std::pair iterpair = mapPublishNotifiers.equal_range(address); - - for (iterator it = iterpair.first; it != iterpair.second; ++it) - { - if (it->second==this) - { - mapPublishNotifiers.erase(it); - break; - } - } - - if (count == 1) - { - LogDebug(BCLog::ZMQ, "Close socket at address %s\n", address); - int linger = 0; - zmq_setsockopt(psocket, ZMQ_LINGER, &linger, sizeof(linger)); - zmq_close(psocket); - } - - psocket = nullptr; -} - -bool CZMQAbstractPublishNotifier::SendZmqMessage(const char *command, const void* data, size_t size) -{ - assert(psocket); - - /* send three parts, command & data & a LE 4byte sequence number */ - unsigned char msgseq[sizeof(uint32_t)]; - WriteLE32(msgseq, nSequence); - int rc = zmq_send_multipart(psocket, command, strlen(command), data, size, msgseq, (size_t)sizeof(uint32_t), nullptr); - if (rc == -1) - return false; - - /* increment memory only sequence number after sending */ - nSequence++; - - return true; -} - -bool CZMQPublishHashBlockNotifier::NotifyBlock(const CBlockIndex *pindex) -{ - uint256 hash = pindex->GetBlockHash(); - LogDebug(BCLog::ZMQ, "Publish hashblock %s to %s\n", hash.GetHex(), this->address); - uint8_t data[32]; - for (unsigned int i = 0; i < 32; i++) { - data[31 - i] = hash.begin()[i]; - } - return SendZmqMessage(MSG_HASHBLOCK, data, 32); -} - -bool CZMQPublishHashTransactionNotifier::NotifyTransaction(const CTransaction &transaction) -{ - uint256 hash = transaction.GetHash().ToUint256(); - LogDebug(BCLog::ZMQ, "Publish hashtx %s to %s\n", hash.GetHex(), this->address); - uint8_t data[32]; - for (unsigned int i = 0; i < 32; i++) { - data[31 - i] = hash.begin()[i]; - } - return SendZmqMessage(MSG_HASHTX, data, 32); -} - -bool CZMQPublishRawBlockNotifier::NotifyBlock(const CBlockIndex *pindex) -{ - LogDebug(BCLog::ZMQ, "Publish rawblock %s to %s\n", pindex->GetBlockHash().GetHex(), this->address); - - std::vector block{}; - if (!m_get_block_by_index(block, *pindex)) { - zmqError("Can't read block from disk"); - return false; - } - - return SendZmqMessage(MSG_RAWBLOCK, block.data(), block.size()); -} - -bool CZMQPublishRawTransactionNotifier::NotifyTransaction(const CTransaction &transaction) -{ - uint256 hash = transaction.GetHash().ToUint256(); - LogDebug(BCLog::ZMQ, "Publish rawtx %s to %s\n", hash.GetHex(), this->address); - DataStream ss; - ss << TX_WITH_WITNESS(transaction); - return SendZmqMessage(MSG_RAWTX, &(*ss.begin()), ss.size()); -} - -// Helper function to send a 'sequence' topic message with the following structure: -// <32-byte hash> | <1-byte label> | <8-byte LE sequence> (optional) -static bool SendSequenceMsg(CZMQAbstractPublishNotifier& notifier, uint256 hash, char label, std::optional sequence = {}) -{ - unsigned char data[sizeof(hash) + sizeof(label) + sizeof(uint64_t)]; - for (unsigned int i = 0; i < sizeof(hash); ++i) { - data[sizeof(hash) - 1 - i] = hash.begin()[i]; - } - data[sizeof(hash)] = label; - if (sequence) WriteLE64(data + sizeof(hash) + sizeof(label), *sequence); - return notifier.SendZmqMessage(MSG_SEQUENCE, data, sequence ? sizeof(data) : sizeof(hash) + sizeof(label)); -} - -bool CZMQPublishSequenceNotifier::NotifyBlockConnect(const CBlockIndex *pindex) -{ - uint256 hash = pindex->GetBlockHash(); - LogDebug(BCLog::ZMQ, "Publish sequence block connect %s to %s\n", hash.GetHex(), this->address); - return SendSequenceMsg(*this, hash, /* Block (C)onnect */ 'C'); -} - -bool CZMQPublishSequenceNotifier::NotifyBlockDisconnect(const CBlockIndex *pindex) -{ - uint256 hash = pindex->GetBlockHash(); - LogDebug(BCLog::ZMQ, "Publish sequence block disconnect %s to %s\n", hash.GetHex(), this->address); - return SendSequenceMsg(*this, hash, /* Block (D)isconnect */ 'D'); -} - -bool CZMQPublishSequenceNotifier::NotifyTransactionAcceptance(const CTransaction &transaction, uint64_t mempool_sequence) -{ - uint256 hash = transaction.GetHash().ToUint256(); - LogDebug(BCLog::ZMQ, "Publish hashtx mempool acceptance %s to %s\n", hash.GetHex(), this->address); - return SendSequenceMsg(*this, hash, /* Mempool (A)cceptance */ 'A', mempool_sequence); -} - -bool CZMQPublishSequenceNotifier::NotifyTransactionRemoval(const CTransaction &transaction, uint64_t mempool_sequence) -{ - uint256 hash = transaction.GetHash().ToUint256(); - LogDebug(BCLog::ZMQ, "Publish hashtx mempool removal %s to %s\n", hash.GetHex(), this->address); - return SendSequenceMsg(*this, hash, /* Mempool (R)emoval */ 'R', mempool_sequence); -} diff --git a/src/zmq/zmqpublishnotifier.h b/src/zmq/zmqpublishnotifier.h deleted file mode 100644 index 842403fa3349..000000000000 --- a/src/zmq/zmqpublishnotifier.h +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2015-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. - -#ifndef BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H -#define BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H - -#include - -#include -#include -#include -#include -#include - -class CBlockIndex; - -class CZMQAbstractPublishNotifier : public CZMQAbstractNotifier -{ -private: - uint32_t nSequence {0U}; //!< upcounting per message sequence number - -public: - - /* send zmq multipart message - parts: - * command - * data - * message sequence number - */ - bool SendZmqMessage(const char *command, const void* data, size_t size); - - bool Initialize(void *pcontext) override; - void Shutdown() override; -}; - -class CZMQPublishHashBlockNotifier : public CZMQAbstractPublishNotifier -{ -public: - bool NotifyBlock(const CBlockIndex *pindex) override; -}; - -class CZMQPublishHashTransactionNotifier : public CZMQAbstractPublishNotifier -{ -public: - bool NotifyTransaction(const CTransaction &transaction) override; -}; - -class CZMQPublishRawBlockNotifier : public CZMQAbstractPublishNotifier -{ -private: - const std::function&, const CBlockIndex&)> m_get_block_by_index; - -public: - CZMQPublishRawBlockNotifier(std::function&, const CBlockIndex&)> get_block_by_index) - : m_get_block_by_index{std::move(get_block_by_index)} {} - bool NotifyBlock(const CBlockIndex *pindex) override; -}; - -class CZMQPublishRawTransactionNotifier : public CZMQAbstractPublishNotifier -{ -public: - bool NotifyTransaction(const CTransaction &transaction) override; -}; - -class CZMQPublishSequenceNotifier : public CZMQAbstractPublishNotifier -{ -public: - bool NotifyBlockConnect(const CBlockIndex *pindex) override; - bool NotifyBlockDisconnect(const CBlockIndex *pindex) override; - bool NotifyTransactionAcceptance(const CTransaction &transaction, uint64_t mempool_sequence) override; - bool NotifyTransactionRemoval(const CTransaction &transaction, uint64_t mempool_sequence) override; -}; - -#endif // BITCOIN_ZMQ_ZMQPUBLISHNOTIFIER_H diff --git a/src/zmq/zmqrpc.h b/src/zmq/zmqrpc.h deleted file mode 100644 index e5379f89351e..000000000000 --- a/src/zmq/zmqrpc.h +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -#ifndef BITCOIN_ZMQ_ZMQRPC_H -#define BITCOIN_ZMQ_ZMQRPC_H - -class CRPCTable; - -void RegisterZMQRPCCommands(CRPCTable& t); - -#endif // BITCOIN_ZMQ_ZMQRPC_H diff --git a/src/zmq/zmqutil.cpp b/src/zmq/zmqutil.cpp deleted file mode 100644 index 7f28f5e523a7..000000000000 --- a/src/zmq/zmqutil.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) 2014-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. - -#include - -#include -#include - -#include - -#include -#include - -void zmqError(const std::string& str) -{ - LogDebug(BCLog::ZMQ, "Error: %s, msg: %s\n", str, zmq_strerror(errno)); -} diff --git a/src/zmq/zmqutil.h b/src/zmq/zmqutil.h deleted file mode 100644 index 86f594c1c041..000000000000 --- a/src/zmq/zmqutil.h +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2014-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. - -#ifndef BITCOIN_ZMQ_ZMQUTIL_H -#define BITCOIN_ZMQ_ZMQUTIL_H - -#include - -void zmqError(const std::string& str); - -/** Prefix for unix domain socket addresses (which are local filesystem paths) */ -const std::string ADDR_PREFIX_IPC = "ipc://"; // used by libzmq, example "ipc:///root/path/to/file" - -#endif // BITCOIN_ZMQ_ZMQUTIL_H diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6f971cb9593a..22e0d258b2d5 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,7 +20,6 @@ function(create_test_config) set_configure_variable(BUILD_UTIL_CHAINSTATE BUILD_BITCOIN_CHAINSTATE) set_configure_variable(BUILD_DAEMON BUILD_BITCOIND) set_configure_variable(BUILD_FUZZ_BINARY ENABLE_FUZZ_BINARY) - set_configure_variable(WITH_ZMQ ENABLE_ZMQ) set_configure_variable(WITH_EMBEDDED_ASMAP ENABLE_EMBEDDED_ASMAP) set_configure_variable(WITH_USDT ENABLE_USDT_TRACEPOINTS) diff --git a/test/config.ini.in b/test/config.ini.in index 5a2f370b0132..91048922f50c 100644 --- a/test/config.ini.in +++ b/test/config.ini.in @@ -20,7 +20,6 @@ RPCAUTH=@abs_top_srcdir@/share/rpcauth/rpcauth.py @BUILD_BITCOIN_CHAINSTATE_TRUE@ENABLE_BITCOIN_CHAINSTATE=true @BUILD_BITCOIND_TRUE@ENABLE_BITCOIND=true @ENABLE_FUZZ_BINARY_TRUE@ENABLE_FUZZ_BINARY=true -@ENABLE_ZMQ_TRUE@ENABLE_ZMQ=true @ENABLE_EMBEDDED_ASMAP_TRUE@ENABLE_EMBEDDED_ASMAP=true @ENABLE_USDT_TRACEPOINTS_TRUE@ENABLE_USDT_TRACEPOINTS=true ENABLE_IPC=true diff --git a/test/lint/README.md b/test/lint/README.md index 2ec73c554a64..023e97f3b4be 100644 --- a/test/lint/README.md +++ b/test/lint/README.md @@ -51,7 +51,6 @@ or `--help`: |-----------|:----------:| | [`lint-python.py`](/test/lint/lint-python.py) | [lief](https://github.com/lief-project/LIEF) | [`lint-python.py`](/test/lint/lint-python.py) | [mypy](https://github.com/python/mypy) -| [`lint-python.py`](/test/lint/lint-python.py) | [pyzmq](https://github.com/zeromq/pyzmq) | [`lint-shell.py`](/test/lint/lint-shell.py) | [ShellCheck](https://github.com/koalaman/shellcheck) | `py_lint` | [ruff](https://github.com/astral-sh/ruff) | markdown link check | [mlc](https://github.com/becheran/mlc) diff --git a/test/lint/lint-python.py b/test/lint/lint-python.py index 14df14c419ee..4b9fc89c5132 100755 --- a/test/lint/lint-python.py +++ b/test/lint/lint-python.py @@ -18,7 +18,7 @@ cache_dir = Path(__file__).parent.parent / ".mypy_cache" os.environ["MYPY_CACHE_DIR"] = str(cache_dir) -DEPS = ['lief', 'mypy', 'pyzmq'] +DEPS = ['lief', 'mypy'] # Only .py files in contrib/devtools have type annotations enforced. MYPY_FILES_ARGS = ['git', 'ls-files', 'contrib/devtools/*.py'] diff --git a/test/sanitizer_suppressions/tsan b/test/sanitizer_suppressions/tsan index 661571018b36..71446593fa82 100644 --- a/test/sanitizer_suppressions/tsan +++ b/test/sanitizer_suppressions/tsan @@ -16,22 +16,12 @@ race:bitcoin-qt race:src/qt/test/* deadlock:src/qt/test/* -# External libraries -# ------------------ -race:libzmq - -# To reproduce, build from depends with CFLAGS='-O0 -g' CXXFLAGS='-O0 -g' -race:zmq::* - # Intermittent issues # ------------------- # # Suppressions that follow might only happen intermittently, thus they are not # reproducible. Make sure to include a link to a full trace. -# https://github.com/bitcoin/bitcoin/issues/20618 -race:CZMQAbstractPublishNotifier::SendZmqMessage - # https://github.com/bitcoin/bitcoin/pull/27498#issuecomment-1517410478 race:epoll_ctl diff --git a/vcpkg.json b/vcpkg.json index f30a51f2d3f5..6c4da456b5d7 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -8,8 +8,7 @@ "libevent" ], "default-features": [ - "tests", - "zeromq" + "tests" ], "features": { "tests": { @@ -17,12 +16,6 @@ "dependencies": [ "boost-test" ] - }, - "zeromq": { - "description": "Enable ZMQ notifications", - "dependencies": [ - "zeromq" - ] } }, "overrides": [