mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 20:22:02 +00:00
Make modified helpers in electra fork aware (#5698)
* Make modified helpers in electra fork aware * Make more functions fork aware * formatting fixes only.
This commit is contained in:
@@ -19,19 +19,20 @@ pub fn process_registry_updates<E: EthSpec>(
|
||||
validator.is_active_at(current_epoch)
|
||||
&& validator.effective_balance <= spec.ejection_balance
|
||||
};
|
||||
let fork_name = state.fork_name_unchecked();
|
||||
let indices_to_update: Vec<_> = state
|
||||
.validators()
|
||||
.iter()
|
||||
.enumerate()
|
||||
.filter(|(_, validator)| {
|
||||
validator.is_eligible_for_activation_queue(spec) || is_ejectable(validator)
|
||||
validator.is_eligible_for_activation_queue(spec, fork_name) || is_ejectable(validator)
|
||||
})
|
||||
.map(|(idx, _)| idx)
|
||||
.collect();
|
||||
|
||||
for index in indices_to_update {
|
||||
let validator = state.get_validator_mut(index)?;
|
||||
if validator.is_eligible_for_activation_queue(spec) {
|
||||
if validator.is_eligible_for_activation_queue(spec, fork_name) {
|
||||
validator.activation_eligibility_epoch = current_epoch.safe_add(1)?;
|
||||
}
|
||||
if is_ejectable(validator) {
|
||||
|
||||
@@ -466,7 +466,7 @@ fn process_single_registry_update(
|
||||
) -> Result<(), Error> {
|
||||
let current_epoch = state_ctxt.current_epoch;
|
||||
|
||||
if validator.is_eligible_for_activation_queue(spec) {
|
||||
if validator.is_eligible_for_activation_queue(spec, state_ctxt.fork_name) {
|
||||
validator.make_mut()?.activation_eligibility_epoch = current_epoch.safe_add(1)?;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user