Skip to content

Commit e386136

Browse files
authored
Merge pull request #174 from Beldex-Coin/dev
merge from dev
2 parents 51172d0 + 817556e commit e386136

File tree

312 files changed

+17415
-13571
lines changed

Some content is hidden

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

312 files changed

+17415
-13571
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,6 @@ __pycache__/
116116

117117
# brew build lock file
118118
contrib/brew/Brewfile.lock.json
119+
120+
*.pyc
121+
*.log

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,12 @@
3131
[submodule "external/oxen-encoding"]
3232
path = external/oxen-encoding
3333
url = https://github.com/oxen-io/oxen-encoding.git
34+
[submodule "external/nlohmann-json"]
35+
path = external/nlohmann-json
36+
url = https://github.com/nlohmann/json.git
37+
[submodule "external/date"]
38+
path = external/date
39+
url = https://github.com/HowardHinnant/date.git
40+
[submodule "external/Catch2"]
41+
path = external/Catch2
42+
url = https://github.com/catchorg/Catch2

.vscode/settings.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@
7272
"thread": "cpp",
7373
"typeindex": "cpp",
7474
"typeinfo": "cpp",
75-
"valarray": "cpp"
75+
"valarray": "cpp",
76+
"__bit_reference": "cpp",
77+
"__hash_table": "cpp",
78+
"__locale": "cpp",
79+
"__node_handle": "cpp",
80+
"__split_buffer": "cpp",
81+
"__threading_support": "cpp",
82+
"__tree": "cpp",
83+
"__verbose_abort": "cpp",
84+
"execution": "cpp",
85+
"ios": "cpp",
86+
"locale": "cpp",
87+
"print": "cpp",
88+
"queue": "cpp",
89+
"stack": "cpp"
7690
}
7791
}

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ cmake_minimum_required(VERSION 3.10)
4848
message(STATUS "CMake version ${CMAKE_VERSION}")
4949

5050
# Has to be set before `project()`, and ignored on non-macos:
51-
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")
51+
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15 CACHE STRING "macOS deployment target (Apple clang only)")
5252

5353
project(beldex
54-
VERSION 6.0.0
54+
VERSION 7.0.0
5555
LANGUAGES CXX C)
56-
set(BELDEX_RELEASE_CODENAME "Hermes")
56+
set(BELDEX_RELEASE_CODENAME "Obscura")
5757

5858
# String value to append to the full version string; this is intended to easily identify whether a
5959
# binary was build from the release or development branches. This should be permanently set to an
@@ -290,6 +290,7 @@ if(NOT MANUAL_SUBMODULES)
290290
check_submodule(external/loki-mq cppzmq)
291291
if(BUILD_TESTS)
292292
check_submodule(external/googletest)
293+
check_submodule(external/Catch2)
293294
endif()
294295
check_submodule(external/uWebSockets uSockets)
295296
check_submodule(external/ghc-filesystem)
@@ -535,7 +536,7 @@ else()
535536
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAG}")
536537
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAG}")
537538

538-
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=uninitialized")
539+
set(WARNINGS "-Wall -Wextra -Wpointer-arith -Wwrite-strings -Wno-error=extra -Wno-error=deprecated-declarations -Wno-unused-parameter -Wno-unused-variable -Wno-error=unused-variable -Wno-error=uninitialized -Wno-error=attributes -Wno-error=unused-but-set-variable")
539540

540541
option(WARNINGS_AS_ERRORS "Enable warning as errors" OFF)
541542
if(NOT MINGW AND WARNINGS_AS_ERRORS)
@@ -571,7 +572,6 @@ else()
571572

