Skip to content

Commit dcea925

Browse files
committed
Merge branch 'auxpow-29.x' into 29.x
2 parents 8915d75 + 1658530 commit dcea925

File tree

8 files changed

+61
-7
lines changed

8 files changed

+61
-7
lines changed

cmake/module/AddBoostIfNeeded.cmake

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ function(add_boost_if_needed)
1717
directory and other added INTERFACE properties.
1818
]=]
1919

20+
if(CMAKE_HOST_APPLE)
21+
find_program(HOMEBREW_EXECUTABLE brew)
22+
if(HOMEBREW_EXECUTABLE)
23+
execute_process(
24+
COMMAND ${HOMEBREW_EXECUTABLE} --prefix boost
25+
OUTPUT_VARIABLE Boost_ROOT
26+
ERROR_QUIET
27+
OUTPUT_STRIP_TRAILING_WHITESPACE
28+
)
29+
endif()
30+
endif()
31+
2032
# We cannot rely on find_package(Boost ...) to work properly without
2133
# Boost_NO_BOOST_CMAKE set until we require a more recent Boost because
2234
# upstream did not ship proper CMake files until 1.82.0.

cmake/module/FindQRencode.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ endif()
2121

2222
find_path(QRencode_INCLUDE_DIR
2323
NAMES qrencode.h
24-
PATHS ${PC_QRencode_INCLUDE_DIRS}
24+
HINTS ${PC_QRencode_INCLUDE_DIRS}
2525
)
2626

2727
find_library(QRencode_LIBRARY_RELEASE
2828
NAMES qrencode
29-
PATHS ${PC_QRencode_LIBRARY_DIRS}
29+
HINTS ${PC_QRencode_LIBRARY_DIRS}
3030
)
3131
find_library(QRencode_LIBRARY_DEBUG
3232
NAMES qrencoded qrencode
33-
PATHS ${PC_QRencode_LIBRARY_DIRS}
33+
HINTS ${PC_QRencode_LIBRARY_DIRS}
3434
)
3535
include(SelectLibraryConfigurations)
3636
select_library_configurations(QRencode)

depends/toolchain.cmake.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,22 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
9292
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
9393
set(QT_TRANSLATIONS_DIR "${CMAKE_CURRENT_LIST_DIR}/translations")
9494

95+
# The following is only necessary when using cmake from Nix or NixOS, because
96+
# Nix patches cmake to remove the root directory `/` from
97+
# CMAKE_SYSTEM_PREFIX_PATH. Adding it back is harmless on other platforms and
98+
# necessary on Nix because without it cmake find_path, find_package, etc
99+
# functions do not know where to look in CMAKE_FIND_ROOT_PATH for dependencies
100+
# (https://github.com/bitcoin/bitcoin/issues/32428).
101+
#
102+
# TODO: longer term, it may be possible to use a dependency provider, which
103+
# would bring the find_package calls completely under our control, making this
104+
# patch unnecessary.
105+
#
106+
# Make sure we only append once, as this file may be called repeatedly.
107+
if(NOT "/" IN_LIST CMAKE_PREFIX_PATH)
108+
list(APPEND CMAKE_PREFIX_PATH "/")
109+
endif()
110+
95111
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND NOT CMAKE_HOST_APPLE)
96112
# The find_package(Qt ...) function internally uses find_library()
97113
# calls for all dependencies to ensure their availability.

doc/release-notes.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ unsupported systems.
3737
Notable changes
3838
===============
3939

40+
### Updated Settings
41+
42+
- The `-maxmempool` and `-dbcache` startup parameters are now capped on
43+
32-bit systems to 500MB and 1GiB respectively.
44+
45+
- #32530 node: cap -maxmempool and -dbcache values for 32-bit
46+
4047
### Wallet
4148

4249
- #31757 wallet: fix crash on double block disconnection
@@ -50,6 +57,8 @@ Notable changes
5057
- #32483 test: fix two intermittent failures in wallet_basic.py
5158
- #32630 test: fix sync function in rpc_psbt.py
5259
- #32765 test: Fix list index out of range error in feature_bip68_sequence.py
60+
- #32742 test: fix catchup loop in outbound eviction functional test
61+
- #32833 test: Add msgtype to msg_generic slots
5362

5463
### Util
5564

@@ -66,6 +75,9 @@ Notable changes
6675
- #32678 guix: warn and abort when SOURCE_DATE_EPOCH is set
6776
- #32690 depends: fix SHA256SUM command on OpenBSD (use GNU mode output)
6877
- #32760 depends: capnp 1.2.0
78+
- #32798 build: add root dir to CMAKE_PREFIX_PATH in toolchain
79+
- #32805 cmake: Use HINTS instead of PATHS in find_* commands
80+
- #32814 cmake: Explicitly specify Boost_ROOT for Homebrew's package
6981

