eth,internal: use correct baseFee when BlockOverrides is provided in call/traceCall

This commit is contained in:
ArtificialPB 2024-02-21 16:52:36 +01:00
parent b590cae892
commit 5b61cbb572
No known key found for this signature in database
GPG key ID: ECE6F743FBD83251
2 changed files with 5 additions and 5 deletions

View file

@ -919,7 +919,7 @@ func (api *API) TraceCall(ctx context.Context, args ethapi.TransactionArgs, bloc
config.BlockOverrides.Apply(&vmctx) config.BlockOverrides.Apply(&vmctx)
} }
// Execute the trace // Execute the trace
msg, err := args.ToMessage(api.backend.RPCGasCap(), block.BaseFee()) msg, err := args.ToMessage(api.backend.RPCGasCap(), vmctx.BaseFee)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View file

@ -1093,14 +1093,14 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S
defer cancel() defer cancel()
// Get a new instance of the EVM. // Get a new instance of the EVM.
msg, err := args.ToMessage(globalGasCap, header.BaseFee)
if err != nil {
return nil, err
}
blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil) blockCtx := core.NewEVMBlockContext(header, NewChainContext(ctx, b), nil)
if blockOverrides != nil { if blockOverrides != nil {
blockOverrides.Apply(&blockCtx) blockOverrides.Apply(&blockCtx)
} }
msg, err := args.ToMessage(globalGasCap, blockCtx.BaseFee)
if err != nil {
return nil, err
}
evm := b.GetEVM(ctx, msg, state, header, &vm.Config{NoBaseFee: true}, &blockCtx) evm := b.GetEVM(ctx, msg, state, header, &vm.Config{NoBaseFee: true}, &blockCtx)
// Wait for the context to be done and cancel the evm. Even if the // Wait for the context to be done and cancel the evm. Even if the