From f8f5609b8eced8421110a9193bbd6cefee40b4af Mon Sep 17 00:00:00 2001 From: Shude Li Date: Wed, 23 Oct 2024 14:33:14 +0800 Subject: [PATCH] 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 --- eth/tracers/internal/tracetest/util.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eth/tracers/internal/tracetest/util.go b/eth/tracers/internal/tracetest/util.go index a74a96f8a4..abc2699498 100644 --- a/eth/tracers/internal/tracetest/util.go +++ b/eth/tracers/internal/tracetest/util.go @@ -47,6 +47,11 @@ func (c *callContext) toBlockContext(genesis *core.Genesis) vm.BlockContext { if genesis.Config.IsLondon(context.BlockNumber) { 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 { excessBlobGas := eip4844.CalcExcessBlobGas(*genesis.ExcessBlobGas, *genesis.BlobGasUsed) context.BlobBaseFee = eip4844.CalcBlobFee(excessBlobGas)