diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 53c3f769c0..3c85ac4153 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -1178,10 +1178,11 @@ func (s *BlockChainAPI) Call(ctx context.Context, args TransactionArgs, blockNrO return result.Return(), result.Err } -// DoEstimateGas returns the lowest possible gas limit that allows the transaction to run +// DoEstimateGas returns some gas limit that allows the transaction to run // successfully at block `blockNrOrHash`. It returns error if the transaction would revert, or if // there are unexpected failures. The gas limit is capped by both `args.Gas` (if non-nil & // non-zero) and `gasCap` (if non-zero). +// The errorRatio specifies how much larger than the minimum necessary gas the result can be. func DoEstimateGas(ctx context.Context, b Backend, args TransactionArgs, blockNrOrHash rpc.BlockNumberOrHash, overrides *StateOverride, gasCap uint64, errorRatio float64) (hexutil.Uint64, error) { // Retrieve the base state and mutate it with any overrides state, header, err := b.StateAndHeaderByNumberOrHash(ctx, blockNrOrHash)