File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,20 @@ def upgrade_to_eip7251(pre: deneb.BeaconState) -> BeaconState:
136136 post.validators[index].activation_eligibility_epoch,
137137 index
138138 ))
139- for index in pre_activation:
139+
140+ activation_churn_limit = get_validator_activation_churn_limit(post)
141+ adjusted_validators = 0
142+ adjusted_epoch = get_current_epoch(post) - 1
143+ for i, index in enumerate (pre_activation):
144+ if i >= activation_churn_limit * 4
145+ break
146+ if post.validators[index].activation_eligibility_epoch > post.finalized_checkpoint.epoch
147+ break
148+ post.validators[index].activation_eligibility_epoch =
149+ adjusted_epoch + (i // activation_churn_limit)
150+ adjusted_validators += 1
151+
152+ for index in pre_activation[adjusted_validators:]:
140153 queue_entire_balance_and_reset_validator(post, ValidatorIndex(index))
141154
142155 # Ensure early adopters of compounding credentials go through the activation churn
You can’t perform that action at this time.
0 commit comments