Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@
[submodule "external/gtest"]
path = external/gtest
url = https://github.com/google/googletest.git
[submodule "external/fcmp-plus-plus"]
path = external/fcmp-plus-plus
url = https://github.com/kayabaNerve/fcmp-plus-plus.git
[submodule "external/mx25519"]
path = external/mx25519
url = https://github.com/jeffro256/mx25519
branch = unclamped
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ if(NOT MANUAL_SUBMODULES)
check_submodule(external/rapidjson)
check_submodule(external/randomx)
check_submodule(external/supercop)
check_submodule(external/mx25519)
endif()
endif()

Expand Down Expand Up @@ -436,7 +437,7 @@ elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
set(BSDI TRUE)
endif()

include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include)
include_directories(external/rapidjson/include external/easylogging++ src contrib/epee/include external external/supercop/include external/mx25519/include)

if(MINGW)
set(DEFAULT_STATIC true)
Expand All @@ -463,6 +464,7 @@ set(PIC_FLAG "-fPIC")
if(STATIC)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DZMQ_STATIC")
add_definitions("-DMX25519_STATIC")
endif()

option(SANITIZE "Use ASAN memory sanitizer" OFF)
Expand Down Expand Up @@ -957,6 +959,9 @@ endif()
add_definitions(-DBOOST_ASIO_ENABLE_SEQUENTIAL_STRAND_ALLOCATION)
add_definitions(-DBOOST_NO_AUTO_PTR)
add_definitions(-DBOOST_UUID_DISABLE_ALIGNMENT) # This restores UUID's std::has_unique_object_representations property
# Boost has two conflicting save/load impls for `std::variant`, one in serialization/variant.hpp,
# and one in serialization/std_variant.hpp. This macro disables the one in variant.hpp.
add_definitions(-DBOOST_NO_CXX17_HDR_VARIANT)

include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
Expand Down
8 changes: 6 additions & 2 deletions contrib/epee/include/math_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
#pragma once

#include <cstdint> // uint64_t
#include <cstdlib> // NULL
#include <utility>

#ifdef _WIN32
#include <sysinfoapi.h> // GetSystemTimeAsFileTime
Expand All @@ -41,6 +43,7 @@ namespace math_helper
template<typename get_interval, bool start_immediate = true>
class once_a_time
{
get_interval m_get_interval;
uint64_t get_time() const
{
#ifdef _WIN32
Expand All @@ -61,11 +64,12 @@ namespace math_helper

void set_next_interval()
{
m_interval = get_interval()();
m_interval = m_get_interval();
}

public:
once_a_time()
once_a_time(get_interval gi = get_interval())
: m_get_interval(std::move(gi))
{
m_last_worked_time = 0;
if(!start_immediate)
Expand Down
1 change: 1 addition & 0 deletions contrib/epee/include/net/http_protocol_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include "net_utils_base.h"
#include "http_auth.h"
#include "http_base.h"
#include "syncobj.h"

#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "net.http"
Expand Down
6 changes: 4 additions & 2 deletions contrib/epee/include/net/levin_protocol_handler_async.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
#include "time_helper.h"
#include "int-util.h"

#include "cryptonote_basic/connection_context.h"

#include <random>
#include <chrono>

Expand Down Expand Up @@ -480,7 +482,7 @@ class async_protocol_handler

buff_to_invoke = {buff_to_invoke.data(), std::size_t(inner_size)};

const size_t max_bytes = m_connection_context.get_max_bytes(m_current_head.m_command);
const size_t max_bytes = cryptonote::get_command_max_bytes(m_current_head.m_command);
if(buff_to_invoke.size() > std::min<size_t>(max_packet_size, max_bytes))
{
MERROR(m_connection_context << "Maximum packet size exceed!, m_max_packet_size = " << std::min<size_t>(max_packet_size, max_bytes)
Expand Down Expand Up @@ -580,7 +582,7 @@ class async_protocol_handler
m_cache_in_buffer.erase(sizeof(bucket_head2));
m_state = stream_state_body;
m_oponent_protocol_ver = m_current_head.m_protocol_version;
const size_t max_bytes = m_connection_context.get_max_bytes(m_current_head.m_command);
const size_t max_bytes = cryptonote::get_command_max_bytes(m_current_head.m_command);
if(m_current_head.m_cb > std::min<size_t>(max_packet_size, max_bytes))
{
LOG_ERROR_CC(m_connection_context, "Maximum packet size exceed!, m_max_packet_size = " << std::min<size_t>(max_packet_size, max_bytes)
Expand Down
9 changes: 9 additions & 0 deletions contrib/epee/include/serialization/keyvalue_serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,22 @@ public: \
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, val_name) \
epee::serialization::selector<is_store>::serialize_stl_container_pod_val_as_blob(this_ref.varialble, stg, hparent_section, val_name);

#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_OPT_N(varialble, val_name, default_value) \
do { \
if (is_store && this_ref.varialble == default_value) \
break; \
if (!epee::serialization::selector<is_store>::serialize_stl_container_pod_val_as_blob(this_ref.varialble, stg, hparent_section, val_name)) \
epee::serialize_default(this_ref.varialble, default_value); \
} while (0);

#define END_KV_SERIALIZE_MAP() return true;}

#define KV_SERIALIZE(varialble) KV_SERIALIZE_N(varialble, #varialble)
#define KV_SERIALIZE_VAL_POD_AS_BLOB(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_VAL_POD_AS_BLOB_OPT(varialble, def) KV_SERIALIZE_VAL_POD_AS_BLOB_OPT_N(varialble, #varialble, def)
#define KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE(varialble) KV_SERIALIZE_VAL_POD_AS_BLOB_FORCE_N(varialble, #varialble) //skip is_trivially_copyable and is_standard_layout compile time check
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB(varialble) KV_SERIALIZE_CONTAINER_POD_AS_BLOB_N(varialble, #varialble)
#define KV_SERIALIZE_CONTAINER_POD_AS_BLOB_OPT(varialble, def) KV_SERIALIZE_CONTAINER_POD_AS_BLOB_OPT_N(varialble, #varialble, def)
#define KV_SERIALIZE_OPT(variable,default_value) KV_SERIALIZE_OPT_N(variable, #variable, default_value)

}
Expand Down
1 change: 1 addition & 0 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,4 @@ add_subdirectory(db_drivers)
add_subdirectory(easylogging++)
add_subdirectory(qrcodegen)
add_subdirectory(randomx EXCLUDE_FROM_ALL)
add_subdirectory(mx25519)
1 change: 1 addition & 0 deletions external/mx25519
Submodule mx25519 added at e808a6
3 changes: 3 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ endfunction ()
include(Version)
monero_add_library(version SOURCES ${CMAKE_BINARY_DIR}/version.cpp DEPENDS genversion)

add_subdirectory(carrot_core)
add_subdirectory(carrot_impl)
add_subdirectory(common)
add_subdirectory(crypto)
add_subdirectory(ringct)
add_subdirectory(checkpoints)
add_subdirectory(cryptonote_basic)
add_subdirectory(cryptonote_core)
add_subdirectory(fcmp_pp)
add_subdirectory(lmdb)
add_subdirectory(multisig)
add_subdirectory(net)
Expand Down
1 change: 1 addition & 0 deletions src/blockchain_db/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ target_link_libraries(blockchain_db
common
cncrypto
cryptonote_basic
fcmp_pp
ringct_basic
${LMDB_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
Expand Down
Loading
Loading