From 189191e6e5f2880d89d0e3e713296263a9fa73a2 Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 22 Nov 2021 20:44:31 +0300 Subject: [PATCH 1/2] stratum: support 128-bit rate in eth_submitHashrate callback --- src/stratum/stratum_server.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/stratum/stratum_server.cpp b/src/stratum/stratum_server.cpp index 2b454c47..5e239baa 100644 --- a/src/stratum/stratum_server.cpp +++ b/src/stratum/stratum_server.cpp @@ -951,13 +951,14 @@ namespace bool r = params_array != nullptr && ps.get_next_value(params_array, rate_submit_id_str); CHECK_AND_ASSERT_MES(r, false, "Incorrect parameters"); - uint64_t rate = 0; - CHECK_AND_ASSERT_MES(pod_from_net_format_reverse(rate_str, rate, true), false, "Can't parse rate from " << rate_str); + struct { uint64_t low, high; } rate_128 = { 0 }; + CHECK_AND_ASSERT_MES(pod_from_net_format_reverse(rate_str, rate_128, true), false, "Can't parse rate from " << rate_str); + CHECK_AND_ASSERT_MES(rate_128.high == 0, false, "rate overflow, rate str: " << rate_str); crypto::hash rate_submit_id = null_hash; CHECK_AND_ASSERT_MES(pod_from_net_format(rate_submit_id_str, rate_submit_id), false, "Can't parse rate_submit_id from " << rate_submit_id_str); - m_last_reported_hashrate = rate; - return m_config.handle_submit_hashrate(this, rate, rate_submit_id); + m_last_reported_hashrate = rate_128.low; + return m_config.handle_submit_hashrate(this, rate_128.low, rate_submit_id); } bool handle_method_eth_submitWork(const jsonrpc_id_t& id, epee::serialization::portable_storage& ps, epee::serialization::portable_storage::hsection params_section) @@ -1123,7 +1124,7 @@ void stratum_server::init_options(boost::program_options::options_description& d command_line::add_arg(desc, arg_stratum_block_template_update_period); command_line::add_arg(desc, arg_stratum_hr_print_interval); command_line::add_arg(desc, arg_stratum_always_online); - + } //------------------------------------------------------------------------------------------------------------------------------ bool stratum_server::should_start(const boost::program_options::variables_map& vm) From 42335023a97d98b47f231750909a9d5c312d0edd Mon Sep 17 00:00:00 2001 From: sowle Date: Mon, 22 Nov 2021 22:57:25 +0300 Subject: [PATCH 2/2] === version bump: 1.3.1.134 -> 1.3.2.135 === --- src/version.h.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/version.h.in b/src/version.h.in index fec98663..2f4959ae 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -5,9 +5,9 @@ #define PROJECT_MAJOR_VERSION "1" #define PROJECT_MINOR_VERSION "3" -#define PROJECT_REVISION "1" +#define PROJECT_REVISION "2" #define PROJECT_VERSION PROJECT_MAJOR_VERSION "." PROJECT_MINOR_VERSION "." PROJECT_REVISION -#define PROJECT_VERSION_BUILD_NO 134 +#define PROJECT_VERSION_BUILD_NO 135 #define PROJECT_VERSION_BUILD_NO_STR STRINGIFY_EXPAND(PROJECT_VERSION_BUILD_NO) #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO_STR "[" BUILD_COMMIT_ID "]"