Fix checkpointing (#1230)

* Fix checkpoint strategy and order, test

* Debug pending delegation events

* Debug print

* Switch print to log

* Add debug print

* More printing

* Remove problematic checkpoint

* checkpoint mixnodes in separate block

* more debugs

* Removing old migration just in case

* Printing all checkpoint heights at migration

* Purging old checkpoint from storage

* Attempting to load raw storage value

* More printing...

* Removed expect

* deserialization changes

* error handling

* cleanup

* clippy

* dead code

* Reduce minimum age for rewarding to 1 epoch

* Add checkpoint query

* Get checkpoint at height

* Fix delegation compounding, fix undelegate accumulate_rewards

* Fix potential overflow, add debug logging

* Moar logging

* Fix total_delegations + rewards

* Better error for horrible overflow

* fmt

* Fixed unit test assertions in bech32 validation

Co-authored-by: Jędrzej Stuczyński <jedrzej.stuczynski@gmail.com>
This commit is contained in:
Drazen Urch
2022-04-29 13:09:00 +02:00
committed by durch
parent 82e6d7335b
commit b09db50bba
14 changed files with 528 additions and 134 deletions
+3 -2
View File
@@ -321,11 +321,12 @@ impl<C> Client<C> {
where
C: SigningCosmWasmClient + Sync,
{
let mut msgs = reward_msgs;
// // First we create the checkpoint, all subsequent changes to a node will be made to the checkpoint
let mut msgs = vec![(ExecuteMsg::CheckpointMixnodes {}, vec![])];
msgs.extend(reward_msgs);
let epoch_msgs = vec![
(ExecuteMsg::ReconcileDelegations {}, vec![]),
(ExecuteMsg::CheckpointMixnodes {}, vec![]),
(ExecuteMsg::AdvanceCurrentEpoch {}, vec![]),
(
ExecuteMsg::WriteRewardedSet {