Skip to content

Commit a124b91

Browse files
committed
Merge bitcoin#32299: [28.x] Backports
812e637 doc: update release notes for 28.x (fanquake) 2ccdfa4 scripted-diff: Use bpf_cflags (MarcoFalke) 3df2624 test: Add imports for util bpf_cflags (MarcoFalke) e656762 build: use make < 3.82 syntax for define directive (Sjors Provoost) 2d6c14e refactor: Remove spurious virtual from final ~CZMQNotificationInterface (MarcoFalke) 9b15b20 test: Handle empty string returned by CLI as None in RPC tests (Brandon Odiwuor) Pull request description: Backports: - bitcoin#32070 - bitcoin#32187 - bitcoin#32286 - bitcoin#32336 ACKs for top commit: willcl-ark: ACK 812e637 Tree-SHA512: b5c9c6b70588658310fd2d79dbd2d1148d8650e020daa9ac8ea2d3380c1e95a92e554b43b0dfd989308a729c5226e1f1ddb13cb1bb56dc5be571e4fc2f2795d6
2 parents dbc450c + 812e637 commit a124b91

File tree

11 files changed

+56
-25
lines changed

11 files changed

+56
-25
lines changed

depends/packages/capnp.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ $(package)_download_file=$(native_$(package)_download_file)
55
$(package)_file_name=$(native_$(package)_file_name)
66
$(package)_sha256_hash=$(native_$(package)_sha256_hash)
77

8-
define $(package)_set_vars :=
8+
define $(package)_set_vars
99
$(package)_config_opts := -DBUILD_TESTING=OFF
1010
$(package)_config_opts += -DWITH_OPENSSL=OFF
1111
$(package)_config_opts += -DWITH_ZLIB=OFF

depends/packages/libmultiprocess.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ifneq ($(host),$(build))
88
$(package)_dependencies += native_capnp
99
endif
1010

11-
define $(package)_set_vars :=
11+
define $(package)_set_vars
1212
ifneq ($(host),$(build))
1313
$(package)_config_opts := -DCAPNP_EXECUTABLE="$$(native_capnp_prefixbin)/capnp"
1414
$(package)_config_opts += -DCAPNPC_CXX_EXECUTABLE="$$(native_capnp_prefixbin)/capnpc-c++"

doc/release-notes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ Notable changes
4848

4949
- #31627 depends: Fix spacing issue
5050
- #31500 depends: Fix compiling libevent package on NetBSD
51+
- #32070 build: use make < 3.82 syntax for define directive
52+
53+
### Test
54+
55+
- #32286 test: Handle empty string returned by CLI as None in RPC tests
56+
- #32336 test: Suppress upstream -Wduplicate-decl-specifier in bpfcc
5157

5258
### Tracing
5359

@@ -56,13 +62,17 @@ Notable changes
5662
### Misc
5763

5864
- #31611 doc: upgrade license to 2025
65+
- #32187 refactor: Remove spurious virtual from final ~CZMQNotificationInterface
5966

6067
Credits
6168
=======
6269

6370
- 0xB10C
71+
- Brandon Odiwuor
6472
- Hennadii Stepanov
6573
- kehiy
74+
- MarcoFalke
75+
- Sjors Provoost
6676

6777
Thanks to everyone who directly contributed to this release:
6878

src/zmq/zmqnotificationinterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2015-2022 The Bitcoin Core developers
1+
// Copyright (c) 2015-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

@@ -22,7 +22,7 @@ struct NewMempoolTransactionInfo;
2222
class CZMQNotificationInterface final : public CValidationInterface
2323
{
2424
public:
25-
virtual ~CZMQNotificationInterface();
25+
~CZMQNotificationInterface();
2626

2727
std::list<const CZMQAbstractNotifier*> GetActiveNotifiers() const;
2828

test/functional/interface_usdt_coinselection.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2022 The Bitcoin Core developers
2+
# Copyright (c) 2022-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -17,6 +17,7 @@
1717
assert_equal,
1818
assert_greater_than,
1919
assert_raises_rpc_error,
20+
bpf_cflags,
2021
)
2122

