From 4d6f5372f03752aa9e6f7fe04e12d495c08a898f Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Mon, 29 Jun 2026 08:31:44 +0000 Subject: [PATCH 1/3] fix(tests): correct mip4 transition test for subsequent forks Derive pre-transition precompile availability from transitions_from() so MONAD_NINEToMONAD_NEXT passes. Co-Authored-By: Claude --- .../mip4_checkreservebalance/test_fork_transition.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py b/tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py index b7654e3cfd0..3ed92bd2ac1 100644 --- a/tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py +++ b/tests/monad_nine/mip4_checkreservebalance/test_fork_transition.py @@ -32,10 +32,14 @@ def test_fork_transition( """ Test reserve balance precompile availability at fork transition. - Before the fork, the precompile doesn't exist, so CALL returns - empty output (RETURNDATASIZE == 0). After the fork, the precompile + Before the MONAD_NINE, the precompile doesn't exist, so CALL returns + empty output (RETURNDATASIZE == 0). After, the precompile returns a 32-byte result (RETURNDATASIZE == 32). """ + precompile_before = ( + Spec.RESERVE_BALANCE_PRECOMPILE + in fork.transitions_from().precompiles() + ) sender = pre.fund_eoa() callee_code = ( @@ -103,14 +107,14 @@ def test_fork_transition( post={ caller_address: Account( storage={ - 14_999: 1, # Call succeeds (precompile just returns empty) + 14_999: 1, # Call succeeds 15_000: 1, # Call succeeds on fork transition block 15_001: 1, # Call continues to succeed after transition } ), callee_address: Account( storage={ - 14_999: 0, # Precompile not available, RETURNDATASIZE==0 + 14_999: 1 if precompile_before else 0, 15_000: 1, # Precompile available, RETURNDATASIZE==32 15_001: 1, # Precompile continues to work } From 1d11f55233cbd2a6aa909953210aec8c10ebf9f2 Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Tue, 30 Jun 2026 09:02:32 +0000 Subject: [PATCH 2/3] feat(monad_next): burn priority fees instead of crediting coinbase MIP-11 shim so post-state roots match a full MIP-11 client when no proposer/validators are wired up. Co-Authored-By: Claude --- src/ethereum/forks/monad_next/fork.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ethereum/forks/monad_next/fork.py b/src/ethereum/forks/monad_next/fork.py index d8284e126c5..06e3a5fabb7 100644 --- a/src/ethereum/forks/monad_next/fork.py +++ b/src/ethereum/forks/monad_next/fork.py @@ -1009,15 +1009,21 @@ def process_transaction( # gas_refund_amount = tx_gas_left * effective_gas_price # For non-1559 transactions effective_gas_price == tx.gas_price - priority_fee_per_gas = effective_gas_price - block_env.base_fee_per_gas - transaction_fee = tx.gas * priority_fee_per_gas + # NOTE: commented out, see MIP-11 shim below + # TODO: uncomment and adjust after MIP-11 lands here + # priority_fee_per_gas = effective_gas_price - block_env.base_fee_per_gas + # transaction_fee = tx.gas * priority_fee_per_gas # Monad: gas is not refunded to the sender (note absence of # create_ether(tx_state, sender, U256(gas_refund_amount)) here). add_sender_authority(block_env.state, block_env.number, sender) - # transfer miner fees - create_ether(tx_state, block_env.coinbase, U256(transaction_fee)) + # MIP-11 shim: priority fees are routed to the staking distribution + # address and paid out to the proposer's validator and delegators. In + # tests no proposer is wired up, so distribution finds an unknown + # validator and the fees are burned rather than credited to the + # coinbase. Burn them here so post-state roots match a client that + # implements MIP-11 fully. for address in tx_output.accounts_to_delete: destroy_account(tx_state, address) From 0847e992c9334eae4830ab72cc39670459bc4473 Mon Sep 17 00:00:00 2001 From: pdobacz <5735525+pdobacz@users.noreply.github.com> Date: Tue, 30 Jun 2026 13:19:20 +0000 Subject: [PATCH 3/3] fix(tests): zero priority fee reward at MONAD_NEXT test_credit_with_transaction_fee credits fee_recipient; MIP-11 burns priority fees, so reward is zero for fork >= MONAD_NEXT. Co-Authored-By: Claude --- tests/monad_eight/reserve_balance/test_transfers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/monad_eight/reserve_balance/test_transfers.py b/tests/monad_eight/reserve_balance/test_transfers.py index 5a06d5b19ce..be3fdcf3140 100644 --- a/tests/monad_eight/reserve_balance/test_transfers.py +++ b/tests/monad_eight/reserve_balance/test_transfers.py @@ -18,7 +18,7 @@ Op, Transaction, ) -from execution_testing.forks import MONAD_EIGHT +from execution_testing.forks import MONAD_EIGHT, MONAD_NEXT from execution_testing.forks.helpers import Fork from execution_testing.test_types.helpers import compute_create_address from execution_testing.tools.tools_code.generators import Initcode @@ -1152,7 +1152,8 @@ def test_credit_with_transaction_fee( gas_price = 10 base_fee_per_gas = 7 priority_gas_price = gas_price - base_fee_per_gas - reward = gas_limit * priority_gas_price + # MIP-11 burns priority fees rather than crediting the coinbase. + reward = 0 if fork >= MONAD_NEXT else gas_limit * priority_gas_price tx_1 = Transaction( gas_limit=gas_limit,