Inverted wrong logic to apply beacon root in TraceCall

This commit is contained in:
Matthieu Vachon 2024-03-29 15:44:50 -04:00
parent 599c461cad
commit c9c894c07a

View file

@ -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{})