2223
coinselection_tracepoints_program = """
@@ -166,7 +167,7 @@ def run_test(self):
166167
ctx.enable_probe(probe="coin_selection:normal_create_tx_internal", fn_name="trace_normal_create_tx")
167168
ctx.enable_probe(probe="coin_selection:attempting_aps_create_tx", fn_name="trace_attempt_aps")
168169
ctx.enable_probe(probe="coin_selection:aps_create_tx_internal", fn_name="trace_aps_create_tx")
169-
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
170+
self.bpf = BPF(text=coinselection_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
170171

171172
self.log.info("Prepare wallets")
172173
self.generate(self.nodes[0], 101)

test/functional/interface_usdt_mempool.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2022 The Bitcoin Core developers
2+
# Copyright (c) 2022-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -19,7 +19,10 @@
1919
from test_framework.messages import COIN, DEFAULT_MEMPOOL_EXPIRY_HOURS
2020
from test_framework.p2p import P2PDataStore
2121
from test_framework.test_framework import BitcoinTestFramework
22-
from test_framework.util import assert_equal
22+
from test_framework.util import (
23+
assert_equal,
24+
bpf_cflags,
25+
)
2326
from test_framework.wallet import MiniWallet
2427

2528
MEMPOOL_TRACEPOINTS_PROGRAM = """
@@ -144,7 +147,7 @@ def added_test(self):
144147
node = self.nodes[0]
145148
ctx = USDT(pid=node.process.pid)
146149
ctx.enable_probe(probe="mempool:added", fn_name="trace_added")
147-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
150+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
148151

149152
def handle_added_event(_, data, __):
150153
events.append(bpf["added_events"].event(data))
@@ -181,7 +184,7 @@ def removed_test(self):
181184
node = self.nodes[0]
182185
ctx = USDT(pid=node.process.pid)
183186
ctx.enable_probe(probe="mempool:removed", fn_name="trace_removed")
184-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
187+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
185188

186189
def handle_removed_event(_, data, __):
187190
events.append(bpf["removed_events"].event(data))
@@ -227,7 +230,7 @@ def replaced_test(self):
227230
node = self.nodes[0]
228231
ctx = USDT(pid=node.process.pid)
229232
ctx.enable_probe(probe="mempool:replaced", fn_name="trace_replaced")
230-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
233+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
231234

