Enhance ledger-tool for multi-epoch rewards (#13837) (#13839)

* Support ledger-tool for multi-epoch rewards

* nits

* Ensure not to skip some records in csv

(cherry picked from commit 6048342c57)

Co-authored-by: Ryo Onodera <ryoqun@gmail.com>
This commit is contained in:
mergify[bot]
2020-11-27 05:36:08 +00:00
committed by GitHub
parent b493d554ad
commit a3be6bacc6
3 changed files with 184 additions and 105 deletions

View File

@@ -1458,6 +1458,7 @@ impl Bank {
let old_vote_balance_and_staked = self.stakes.read().unwrap().vote_balance_and_staked();
let validator_point_value = self.pay_validator_rewards(
prev_epoch,
validator_rewards,
reward_calc_tracer,
self.stake_program_v2_enabled(),
@@ -1576,6 +1577,7 @@ impl Bank {
/// successfully load and parse, return the lamport value of one point
fn pay_validator_rewards(
&mut self,
rewarded_epoch: Epoch,
rewards: u64,
reward_calc_tracer: &mut Option<impl FnMut(&RewardCalculationEvent)>,
fix_stake_deactivate: bool,
@@ -1624,6 +1626,7 @@ impl Bank {
}
});
let redeemed = stake_state::redeem_rewards(
rewarded_epoch,
stake_account,
vote_account,
&point_value,