diff --git a/configure.ac b/configure.ac index 2e0c8bd1f..a7be75c61 100644 --- a/configure.ac +++ b/configure.ac @@ -644,6 +644,17 @@ AX_BOOST_PROGRAM_OPTIONS AX_BOOST_THREAD AX_BOOST_CHRONO +dnl Prevent use of std::unary_function, which was removed in C++17, +dnl and will generate warnings with newer compilers for Boost +dnl older than 1.80. +dnl See: https://github.com/boostorg/container_hash/issues/22, https://github.com/boostorg/config/pull/430. + +dnl _HAS_AUTO_PTR_ETC check required only for boost 1.72 and older, for 1.73+ we can use BOOST_NO_CXX98_FUNCTION_BASE +AX_CHECK_PREPROC_FLAG([-D_HAS_AUTO_PTR_ETC=0], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -D_HAS_AUTO_PTR_ETC=0"], [], [$CXXFLAG_WERROR], + [AC_LANG_PROGRAM([[#include ]])]) +AX_CHECK_PREPROC_FLAG([-DBOOST_NO_CXX98_FUNCTION_BASE], [BOOST_CPPFLAGS="$BOOST_CPPFLAGS -DBOOST_NO_CXX98_FUNCTION_BASE"], [], [$CXXFLAG_WERROR], + [AC_LANG_PROGRAM([[#include ]])]) + fi if test x$use_reduce_exports = xyes; then @@ -947,11 +958,12 @@ echo echo " target os = $TARGET_OS" echo " build os = $BUILD_OS" echo -echo " CC = $CC" -echo " CFLAGS = $CFLAGS" -echo " CPPFLAGS = $CPPFLAGS" -echo " CXX = $CXX" -echo " CXXFLAGS = $CXXFLAGS" -echo " LDFLAGS = $LDFLAGS" -echo " ARFLAGS = $ARFLAGS" +echo " CC = $CC" +echo " CFLAGS = $CFLAGS" +echo " CPPFLAGS = $CPPFLAGS" +echo " CXX = $CXX" +echo " CXXFLAGS = $CXXFLAGS" +echo " BOOST_CPPFLAGS = $BOOST_CPPFLAGS" +echo " LDFLAGS = $LDFLAGS" +echo " ARFLAGS = $ARFLAGS" echo diff --git a/contrib/hush_seed_nodes.txt b/contrib/hush_seed_nodes.txt index d176dc884..8edf78b70 100644 --- a/contrib/hush_seed_nodes.txt +++ b/contrib/hush_seed_nodes.txt @@ -12,9 +12,6 @@ 155.138.228.68 107.174.70.251 # hush_scanner uses nc which cannot deal with these -# 56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion -# hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion -# hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion # iljqq7nnmw2ij2ezl334cerwwmgzmmbmoc3n4saditd2xhi3xohq.b32.i2p # [2a0c:b641:6f1:34::2] # [2a0c:b641:6f1:c::2] @@ -28,8 +25,3 @@ node5.hush.is node6.hush.is node7.hush.is node8.hush.is -node1.hush.land -node2.hush.land -node3.hush.land -node4.hush.land -node5.hush.land diff --git a/contrib/seeds/nodes_main.txt b/contrib/seeds/nodes_main.txt index 1ad72eeec..c38b19acd 100644 --- a/contrib/seeds/nodes_main.txt +++ b/contrib/seeds/nodes_main.txt @@ -1,18 +1,15 @@ -# node1.hush.land +# node1.hush.is 103.69.128.148 -# node2.hush.land -194.29.100.208 +# node2.hush.is +194.29.100.179 -# node3.hush.land +# node3.hush.is 45.132.75.69 -# node4.hush.land +# node4.hush.is 170.205.39.39 -# node5.hush.land -178.250.189.141 - # lite.hushpool.is 149.28.102.219 @@ -23,9 +20,7 @@ 107.174.70.251 # torv3 -56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion -hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion -hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion +b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion # ipv6 2a0c:b641:6f1:18e::2 diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk index f7d34c253..ac9f5f74c 100644 --- a/depends/packages/boost.mk +++ b/depends/packages/boost.mk @@ -7,7 +7,7 @@ $(package)_sha256_hash=59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417c $(package)_download_path=https://git.hush.is/attachments $(package)_file_name=7b13759e-8623-4e48-ae08-f78502f4b6a5 $(package)_download_file=7b13759e-8623-4e48-ae08-f78502f4b6a5 -$(package)_patches=fix-Solaris.patch +$(package)_patches=fix-Solaris.patch ignore_wnonnull_gcc_11.patch range_enums_clang_16.patch define $(package)_set_vars $(package)_config_opts_release=variant=release @@ -32,7 +32,9 @@ endef define $(package)_preprocess_cmds echo "using $(boost_toolset_$(host_os)) : : $($(package)_cxx) : \"$($(package)_cxxflags) $($(package)_cppflags)\" \"$($(package)_ldflags)\" \"$(boost_archiver_$(host_os))\" \"$(host_STRIP)\" \"$(host_RANLIB)\" \"$(host_WINDRES)\" : ;" > user-config.jam&& \ - patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch + patch -p1 < $($(package)_patch_dir)/fix-Solaris.patch &&\ + patch -p2 < $($(package)_patch_dir)/ignore_wnonnull_gcc_11.patch &&\ + patch -p2 < $($(package)_patch_dir)/range_enums_clang_16.patch endef define $(package)_config_cmds diff --git a/depends/patches/boost/ignore_wnonnull_gcc_11.patch b/depends/patches/boost/ignore_wnonnull_gcc_11.patch new file mode 100644 index 000000000..f914c1e68 --- /dev/null +++ b/depends/patches/boost/ignore_wnonnull_gcc_11.patch @@ -0,0 +1,68 @@ +diff --git a/include/boost/concept/detail/general.hpp b/include/boost/concept/detail/general.hpp +index eeb08750..8d7d6f69 100644 +--- a/include/boost/concept/detail/general.hpp ++++ b/include/boost/concept/detail/general.hpp +@@ -28,7 +28,14 @@ namespace detail + template + struct requirement + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + struct failed {}; +@@ -36,7 +43,14 @@ struct failed {}; + template + struct requirement + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + # ifdef BOOST_OLD_CONCEPT_SUPPORT +@@ -44,7 +58,14 @@ struct requirement + template + struct constraint + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + static void failed() { ((Model*)0)->constraints(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + template +diff --git a/include/boost/concept/usage.hpp b/include/boost/concept/usage.hpp +index 373de63a..fe88b5f5 100644 +--- a/include/boost/concept/usage.hpp ++++ b/include/boost/concept/usage.hpp +@@ -13,7 +13,14 @@ namespace boost { namespace concepts { + template + struct usage_requirements + { ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic push ++# pragma GCC diagnostic ignored "-Wnonnull" ++# endif + ~usage_requirements() { ((Model*)0)->~Model(); } ++# if defined(BOOST_GCC) && (BOOST_GCC >= 110000) ++# pragma GCC diagnostic pop ++# endif + }; + + # if BOOST_WORKAROUND(__GNUC__, <= 3) diff --git a/depends/patches/boost/range_enums_clang_16.patch b/depends/patches/boost/range_enums_clang_16.patch new file mode 100644 index 000000000..3e049e261 --- /dev/null +++ b/depends/patches/boost/range_enums_clang_16.patch @@ -0,0 +1,75 @@ +diff --git a/include/boost/numeric/conversion/detail/int_float_mixture.hpp b/include/boost/numeric/conversion/detail/int_float_mixture.hpp +index 464e527..7690d07 100644 +--- a/include/boost/numeric/conversion/detail/int_float_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/int_float_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/int_float_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'IntFloatMixture' +- typedef mpl::integral_c int2int_c ; +- typedef mpl::integral_c int2float_c ; +- typedef mpl::integral_c float2int_c ; +- typedef mpl::integral_c float2float_c ; ++ typedef boost::integral_constant int2int_c ; ++ typedef boost::integral_constant int2float_c ; ++ typedef boost::integral_constant float2int_c ; ++ typedef boost::integral_constant float2float_c ; + + // Metafunction: + // +diff --git a/include/boost/numeric/conversion/detail/sign_mixture.hpp b/include/boost/numeric/conversion/detail/sign_mixture.hpp +index c7f9e42..fde1584 100644 +--- a/include/boost/numeric/conversion/detail/sign_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/sign_mixture.hpp +@@ -16,15 +16,15 @@ + #include "boost/numeric/conversion/sign_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'SignMixture' +- typedef mpl::integral_c unsig2unsig_c ; +- typedef mpl::integral_c sig2sig_c ; +- typedef mpl::integral_c sig2unsig_c ; +- typedef mpl::integral_c unsig2sig_c ; ++ typedef boost::integral_constant unsig2unsig_c ; ++ typedef boost::integral_constant sig2sig_c ; ++ typedef boost::integral_constant sig2unsig_c ; ++ typedef boost::integral_constant unsig2sig_c ; + + // Metafunction: + // +diff --git a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +index 36dbc49..a39d29f 100644 +--- a/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp ++++ b/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +@@ -15,15 +15,15 @@ + #include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" + #include "boost/numeric/conversion/detail/meta.hpp" + +-#include "boost/mpl/integral_c.hpp" ++#include "boost/type_traits/integral_constant.hpp" + + namespace boost { namespace numeric { namespace convdetail + { + // Integral Constants for 'UdtMixture' +- typedef mpl::integral_c builtin2builtin_c ; +- typedef mpl::integral_c builtin2udt_c ; +- typedef mpl::integral_c udt2builtin_c ; +- typedef mpl::integral_c udt2udt_c ; ++ typedef boost::integral_constant builtin2builtin_c ; ++ typedef boost::integral_constant builtin2udt_c ; ++ typedef boost::integral_constant udt2builtin_c ; ++ typedef boost::integral_constant udt2udt_c ; + + // Metafunction: + // diff --git a/src/cc/Makefile_custom b/src/cc/Makefile_custom index 3c71a60c0..9db01b106 100644 --- a/src/cc/Makefile_custom +++ b/src/cc/Makefile_custom @@ -4,7 +4,7 @@ CC_DARWIN = g++-8 CC_WIN = x86_64-w64-mingw32-gcc-posix CC_AARCH64 = aarch64-linux-gnu-g++ CFLAGS_DARWIN = -DBUILD_CUSTOMCC -std=c++11 -arch x86_64 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -Wl,-undefined -Wl,dynamic_lookup -Wno-write-strings -shared -dynamiclib -CFLAGS = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared +CFLAGS = -D_HAS_AUTO_PTR_ETC=0 -DBOOST_NO_CXX98_FUNCTION_BASE -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/$(shell echo `../..//depends/config.guess`/include) -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared CFLAGS_WIN = -Wno-write-strings -DBUILD_CUSTOMCC -std=c++11 -I../secp256k1/include -I../../depends/x86_64-w64-mingw32/include -I../univalue/include -I../leveldb/include -I.. -I. -fPIC -shared DEBUGFLAGS = -O0 -D _DEBUG RELEASEFLAGS = -O2 -D NDEBUG -combine -fwhole-program diff --git a/src/chainparamsseeds.h b/src/chainparamsseeds.h index 4f8bdd06b..41c5d285e 100644 --- a/src/chainparamsseeds.h +++ b/src/chainparamsseeds.h @@ -12,16 +12,13 @@ // static const uint8_t chainparams_seed_main[] = { 0x01,0x04,0x67,0x45,0x80,0x94,0x00,0x00, // 103.69.128.148 - 0x01,0x04,0xc2,0x1d,0x64,0xd0,0x00,0x00, // 194.29.100.208 + 0x01,0x04,0xc2,0x1d,0x64,0xb3,0x00,0x00, // 194.29.100.179 0x01,0x04,0x2d,0x84,0x4b,0x45,0x00,0x00, // 45.132.75.69 0x01,0x04,0xaa,0xcd,0x27,0x27,0x00,0x00, // 170.205.39.39 - 0x01,0x04,0xb2,0xfa,0xbd,0x8d,0x00,0x00, // 178.250.189.141 0x01,0x04,0x95,0x1c,0x66,0xdb,0x00,0x00, // 149.28.102.219 0x01,0x04,0x9b,0x8a,0xe4,0x44,0x00,0x00, // 155.138.228.68 0x01,0x04,0x6b,0xae,0x46,0xfb,0x00,0x00, // 107.174.70.251 - 0x04,0x20,0xef,0xad,0x0c,0x95,0x3e,0x61,0xee,0x69,0x57,0x67,0xdb,0x4f,0xb7,0x8d,0xc2,0x35,0x1c,0x6b,0x96,0xf4,0x1f,0x7a,0xb4,0x06,0x09,0x3a,0x64,0x33,0xf4,0x0b,0x2c,0x94,0x00,0x00, // 56wqzfj6mhxgsv3h3nh3pdocguogxfxud55libqjhjsdh5alfsko2iqd.onion - 0x04,0x20,0x3d,0x24,0x7a,0xec,0xfe,0x60,0x6e,0x3d,0x3d,0xf3,0x4f,0x35,0x12,0x29,0xdb,0x48,0x89,0x71,0x19,0xb9,0xee,0x6a,0xfd,0xb2,0x02,0xa7,0x99,0x89,0xbb,0x69,0x39,0xdb,0x00,0x00, // hushv3h6mbxd2pptj42reko3jcexcgnz5zvp3mqcu6myto3jhhn4yzyd.onion - 0x04,0x20,0x3d,0x24,0x7a,0xee,0xf5,0x39,0x20,0x7e,0x69,0x92,0xda,0xc7,0xa6,0x9f,0xbd,0xeb,0x29,0x21,0x20,0x93,0x52,0x03,0xf3,0x60,0x41,0xfc,0xb8,0xf9,0x06,0x29,0x96,0x24,0x00,0x00, // hushv3xvheqh42ms3ld2nh555muscietkib7gycb7s4psbrjsysfywqd.onion + 0x04,0x20,0x0e,0x86,0xb6,0xfd,0x96,0xfe,0x06,0xda,0x39,0xeb,0x97,0x39,0xc9,0xd1,0x17,0xa2,0x4e,0x2b,0x75,0x4d,0xeb,0xb5,0xa1,0x34,0x1e,0x34,0x0a,0xcb,0x68,0xab,0xf0,0xe2,0x00,0x00, // b2dln7mw7ydnuopls444tuixujhcw5kn5o22cna6gqfmw2fl6drb5nad.onion 0x02,0x10,0x2a,0x0c,0xb6,0x41,0x06,0xf1,0x01,0x8e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,0x00, // 2a0c:b641:6f1:18e::2 0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x03,0x12,0x69,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:3:1269::1 0x02,0x10,0x24,0x06,0xef,0x80,0x00,0x02,0x3b,0x59,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x00, // 2406:ef80:2:3b59::1 diff --git a/src/hush_utils.h b/src/hush_utils.h index 5f2760b5c..433d4a8dc 100644 --- a/src/hush_utils.h +++ b/src/hush_utils.h @@ -1805,9 +1805,7 @@ void hush_args(char *argv0) if (ishush3) { HUSH_nodes = {"node1.hush.is","node2.hush.is","node3.hush.is", "node4.hush.is","node5.hush.is","node6.hush.is", - "node7.hush.is","node8.hush.is","node1.hush.land", - "node2.hush.land","node3.hush.land","node4.hush.land", - "node5.hush.land","node6.hush.land","node7.hush.land"}; + "node7.hush.is","node8.hush.is"}; } if (isdragonx) { diff --git a/src/init.cpp b/src/init.cpp index b0c64fe05..9093a8e5e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -432,6 +432,8 @@ std::string HelpMessage(HelpMessageMode mode) strUsage += HelpMessageOpt("-disableipv4", _("Disable Ipv4 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV4)); strUsage += HelpMessageOpt("-disableipv6", _("Disable Ipv6 network connections") + " " + strprintf(_("(default: %u)"), DEFAULT_DISABLE_IPV6)); + strUsage += HelpMessageOpt("-clearnet", _("Enable clearnet connections. Setting to 0 will disable clearnet and use sane defaults for Tor/i2p") + " " + strprintf(_("(default: %u)"), DEFAULT_CLEARNET)); + strUsage += HelpMessageOpt("-permitbaremultisig", strprintf(_("Relay non-P2SH multisig (default: %u)"), 1)); strUsage += HelpMessageOpt("-peerbloomfilters", strprintf(_("Support filtering of blocks and transaction with Bloom filters (default: %u)"), 1)); if (showDebug) @@ -1643,6 +1645,19 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) } //fprintf(stderr,"%s tik18\n", __FUNCTION__); + // Disable clearnet peers if -clearnet=0 + if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) { + SoftSetBoolArg("-disableipv4", true); + SoftSetBoolArg("-disableipv6", true); + SoftSetBoolArg("-dns", false); + SoftSetBoolArg("-dnsseed", false); + SoftSetArg("-bind", "127.0.0.1"); + SoftSetArg("-onlynet", "onion"); + SoftSetArg("-onlynet", "i2p"); + SoftSetArg("-onion", "127.0.0.1:9050"); + SoftSetArg("-i2psam", "127.0.0.1:7656"); + } + if (mapArgs.count("-onlynet")) { std::set nets; BOOST_FOREACH(const std::string& snet, mapMultiArgs["-onlynet"]) { diff --git a/src/net.cpp b/src/net.cpp index 168f2b169..b786938bd 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1652,6 +1652,11 @@ int64_t PoissonNextSend(int64_t now, int average_interval_seconds) } void ASMapHealthCheck() { + // No health check if clearnet is disabled + if (!GetBoolArg("-clearnet", DEFAULT_CLEARNET)) { + return; + } + std::set clearnet_asns{}; int unmapped_count{0}; LOCK(cs_vNodes); diff --git a/src/net.h b/src/net.h index 8684b3419..937f07ef1 100644 --- a/src/net.h +++ b/src/net.h @@ -86,6 +86,9 @@ static const unsigned int MAX_SUBVERSION_LENGTH = 256; /** -listen default */ static const bool DEFAULT_LISTEN = true; +/** -clearnet default */ +static const bool DEFAULT_CLEARNET = true; + /** -disableipv4 default */ static const bool DEFAULT_DISABLE_IPV4 = false; /** -disableipv6 default */ diff --git a/src/util.cpp b/src/util.cpp index 20bf79858..45f105a89 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,6 +1,6 @@ // Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2014 The Bitcoin Core developers -// Copyright (c) 2016-2024 The Hush developers +// Copyright (c) 2016-2025 The Hush developers // Distributed under the GPLv3 software license, see the accompanying // file COPYING or https://www.gnu.org/licenses/gpl-3.0.en.html @@ -438,6 +438,7 @@ bool SoftSetArg(const std::string& strArg, const std::string& strValue) if (mapArgs.count(strArg)) return false; mapArgs[strArg] = strValue; + mapMultiArgs[strArg].push_back(strValue); return true; }