232235
def handle_replaced_event(_, data, __):
233236
events.append(bpf["replaced_events"].event(data))
@@ -278,7 +281,7 @@ def rejected_test(self):
278281
self.log.info("Hooking into mempool:rejected tracepoint...")
279282
ctx = USDT(pid=node.process.pid)
280283
ctx.enable_probe(probe="mempool:rejected", fn_name="trace_rejected")
281-
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
284+
bpf = BPF(text=MEMPOOL_TRACEPOINTS_PROGRAM, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
282285

283286
def handle_rejected_event(_, data, __):
284287
events.append(bpf["rejected_events"].event(data))

test/functional/interface_usdt_net.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2022 The Bitcoin Core developers
2+
# Copyright (c) 2022-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -17,7 +17,10 @@
1717
from test_framework.messages import msg_version
1818
from test_framework.p2p import P2PInterface
1919
from test_framework.test_framework import BitcoinTestFramework
20-
from test_framework.util import assert_equal
20+
from test_framework.util import (
21+
assert_equal,
22+
bpf_cflags,
23+
)
2124

2225
# Tor v3 addresses are 62 chars + 6 chars for the port (':12345').
2326
MAX_PEER_ADDR_LENGTH = 68
@@ -115,7 +118,7 @@ def __repr__(self):
115118
fn_name="trace_inbound_message")
116119
ctx.enable_probe(probe="net:outbound_message",
117120
fn_name="trace_outbound_message")
118-
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
121+
bpf = BPF(text=net_tracepoints_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
119122

120123
EXPECTED_INOUTBOUND_VERSION_MSG = 1
121124
checked_inbound_version_msg = 0

test/functional/interface_usdt_utxocache.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2022 The Bitcoin Core developers
2+
# Copyright (c) 2022-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -15,7 +15,10 @@
1515
pass
1616
from test_framework.messages import COIN
1717
from test_framework.test_framework import BitcoinTestFramework
18-
from test_framework.util import assert_equal
18+
from test_framework.util import (
19+
assert_equal,
20+
bpf_cflags,
21+
)
1922
from test_framework.wallet import MiniWallet
2023

2124
utxocache_changes_program = """
@@ -175,7 +178,7 @@ def test_uncache(self):
175178
ctx = USDT(pid=self.nodes[0].process.pid)
176179
ctx.enable_probe(probe="utxocache:uncache",
177180
fn_name="trace_utxocache_uncache")
178-
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
181+
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
179182

180183
# The handle_* function is a ctypes callback function called from C. When
181184
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -244,7 +247,7 @@ def test_add_spent(self):
244247
ctx.enable_probe(probe="utxocache:add", fn_name="trace_utxocache_add")
245248
ctx.enable_probe(probe="utxocache:spent",
246249
fn_name="trace_utxocache_spent")
247-
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
250+
bpf = BPF(text=utxocache_changes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
248251

249252
# The handle_* function is a ctypes callback function called from C. When
250253
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -333,7 +336,7 @@ def test_flush(self):
333336
ctx = USDT(pid=self.nodes[0].process.pid)
334337
ctx.enable_probe(probe="utxocache:flush",
335338
fn_name="trace_utxocache_flush")
336-
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
339+
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
337340

338341
# The handle_* function is a ctypes callback function called from C. When
339342
# we assert in the handle_* function, the AssertError doesn't propagate
@@ -390,7 +393,7 @@ def handle_utxocache_flush(_, data, __):
390393
ctx = USDT(pid=self.nodes[0].process.pid)
391394
ctx.enable_probe(probe="utxocache:flush",
392395
fn_name="trace_utxocache_flush")
393-
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
396+
bpf = BPF(text=utxocache_flushes_program, usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
394397
bpf["utxocache_flush"].open_perf_buffer(handle_utxocache_flush)
395398

396399
self.log.info(f"prune blockchain to trigger a flush for pruning")

test/functional/interface_usdt_validation.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python3
2-
# Copyright (c) 2022 The Bitcoin Core developers
2+
# Copyright (c) 2022-present The Bitcoin Core developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -17,8 +17,10 @@
1717

1818
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
1919
from test_framework.test_framework import BitcoinTestFramework
20-
from test_framework.util import assert_equal
21-
20+
from test_framework.util import (
21+
assert_equal,
22+
bpf_cflags,
23+
)
2224

2325
validation_blockconnected_program = """
2426
#include <uapi/linux/ptrace.h>
@@ -94,7 +96,7 @@ def __repr__(self):
9496
ctx.enable_probe(probe="validation:block_connected",
9597
fn_name="trace_block_connected")
9698
bpf = BPF(text=validation_blockconnected_program,
97-
usdt_contexts=[ctx], debug=0, cflags=["-Wno-error=implicit-function-declaration"])
99+
usdt_contexts=[ctx], debug=0, cflags=bpf_cflags())
98100

99101
def handle_blockconnected(_, data, __):
100102
event = ctypes.cast(data, ctypes.POINTER(Block)).contents

test/functional/test_framework/test_node.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,8 @@ def send_cli(self, clicommand=None, *args, **kwargs):
914914
# Ignore cli_stdout, raise with cli_stderr
915915
raise subprocess.CalledProcessError(returncode, self.binary, output=cli_stderr)
916916
try:
917+
if not cli_stdout.strip():
918+
return None
917919
return json.loads(cli_stdout, parse_float=decimal.Decimal)
918920
except (json.JSONDecodeError, decimal.InvalidOperation):
919921
return cli_stdout.rstrip("\n")

0 commit comments

Comments
 (0)