Skip to content

Commit 99d2360

Browse files
Electra: review process_registry_updates
1 parent 093e3df commit 99d2360

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

beacon-chain/core/electra/registry_updates.go

+17-16
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,24 @@ import (
1818
//
1919
// Spec pseudocode definition:
2020
//
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
2626
//
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]
3232
//
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
3839
func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error {
3940
currentEpoch := time.CurrentEpoch(st)
4041
ejectionBal := params.BeaconConfig().EjectionBalance
@@ -90,8 +91,8 @@ func ProcessRegistryUpdates(ctx context.Context, st state.BeaconState) error {
9091
}
9192
}
9293

94+
// Activate all eligible validators.
9395
for _, idx := range eligibleForActivation {
94-
// Activate all eligible validators.
9596
v, err := st.ValidatorAtIndex(idx)
9697
if err != nil {
9798
return err

0 commit comments

Comments
 (0)