@@ -1024,7 +1024,7 @@ func (context *ChainContext) GetHeader(hash common.Hash, number uint64) *types.H
1024
1024
return header
1025
1025
}
1026
1026
1027
- func doCall (ctx context.Context , b Backend , args TransactionArgs , state * state.StateDB , header * types.Header , overrides * StateOverride , blockOverrides * BlockOverrides , timeout time.Duration , globalGasCap uint64 ) (* core.ExecutionResult , error ) {
1027
+ func doCall (ctx context.Context , b Backend , args TransactionArgs , state * state.StateDB , header * types.Header , overrides * StateOverride , blockOverrides * BlockOverrides , timeout time.Duration , globalGasCap uint64 , noBaseFee bool ) (* core.ExecutionResult , error ) {
1028
1028
if err := overrides .Apply (state ); err != nil {
1029
1029
return nil , err
1030
1030
}
@@ -1049,7 +1049,7 @@ func doCall(ctx context.Context, b Backend, args TransactionArgs, state *state.S
1049
1049
if blockOverrides != nil {
1050
1050
blockOverrides .Apply (& blockCtx )
1051
1051
}
1052
- evm , vmError := b .GetEVM (ctx , msg , state , header , & vm.Config {NoBaseFee : true }, & blockCtx )
1052
+ evm , vmError := b .GetEVM (ctx , msg , state , header , & vm.Config {NoBaseFee : noBaseFee }, & blockCtx )
1053
1053
1054
1054
// Wait for the context to be done and cancel the evm. Even if the
1055
1055
// EVM has finished, cancelling may be done (repeatedly)
@@ -1083,7 +1083,7 @@ func DoCall(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash
1083
1083
return nil , err
1084
1084
}
1085
1085
1086
- return doCall (ctx , b , args , state , header , overrides , blockOverrides , timeout , globalGasCap )
1086
+ return doCall (ctx , b , args , state , header , overrides , blockOverrides , timeout , globalGasCap , true )
1087
1087
}
1088
1088
1089
1089
func newRevertError (result * core.ExecutionResult ) * revertError {
@@ -1134,7 +1134,7 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO
1134
1134
return result .Return (), result .Err
1135
1135
}
1136
1136
1137
- func DoEstimateGas (ctx context.Context , b Backend , args TransactionArgs , blockNrOrHash rpc.BlockNumberOrHash , gasCap uint64 ) (hexutil.Uint64 , error ) {
1137
+ func DoEstimateGas (ctx context.Context , b Backend , args TransactionArgs , blockNrOrHash rpc.BlockNumberOrHash , gasCap uint64 , noBaseFee bool ) (hexutil.Uint64 , error ) {
1138
1138
// Binary search the gas requirement, as it may be higher than the amount used
1139
1139
var (
1140
1140
lo uint64 = params .TxGas - 1
@@ -1208,7 +1208,7 @@ func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNr
1208
1208
executable := func (gas uint64 , state * state.StateDB , header * types.Header ) (bool , * core.ExecutionResult , error ) {
1209
1209
args .Gas = (* hexutil .Uint64 )(& gas )
1210
1210
1211
- result , err := doCall (ctx , b , args , state , header , nil , nil , 0 , gasCap )
1211
+ result , err := doCall (ctx , b , args , state , header , nil , nil , 0 , gasCap , noBaseFee )
1212
1212
if err != nil {
1213
1213
if errors .Is (err , core .ErrIntrinsicGas ) {
1214
1214
return true , nil , nil // Special case, raise gas limit
@@ -1266,7 +1266,7 @@ func (s *BlockChainAPI) EstimateGas(ctx context.Context, args TransactionArgs, b
1266
1266
if blockNrOrHash != nil {
1267
1267
bNrOrHash = * blockNrOrHash
1268
1268
}
1269
- return DoEstimateGas (ctx , s .b , args , bNrOrHash , s .b .RPCGasCap ())
1269
+ return DoEstimateGas (ctx , s .b , args , bNrOrHash , s .b .RPCGasCap (), false )
1270
1270
}
1271
1271
1272
1272
// RPCMarshalHeader converts the given header to the RPC output .
0 commit comments