572573
# if those don't work for your compiler, single it out where appropriate
573574
if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT OPENBSD)
574-
set(C_SECURITY_FLAGS "${C_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
575575
set(C_SECURITY_FLAGS "${C_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
576576
set(CXX_SECURITY_FLAGS "${CXX_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
577577
endif()
@@ -606,6 +606,12 @@ else()
606606
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
607607
endif()
608608

609+
# GCC 12's stringop-overflow warnings are really broken, with tons and tons of false positives all
610+
# over the place (not just in our code, but also in its own stdlibc++ code).
611+
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 12)
612+
set(CXX_WARNINGS "${CXX_WARNINGS} -Wno-stringop-overflow")
613+
endif()
614+
609615
# Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
610616
if (NOT CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1)
611617
add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
@@ -857,7 +863,7 @@ if(BUILD_STATIC_DEPS)
857863
# sqlite3 target already set up
858864
else()
859865
add_library(sqlite3 INTERFACE)
860-
pkg_check_modules(SQLITE3 REQUIRED sqlite3 IMPORTED_TARGET)
866+
pkg_check_modules(SQLITE3 REQUIRED sqlite3>=3.24.0 IMPORTED_TARGET)
861867
message(STATUS "Found sqlite3 ${SQLITE3_VERSION}")
862868
target_link_libraries(sqlite3 INTERFACE PkgConfig::SQLITE3)
863869
endif()

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,19 +97,19 @@ release: cmake-release
9797
9898
release-test:
9999
mkdir -p $(builddir)/release
100-
cd $(builddir)/release && cmake -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE) && $(MAKE) test
100+
cd $(builddir)/release && cmake -D BUILD_TESTS=ON -D USE_LTO=OFF -D RANDOMX_ENABLE_JIT=OFF -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE) && $(MAKE) test
101101
102102
release-all:
103103
mkdir -p $(builddir)/release
104-
cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
104+
cd $(builddir)/release && cmake -D BUILD_TESTS=OFF -DUSE_LTO=OFF -DRANDOMX_ENABLE_JIT=OFF -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
105105
106106
release-static:
107107
mkdir -p $(builddir)/release
108108
cd $(builddir)/release && cmake -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
109109
110110
release-full-static:
111111
mkdir -p $(builddir)/release-static
112-
cd $(builddir)/release-static && cmake -DBUILD_STATIC_DEPS=ON -DCMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
112+
cd $(builddir)/release-static && cmake -DBUILD_STATIC_DEPS=ON -DUSE_LTO=OFF -DRANDOMX_ENABLE_JIT=OFF -DCMAKE_BUILD_TYPE=Release $(topdir) && $(MAKE)
113113
114114
release-full-static-archive: release-full-static
115115
cd $(builddir)/release-static && $(MAKE) strip_binaries && $(MAKE) create_archive

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ library archives (`.a`).
4545
| pkg-config | any | NO | `pkg-config` | `base-devel` | `pkgconf` | NO | |
4646
| Boost | 1.65 | NO | `libboost-all-dev`[2] | `boost` | `boost-devel` | NO | C++ libraries |
4747
| libzmq | 4.3.0 | YES | `libzmq3-dev` | `zeromq` | `zeromq-devel` | NO | ZeroMQ library |
48-
| sqlite3 | ? | YES | `libsqlite3-dev` | `sqlite` | `sqlite-devel` | NO | Beldex Name System |
48+
| sqlite3 | 3.24.0 | YES | `libsqlite3-dev` | `sqlite` | `sqlite-devel` | NO | Beldex Name System |
4949
| libsodium | 1.0.9 | YES | `libsodium-dev` | `libsodium` | `libsodium-devel` | NO | cryptography |
5050
| libcurl | 4.0 | NO | `curl` | `curl-devel` | NO | HTTP | RPC |
5151
| libuv (Win) | any | NO | (Windows only) | -- | -- | NO | RPC event loop |
@@ -413,7 +413,7 @@ See [README.i18n.md](README.i18n.md).
413413
> feature allows connecting over IPv4 and Tor simulatenously - IPv4 is used for
414414
> relaying blocks and relaying transactions received by peers whereas Tor is
415415
> used solely for relaying transactions received over local RPC. This provides
416-
> privacy and better protection against surrounding node (sybil) attacks.
416+
> confidential transactions and better protection against surrounding node (sybil) attacks.
417417
418418
While Beldex isn't made to integrate with Tor, it can be used wrapped with torsocks, by
419419
setting the following configuration parameters and environment variables:

cmake/StaticBuild.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set(LOCAL_MIRROR "" CACHE STRING "local mirror path/URL for lib downloads")
77

