From c9c894c07a2638c3b56d542884c802e449cb3506 Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Fri, 29 Mar 2024 15:44:50 -0400 Subject: [PATCH] Inverted wrong logic to apply beacon root in `TraceCall` --- eth/tracers/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index e234851e37..5019780559 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -945,7 +945,8 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc } defer release() - if config != nil && config.TxIndex != nil { + // Apply only when we have used StateAtBlock since `StateAtTransaction` already handles the beacon root + if config == nil || config.TxIndex == nil { if beaconRoot := block.BeaconRoot(); beaconRoot != nil { context := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) vmenv := vm.NewEVM(context, vm.TxContext{}, statedb, api.backend.ChainConfig(), vm.Config{})