Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"root": "0x",
"status": "0x1",
"cumulativeGasUsed": "0x5208",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionHash": "0x0557bacce3375c98d806609b8d5043072f0b6a8bae45ae5a67a00d3a1a18d673",
"contractAddress": "0x0000000000000000000000000000000000000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"root": "0x",
"status": "0x1",
"cumulativeGasUsed": "0x521f",
"logs": [],
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"transactionHash": "0x72fadbef39cd251a437eea619cfeda752271a5faaaa2147df012e112159ffb81",
"contractAddress": "0x0000000000000000000000000000000000000000",
Expand Down
42 changes: 21 additions & 21 deletions src/ethereum/forks/amsterdam/fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion src/ethereum/forks/amsterdam/vm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 1 addition & 3 deletions src/ethereum/forks/amsterdam/vm/instructions/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
Loading