From 9b15b20cb17f048fedf3628dbb0e7c5db9561fc5 Mon Sep 17 00:00:00 2001 From: Brandon Odiwuor Date: Wed, 16 Apr 2025 14:18:48 +0300 Subject: [PATCH 1/6] test: Handle empty string returned by CLI as None in RPC tests --- test/functional/test_framework/test_node.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py index 32a266586ad..26d052abab4 100755 --- a/test/functional/test_framework/test_node.py +++ b/test/functional/test_framework/test_node.py @@ -914,6 +914,8 @@ class TestNodeCLI(): # Ignore cli_stdout, raise with cli_stderr raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr) try: + if not cli_stdout.strip(): + return None return json.loads(cli_stdout, parse_float=decimal.Decimal) except (json.JSONDecodeError, decimal.InvalidOperation): return cli_stdout.rstrip("\n") From 2d6c14efbacb08da70e6323ed44b64a35cda9f52 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 1 Apr 2025 18:41:54 +0200 Subject: [PATCH 2/6] refactor: Remove spurious virtual from final ~CZMQNotificationInterface Github-Pull: #32187 Rebased-From: fa69c42fdf0aeec0546e951bc6132ab630edb9d4 --- src/zmq/zmqnotificationinterface.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zmq/zmqnotificationinterface.h b/src/zmq/zmqnotificationinterface.h index c879fdd0ddf..ad445bbd393 100644 --- a/src/zmq/zmqnotificationinterface.h +++ b/src/zmq/zmqnotificationinterface.h @@ -1,4 +1,4 @@ -// Copyright (c) 2015-2022 The Bitcoin Core developers +// 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. @@ -22,7 +22,7 @@ struct NewMempoolTransactionInfo; class CZMQNotificationInterface final : public CValidationInterface { public: - virtual ~CZMQNotificationInterface(); + ~CZMQNotificationInterface(); std::list GetActiveNotifiers() const; From e65676216c6840001dbf153cb8d4861495e231ea Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 14 Mar 2025 16:19:45 +0100 Subject: [PATCH 3/6] build: use make < 3.82 syntax for define directive From the GNU make 3.82 release announcement: * The 'define' make directive now allows a variable assignment operator after the variable name, to allow for simple, conditional, or appending multi-line variable assignment. macOS ships with 3.81. This caused the multiprocess config options to be ignored. Fixes #32068 Co-authored-by: Ryan Ofsky Github-Pull: #32070 Rebased-From: 9157d9e449870851ef455e077249ac46fc2df24c --- depends/packages/capnp.mk | 2 +- depends/packages/libmultiprocess.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/depends/packages/capnp.mk b/depends/packages/capnp.mk index 6d792db7113..3fb915d5114 100644 --- a/depends/packages/capnp.mk +++ b/depends/packages/capnp.mk @@ -5,7 +5,7 @@ $(package)_download_file=$(native_$(package)_download_file) $(package)_file_name=$(native_$(package)_file_name) $(package)_sha256_hash=$(native_$(package)_sha256_hash) -define $(package)_set_vars := +define $(package)_set_vars $(package)_config_opts := -DBUILD_TESTING=OFF $(package)_config_opts += -DWITH_OPENSSL=OFF $(package)_config_opts += -DWITH_ZLIB=OFF diff --git a/depends/packages/libmultiprocess.mk b/depends/packages/libmultiprocess.mk index c292c49bfba..07d1f87b808 100644 --- a/depends/packages/libmultiprocess.mk +++ b/depends/packages/libmultiprocess.mk @@ -8,7 +8,7 @@ ifneq ($(host),$(build)) $(package)_dependencies += native_capnp endif -define $(package)_set_vars := +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++" From 3df2624ee9ab25a0281b27116740d0c5aff1c101 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 24 Apr 2025 10:21:40 +0200 Subject: [PATCH 4/6] test: Add imports for util bpf_cflags This is required for the next commit. Github-Pull: #32336 Rebased-From: fa0c1baaf89805182de56d6a2e8eed2265a94b40 --- test/functional/interface_usdt_coinselection.py | 3 ++- test/functional/interface_usdt_mempool.py | 7 +++++-- test/functional/interface_usdt_net.py | 7 +++++-- test/functional/interface_usdt_utxocache.py | 7 +++++-- test/functional/interface_usdt_validation.py | 8 +++++--- test/functional/test_framework/util.py | 7 +++++++ 6 files changed, 29 insertions(+), 10 deletions(-) diff --git a/test/functional/interface_usdt_coinselection.py b/test/functional/interface_usdt_coinselection.py index dc40986a75d..2566b91e0b2 100755 --- a/test/functional/interface_usdt_coinselection.py +++ b/test/functional/interface_usdt_coinselection.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-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. @@ -17,6 +17,7 @@ from test_framework.util import ( assert_equal, assert_greater_than, assert_raises_rpc_error, + bpf_cflags, ) coinselection_tracepoints_program = """ diff --git a/test/functional/interface_usdt_mempool.py b/test/functional/interface_usdt_mempool.py index a0882786656..08158f3ee4c 100755 --- a/test/functional/interface_usdt_mempool.py +++ b/test/functional/interface_usdt_mempool.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-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. @@ -19,7 +19,10 @@ from test_framework.blocktools import COINBASE_MATURITY from test_framework.messages import COIN, DEFAULT_MEMPOOL_EXPIRY_HOURS from test_framework.p2p import P2PDataStore from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) from test_framework.wallet import MiniWallet MEMPOOL_TRACEPOINTS_PROGRAM = """ diff --git a/test/functional/interface_usdt_net.py b/test/functional/interface_usdt_net.py index 5468ddf8586..a599847ae82 100755 --- a/test/functional/interface_usdt_net.py +++ b/test/functional/interface_usdt_net.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-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. @@ -17,7 +17,10 @@ except ImportError: from test_framework.messages import msg_version from test_framework.p2p import P2PInterface from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) # Tor v3 addresses are 62 chars + 6 chars for the port (':12345'). MAX_PEER_ADDR_LENGTH = 68 diff --git a/test/functional/interface_usdt_utxocache.py b/test/functional/interface_usdt_utxocache.py index ad98a3a1628..cd9329f3ee9 100755 --- a/test/functional/interface_usdt_utxocache.py +++ b/test/functional/interface_usdt_utxocache.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-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,7 +15,10 @@ except ImportError: pass from test_framework.messages import COIN from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal +from test_framework.util import ( + assert_equal, + bpf_cflags, +) from test_framework.wallet import MiniWallet utxocache_changes_program = """ diff --git a/test/functional/interface_usdt_validation.py b/test/functional/interface_usdt_validation.py index 9a37b96ada8..7d74d8911ab 100755 --- a/test/functional/interface_usdt_validation.py +++ b/test/functional/interface_usdt_validation.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright (c) 2022 The Bitcoin Core developers +# Copyright (c) 2022-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. @@ -17,8 +17,10 @@ except ImportError: from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE from test_framework.test_framework import BitcoinTestFramework -from test_framework.util import assert_equal - +from test_framework.util import ( + assert_equal, + bpf_cflags, +) validation_blockconnected_program = """ #include diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index 00fe5b08e4c..3769d1c9379 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -301,6 +301,13 @@ def wait_until_helper_internal(predicate, *, attempts=float('inf'), timeout=floa raise RuntimeError('Unreachable') +def bpf_cflags(): + return [ + "-Wno-error=implicit-function-declaration", + "-Wno-duplicate-decl-specifier", # https://github.com/bitcoin/bitcoin/issues/32322 + ] + + def sha256sum_file(filename): h = hashlib.sha256() with open(filename, 'rb') as f: From 2ccdfa424cba3f2e414520d49485d3242f28b283 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Thu, 24 Apr 2025 10:26:11 +0200 Subject: [PATCH 5/6] scripted-diff: Use bpf_cflags -BEGIN VERIFY SCRIPT- ren() { sed --regexp-extended -i "s/$1/$2/g" $( git grep --extended-regexp -l "$1" ) ; } ren 'cflags=\["-Wno-error=implicit-function-declaration"\]' 'cflags=bpf_cflags()' -END VERIFY SCRIPT- Github-Pull: #32336 Rebased-From: facb9b327b9da39ce1e09ed56199be9efb19b5b8 --- test/functional/interface_usdt_coinselection.py | 2 +- test/functional/interface_usdt_mempool.py | 8 ++++---- test/functional/interface_usdt_net.py | 2 +- test/functional/interface_usdt_utxocache.py | 8 ++++---- test/functional/interface_usdt_validation.py | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/test/functional/interface_usdt_coinselection.py b/test/functional/interface_usdt_coinselection.py index 2566b91e0b2..9aea3fecf62 100755 --- a/test/functional/interface_usdt_coinselection.py +++ b/test/functional/interface_usdt_coinselection.py @@ -167,7 +167,7 @@ class CoinSelectionTracepointTest(BitcoinTestFramework): ctx.enable_probe(probe="coin_selection:normal_create_tx_internal", fn_name="trace_normal_create_tx") ctx.enable_probe(probe="coin_selection:attempting_aps_create_tx", fn_name="trace_attempt_aps") ctx.enable_probe(probe="coin_selection:aps_create_tx_internal", fn_name="trace_aps_create_tx") - self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) self.log.info("Prepare wallets") self.generate(self.nodes[0], 101) diff --git a/test/functional/interface_usdt_mempool.py b/test/functional/interface_usdt_mempool.py index 08158f3ee4c..c4a7f185fa4 100755 --- a/test/functional/interface_usdt_mempool.py +++ b/test/functional/interface_usdt_mempool.py @@ -147,7 +147,7 @@ class MempoolTracepointTest(BitcoinTestFramework): node = self.nodes[0] ctx = USDT(pid=node.process.pid) ctx.enable_probe(probe="mempool:added", fn_name="trace_added") - bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) def handle_added_event(_, data, __): events.append(bpf["added_events"].event(data)) @@ -184,7 +184,7 @@ class MempoolTracepointTest(BitcoinTestFramework): node = self.nodes[0] ctx = USDT(pid=node.process.pid) ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed") - bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) def handle_removed_event(_, data, __): events.append(bpf["removed_events"].event(data)) @@ -230,7 +230,7 @@ class MempoolTracepointTest(BitcoinTestFramework): node = self.nodes[0] ctx = USDT(pid=node.process.pid) ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced") - bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) def handle_replaced_event(_, data, __): events.append(bpf["replaced_events"].event(data)) @@ -281,7 +281,7 @@ class MempoolTracepointTest(BitcoinTestFramework): self.log.info("Hooking into mempool:rejected tracepoint...") ctx = USDT(pid=node.process.pid) ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected") - bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) def handle_rejected_event(_, data, __): events.append(bpf["rejected_events"].event(data)) diff --git a/test/functional/interface_usdt_net.py b/test/functional/interface_usdt_net.py index a599847ae82..ca86e8a8f5f 100755 --- a/test/functional/interface_usdt_net.py +++ b/test/functional/interface_usdt_net.py @@ -118,7 +118,7 @@ class NetTracepointTest(BitcoinTestFramework): fn_name="trace_inbound_message") ctx.enable_probe(probe="net:outbound_message", fn_name="trace_outbound_message") - bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) EXPECTED_INOUTBOUND_VERSION_MSG = 1 checked_inbound_version_msg = 0 diff --git a/test/functional/interface_usdt_utxocache.py b/test/functional/interface_usdt_utxocache.py index cd9329f3ee9..bd2d9292a52 100755 --- a/test/functional/interface_usdt_utxocache.py +++ b/test/functional/interface_usdt_utxocache.py @@ -178,7 +178,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework): ctx = USDT(pid=self.nodes[0].process.pid) ctx.enable_probe(probe="utxocache:uncache", fn_name="trace_utxocache_uncache") - bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) # The handle_* function is a ctypes callback function called from C. When # we assert in the handle_* function, the AssertError doesn't propagate @@ -247,7 +247,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework): ctx.enable_probe(probe="utxocache:add", fn_name="trace_utxocache_add") ctx.enable_probe(probe="utxocache:spent", fn_name="trace_utxocache_spent") - bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) # The handle_* function is a ctypes callback function called from C. When # we assert in the handle_* function, the AssertError doesn't propagate @@ -336,7 +336,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework): ctx = USDT(pid=self.nodes[0].process.pid) ctx.enable_probe(probe="utxocache:flush", fn_name="trace_utxocache_flush") - bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) # The handle_* function is a ctypes callback function called from C. When # we assert in the handle_* function, the AssertError doesn't propagate @@ -393,7 +393,7 @@ class UTXOCacheTracepointTest(BitcoinTestFramework): ctx = USDT(pid=self.nodes[0].process.pid) ctx.enable_probe(probe="utxocache:flush", fn_name="trace_utxocache_flush") - bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) bpf["utxocache_flush"].open_perf_buffer(handle_utxocache_flush) self.log.info(f"prune blockchain to trigger a flush for pruning") diff --git a/test/functional/interface_usdt_validation.py b/test/functional/interface_usdt_validation.py index 7d74d8911ab..8c16abba61d 100755 --- a/test/functional/interface_usdt_validation.py +++ b/test/functional/interface_usdt_validation.py @@ -96,7 +96,7 @@ class ValidationTracepointTest(BitcoinTestFramework): ctx.enable_probe(probe="validation:block_connected", fn_name="trace_block_connected") bpf = BPF(text=validation_blockconnected_program, - usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"]) + usdt_contexts=[ctx], debug=0, cflags=bpf_cflags()) def handle_blockconnected(_, data, __): event = ctypes.cast(data, ctypes.POINTER(Block)).contents From 812e6375213e883a0c22aa926ebcde5da4d23a3e Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 17 Apr 2025 13:13:16 +0100 Subject: [PATCH 6/6] doc: update release notes for 28.x --- doc/release-notes.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/doc/release-notes.md b/doc/release-notes.md index ab7b7257e54..19ba6560a97 100644 --- a/doc/release-notes.md +++ b/doc/release-notes.md @@ -48,6 +48,12 @@ Notable changes - #31627 depends: Fix spacing issue - #31500 depends: Fix compiling libevent package on NetBSD +- #32070 build: use make < 3.82 syntax for define directive + +### Test + +- #32286 test: Handle empty string returned by CLI as None in RPC tests +- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc ### Tracing @@ -56,13 +62,17 @@ Notable changes ### Misc - #31611 doc: upgrade license to 2025 +- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface Credits ======= - 0xB10C +- Brandon Odiwuor - Hennadii Stepanov - kehiy +- MarcoFalke +- Sjors Provoost Thanks to everyone who directly contributed to this release: