From dc0992686601bcc1ba932f64964e1b050a9e73fd Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 11:41:43 +0100 Subject: [PATCH 1/9] chore: fix commision rewards --- .../cli/include/cli/config_jsons/default/default_genesis.json | 1 + .../cli/include/cli/config_jsons/devnet/devnet_genesis.json | 1 + .../cli/include/cli/config_jsons/mainnet/mainnet_genesis.json | 1 + .../cli/include/cli/config_jsons/testnet/testnet_genesis.json | 1 + libraries/config/include/config/hardfork.hpp | 2 ++ libraries/config/src/hardfork.cpp | 2 ++ submodules/taraxa-evm | 2 +- tests/rewards_stats_test.cpp | 2 +- 8 files changed, 10 insertions(+), 2 deletions(-) diff --git a/libraries/cli/include/cli/config_jsons/default/default_genesis.json b/libraries/cli/include/cli/config_jsons/default/default_genesis.json index cad60f15cc..0a4de3c0b8 100644 --- a/libraries/cli/include/cli/config_jsons/default/default_genesis.json +++ b/libraries/cli/include/cli/config_jsons/default/default_genesis.json @@ -99,6 +99,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, + "fix_commission_block_num": 0, "rewards_distribution_frequency": { "0" : 100 }, diff --git a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json index 5a0d4441ae..398be3bfd2 100644 --- a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json @@ -265,6 +265,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, + "fix_commission_block_num": 0, "rewards_distribution_frequency": { "0": 100 }, diff --git a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json index 747257b6b1..f0803f85a4 100644 --- a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json @@ -1627,6 +1627,7 @@ }, "hardforks": { "fix_redelegate_block_num": 3091000, + "fix_commission_block_num": 0, "redelegations": [ { "validator": "0x6671df8b597c0A14a9361b4B98F97AF1360e4352", diff --git a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json index 79c2f1911a..c0139b846c 100644 --- a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json @@ -133,6 +133,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, + "fix_commission_block_num": 0, "redelegations": [], "rewards_distribution_frequency": { "297000": 100 diff --git a/libraries/config/include/config/hardfork.hpp b/libraries/config/include/config/hardfork.hpp index 7246e9932c..525470b82b 100644 --- a/libraries/config/include/config/hardfork.hpp +++ b/libraries/config/include/config/hardfork.hpp @@ -26,6 +26,8 @@ void dec_json(const Json::Value& json, MagnoliaHardfork& obj); struct HardforksConfig { // disable it by default (set to max uint64) uint64_t fix_redelegate_block_num = -1; + // disable it by default (set to max uint64) + uint64_t fix_commission_block_num = -1; std::vector redelegations; /* * @brief key is block number at which change is applied and value is new distribution interval. diff --git a/libraries/config/src/hardfork.cpp b/libraries/config/src/hardfork.cpp index 6b4f7d5cee..c051fac454 100644 --- a/libraries/config/src/hardfork.cpp +++ b/libraries/config/src/hardfork.cpp @@ -32,6 +32,7 @@ RLP_FIELDS_DEFINE(MagnoliaHardfork, block_num, jail_time) Json::Value enc_json(const HardforksConfig& obj) { Json::Value json(Json::objectValue); json["fix_redelegate_block_num"] = dev::toJS(obj.fix_redelegate_block_num); + json["fix_commission_block_num"] = dev::toJS(obj.fix_commission_block_num); json["initial_validators"] = Json::Value(Json::arrayValue); for (const auto& v : obj.redelegations) { json["redelegations"].append(enc_json(v)); @@ -50,6 +51,7 @@ Json::Value enc_json(const HardforksConfig& obj) { void dec_json(const Json::Value& json, HardforksConfig& obj) { obj.fix_redelegate_block_num = dev::getUInt(json["fix_redelegate_block_num"]); + obj.fix_commission_block_num = dev::getUInt(json["fix_commission_block_num"]); const auto& redelegations_json = json["redelegations"]; obj.redelegations = std::vector(redelegations_json.size()); diff --git a/submodules/taraxa-evm b/submodules/taraxa-evm index 0460292911..58a4da0c04 160000 --- a/submodules/taraxa-evm +++ b/submodules/taraxa-evm @@ -1 +1 @@ -Subproject commit 046029291102f0323412ee4133f6fc0a4b33dc2b +Subproject commit 58a4da0c04cd337d019c7140ea0b1f53ff52c869 diff --git a/tests/rewards_stats_test.cpp b/tests/rewards_stats_test.cpp index 53daec009f..9e798d9fc1 100644 --- a/tests/rewards_stats_test.cpp +++ b/tests/rewards_stats_test.cpp @@ -20,7 +20,7 @@ struct RewardsStatsTest : NodesTest {}; class TestableRewardsStats : public rewards::Stats { public: TestableRewardsStats(const HardforksConfig::RewardsDistributionMap& rdm, std::shared_ptr db) - : rewards::Stats(100, HardforksConfig{0, {}, rdm, MagnoliaHardfork{0, 0}}, db, [](auto) { return 100; }) {} + : rewards::Stats(100, HardforksConfig{0, 0, {}, rdm, MagnoliaHardfork{0, 0}}, db, [](auto) { return 100; }) {} auto getStats() { return blocks_stats_; } }; From bc41fcf53051db32ff462fd18c7945738052b279 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 12:55:08 +0100 Subject: [PATCH 2/9] chore: increase conan version --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3fd932d760..acb9288e67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -63,7 +63,7 @@ RUN ln -s /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang RUN ln -s /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ # Install conan -RUN pip3 install conan==1.59.0 +RUN pip3 install conan==1.60.0 ENV CONAN_REVISIONS_ENABLED=1 From 448b092d34386f268f897c56152152c2757f6e39 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 13:34:42 +0100 Subject: [PATCH 3/9] chore: fix rlp encoding --- libraries/config/src/hardfork.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/config/src/hardfork.cpp b/libraries/config/src/hardfork.cpp index c051fac454..e68097acd0 100644 --- a/libraries/config/src/hardfork.cpp +++ b/libraries/config/src/hardfork.cpp @@ -72,4 +72,4 @@ void dec_json(const Json::Value& json, HardforksConfig& obj) { } } -RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, redelegations, rewards_distribution_frequency, magnolia_hf) +RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, fix_commission_block_num, redelegations, rewards_distribution_frequency, magnolia_hf) From 9eb15315aa8aedf74e9cb67b2d21dda6d10be6cf Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 13:35:22 +0100 Subject: [PATCH 4/9] chore: increase node version --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7d0a3f96f6..3c1b9db04a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.20) # Set current version of the project set(TARAXA_MAJOR_VERSION 1) -set(TARAXA_MINOR_VERSION 5) -set(TARAXA_PATCH_VERSION 3) +set(TARAXA_MINOR_VERSION 6) +set(TARAXA_PATCH_VERSION 0) set(TARAXA_VERSION ${TARAXA_MAJOR_VERSION}.${TARAXA_MINOR_VERSION}.${TARAXA_PATCH_VERSION}) # Any time a change in the network protocol is introduced this version should be increased From 74e0d082b674ec10077bc5410b124ec1ab08ae77 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 14:08:07 +0100 Subject: [PATCH 5/9] chore: rename hf --- .../include/cli/config_jsons/default/default_genesis.json | 2 +- .../include/cli/config_jsons/devnet/devnet_genesis.json | 2 +- .../include/cli/config_jsons/mainnet/mainnet_genesis.json | 2 +- .../include/cli/config_jsons/testnet/testnet_genesis.json | 2 +- libraries/config/include/config/hardfork.hpp | 2 +- libraries/config/src/hardfork.cpp | 7 ++++--- submodules/taraxa-evm | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/libraries/cli/include/cli/config_jsons/default/default_genesis.json b/libraries/cli/include/cli/config_jsons/default/default_genesis.json index 0a4de3c0b8..1ff6ef501d 100644 --- a/libraries/cli/include/cli/config_jsons/default/default_genesis.json +++ b/libraries/cli/include/cli/config_jsons/default/default_genesis.json @@ -99,7 +99,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "fix_commission_block_num": 0, + "cora_hf_block_num": 0, "rewards_distribution_frequency": { "0" : 100 }, diff --git a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json index 398be3bfd2..af239ce6c8 100644 --- a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json @@ -265,7 +265,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "fix_commission_block_num": 0, + "cora_hf_block_num": 0, "rewards_distribution_frequency": { "0": 100 }, diff --git a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json index f0803f85a4..2382705d0b 100644 --- a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json @@ -1627,7 +1627,7 @@ }, "hardforks": { "fix_redelegate_block_num": 3091000, - "fix_commission_block_num": 0, + "cora_hf_block_num": 0, "redelegations": [ { "validator": "0x6671df8b597c0A14a9361b4B98F97AF1360e4352", diff --git a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json index c0139b846c..0c34da0c8d 100644 --- a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json @@ -133,7 +133,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "fix_commission_block_num": 0, + "cora_hf_block_num": 0, "redelegations": [], "rewards_distribution_frequency": { "297000": 100 diff --git a/libraries/config/include/config/hardfork.hpp b/libraries/config/include/config/hardfork.hpp index 525470b82b..905d64747b 100644 --- a/libraries/config/include/config/hardfork.hpp +++ b/libraries/config/include/config/hardfork.hpp @@ -27,7 +27,7 @@ struct HardforksConfig { // disable it by default (set to max uint64) uint64_t fix_redelegate_block_num = -1; // disable it by default (set to max uint64) - uint64_t fix_commission_block_num = -1; + uint64_t cora_hf_block_num = -1; std::vector redelegations; /* * @brief key is block number at which change is applied and value is new distribution interval. diff --git a/libraries/config/src/hardfork.cpp b/libraries/config/src/hardfork.cpp index e68097acd0..a61baffef5 100644 --- a/libraries/config/src/hardfork.cpp +++ b/libraries/config/src/hardfork.cpp @@ -32,7 +32,7 @@ RLP_FIELDS_DEFINE(MagnoliaHardfork, block_num, jail_time) Json::Value enc_json(const HardforksConfig& obj) { Json::Value json(Json::objectValue); json["fix_redelegate_block_num"] = dev::toJS(obj.fix_redelegate_block_num); - json["fix_commission_block_num"] = dev::toJS(obj.fix_commission_block_num); + json["cora_hf_block_num"] = dev::toJS(obj.cora_hf_block_num); json["initial_validators"] = Json::Value(Json::arrayValue); for (const auto& v : obj.redelegations) { json["redelegations"].append(enc_json(v)); @@ -51,7 +51,7 @@ Json::Value enc_json(const HardforksConfig& obj) { void dec_json(const Json::Value& json, HardforksConfig& obj) { obj.fix_redelegate_block_num = dev::getUInt(json["fix_redelegate_block_num"]); - obj.fix_commission_block_num = dev::getUInt(json["fix_commission_block_num"]); + obj.cora_hf_block_num = dev::getUInt(json["cora_hf_block_num"]); const auto& redelegations_json = json["redelegations"]; obj.redelegations = std::vector(redelegations_json.size()); @@ -72,4 +72,5 @@ void dec_json(const Json::Value& json, HardforksConfig& obj) { } } -RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, fix_commission_block_num, redelegations, rewards_distribution_frequency, magnolia_hf) +RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, cora_hf_block_num, redelegations, + rewards_distribution_frequency, magnolia_hf) diff --git a/submodules/taraxa-evm b/submodules/taraxa-evm index 58a4da0c04..7ee96b2e11 160000 --- a/submodules/taraxa-evm +++ b/submodules/taraxa-evm @@ -1 +1 @@ -Subproject commit 58a4da0c04cd337d019c7140ea0b1f53ff52c869 +Subproject commit 7ee96b2e110f6b992ebc250a3c3ce100792a49ee From f24a4bfd2f5e3f15878647205f411df096f86f66 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 14:37:59 +0100 Subject: [PATCH 6/9] set HF number --- .../cli/include/cli/config_jsons/mainnet/mainnet_genesis.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json index 2382705d0b..fc8e8ce6fe 100644 --- a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json @@ -1627,7 +1627,7 @@ }, "hardforks": { "fix_redelegate_block_num": 3091000, - "cora_hf_block_num": 0, + "cora_hf_block_num": 6943000, "redelegations": [ { "validator": "0x6671df8b597c0A14a9361b4B98F97AF1360e4352", From 40e15f2780b4269bcac9078e52d6121213a5c81c Mon Sep 17 00:00:00 2001 From: kstdl Date: Fri, 19 Jan 2024 16:29:34 +0100 Subject: [PATCH 7/9] feat: add burn function to dposContract --- .../include/cli/config_jsons/default/default_genesis.json | 2 +- .../include/cli/config_jsons/devnet/devnet_genesis.json | 2 +- .../include/cli/config_jsons/mainnet/mainnet_genesis.json | 8 ++++---- .../include/cli/config_jsons/testnet/testnet_genesis.json | 2 +- libraries/config/include/config/hardfork.hpp | 2 +- libraries/config/src/hardfork.cpp | 6 +++--- submodules/taraxa-evm | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/libraries/cli/include/cli/config_jsons/default/default_genesis.json b/libraries/cli/include/cli/config_jsons/default/default_genesis.json index 1ff6ef501d..4526c74d52 100644 --- a/libraries/cli/include/cli/config_jsons/default/default_genesis.json +++ b/libraries/cli/include/cli/config_jsons/default/default_genesis.json @@ -99,7 +99,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "cora_hf_block_num": 0, + "phalaenopsis_hf_block_num": 0, "rewards_distribution_frequency": { "0" : 100 }, diff --git a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json index af239ce6c8..ebbb1671f3 100644 --- a/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/devnet/devnet_genesis.json @@ -265,7 +265,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "cora_hf_block_num": 0, + "phalaenopsis_hf_block_num": 1000, "rewards_distribution_frequency": { "0": 100 }, diff --git a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json index fc8e8ce6fe..03f1fd2601 100644 --- a/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/mainnet/mainnet_genesis.json @@ -1627,7 +1627,7 @@ }, "hardforks": { "fix_redelegate_block_num": 3091000, - "cora_hf_block_num": 6943000, + "phalaenopsis_hf_block_num": 6943000, "redelegations": [ { "validator": "0x6671df8b597c0A14a9361b4B98F97AF1360e4352", @@ -1636,10 +1636,10 @@ } ], "rewards_distribution_frequency": { - "5730000" : 100 + "5730000": 100 }, - "magnolia_hf" : { - "block_num" : 5730000, + "magnolia_hf": { + "block_num": 5730000, "jail_time": 163459 } } diff --git a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json index 0c34da0c8d..29f9249b9e 100644 --- a/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json +++ b/libraries/cli/include/cli/config_jsons/testnet/testnet_genesis.json @@ -133,7 +133,7 @@ }, "hardforks": { "fix_redelegate_block_num": 0, - "cora_hf_block_num": 0, + "phalaenopsis_hf_block_num": 0, "redelegations": [], "rewards_distribution_frequency": { "297000": 100 diff --git a/libraries/config/include/config/hardfork.hpp b/libraries/config/include/config/hardfork.hpp index 905d64747b..27ba6ccddf 100644 --- a/libraries/config/include/config/hardfork.hpp +++ b/libraries/config/include/config/hardfork.hpp @@ -27,7 +27,7 @@ struct HardforksConfig { // disable it by default (set to max uint64) uint64_t fix_redelegate_block_num = -1; // disable it by default (set to max uint64) - uint64_t cora_hf_block_num = -1; + uint64_t phalaenopsis_hf_block_num = -1; std::vector redelegations; /* * @brief key is block number at which change is applied and value is new distribution interval. diff --git a/libraries/config/src/hardfork.cpp b/libraries/config/src/hardfork.cpp index a61baffef5..9f6587acfb 100644 --- a/libraries/config/src/hardfork.cpp +++ b/libraries/config/src/hardfork.cpp @@ -32,7 +32,7 @@ RLP_FIELDS_DEFINE(MagnoliaHardfork, block_num, jail_time) Json::Value enc_json(const HardforksConfig& obj) { Json::Value json(Json::objectValue); json["fix_redelegate_block_num"] = dev::toJS(obj.fix_redelegate_block_num); - json["cora_hf_block_num"] = dev::toJS(obj.cora_hf_block_num); + json["phalaenopsis_hf_block_num"] = dev::toJS(obj.phalaenopsis_hf_block_num); json["initial_validators"] = Json::Value(Json::arrayValue); for (const auto& v : obj.redelegations) { json["redelegations"].append(enc_json(v)); @@ -51,7 +51,7 @@ Json::Value enc_json(const HardforksConfig& obj) { void dec_json(const Json::Value& json, HardforksConfig& obj) { obj.fix_redelegate_block_num = dev::getUInt(json["fix_redelegate_block_num"]); - obj.cora_hf_block_num = dev::getUInt(json["cora_hf_block_num"]); + obj.phalaenopsis_hf_block_num = dev::getUInt(json["phalaenopsis_hf_block_num"]); const auto& redelegations_json = json["redelegations"]; obj.redelegations = std::vector(redelegations_json.size()); @@ -72,5 +72,5 @@ void dec_json(const Json::Value& json, HardforksConfig& obj) { } } -RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, cora_hf_block_num, redelegations, +RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, phalaenopsis_hf_block_num, redelegations, rewards_distribution_frequency, magnolia_hf) diff --git a/submodules/taraxa-evm b/submodules/taraxa-evm index 7ee96b2e11..f60febfd34 160000 --- a/submodules/taraxa-evm +++ b/submodules/taraxa-evm @@ -1 +1 @@ -Subproject commit 7ee96b2e110f6b992ebc250a3c3ce100792a49ee +Subproject commit f60febfd34b4e5cbb5e38e32e1a1d6035da76797 From 58af94f2a98f251296bea25ee1555458ee553e69 Mon Sep 17 00:00:00 2001 From: kstdl Date: Fri, 19 Jan 2024 16:43:26 +0100 Subject: [PATCH 8/9] chore: update evm submodule --- submodules/taraxa-evm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/taraxa-evm b/submodules/taraxa-evm index f60febfd34..b012e98126 160000 --- a/submodules/taraxa-evm +++ b/submodules/taraxa-evm @@ -1 +1 @@ -Subproject commit f60febfd34b4e5cbb5e38e32e1a1d6035da76797 +Subproject commit b012e98126fc5aea99c4b802282a0073730c5357 From f96e3b741d6c5d088fd121d6c4ac331b0d095cd8 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Fri, 19 Jan 2024 18:47:53 +0100 Subject: [PATCH 9/9] chore: update evm --- submodules/taraxa-evm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/taraxa-evm b/submodules/taraxa-evm index b012e98126..69bb3cf7de 160000 --- a/submodules/taraxa-evm +++ b/submodules/taraxa-evm @@ -1 +1 @@ -Subproject commit b012e98126fc5aea99c4b802282a0073730c5357 +Subproject commit 69bb3cf7dedff04085a1226abf3fda97a6139f00