mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 01:05:47 +00:00
Implement "Update initial earliest_exit_epoch calculation"
This commit is contained in:
@@ -14,13 +14,15 @@ pub fn upgrade_to_electra<E: EthSpec>(
|
|||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let epoch = pre_state.current_epoch();
|
let epoch = pre_state.current_epoch();
|
||||||
|
|
||||||
|
let activation_exit_epoch = spec.compute_activation_exit_epoch(epoch)?;
|
||||||
let earliest_exit_epoch = pre_state
|
let earliest_exit_epoch = pre_state
|
||||||
.validators()
|
.validators()
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|v| v.exit_epoch != spec.far_future_epoch)
|
.filter(|v| v.exit_epoch != spec.far_future_epoch)
|
||||||
.map(|v| v.exit_epoch)
|
.map(|v| v.exit_epoch)
|
||||||
.max()
|
.max()
|
||||||
.unwrap_or(epoch)
|
.unwrap_or(activation_exit_epoch)
|
||||||
|
.max(activation_exit_epoch)
|
||||||
.safe_add(1)?;
|
.safe_add(1)?;
|
||||||
|
|
||||||
// The total active balance cache must be built before the consolidation churn limit
|
// The total active balance cache must be built before the consolidation churn limit
|
||||||
|
|||||||
Reference in New Issue
Block a user