88
set(BOOST_VERSION 1.83.0 CACHE STRING "boost version")
9-
set(BOOST_MIRROR ${LOCAL_MIRROR} https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source
9+
set(BOOST_MIRROR ${LOCAL_MIRROR} https://archives.boost.io/release/${BOOST_VERSION}/source
1010
CACHE STRING "boost download mirror(s)")
1111
string(REPLACE "." "_" BOOST_VERSION_ ${BOOST_VERSION})
1212
set(BOOST_SOURCE boost_${BOOST_VERSION_}.tar.bz2)
@@ -79,11 +79,11 @@ set(ZMQ_SOURCE zeromq-${ZMQ_VERSION}.tar.gz)
7979
set(ZMQ_HASH SHA512=e198ef9f82d392754caadd547537666d4fba0afd7d027749b3adae450516bcf284d241d4616cad3cb4ad9af8c10373d456de92dc6d115b037941659f141e7c0e
8080
CACHE STRING "libzmq source hash")
8181

82-
set(ZLIB_VERSION 1.2.11 CACHE STRING "zlib version")
83-
set(ZLIB_MIRROR ${LOCAL_MIRROR} https://zlib.net/fossils
82+
set(ZLIB_VERSION 1.3.1 CACHE STRING "zlib version")
83+
set(ZLIB_MIRROR ${LOCAL_MIRROR} https://github.com/madler/zlib/releases/download/v${ZLIB_VERSION}
8484
CACHE STRING "zlib mirror(s)")
85-
set(ZLIB_SOURCE zlib-${ZLIB_VERSION}.tar.gz)
86-
set(ZLIB_HASH SHA512=73fd3fff4adeccd4894084c15ddac89890cd10ef105dd5e1835e1e9bbb6a49ff229713bd197d203edfa17c2727700fce65a2a235f07568212d820dca88b528ae
85+
set(ZLIB_SOURCE zlib-${ZLIB_VERSION}.tar.xz)
86+
set(ZLIB_HASH SHA256=38ef96b8dfe510d42707d9c781877914792541133e1870841463bfa73f883e32
8787
CACHE STRING "zlib source hash")
8888

8989
set(CURL_VERSION 7.76.1 CACHE STRING "curl version")

contrib/epee/include/epee/console_handler.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ namespace epee
194194
if (m_read_status == state_cancelled)
195195
return false;
196196

197-
int retval = ::WaitForSingleObject(::GetStdHandle(STD_INPUT_HANDLE), 100);
197+
auto retval = ::WaitForSingleObject(::GetStdHandle(STD_INPUT_HANDLE), 100);
198198
switch (retval)
199199
{
200200
case WAIT_FAILED:
@@ -529,8 +529,7 @@ namespace epee
529529
catch (const std::exception &e)
530530
{
531531
rdln::suspend_readline pause_readline;
532-
std::cout << "Command errored: " << cmd.front() << ", " << e.what();
533-
}
532+
std::cout << "Command errored: " << cmd.front() << ", " << e.what() << "\n"; }
534533

535534
return false;
536535
}

contrib/epee/include/epee/misc_os_dependent.h

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

contrib/epee/include/epee/net/abstract_tcp_server2.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ namespace net_utils
302302
{
303303
auto ptr = std::make_shared<idle_callback_conext<t_handler>>(io_service_, std::move(callback), timeout);
304304
//needed call handler here ?...
305-
ptr->m_timer.expires_from_now(ptr->m_period);
305+
ptr->m_timer.expires_after(ptr->m_period);
306306
ptr->m_timer.async_wait([this, ptr] (const boost::system::error_code&) { global_timer_handler<t_handler>(ptr); });
307307
return true;
308308
}
@@ -313,14 +313,14 @@ namespace net_utils
313313
//if handler return false - he don't want to be called anymore
314314
if(!ptr->call_handler())
315315
return;
316-
ptr->m_timer.expires_from_now(ptr->m_period);
316+
ptr->m_timer.expires_after(ptr->m_period);
317317
ptr->m_timer.async_wait([this, ptr] (const boost::system::error_code&) { global_timer_handler<t_handler>(ptr); });
318318
}
319319

320320
template<class t_handler>
321321
bool async_call(t_handler t_callback)
322322
{
323-
io_service_.post(std::move(t_callback));
323+
boost::asio::post(io_service_, std::move(t_callback));
324324
return true;
325325
}
326326

@@ -340,11 +340,11 @@ namespace net_utils
340340
struct worker
341341
{
342342
worker()
343-
: io_service(), work(io_service)
343+
: io_service(), work(io_service.get_executor())
344344
{}
345345

346346
boost::asio::io_service io_service;
347-
boost::asio::io_service::work work;
347+
boost::asio::executor_work_guard<decltype(io_service.get_executor())> work;
348348
};
349349
std::unique_ptr<worker> m_io_service_local_instance;
350350
boost::asio::io_service& io_service_;

0 commit comments

Comments
 (0)