eth/tracers/internal/tracertest: add missing Random to call context (#30652)

Fixes a configuration issue in a test-helper, so that we can do call tracing-tests post-merge
This commit is contained in:
Shude Li 2024-10-23 14:33:14 +08:00 committed by GitHub
parent 478012ab23
commit f8f5609b8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -47,6 +47,11 @@ func (c *callContext) toBlockContext(genesis *core.Genesis) vm.BlockContext {
if genesis.Config.IsLondon(context.BlockNumber) { if genesis.Config.IsLondon(context.BlockNumber) {
context.BaseFee = (*big.Int)(c.BaseFee) context.BaseFee = (*big.Int)(c.BaseFee)
} }
if genesis.Config.TerminalTotalDifficulty != nil && genesis.Config.TerminalTotalDifficulty.Sign() == 0 {
context.Random = &genesis.Mixhash
}
if genesis.ExcessBlobGas != nil && genesis.BlobGasUsed != nil { if genesis.ExcessBlobGas != nil && genesis.BlobGasUsed != nil {
excessBlobGas := eip4844.CalcExcessBlobGas(*genesis.ExcessBlobGas, *genesis.BlobGasUsed) excessBlobGas := eip4844.CalcExcessBlobGas(*genesis.ExcessBlobGas, *genesis.BlobGasUsed)
context.BlobBaseFee = eip4844.CalcBlobFee(excessBlobGas) context.BlobBaseFee = eip4844.CalcBlobFee(excessBlobGas)