Skip to content

Commit

Permalink
support multiple undelegagtions
Browse files Browse the repository at this point in the history
  • Loading branch information
JakubFornadel authored and kstdl committed Aug 22, 2024
1 parent 0e283fb commit 904b5c1
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
"block_num": 20,
"pillar_blocks_interval": 10,
"bridge_contract_address": "0xcAF2b453FE8382a4B8110356DF0508f6d71F22BF"
}
},
"cornus_hf_block_num": 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"block_num": 100,
"pillar_blocks_interval": 10,
"bridge_contract_address": "0xcAF2b453FE8382a4B8110356DF0508f6d71F22BF"
}
},
"cornus_hf_block_num": 0
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@
"block_num": 11616000,
"pillar_blocks_interval": 4000,
"bridge_contract_address": "0xe126E0BaeAE904b8Cfd619Be1A8667A173b763a1"
}
},
"cornus_hf_block_num": -1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
"block_num": 1000,
"pillar_blocks_interval": 1000,
"bridge_contract_address": "0xcAF2b453FE8382a4B8110356DF0508f6d71F22BF"
}
},
"cornus_hf_block_num": -1
}
}
3 changes: 3 additions & 0 deletions libraries/config/include/config/hardfork.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ struct HardforksConfig {
// Ficus hardfork: implementation of pillar chain
FicusHardforkConfig ficus_hf;

// Cornus hf - support multiple undelegations from the same validator at the same time
uint64_t cornus_hf_block_num{0};

HAS_RLP_FIELDS
};

Expand Down
5 changes: 4 additions & 1 deletion libraries/config/src/hardfork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ Json::Value enc_json(const HardforksConfig& obj) {
json["aspen_hf"] = enc_json(obj.aspen_hf);
json["ficus_hf"] = enc_json(obj.ficus_hf);
// json["bamboo_hf"] = enc_json(obj.bamboo_hf);
json["cornus_hf_block_num"] = dev::toJS(obj.cornus_hf_block_num);

return json;
}
Expand Down Expand Up @@ -188,7 +189,9 @@ void dec_json(const Json::Value& json, HardforksConfig& obj) {
dec_json(json["aspen_hf"], obj.aspen_hf);
dec_json(json["ficus_hf"], obj.ficus_hf);
// dec_json(json["bamboo_hf"], obj.bamboo_hf);
obj.cornus_hf_block_num =
json["cornus_hf_block_num"].isUInt64() ? dev::getUInt(json["cornus_hf_block_num"]) : uint64_t(-1);
}

RLP_FIELDS_DEFINE(HardforksConfig, fix_redelegate_block_num, redelegations, rewards_distribution_frequency, magnolia_hf,
phalaenopsis_hf_block_num, fix_claim_all_block_num, aspen_hf, ficus_hf)
phalaenopsis_hf_block_num, fix_claim_all_block_num, aspen_hf, ficus_hf, cornus_hf_block_num)

0 comments on commit 904b5c1

Please sign in to comment.