7082
### Gui
7183

@@ -106,6 +118,7 @@ Thanks to everyone who directly contributed to this release:
106118
- benthecarman
107119
- Brandon Odiwuor
108120
- davidgumberg
121+
- dergoegge
109122
- enirox001
110123
- fanquake
111124
- furszy

src/node/caches.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
static constexpr size_t MAX_TX_INDEX_CACHE{1024_MiB};
2121
//! Max memory allocated to all block filter index caches combined in bytes.
2222
static constexpr size_t MAX_FILTER_INDEX_CACHE{1024_MiB};
23+
//! Maximum dbcache size on 32-bit systems.
24+
static constexpr size_t MAX_32BIT_DBCACHE{1024_MiB};
2325

2426
namespace node {
2527
CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes)
@@ -29,7 +31,8 @@ CacheSizes CalculateCacheSizes(const ArgsManager& args, size_t n_indexes)
2931
if (std::optional<int64_t> db_cache = args.GetIntArg("-dbcache")) {
3032
if (*db_cache < 0) db_cache = 0;
3133
uint64_t db_cache_bytes = SaturatingLeftShift<uint64_t>(*db_cache, 20);
32-
total_cache = std::max<size_t>(MIN_DB_CACHE, std::min<uint64_t>(db_cache_bytes, std::numeric_limits<size_t>::max()));
34+
constexpr auto max_db_cache{sizeof(void*) == 4 ? MAX_32BIT_DBCACHE : std::numeric_limits<size_t>::max()};
35+
total_cache = std::max<size_t>(MIN_DB_CACHE, std::min<uint64_t>(db_cache_bytes, max_db_cache));
3336
}
3437

3538
IndexCacheSizes index_sizes;

src/node/mempool_args.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ using common::AmountErrMsg;
2525
using kernel::MemPoolLimits;
2626
using kernel::MemPoolOptions;
2727

28+
//! Maximum mempool size on 32-bit systems.
29+
static constexpr int MAX_32BIT_MEMPOOL_MB{500};
30+
2831
namespace {
2932
void ApplyArgsManOptions(const ArgsManager& argsman, MemPoolLimits& mempool_limits)
3033
{
@@ -42,7 +45,13 @@ util::Result<void> ApplyArgsManOptions(const ArgsManager& argsman, const CChainP
4245
{
4346
mempool_opts.check_ratio = argsman.GetIntArg("-checkmempool", mempool_opts.check_ratio);
4447

45-
if (auto mb = argsman.GetIntArg("-maxmempool")) mempool_opts.max_size_bytes = *mb * 1'000'000;
48+
if (auto mb = argsman.GetIntArg("-maxmempool")) {
49+
constexpr bool is_32bit{sizeof(void*) == 4};
50+
if (is_32bit && *mb > MAX_32BIT_MEMPOOL_MB) {
51+
return util::Error{Untranslated(strprintf("-maxmempool is set to %i but can't be over %i MB on 32-bit systems", *mb, MAX_32BIT_MEMPOOL_MB))};
52+
}
53+
mempool_opts.max_size_bytes = *mb * 1'000'000;
54+
}
4655

4756
if (auto hours = argsman.GetIntArg("-mempoolexpiry")) mempool_opts.expiry = std::chrono::hours{*hours};
4857

test/functional/p2p_outbound_eviction.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def test_outbound_eviction_unprotected(self):
8888
# Generate an additional block so the peers is 2 blocks behind
8989
prev_header = from_hex(CBlockHeader(), node.getblockheader(best_block_hash, False))
9090
best_block_hash = self.generateblock(node, output="raw(42)", transactions=[])["hash"]
91+
tip_header = from_hex(CBlockHeader(), node.getblockheader(best_block_hash, False))
9192
peer.sync_with_ping()
9293

9394
# Advance time but not enough to evict the peer
@@ -100,7 +101,7 @@ def test_outbound_eviction_unprotected(self):
100101

101102
# Send a header with the previous tip (so we go back to 1 block behind)
102103
peer.send_and_ping(msg_headers([prev_header]))
103-
prev_prev_hash = tip_header.hash
104+
prev_prev_hash = tip_header.hashPrevBlock
104105

105106
self.log.info("Create an outbound connection and take some time to catch up, but do it in time")
106107
# Check that if the peer manages to catch up within time, the timeouts are removed (and the peer is not disconnected)

test/functional/test_framework/messages.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ def __repr__(self):
14261426
# for cases where a user needs tighter control over what is sent over the wire
14271427
# note that the user must supply the name of the msgtype, and the data
14281428
class msg_generic:
1429-
__slots__ = ("data")
1429+
__slots__ = ("msgtype", "data")
14301430

14311431
def __init__(self, msgtype, data=None):
14321432
self.msgtype = msgtype

0 commit comments

Comments
 (0)