Skip to content

Commit 805c0e1

Browse files
committed
Reclaim Lost Epochs
1 parent 8ff66f8 commit 805c0e1

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

specs/_features/eip7251/fork.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)