Skip to content

Commit 5b61cbb

Browse files
committed
eth,internal: use correct baseFee when BlockOverrides is provided in call/traceCall
1 parent b590cae commit 5b61cbb

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

eth/tracers/api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc
919919
config.BlockOverrides.Apply(&vmctx)
920920
}
921921
// Execute the trace
922-
msg, err := args.ToMessage(api.backend.RPCGasCap(), block.BaseFee())
922+
msg, err := args.ToMessage(api.backend.RPCGasCap(), vmctx.BaseFee)
923923
if err != nil {
924924
return nil, err
925925
}

internal/ethapi/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,14 +1093,14 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S
10931093
defer cancel()
10941094

10951095
// Get a new instance of the EVM.
1096-
msg, err := args.ToMessage(globalGasCap, header.BaseFee)
1097-
if err != nil {
1098-
return nil, err
1099-
}
11001096
blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil)
11011097
if blockOverrides != nil {
11021098
blockOverrides.Apply(&blockCtx)
11031099
}
1100+
msg, err := args.ToMessage(globalGasCap, blockCtx.BaseFee)
1101+
if err != nil {
1102+
return nil, err
1103+
}
11041104
evm := b.GetEVM(ctx, msg, state, header, &vm.Config{NoBaseFee: true}, &blockCtx)
11051105

11061106
// Wait for the context to be done and cancel the evm. Even if the

0 commit comments

Comments
 (0)