Skip to content

Commit cc61bc2

Browse files
committed
compat: remove glibcxx sanity checks
These checks were added in #4339, (see also #4081), to test our back-compat stubs, however, those stubs no-longer exist (#22930), meaning that these checks are now just testing some specific standard library behaviour, without a particular rationale, or reason, compared to any other standard library functions we use. There has also been some discussion about the sanity checks in the context of the libbitcoinkernel refactoring, see bitcoin/bitcoin#25065 (comment). Removing the checks removes the need to worry about atleast the glibcxx checks. Also remove the list of check from the doc in init.h, because it is incomplete, and anyone who wants to know what checks are included can look at the function.
1 parent ba48fcf commit cc61bc2

File tree

7 files changed

+1
-85
lines changed

7 files changed

+1
-85
lines changed

src/Makefile.am

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ BITCOIN_CORE_H = \
139139
compat/byteswap.h \
140140
compat/cpuid.h \
141141
compat/endian.h \
142-
compat/sanity.h \
143142
compressor.h \
144143
consensus/consensus.h \
145144
consensus/tx_check.h \
@@ -629,15 +628,12 @@ libbitcoin_common_a_SOURCES = \
629628
$(BITCOIN_CORE_H)
630629

631630
# util: shared between all executables.
632-
# This library *must* be included to make sure that the glibc
633-
# sanity checks are linked.
634631
libbitcoin_util_a_CPPFLAGS = $(AM_CPPFLAGS) $(BITCOIN_INCLUDES)
635632
libbitcoin_util_a_CXXFLAGS = $(AM_CXXFLAGS) $(PIE_FLAGS)
636633
libbitcoin_util_a_SOURCES = \
637634
support/lockedpool.cpp \
638635
chainparamsbase.cpp \
639636
clientversion.cpp \
640-
compat/glibcxx_sanity.cpp \
641637
fs.cpp \
642638
interfaces/echo.cpp \
643639
interfaces/handler.cpp \
@@ -857,7 +853,6 @@ libbitcoinkernel_la_SOURCES = \
857853
chainparams.cpp \
858854
clientversion.cpp \
859855
coins.cpp \
860-
compat/glibcxx_sanity.cpp \
861856
compressor.cpp \
862857
consensus/merkle.cpp \
863858
consensus/tx_check.cpp \

src/compat/glibcxx_sanity.cpp

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

src/compat/sanity.h

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

src/init.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <blockfilter.h>
1515
#include <chain.h>
1616
#include <chainparams.h>
17-
#include <compat/sanity.h>
1817
#include <consensus/amount.h>
1918
#include <deploymentstatus.h>
2019
#include <fs.h>

src/init.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ bool AppInitBasicSetup(const ArgsManager& args);
4343
*/
4444
bool AppInitParameterInteraction(const ArgsManager& args, bool use_syscall_sandbox = true);
4545
/**
46-
* Initialization sanity checks: ecc init, sanity checks, dir lock.
46+
* Initialization sanity checks.
4747
* @note This can be done before daemonization. Do not call Shutdown() if this function fails.
4848
* @pre Parameters should be parsed and config file should be read, AppInitParameterInteraction should have been called.
4949
*/

src/init/common.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#endif
88

99
#include <clientversion.h>
10-
#include <compat/sanity.h>
1110
#include <crypto/sha256.h>
1211
#include <fs.h>
1312
#include <key.h>
@@ -49,9 +48,6 @@ bool SanityChecks()
4948
return InitError(Untranslated("Elliptic curve cryptography sanity check failure. Aborting."));
5049
}
5150

52-
if (!glibcxx_sanity_test())
53-
return false;
54-
5551
if (!Random_SanityCheck()) {
5652
return InitError(Untranslated("OS cryptographic RNG sanity check failure. Aborting."));
5753
}

src/test/sanity_tests.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#include <compat/sanity.h>
65
#include <key.h>
76
#include <test/util/setup_common.h>
87
#include <util/time.h>
@@ -13,7 +12,6 @@ BOOST_FIXTURE_TEST_SUITE(sanity_tests, BasicTestingSetup)
1312

1413
BOOST_AUTO_TEST_CASE(basic_sanity)
1514
{
16-
BOOST_CHECK_MESSAGE(glibcxx_sanity_test() == true, "stdlib sanity test");
1715
BOOST_CHECK_MESSAGE(ECC_InitSanityCheck() == true, "secp256k1 sanity test");
1816
BOOST_CHECK_MESSAGE(ChronoSanityCheck() == true, "chrono epoch test");
1917
}

0 commit comments

Comments
 (0)