From 50729ecb0b5fff3ed63e113695ed5e2ef6b0a8a9 Mon Sep 17 00:00:00 2001 From: William Morriss Date: Tue, 7 May 2024 18:04:51 -0700 Subject: [PATCH] fix DoEstimateGas docs and document errorRatio parameter --- internal/ethapi/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)