From dffd93b4758e7027aadbe5611794df9eac4d7ab5 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Wed, 9 Nov 2022 09:34:42 +0100 Subject: [PATCH] cmd/evm: slight change in how t8n handles coinbase pre eip-158 (#26139) This PR fixes a subtle bug in t8n. After this PR, t8n behaves like our state-test runner in certain pre-EIP-158 scenarios --- cmd/evm/internal/t8ntool/execution.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index a27c6f6b4f..adbf56f70c 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -230,8 +230,8 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig, txIndex++ } statedb.IntermediateRoot(chainConfig.IsEIP158(vmContext.BlockNumber)) - // Add mining reward? - if miningReward > 0 { + // Add mining reward? (-1 means rewards are disabled) + if miningReward >= 0 { // Add mining reward. The mining reward may be `0`, which only makes a difference in the cases // where // - the coinbase suicided, or