@@ -18,23 +18,24 @@ import (
18
18
//
19
19
// Spec pseudocode definition:
20
20
//
21
- // def process_registry_updates(state: BeaconState) -> None:
22
- // # Process activation eligibility and ejections
23
- // for index, validator in enumerate(state.validators):
24
- // if is_eligible_for_activation_queue(validator):
25
- // validator.activation_eligibility_epoch = get_current_epoch(state) + 1
21
+ // def process_registry_updates(state: BeaconState) -> None:
22
+ // # Process activation eligibility and ejections
23
+ // for index, validator in enumerate(state.validators):
24
+ // if is_eligible_for_activation_queue(validator): # [Modified in Electra:EIP7251]
25
+ // validator.activation_eligibility_epoch = get_current_epoch(state) + 1
26
26
//
27
- // if (
28
- // is_active_validator(validator, get_current_epoch(state))
29
- // and validator.effective_balance <= EJECTION_BALANCE
30
- // ):
31
- // initiate_validator_exit(state, ValidatorIndex(index))
27
+ // if (
28
+ // is_active_validator(validator, get_current_epoch(state))
29
+ // and validator.effective_balance <= EJECTION_BALANCE
30
+ // ):
31
+ // initiate_validator_exit(state, ValidatorIndex(index)) # [Modified in Electra:EIP7251]
32
32
//
33
- // # Activate all eligible validators
34
- // activation_epoch = compute_activation_exit_epoch(get_current_epoch(state))
35
- // for validator in state.validators:
36
- // if is_eligible_for_activation(state, validator):
37
- // validator.activation_epoch = activation_epoch
33
+ // # Activate all eligible validators
34
+ // # [Modified in Electra:EIP7251]
35
+ // activation_epoch = compute_activation_exit_epoch(get_current_epoch(state))
36
+ // for validator in state.validators:
37
+ // if is_eligible_for_activation(state, validator):
38
+ // validator.activation_epoch = activation_epoch
38
39
func ProcessRegistryUpdates (ctx context.Context , st state.BeaconState ) error {
39
40
currentEpoch := time .CurrentEpoch (st )
40
41
ejectionBal := params .BeaconConfig ().EjectionBalance
@@ -90,8 +91,8 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error {
90
91
}
91
92
}
92
93
94
+ // Activate all eligible validators.
93
95
for _ , idx := range eligibleForActivation {
94
- // Activate all eligible validators.
95
96
v , err := st .ValidatorAtIndex (idx )
96
97
if err != nil {
97
98
return err
0 commit comments