-
Notifications
You must be signed in to change notification settings - Fork 907
Closed
Labels
code-qualityconsensusAn issue/PR that touches consensus code, such as state_processing or block verification.An issue/PR that touches consensus code, such as state_processing or block verification.v4.2.0Q2 2023Q2 2023
Description
Description
The v1.3.0 spec simplified the calculation of proposer boost in a way that is almost equivalent to the previous definition. We are still using the old definition but could update at any time to the simpler version.
Our impl:
lighthouse/consensus/proto_array/src/proto_array.rs
Lines 1054 to 1068 in a53830f
pub fn calculate_committee_fraction<E: EthSpec>( | |
justified_balances: &JustifiedBalances, | |
proposer_score_boost: u64, | |
) -> Option<u64> { | |
let average_balance = justified_balances | |
.total_effective_balance | |
.checked_div(justified_balances.num_active_validators)?; | |
let committee_size = justified_balances | |
.num_active_validators | |
.checked_div(E::slots_per_epoch())?; | |
let committee_weight = committee_size.checked_mul(average_balance)?; | |
committee_weight | |
.checked_mul(proposer_score_boost)? | |
.checked_div(100) | |
} |
Discussion: ethereum/consensus-specs#3034 (comment)
Version
v4.0.1
Metadata
Metadata
Assignees
Labels
code-qualityconsensusAn issue/PR that touches consensus code, such as state_processing or block verification.An issue/PR that touches consensus code, such as state_processing or block verification.v4.2.0Q2 2023Q2 2023