Update proposer_slashings and attester_slashings amounts for electra. (#7316)

Did not find a specific issue beside https://github.com/sigp/lighthouse/issues/6821


  Leverage `whistleblower_reward_quotient_for_state` to have accurate post-electra `proposer_slashings` and `attester_slashings` fields returned by `/eth/v1/beacon/rewards/blocks/<id>`.
This commit is contained in:
Jean-Baptiste Pinalie
2025-04-17 02:58:36 +02:00
committed by GitHub
parent 6fad6fba6a
commit 5352d5f78a
4 changed files with 150 additions and 7 deletions

View File

@@ -139,7 +139,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
state
.get_validator(proposer_slashing.proposer_index() as usize)?
.effective_balance
.safe_div(self.spec.whistleblower_reward_quotient)?,
.safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?,
)?;
}
@@ -161,7 +161,7 @@ impl<T: BeaconChainTypes> BeaconChain<T> {
state
.get_validator(attester_index as usize)?
.effective_balance
.safe_div(self.spec.whistleblower_reward_quotient)?,
.safe_div(self.spec.whistleblower_reward_quotient_for_state(state))?,
)?;
}
}