From 556eca47bd5a4a318a39bf03a1fd8ac9c0c926d8 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Tue, 25 Nov 2025 15:28:08 +0100 Subject: [PATCH 1/3] Squashed 'libbitcoinkernel-sys/bitcoin/' changes from 3789215f7346..09e054930101 09e054930101 Add sans utxo set block validation d0660fbf582f block header 6493e47fd8d3 doc: Add docstrings for ConnectBlock and SpendBlock ed35dc3c4a52 validation: Move coin existence and spend check to SpendBlock 637000b981c0 validation: Move SetBestBlock out of ConnectBlock 91ff9de0076f validation: Add SpendBlock function 20b5547f32b3 validation: Use vector of outputs instead of CCoinsViewCache in CheckInputScripts 4bee0a8cf671 consensus: Use Coin span in CheckTxInputs 1bedce6b44bd consensus: Use Coin span in GetTransactionSigOpCost bec73c5e30ad consensus: Use Coin span in GetP2SHSigOpCount REVERT: 3789215f7346 Merge bitcoin/bitcoin#33724: refactor: Return uint64_t from GetSerializeSize REVERT: d4e2a4583305 Merge bitcoin/bitcoin#33750: doc: document fingerprinting risk when operating node on multiple networks REVERT: 47618446a06d Merge bitcoin/bitcoin#33853: kernel: Allow null arguments for serialized data REVERT: a3ac59a43163 ci: Enable experimental kernel stuff in ASan task REVERT: 5b89956eeb76 kernel: Allow null arguments for serialized data REVERT: e346ecae830e Add eclipse, partitioning, and fingerprinting note to i2p.md REVERT: 19a6a3e75ed6 Add eclipse, partitioning, and fingerprinting note in tor.md REVERT: fa6c0bedd33a refactor: Return uint64_t from GetSerializeSize REVERT: fad0c8680ea7 refactor: Use uint64_t over size_t for serialized-size values REVERT: fa4f388fc99c refactor: Use fixed size ints over (un)signed ints for serialized values REVERT: fa01f38e53cf move-only: Move CBlockFileInfo to kernel namespace REVERT: fa2bbc9e4cfe refactor: [rpc] Remove cast when reporting serialized size REVERT: fa364af89bd9 test: Remove outdated comment git-subtree-dir: libbitcoinkernel-sys/bitcoin git-subtree-split: 09e05493010119fc60d310d3e7ffc388de441f9a --- .github/workflows/ci.yml | 2 +- ci/test/00_setup_env_native_asan.sh | 2 +- doc/i2p.md | 10 - doc/tor.md | 7 - src/bench/connectblock.cpp | 5 +- src/bitcoin-chainstate.cpp | 2 +- src/chain.cpp | 6 + src/chain.h | 41 +++ src/coins.cpp | 27 +- src/coins.h | 16 ++ src/consensus/tx_verify.cpp | 63 +++-- src/consensus/tx_verify.h | 25 +- src/flatfile.h | 10 +- src/index/blockfilterindex.cpp | 4 +- src/index/disktxpos.h | 4 +- src/kernel/bitcoinkernel.cpp | 118 ++++++++- src/kernel/bitcoinkernel.h | 182 ++++++++++++- src/kernel/bitcoinkernel_wrapper.h | 141 ++++++++-- src/node/blockstorage.cpp | 6 - src/node/blockstorage.h | 42 --- src/node/psbt.cpp | 3 +- src/policy/policy.cpp | 2 +- src/rpc/blockchain.cpp | 10 +- src/serialize.h | 21 +- src/test/arith_uint256_tests.cpp | 2 +- src/test/blockmanager_tests.cpp | 1 - src/test/coinstatsindex_tests.cpp | 5 +- src/test/flatfile_tests.cpp | 4 +- src/test/fuzz/block_index.cpp | 2 - src/test/fuzz/coins_view.cpp | 11 +- src/test/fuzz/deserialize.cpp | 2 - src/test/fuzz/miniscript.cpp | 2 +- src/test/kernel/test_kernel.cpp | 71 ++++- src/test/miner_tests.cpp | 2 +- src/test/miniscript_tests.cpp | 2 +- src/test/script_p2sh_tests.cpp | 11 +- src/test/sigopcount_tests.cpp | 33 ++- src/test/transaction_tests.cpp | 6 +- src/test/txvalidationcache_tests.cpp | 35 ++- src/txmempool.cpp | 4 +- src/validation.cpp | 382 +++++++++++++++++---------- src/validation.h | 34 ++- src/wallet/spend.cpp | 2 +- test/functional/feature_block.py | 2 +- 44 files changed, 1003 insertions(+), 359 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ffaafe3..d4336462 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -468,7 +468,7 @@ jobs: file-env: './ci/test/00_setup_env_arm.sh' provider: 'gha' - - name: 'ASan + LSan + UBSan + integer' + - name: 'ASan + LSan + UBSan + integer, no depends, USDT' cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools fallback-runner: 'ubuntu-24.04' timeout-minutes: 120 diff --git a/ci/test/00_setup_env_native_asan.sh b/ci/test/00_setup_env_native_asan.sh index 0e732240..229d4fff 100755 --- a/ci/test/00_setup_env_native_asan.sh +++ b/ci/test/00_setup_env_native_asan.sh @@ -26,7 +26,7 @@ export NO_DEPENDS=1 export GOAL="install" export CI_LIMIT_STACK_SIZE=1 export BITCOIN_CONFIG="\ - --preset=dev-mode \ + -DWITH_USDT=ON -DWITH_ZMQ=ON -DBUILD_GUI=ON \ -DSANITIZERS=address,float-divide-by-zero,integer,undefined \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ diff --git a/doc/i2p.md b/doc/i2p.md index 624b651f..b769a74d 100644 --- a/doc/i2p.md +++ b/doc/i2p.md @@ -166,13 +166,3 @@ In most cases, the default router settings should work fine. Please see the "General Guidance for Developers" section in https://geti2p.net/en/docs/api/samv3 if you are developing a downstream application that may be bundling I2P with Bitcoin. - -## Privacy recommendations - -- Operating a node that listens on multiple networks (e.g. IPv4 and I2P) can help - strengthen the Bitcoin network, as nodes in this configuration (i.e. bridge nodes) increase - the cost and complexity of launching eclipse and partition attacks. However, under certain - conditions, an adversary that can connect to your node on multiple networks may be - able to correlate those identities by observing shared runtime characteristics. It - is not recommended to expose your node over multiple networks if you require - unlinkability across those identities. diff --git a/doc/tor.md b/doc/tor.md index e9db555f..839c02ee 100644 --- a/doc/tor.md +++ b/doc/tor.md @@ -238,10 +238,3 @@ for normal IPv4/IPv6 communication, use: Otherwise it is trivial to link them, which may reduce privacy. Onion services created automatically (as in section 2) always have only one port open. -- Operating a node that listens on multiple networks (e.g. IPv4 and Tor) can help - strengthen the Bitcoin network, as nodes in this configuration (i.e. bridge nodes) increase - the cost and complexity of launching eclipse and partition attacks. However, under certain - conditions, an adversary that can connect to your node on multiple networks may be - able to correlate those identities by observing shared runtime characteristics. It - is not recommended to expose your node over multiple networks if you require - unlinkability across those identities. diff --git a/src/bench/connectblock.cpp b/src/bench/connectblock.cpp index 3746ea29..9ea50601 100644 --- a/src/bench/connectblock.cpp +++ b/src/bench/connectblock.cpp @@ -9,6 +9,7 @@ #include