From a14479a70f7f9909bc6c8d1ab58727d0c25f7f98 Mon Sep 17 00:00:00 2001 From: Potuz Date: Tue, 1 Nov 2022 17:06:35 -0300 Subject: [PATCH] g11tech review --- specs/capella/beacon-chain.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/specs/capella/beacon-chain.md b/specs/capella/beacon-chain.md index 71dbbfc21..318346347 100644 --- a/specs/capella/beacon-chain.md +++ b/specs/capella/beacon-chain.md @@ -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): @@ -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