mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 06:36:43 +00:00
core,eth/tracers: fix TestPrestateWithDiffModeTracer
This commit is contained in:
parent
46882e8247
commit
60b85cf088
9 changed files with 68 additions and 15 deletions
|
|
@ -141,6 +141,9 @@ func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, sta
|
|||
statedb.AddBalance(result.BurntContractAddress, result.FeeBurnt)
|
||||
}
|
||||
|
||||
// TODO(raneet10) Double check
|
||||
statedb.AddBalance(evm.Context.Coinbase, result.FeeTipped)
|
||||
|
||||
if result.Err == vm.ErrInterrupt {
|
||||
return nil, result.Err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -441,15 +441,16 @@ func (st *StateTransition) TransitionDb(interruptCtx context.Context) (*Executio
|
|||
effectiveTip = cmath.BigMin(msg.GasTipCap, new(big.Int).Sub(msg.GasFeeCap, st.evm.Context.BaseFee))
|
||||
}
|
||||
|
||||
if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {
|
||||
// Skip fee payment when NoBaseFee is set and the fee fields
|
||||
// are 0. This avoids a negative effectiveTip being applied to
|
||||
// the coinbase when simulating calls.
|
||||
} else {
|
||||
fee := new(big.Int).SetUint64(st.gasUsed())
|
||||
fee.Mul(fee, effectiveTip)
|
||||
st.state.AddBalance(st.evm.Context.Coinbase, fee)
|
||||
}
|
||||
// TODO(raneet10): Double check. We might want to inculcate this fix in a separate condition
|
||||
// if st.evm.Config.NoBaseFee && msg.GasFeeCap.Sign() == 0 && msg.GasTipCap.Sign() == 0 {
|
||||
// // Skip fee payment when NoBaseFee is set and the fee fields
|
||||
// // are 0. This avoids a negative effectiveTip being applied to
|
||||
// // the coinbase when simulating calls.
|
||||
// } else {
|
||||
// fee := new(big.Int).SetUint64(st.gasUsed())
|
||||
// fee.Mul(fee, effectiveTip)
|
||||
// st.state.AddBalance(st.evm.Context.Coinbase, fee)
|
||||
// }
|
||||
|
||||
amount := new(big.Int).Mul(new(big.Int).SetUint64(st.gasUsed()), effectiveTip)
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,13 @@
|
|||
"clique": {
|
||||
"period": 0,
|
||||
"epoch": 30000
|
||||
},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -41,7 +41,14 @@
|
|||
"londonBlock": 12965000,
|
||||
"arrowGlacierBlock": 13773000,
|
||||
"grayGlacierBlock": 15050000,
|
||||
"ethash": {}
|
||||
"ethash": {},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,14 @@
|
|||
"arrowGlacierBlock": 13773000,
|
||||
"grayGlacierBlock": 15050000,
|
||||
"terminalTotalDifficultyPassed": true,
|
||||
"ethash": {}
|
||||
"ethash": {},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x0000000000000000000000000000000000000dead"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
|
|
|
|||
|
|
@ -53,7 +53,14 @@
|
|||
"londonBlock": 12965000,
|
||||
"arrowGlacierBlock": 13773000,
|
||||
"grayGlacierBlock": 15050000,
|
||||
"ethash": {}
|
||||
"ethash": {},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
|
|
|
|||
|
|
@ -189,7 +189,14 @@
|
|||
"londonBlock": 12965000,
|
||||
"arrowGlacierBlock": 13773000,
|
||||
"grayGlacierBlock": 15050000,
|
||||
"ethash": {}
|
||||
"ethash": {},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
|
|
|
|||
|
|
@ -41,7 +41,14 @@
|
|||
"eip155Block": 10,
|
||||
"eip158Block": 10,
|
||||
"ethash": {},
|
||||
"homesteadBlock": 0
|
||||
"homesteadBlock": 0,
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
},
|
||||
"difficulty": "3509749784",
|
||||
"extraData": "0x4554482e45544846414e532e4f52472d4641313738394444",
|
||||
|
|
|
|||
|
|
@ -61,7 +61,14 @@
|
|||
"londonBlock": 12965000,
|
||||
"arrowGlacierBlock": 13773000,
|
||||
"grayGlacierBlock": 15050000,
|
||||
"ethash": {}
|
||||
"ethash": {},
|
||||
"bor": {
|
||||
"validatorContract": "0x0000000000000000000000000000000000001000",
|
||||
"stateReceiverContract": "0x0000000000000000000000000000000000001001",
|
||||
"burntContract": {
|
||||
"0": "0x00000000000000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue