Skip to content

Commit

Permalink
Merge pull request #155 from Beldex-Coin/dev
Browse files Browse the repository at this point in the history
Merge from dev for HF-19 release
  • Loading branch information
sanada08 authored Aug 19, 2024
2 parents d98daf6 + e176264 commit cd985ab
Show file tree
Hide file tree
Showing 39 changed files with 646 additions and 232 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ message(STATUS "CMake version ${CMAKE_VERSION}")
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")

project(beldex
VERSION 5.0.2
VERSION 6.0.0
LANGUAGES CXX C)
set(BELDEX_RELEASE_CODENAME "Bern")
set(BELDEX_RELEASE_CODENAME "Hermes")

# String value to append to the full version string; this is intended to easily identify whether a
# binary was build from the release or development branches. This should be permanently set to an
Expand Down Expand Up @@ -427,7 +427,7 @@ set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)

if (APPLE AND NOT IOS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=x86-64 -fvisibility=default")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION -fvisibility=default")
endif()

add_definition_if_library_exists(c memset_s "string.h" HAVE_MEMSET_S)
Expand Down
4 changes: 2 additions & 2 deletions cmake/StaticBuild.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

set(LOCAL_MIRROR "" CACHE STRING "local mirror path/URL for lib downloads")

set(BOOST_VERSION 1.76.0 CACHE STRING "boost version")
set(BOOST_VERSION 1.83.0 CACHE STRING "boost version")
set(BOOST_MIRROR ${LOCAL_MIRROR} https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source
CACHE STRING "boost download mirror(s)")
string(REPLACE "." "_" BOOST_VERSION_ ${BOOST_VERSION})
set(BOOST_SOURCE boost_${BOOST_VERSION_}.tar.bz2)
set(BOOST_HASH SHA256=f0397ba6e982c4450f27bf32a2a83292aba035b827a5623a14636ea583318c41
set(BOOST_HASH SHA256=6478edfe2f3305127cffe8caf73ea0176c53769f4bf1585be237eb30798c3b8e
CACHE STRING "boost source hash")

set(NCURSES_VERSION 6.2 CACHE STRING "ncurses version")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "../pragma_comp_defs.h"
#include "portable_storage_base.h"
#include <boost/endian/conversion.hpp>
#include <oxenmq/variant.h>
#include <oxenc/variant.h>

namespace epee
{
Expand Down
2 changes: 1 addition & 1 deletion contrib/epee/src/portable_storage.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "epee/storages/portable_storage_to_json.h"
#include "epee/storages/portable_storage.h"
#include <oxenmq/variant.h>
#include <oxenc/variant.h>

namespace epee {
namespace serialization {
Expand Down
2 changes: 1 addition & 1 deletion external/loki-mq
2 changes: 1 addition & 1 deletion external/oxen-encoding
1 change: 1 addition & 0 deletions src/beldex_economy.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enum struct mapping_type : uint16_t
belnet_2years,
belnet_5years,
belnet_10years,
eth_addr,
_count,
update_record_internal,
};
Expand Down
2 changes: 1 addition & 1 deletion src/common/meta.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once
#include <string>
#include <oxenmq/variant.h>
#include <oxenc/variant.h>
#include <array>
#include <typeinfo>
#ifdef __GNUG__
Expand Down
2 changes: 2 additions & 0 deletions src/cryptonote_basic/hardfork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static constexpr std::array mainnet_hard_forks =
hard_fork{15, 0, 742420, 1636320320 }, //Friday, December 10, 2021 6:00:00 PM (GMT)
hard_fork{17, 0, 742421, 1636320540 },
hard_fork{18, 0, 2986890, 1706506200 }, // Monday, January 29, 2024 5:30:00 AM (UTC)
hard_fork{19, 0, 3546545, 1725514200 }, // Thursday, September 5, 2024 5:30:00 AM (UTC)
};

static constexpr std::array testnet_hard_forks =
Expand All @@ -56,6 +57,7 @@ static constexpr std::array testnet_hard_forks =
hard_fork{15, 0, 169950, 1636391396 }, // Monday, November 8, 2021 5:09:56 PM
hard_fork{17, 0, 169960, 1636391696 }, // Monday, November 8, 2021 5:14:56 PM
hard_fork{18, 0, 1251330, 1701063000 }, // Monday, November 27, 2023 5:30:00 AM
hard_fork{19, 0, 1997558, 1723447800 }, // Monday, Aug 12, 2024 7:30:00 AM
};

static constexpr std::array devnet_hard_forks =
Expand Down
16 changes: 16 additions & 0 deletions src/cryptonote_basic/tx_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ tx_extra_beldex_name_system tx_extra_beldex_name_system::make_buy(
const std::string& encrypted_bchat_value,
const std::string& encrypted_wallet_value,
const std::string& encrypted_belnet_value,
const std::string& encrypted_eth_addr_value,
const crypto::hash& prev_txid)
{
tx_extra_beldex_name_system result{};
Expand Down Expand Up @@ -43,6 +44,12 @@ tx_extra_beldex_name_system tx_extra_beldex_name_system::make_buy(
result.encrypted_belnet_value = encrypted_belnet_value;
}

if (encrypted_eth_addr_value.size())
{
result.fields |= bns::extra_field::encrypted_eth_addr_value;
result.encrypted_eth_addr_value = encrypted_eth_addr_value;
}

result.prev_txid = prev_txid;
return result;
}
Expand Down Expand Up @@ -71,6 +78,7 @@ tx_extra_beldex_name_system tx_extra_beldex_name_system::make_update(
std::string_view encrypted_bchat_value,
std::string_view encrypted_wallet_value,
std::string_view encrypted_belnet_value,
std::string_view encrypted_eth_addr_value,
const bns::generic_owner* owner,
const bns::generic_owner* backup_owner,
const crypto::hash& prev_txid)
Expand Down Expand Up @@ -98,6 +106,12 @@ tx_extra_beldex_name_system tx_extra_beldex_name_system::make_update(
result.fields |= bns::extra_field::encrypted_belnet_value;
result.encrypted_belnet_value = std::string{encrypted_belnet_value};
}

if (encrypted_eth_addr_value.size())
{
result.fields |= bns::extra_field::encrypted_eth_addr_value;
result.encrypted_eth_addr_value = std::string{encrypted_eth_addr_value};
}

if (owner)
{
Expand All @@ -124,6 +138,7 @@ std::vector<std::string> readable_reasons(uint16_t decomm_reason) {
if (decomm_reason & timestamp_response_unreachable) results.push_back("Unreachable for Timestamp Check");
if (decomm_reason & timesync_status_out_of_sync) results.push_back("Time out of sync");
if (decomm_reason & belnet_unreachable) results.push_back("Belnet Unreachable");
if (decomm_reason & multi_mn_accept_range_not_met) results.push_back("Multi MN accept Range Not Met");
return results;
}

Expand All @@ -136,6 +151,7 @@ std::vector<std::string> coded_reasons(uint16_t decomm_reason) {
if (decomm_reason & timestamp_response_unreachable) results.push_back("timecheck");
if (decomm_reason & timesync_status_out_of_sync) results.push_back("timesync");
if (decomm_reason & belnet_unreachable) results.push_back("belnet");
if (decomm_reason & multi_mn_accept_range_not_met) results.push_back("multi_mn_range");
return results;
}

Expand Down
10 changes: 8 additions & 2 deletions src/cryptonote_basic/tx_extra.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ enum struct extra_field : uint8_t
encrypted_bchat_value = 1 << 3,
encrypted_wallet_value = 1 << 4,
encrypted_belnet_value = 1 << 5,
encrypted_eth_addr_value = 1 << 6,

// Bit Masks
updatable_fields = (extra_field::owner | extra_field::backup_owner | extra_field::encrypted_bchat_value | extra_field::encrypted_wallet_value | extra_field::encrypted_belnet_value),
updatable_fields = (extra_field::owner | extra_field::backup_owner | extra_field::encrypted_bchat_value | extra_field::encrypted_wallet_value | extra_field::encrypted_belnet_value | extra_field::encrypted_eth_addr_value),
buy_no_backup = (extra_field::owner),
buy_any_value = (extra_field::encrypted_bchat_value | extra_field::encrypted_wallet_value | extra_field::encrypted_belnet_value),
buy_any_value = (extra_field::encrypted_bchat_value | extra_field::encrypted_wallet_value | extra_field::encrypted_belnet_value | extra_field::encrypted_eth_addr_value),
buy = (extra_field::buy_no_backup | extra_field::backup_owner),
all = (extra_field::updatable_fields | extra_field::signature),
};
Expand Down Expand Up @@ -435,6 +436,7 @@ namespace cryptonote
timestamp_response_unreachable = 1 << 4,
timesync_status_out_of_sync = 1 << 5,
belnet_unreachable = 1 << 6,
multi_mn_accept_range_not_met = 1 << 7,
};

