Skip to content

EIP-7928 BAL Zero value withdrawals incorrectly produce balance_changes entries #27

@raxhvl

Description

@raxhvl

Zero value withdrawals incorrectly produce balance_changes entries , even though the balance does not actually change.

Function Name Goal Setup Expectation
test_bal_zero_withdrawal Ensure BAL handles zero-amount withdrawal correctly Block with 0 transactions and 1 zero-amount withdrawal (0 gwei) to Charlie. Two variations: Charlie has existing balance (5 gwei) or Charlie is non-existent. BAL MUST include Charlie at block_access_index = 1 with empty changes. Balance remains unchanged.

Expected Behavior

When a withdrawal has amount=0:

  • The account should appear in the BAL (since it was accessed)
  • The account should have empty changes (no balance_changes entry)

Actual Behavior

Zero-amount withdrawals create a balance_changes entry with post_balance equal to the account's existing balance, even though no mutation occurred.

For existing account (with 5 gwei balance):

balance_changes=[BalBalanceChange(tx_index=1, post_balance=5000000000)]

For non-existent account (balance=0):

  balance_changes=[BalBalanceChange(tx_index=1, post_balance=0)]

cc: @nerolation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions