Skip to content

Commit

Permalink
g11tech review
Browse files Browse the repository at this point in the history
  • Loading branch information
potuz authored and hwwhww committed Nov 3, 2022
1 parent 7e4d169 commit a14479a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions specs/capella/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
withdrawal_index = state.next_withdrawal_index
index = ValidatorIndex((state.last_withdrawal_validator_index + 1) % len(state.validators))
ret: List[Withdrawal] = []
probed = 0
while (len(ret) < MAX_WITHDRAWALS_PER_PAYLOAD) and (probed < len(state.validators)):
for probed in range(len(state.validators))):
val = state.validators[index]
balance = state.balances[index]
if is_fully_withdrawable_validator(val, balance, epoch):
Expand All @@ -310,6 +309,8 @@ def get_expected_withdrawals(state: BeaconState) -> Sequence[Withdrawal]:
)
ret.append(withdrawal)
withdrawal_index = WithdrawalIndex(withdrawal_index + 1)
if len(ret) == MAX_WITHDRAWALS_PER_PAYLOAD:
break
probed += 1
index = ValidatorIndex((index + probed) % len(state.validators))
return ret
Expand Down

0 comments on commit a14479a

Please sign in to comment.