// Returns human-readable reason strings (e.g. "Missed Uptime Proofs") for the given reason bits
Expand Down Expand Up @@ -557,6 +559,7 @@ namespace cryptonote
std::string encrypted_bchat_value; // binary format of the name->bchat_value mapping
std::string encrypted_wallet_value; // binary format of the name->wallet_value mapping
std::string encrypted_belnet_value; // binary format of the name->belnet_value mapping
std::string encrypted_eth_addr_value; // binary format of the name->eth_addr_value mapping

bool field_is_set (bns::extra_field bit) const { return (fields & bit) == bit; }
bool field_any_set(bns::extra_field bit) const { return (fields & bit) != bns::extra_field::none; }
Expand All @@ -577,6 +580,7 @@ namespace cryptonote
const std::string& encrypted_bchat_value,
const std::string& encrypted_wallet_value,
const std::string& encrypted_belnet_value,
const std::string& encrypted_eth_addr_value,
const crypto::hash& prev_txid);

static tx_extra_beldex_name_system make_renew(
Expand All @@ -591,6 +595,7 @@ namespace cryptonote
std::string_view encrypted_bchat_value,
std::string_view encrypted_wallet_value,
std::string_view encrypted_belnet_value,
std::string_view encrypted_eth_addr_value,
const bns::generic_owner* owner,
const bns::generic_owner* backup_owner,
const crypto::hash& prev_txid);
Expand All @@ -610,6 +615,7 @@ namespace cryptonote
if (field_is_set(bns::extra_field::encrypted_bchat_value)) FIELD(encrypted_bchat_value);
if (field_is_set(bns::extra_field::encrypted_wallet_value)) FIELD(encrypted_wallet_value);
if (field_is_set(bns::extra_field::encrypted_belnet_value)) FIELD(encrypted_belnet_value);
if (field_is_set(bns::extra_field::encrypted_eth_addr_value)) FIELD(encrypted_eth_addr_value);
END_SERIALIZE()
};

Expand Down
Loading

0 comments on commit cd985ab

Please sign in to comment.