diff --git a/packages/testing/src/execution_testing/client_clis/tests/fixtures/1/exp.json b/packages/testing/src/execution_testing/client_clis/tests/fixtures/1/exp.json index 03da7dcdb26..b4ab25eafb5 100644 --- a/packages/testing/src/execution_testing/client_clis/tests/fixtures/1/exp.json +++ b/packages/testing/src/execution_testing/client_clis/tests/fixtures/1/exp.json @@ -30,6 +30,7 @@ "root": "0x", "status": "0x1", "cumulativeGasUsed": "0x5208", + "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionHash": "0x0557bacce3375c98d806609b8d5043072f0b6a8bae45ae5a67a00d3a1a18d673", "contractAddress": "0x0000000000000000000000000000000000000000", diff --git a/packages/testing/src/execution_testing/client_clis/tests/fixtures/3/exp.json b/packages/testing/src/execution_testing/client_clis/tests/fixtures/3/exp.json index 6238b76ecb8..6e8c7dcbd76 100644 --- a/packages/testing/src/execution_testing/client_clis/tests/fixtures/3/exp.json +++ b/packages/testing/src/execution_testing/client_clis/tests/fixtures/3/exp.json @@ -31,6 +31,7 @@ "root": "0x", "status": "0x1", "cumulativeGasUsed": "0x521f", + "logs": [], "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionHash": "0x72fadbef39cd251a437eea619cfeda752271a5faaaa2147df012e112159ffb81", "contractAddress": "0x0000000000000000000000000000000000000000", diff --git a/src/ethereum/forks/amsterdam/fork.py b/src/ethereum/forks/amsterdam/fork.py index fada02c6605..69f314f2519 100644 --- a/src/ethereum/forks/amsterdam/fork.py +++ b/src/ethereum/forks/amsterdam/fork.py @@ -1054,27 +1054,6 @@ def process_transaction( sender_balance_after_refund, ) - coinbase_balance_after_mining_fee = get_account( - block_env.state, block_env.coinbase - ).balance + U256(transaction_fee) - - set_account_balance( - block_env.state, block_env.coinbase, coinbase_balance_after_mining_fee - ) - track_balance_change( - tx_env.state_changes, - 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) - - block_output.block_gas_used += tx_gas_used_after_refund - block_output.blob_gas_used += tx_blob_gas_used - # EIP-7708: Emit selfdestruct logs for remaining balance at finalization. # This handles the case where a contract receives ETH after being flagged # for SELFDESTRUCT but before finalization. @@ -1096,6 +1075,27 @@ def process_transaction( all_logs = tx_output.logs + tuple(finalization_logs) + coinbase_balance_after_mining_fee = get_account( + block_env.state, block_env.coinbase + ).balance + U256(transaction_fee) + + set_account_balance( + block_env.state, block_env.coinbase, coinbase_balance_after_mining_fee + ) + track_balance_change( + tx_env.state_changes, + 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) + + block_output.block_gas_used += tx_gas_used_after_refund + block_output.blob_gas_used += tx_blob_gas_used + receipt = make_receipt( tx, tx_output.error, block_output.block_gas_used, all_logs ) diff --git a/src/ethereum/forks/amsterdam/vm/__init__.py b/src/ethereum/forks/amsterdam/vm/__init__.py index 1e7ca7910f7..5d6d1841dff 100644 --- a/src/ethereum/forks/amsterdam/vm/__init__.py +++ b/src/ethereum/forks/amsterdam/vm/__init__.py @@ -228,7 +228,7 @@ def emit_transfer_log( sender : The account address sending the transfer recipient : - The account address recieving the transfer + The account address receiving the transfer transfer_amount : The amount of ETH transacted diff --git a/src/ethereum/forks/amsterdam/vm/instructions/system.py b/src/ethereum/forks/amsterdam/vm/instructions/system.py index e01532a1934..13fce01a77c 100644 --- a/src/ethereum/forks/amsterdam/vm/instructions/system.py +++ b/src/ethereum/forks/amsterdam/vm/instructions/system.py @@ -466,11 +466,9 @@ def call(evm: Evm) -> None: extra_gas, ) charge_gas(evm, message_call_gas.cost + extend_memory.cost) - if evm.message.is_static and value != U256(0): - raise WriteInStaticContext - evm.memory += b"\x00" * extend_memory.expand_by # OPERATION + evm.memory += b"\x00" * extend_memory.expand_by sender_balance = get_account(state, evm.message.current_target).balance if sender_balance < value: push(evm.stack, U256(0))