Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/ethereum/forks/amsterdam/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,13 +1000,17 @@ def process_transaction(
coinbase_balance_after_mining_fee = get_account(
block_env.state, block_env.coinbase
).balance + U256(transaction_fee)
if coinbase_balance_after_mining_fee != 0:
set_account_balance(
block_env.state,
block_env.coinbase,
coinbase_balance_after_mining_fee,
)
elif account_exists_and_is_empty(block_env.state, block_env.coinbase):

# Always set coinbase balance to ensure proper tracking
set_account_balance(
block_env.state,
block_env.coinbase,
coinbase_balance_after_mining_fee,
)

if coinbase_balance_after_mining_fee == 0 and account_exists_and_is_empty(
block_env.state, block_env.coinbase
):
destroy_account(block_env.state, block_env.coinbase)

for address in tx_output.accounts_to_delete:
Expand Down
Loading