Skip to content

Commit 50db326

Browse files
2867107 merge bitcoin#31502: Fix CXXFLAGS on NetBSD (Kittywhiskers Van Gogh) 83e8ff0 merge bitcoin#28687: std::views::reverse (Kittywhiskers Van Gogh) 525bf6f merge bitcoin#29815: always use our fallback timingsafe_bcmp rather than libc's (Kittywhiskers Van Gogh) 42aa57a merge bitcoin#29081: Remove gmtime* (Kittywhiskers Van Gogh) d5179ec refactor: move away from `gmtime` (Kittywhiskers Van Gogh) 3a71354 merge bitcoin#29577: ignore deprecated-declarations warnings in objc++ macOS code (Kittywhiskers Van Gogh) 74bcdf0 merge bitcoin#29484: replace char-is-int8_t autoconf detection with c++20 concept (Kittywhiskers Van Gogh) e317a5c merge bitcoin#29085: Use std::rotl (Kittywhiskers Van Gogh) 9f2c278 merge bitcoin#29181: remove systemtap variadic patch (Kittywhiskers Van Gogh) 209488d merge bitcoin#29040: Remove pre-C++20 code, fs::path cleanup (Kittywhiskers Van Gogh) e2eb625 partial bitcoin#28894: batch all individual spkms setup db writes in a single db txn (Kittywhiskers Van Gogh) f29610b partial bitcoin#26707: Fix `performance-*move*` warnings in headers (Kittywhiskers Van Gogh) ee63d4b merge bitcoin#24470: Disallow more unsafe string->path conversions allowed by path append operators (Kittywhiskers Van Gogh) abfd303 merge bitcoin#24469: Correctly decode UTF-8 literal string paths (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Depends on #6378 ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: PastaPastaPasta: utACK 2867107 UdjinM6: utACK 2867107 Tree-SHA512: 9ade297d5078063229c297036c36ba2fd82eb0ffc15124d746564844315b6ed9d86f38ddc0f4e9f00e12f8d5eeeb6248c2a86b65a7bee856a234071e1546cf40
2 parents 48cecd6 + 2867107 commit 50db326

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+307
-386
lines changed

configure.ac

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,10 @@ case $host in
849849
fi
850850

851851
CORE_CPPFLAGS="$CORE_CPPFLAGS -DMAC_OSX -DOBJC_OLD_DISPATCH_PROTOTYPES=0"
852-
OBJCXXFLAGS="$CXXFLAGS"
852+
853+
dnl ignore deprecated-declarations warnings coming from objcxx code
854+
dnl "'NSUserNotificationCenter' is deprecated: first deprecated in macOS 11.0".
855+
OBJCXXFLAGS="$CXXFLAGS -Wno-deprecated-declarations"
853856
;;
854857
*android*)
855858
dnl make sure android stays above linux for hosts like *linux-android*
@@ -1054,8 +1057,6 @@ AC_CHECK_DECLS([setsid])
10541057

10551058
AC_CHECK_DECLS([pipe2])
10561059

1057-
AC_CHECK_FUNCS([timingsafe_bcmp])
1058-
10591060
dnl Check for mallopt(M_ARENA_MAX) (to set glibc arenas)
10601061
AC_MSG_CHECKING([for mallopt M_ARENA_MAX])
10611062
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <malloc.h>]],
@@ -1156,22 +1157,6 @@ if test "$use_thread_local" = "yes" || test "$use_thread_local" = "auto"; then
11561157
LDFLAGS="$TEMP_LDFLAGS"
11571158
fi
11581159

1159-
dnl check for gmtime_r(), fallback to gmtime_s() if that is unavailable
1160-
dnl fail if neither are available.
1161-
AC_MSG_CHECKING([for gmtime_r])
1162-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
1163-
[[ gmtime_r((const time_t *) nullptr, (struct tm *) nullptr); ]])],
1164-
[ AC_MSG_RESULT([yes]); AC_DEFINE([HAVE_GMTIME_R], [1], [Define this symbol if gmtime_r is available]) ],
1165-
[ AC_MSG_RESULT([no]);
1166-
AC_MSG_CHECKING([for gmtime_s]);
1167-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <ctime>]],
1168-
[[ gmtime_s((struct tm *) nullptr, (const time_t *) nullptr); ]])],
1169-
[ AC_MSG_RESULT([yes])],
1170-
[ AC_MSG_RESULT([no]); AC_MSG_ERROR([Both gmtime_r and gmtime_s are unavailable]) ]
1171-
)
1172-
]
1173-
)
1174-
11751160
dnl Check for different ways of gathering OS randomness
11761161
AC_MSG_CHECKING([for Linux getrandom syscall])
11771162
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>
@@ -1213,14 +1198,6 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
12131198
[ AC_MSG_RESULT([no])]
12141199
)
12151200

1216-
AC_MSG_CHECKING([for if type char equals int8_t])
1217-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdint.h>
1218-
#include <type_traits>]],
1219-
[[ static_assert(std::is_same<int8_t, char>::value, ""); ]])],
1220-
[ AC_MSG_RESULT([yes]); AC_DEFINE([CHAR_EQUALS_INT8], [1], [Define this symbol if type char equals int8_t]) ],
1221-
[ AC_MSG_RESULT([no])]
1222-
)
1223-
12241201
dnl ensure backtrace() is found, check -lexecinfo if necessary
12251202
if test "$TARGET_OS" != "windows"; then
12261203
if test "$enable_stacktraces" != "no"; then
@@ -1908,7 +1885,6 @@ AC_SUBST(HAVE_O_CLOEXEC)
19081885
AC_SUBST(HAVE_BUILTIN_PREFETCH)
19091886
AC_SUBST(HAVE_MM_PREFETCH)
19101887
AC_SUBST(HAVE_STRONG_GETAUXVAL)
1911-
AC_SUBST(HAVE_GMTIME_R)
19121888
AC_SUBST(ANDROID_ARCH)
19131889
AC_SUBST(HAVE_EVHTTP_CONNECTION_GET_PEER_CONST_CHAR)
19141890
AC_CONFIG_FILES([Makefile src/Makefile doc/man/Makefile share/setup.nsi share/qt/Info.plist test/config.ini])

contrib/devtools/copyright_header.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
'src/bench/nanobench.h',
2424
'src/crypto/*',
2525
'src/ctpl_stl.h',
26-
'src/reverse_iterator.h',
2726
'src/test/fuzz/FuzzedDataProvider.h',
2827
'src/tinyformat.h',
2928
'src/util/expected.h',

depends/hosts/netbsd.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ netbsd_NM = $(host_toolchain)gcc-nm
77
netbsd_RANLIB = $(host_toolchain)gcc-ranlib
88
endif
99

10-
netbsd_CXXFLAGS=$(netbsd_CFLAGS)
11-
1210
netbsd_release_CFLAGS=-O2
1311
netbsd_release_CXXFLAGS=$(netbsd_release_CFLAGS)
1412

depends/packages/systemtap.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ $(package)_version=4.8
33
$(package)_download_path=https://sourceware.org/ftp/systemtap/releases/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=cbd50a4eba5b261394dc454c12448ddec73e55e6742fda7f508f9fbc1331c223
6-
$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch fix_variadic_warning.patch
6+
$(package)_patches=remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch
77

88
define $(package)_preprocess_cmds
99
patch -p1 < $($(package)_patch_dir)/remove_SDT_ASM_SECTION_AUTOGROUP_SUPPORT_check.patch && \
10-
patch -p1 < $($(package)_patch_dir)/fix_variadic_warning.patch && \
1110
mkdir -p $($(package)_staging_prefix_dir)/include/sys && \
1211
cp includes/sys/sdt.h $($(package)_staging_prefix_dir)/include/sys/sdt.h
1312
endef

depends/patches/systemtap/fix_variadic_warning.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.

doc/developer-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1408,7 +1408,7 @@ A few guidelines for introducing and reviewing new RPC interfaces:
14081408

14091409
- *Rationale*: User-facing consistency.
14101410

1411-
- Use `fs::path::u8string()` and `fs::u8path()` functions when converting path
1411+
- Use `fs::path::u8string()`/`fs::path::utf8string()` and `fs::u8path()` functions when converting path
14121412
to JSON strings, not `fs::PathToString` and `fs::PathFromString`
14131413

14141414
- *Rationale*: JSON strings are Unicode strings, not byte strings, and

