mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-21 05:44:44 +00:00
Correct reward denominator in op pool (#5047)
Closes #5016 The op pool was using the wrong denominator when calculating proposer block rewards! This was mostly inconsequential as our studies of Lighthouse's block profitability already showed that it is very close to optimal. The wrong denominator was leftover from phase0 code, and wasn't properly updated for Altair.
This commit is contained in:
@@ -9,7 +9,7 @@ mod reward_cache;
|
||||
mod sync_aggregate_id;
|
||||
|
||||
pub use crate::bls_to_execution_changes::ReceivedPreCapella;
|
||||
pub use attestation::{earliest_attestation_validators, AttMaxCover};
|
||||
pub use attestation::{earliest_attestation_validators, AttMaxCover, PROPOSER_REWARD_DENOMINATOR};
|
||||
pub use attestation_storage::{CompactAttestationRef, SplitAttestation};
|
||||
pub use max_cover::MaxCover;
|
||||
pub use persistence::{
|
||||
@@ -1402,7 +1402,8 @@ mod release_tests {
|
||||
.retain(|validator_index, _| !seen_indices.contains(validator_index));
|
||||
|
||||
// Check that rewards are in decreasing order
|
||||
let rewards = fresh_validators_rewards.values().sum();
|
||||
let rewards =
|
||||
fresh_validators_rewards.values().sum::<u64>() / PROPOSER_REWARD_DENOMINATOR;
|
||||
assert!(prev_reward >= rewards);
|
||||
prev_reward = rewards;
|
||||
seen_indices.extend(fresh_validators_rewards.keys());
|
||||
|
||||
Reference in New Issue
Block a user