Inspiration: Optimistic Gas Limit Pre-Check
Geth implementation (lines 143-159 in gasestimator.go):
// There's a fairly high chance for the transaction to execute successfully
// with gasLimit set to the first execution's usedGas + gasRefund. Explicitly
// check that gas amount and use as a limit for the binary search.
optimisticGasLimit := (result.UsedGas + result.RefundedGas + params.CallStipend) * 64 / 63
if optimisticGasLimit < hi {
failed, _, err = execute(ctx, call, opts, optimisticGasLimit)
if err != nil {
log.Error("Execution error in estimate gas", "err", err)
return 0, nil, err
}
if failed {
lo = optimisticGasLimit
} else {
hi = optimisticGasLimit
}
}
The Ask
Implement analogous behavior for Nibiru's EstimateGas keeper method, which
powers the RPC method.
Inspiration: Optimistic Gas Limit Pre-Check
Geth implementation (lines 143-159 in gasestimator.go):
The Ask
Implement analogous behavior for Nibiru's
EstimateGaskeeper method, whichpowers the RPC method.