Skip to content

Commit ffd3674

Browse files
authored
eip7732: fix zero-amount builder withdrawals (#4651)
This update fixes an issue where builder withdrawals with a zero amount could be created, violating EIP-4895’s requirement that all withdrawals must have non-zero amounts. The change adds a guard to ensure builder withdrawals are only appended when the `withdrawable_balance` is greater than zero, aligning their behavior with standard validator withdrawals. The problem occurred when a builder’s balance dropped to or below the `MIN_ACTIVATION_BALANCE` between bid creation and withdrawal processing, resulting in a zero-amount withdrawal being included in the execution payload. With this fix, such withdrawals are now excluded.
1 parent ca5f3cd commit ffd3674

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

specs/gloas/beacon-chain.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -826,15 +826,16 @@ def get_expected_withdrawals(state: BeaconState) -> Tuple[Sequence[Withdrawal],
826826
else:
827827
withdrawable_balance = 0
828828

829-
withdrawals.append(
830-
Withdrawal(
831-
index=withdrawal_index,
832-
validator_index=withdrawal.builder_index,
833-
address=withdrawal.fee_recipient,
834-
amount=withdrawable_balance,
829+
if withdrawable_balance > 0:
830+
withdrawals.append(
831+
Withdrawal(
832+
index=withdrawal_index,
833+
validator_index=withdrawal.builder_index,
834+
address=withdrawal.fee_recipient,
835+
amount=withdrawable_balance,
836+
)
835837
)
836-
)
837-
withdrawal_index += WithdrawalIndex(1)
838+
withdrawal_index += WithdrawalIndex(1)
838839
processed_builder_withdrawals_count += 1
839840

840841
# Sweep for pending partial withdrawals

0 commit comments

Comments
 (0)