src/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ DIST_SUBDIRS = secp256k1
1212
AM_LDFLAGS = $(LIBTOOL_LDFLAGS) $(HARDENED_LDFLAGS) $(GPROF_LDFLAGS) $(SANITIZER_LDFLAGS) $(CORE_LDFLAGS)
1313
AM_CFLAGS = $(DEBUG_CFLAGS)
1414
AM_CXXFLAGS = $(DEBUG_CXXFLAGS) $(HARDENED_CXXFLAGS) $(WARN_CXXFLAGS) $(NOWARN_CXXFLAGS) $(ERROR_CXXFLAGS) $(GPROF_CXXFLAGS) $(SANITIZER_CXXFLAGS) $(CORE_CXXFLAGS)
15+
AM_OBJCXXFLAGS = $(AM_CXXFLAGS)
1516
AM_CPPFLAGS = $(DEBUG_CPPFLAGS) $(HARDENED_CPPFLAGS) $(CORE_CPPFLAGS)
1617
AM_LIBTOOLFLAGS = --preserve-dup-deps
1718
PTHREAD_FLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS)
@@ -296,7 +297,6 @@ BITCOIN_CORE_H = \
296297
psbt.h \
297298
random.h \
298299
randomenv.h \
299-
reverse_iterator.h \
300300
rpc/blockchain.h \
301301
rpc/client.h \
302302
rpc/index_util.h \

src/Makefile.bench.include

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ endif
8383
if ENABLE_WALLET
8484
bench_bench_dash_SOURCES += bench/coin_selection.cpp
8585
bench_bench_dash_SOURCES += bench/wallet_balance.cpp
86+
bench_bench_dash_SOURCES += bench/wallet_create.cpp
8687
endif
8788

8889
bench_bench_dash_LDADD += $(BACKTRACE_LIB) $(BDB_LIBS) $(EVENT_PTHREADS_LIBS) $(EVENT_LIBS) $(MINIUPNPC_LIBS) $(NATPMP_LIBS) $(SQLITE_LIBS) $(GMP_LIBS)

src/addrdb.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ bool SerializeFileDB(const std::string& prefix, const fs::path& path, const Data
5454
std::string tmpfn = strprintf("%s.%04x", prefix, randv);
5555

5656
// open temp output file, and associate with CAutoFile
57-
fs::path pathTmp = gArgs.GetDataDirNet() / tmpfn;
57+
fs::path pathTmp = gArgs.GetDataDirNet() / fs::u8path(tmpfn);
5858
FILE *file = fsbridge::fopen(pathTmp, "wb");
5959
CAutoFile fileout(file, SER_DISK, version);
6060
if (fileout.IsNull()) {

src/bench/wallet_create.cpp

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
// Copyright (c) 2023-present The Bitcoin Core developers
2+
// Distributed under the MIT software license, see the accompanying
3+
// file COPYING or https://www.opensource.org/licenses/mit-license.php.
4+
5+
#include <bench/bench.h>
6+
#include <node/context.h>
7+
#include <random.h>
8+
#include <test/util/setup_common.h>
9+
#include <util/translation.h>
10+
#include <wallet/context.h>
11+
#include <wallet/wallet.h>
12+
13+
namespace wallet {
14+
static void WalletCreate(benchmark::Bench& bench, bool encrypted)
15+
{
16+
auto test_setup = MakeNoLogFileContext<TestingSetup>();
17+
FastRandomContext random;
18+
19+
WalletContext context;
20+
context.args = &test_setup->m_args;
21+
context.chain = test_setup->m_node.chain.get();
22+
23+
DatabaseOptions options;
24+
options.require_format = DatabaseFormat::SQLITE;
25+
options.require_create = true;
26+
options.create_flags = WALLET_FLAG_DESCRIPTORS;
27+
28+
if (encrypted) {
29+
options.create_passphrase = random.rand256().ToString();
30+
}
31+
32+
DatabaseStatus status;
33+
bilingual_str error_string;
34+
std::vector<bilingual_str> warnings;
35+
36+
fs::path wallet_path = test_setup->m_path_root / strprintf("test_wallet_%d", random.rand32()).c_str();
37+
bench.run([&] {
38+
auto wallet = CreateWallet(context, wallet_path.utf8string(), /*load_on_start=*/std::nullopt, options, status, error_string, warnings);
39+
assert(status == DatabaseStatus::SUCCESS);
40+
assert(wallet != nullptr);
41+
42+
// Cleanup
43+
wallet.reset();
44+
fs::remove_all(wallet_path);
45+
});
46+
}
47+
48+
static void WalletCreatePlain(benchmark::Bench& bench) { WalletCreate(bench, /*encrypted=*/false); }
49+
static void WalletCreateEncrypted(benchmark::Bench& bench) { WalletCreate(bench, /*encrypted=*/true); }
50+
51+
#ifdef USE_SQLITE
52+
BENCHMARK(WalletCreatePlain);
53+
BENCHMARK(WalletCreateEncrypted);
54+
#endif
55+
56+
} // namespace wallet

0 commit comments

Comments
 (0)