diff --git a/contrib/ethereum/libethash/progpow.cpp b/contrib/ethereum/libethash/progpow.cpp index a7b85c0e..d74c8747 100644 --- a/contrib/ethereum/libethash/progpow.cpp +++ b/contrib/ethereum/libethash/progpow.cpp @@ -116,27 +116,27 @@ inline uint32_t random_math(uint32_t a, uint32_t b, uint32_t selector) noexcept switch (selector % 11) { default: - case 0: - return a * b; - case 1: - return a + b; case 2: - return mul_hi32(a, b); + return a + b; case 3: - return std::min(a, b); + return a * b; case 4: - return rotl32(a, b); + return mul_hi32(a, b); case 5: - return rotr32(a, b); + return std::min(a, b); case 6: - return a & b; + return rotl32(a, b); case 7: - return a | b; + return rotr32(a, b); case 8: - return a ^ b; + return a & b; case 9: - return clz32(a) + clz32(b); + return a | b; case 10: + return a ^ b; + case 0: + return clz32(a) + clz32(b); + case 1: return popcount32(a) + popcount32(b); } } diff --git a/src/currency_core/currency_config.h b/src/currency_core/currency_config.h index c89174df..54584187 100644 --- a/src/currency_core/currency_config.h +++ b/src/currency_core/currency_config.h @@ -7,7 +7,7 @@ #pragma once -#define CURRENCY_FORMATION_VERSION 79 +#define CURRENCY_FORMATION_VERSION 80 #define CURRENCY_MAX_BLOCK_NUMBER 500000000 @@ -53,7 +53,7 @@ // #define CURRENCY_FIXED_REWARD_ZONE_REWARD_AMOUNT ((uint64_t)100000000) // should be TX_MINIMUM_FEE * CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER // #define CURRENCY_FIXED_REWARD_ZONE_FEE_MULTIPLIER 1000 // reward in minimum fees for a block in the zone -#define CURRENCY_TESTNET_CONST_REWARD 100000000000000 +#define CURRENCY_BLOCK_REWARD 1000000000000 // 1.0 coin #define WALLET_MAX_ALLOWED_OUTPUT_AMOUNT ((uint64_t)0xffffffffffffffffLL) diff --git a/src/currency_core/currency_format_utils.cpp b/src/currency_core/currency_format_utils.cpp index e50b7277..57b9a8d2 100644 --- a/src/currency_core/currency_format_utils.cpp +++ b/src/currency_core/currency_format_utils.cpp @@ -2377,7 +2377,7 @@ namespace currency if (!height) return PREMINE_AMOUNT; - return CURRENCY_TESTNET_CONST_REWARD; + return CURRENCY_BLOCK_REWARD; } //----------------------------------------------------------------------------------------------- bool get_block_reward(bool is_pos, size_t median_size, size_t current_block_size, const boost::multiprecision::uint128_t& already_generated_coins, uint64_t &reward, uint64_t height) diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 70e2436e..d28de566 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -804,7 +804,7 @@ namespace currency LOG_ERROR("Failed to create block template"); return false; } - res.difficulty = dt.convert_to(); + res.difficulty = dt.convert_to(); blobdata block_blob = t_serializable_object_to_blob(b); res.blocktemplate_blob = string_tools::buff_to_hex_nodelimer(block_blob); @@ -1112,7 +1112,7 @@ namespace currency set_session_blob(job_id, b); job.blob = string_tools::buff_to_hex_nodelimer(currency::get_block_hashing_blob(b)); //TODO: set up share difficulty here! - job.difficulty = std::to_string(bt_res.difficulty); //difficulty leaved as string field since it will be refactored into 128 bit format + job.difficulty = bt_res.difficulty; //difficulty leaved as string field since it will be refactored into 128 bit format job.job_id = "SOME_JOB_ID"; get_current_hi(job.prev_hi); return true; diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index 6c3959d8..fe143042 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -791,7 +791,7 @@ namespace currency struct response { - uint64_t difficulty; + std::string difficulty; uint64_t height; crypto::hash seed; blobdata blocktemplate_blob; diff --git a/src/version.h.in b/src/version.h.in index 3678d223..7af90388 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -2,6 +2,6 @@ #define BUILD_COMMIT_ID "@VERSION@" #define PROJECT_VERSION "1.0" -#define PROJECT_VERSION_BUILD_NO 14 +#define PROJECT_VERSION_BUILD_NO 15 #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 "]" diff --git a/tests/core_tests/checkpoints_tests.cpp b/tests/core_tests/checkpoints_tests.cpp index a7405288..bb4cffa4 100644 --- a/tests/core_tests/checkpoints_tests.cpp +++ b/tests/core_tests/checkpoints_tests.cpp @@ -628,7 +628,7 @@ bool gen_no_attchments_in_coinbase::init_config_set_cp(currency::core& c, size_t crc.pos_minimum_heigh = 1; c.get_blockchain_storage().set_core_runtime_config(crc); - m_checkpoints.add_checkpoint(12, "446b25ca3816e36df92745ea91c3c54a8745db565bafd4d2aa7df9da49220a19"); + m_checkpoints.add_checkpoint(12, "ea03a5c99aeedc2050ca5dae011a6c411b31f8b7fb9d0b82735c403b5c608b7b"); c.set_checkpoints(currency::checkpoints(m_checkpoints)); return true; diff --git a/tests/core_tests/multisig_wallet_tests.cpp b/tests/core_tests/multisig_wallet_tests.cpp index 21a03f4e..a023ce76 100644 --- a/tests/core_tests/multisig_wallet_tests.cpp +++ b/tests/core_tests/multisig_wallet_tests.cpp @@ -1621,7 +1621,7 @@ multisig_and_checkpoints::multisig_and_checkpoints() bool multisig_and_checkpoints::set_cp(currency::core& c, size_t ev_index, const std::vector& events) { currency::checkpoints checkpoints; - checkpoints.add_checkpoint(15, "37da2a30fd8cf1daa05ba11cb2ac5f7a3cc998bce56e4b575fbbea58f0592f5b"); + checkpoints.add_checkpoint(15, "46f45b849160be33937c60fa564e820792b0aaa6cf4a080e6002b6f25d84d688"); c.set_checkpoints(std::move(checkpoints)); return true;