From bfecb5fbcb8ac6e31ce2af02a1f74f3b0991c611 Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 22 Jul 2025 00:31:24 +0800 Subject: [PATCH] fix: potential overflow --- eth/gasestimator/gasestimator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/gasestimator/gasestimator.go b/eth/gasestimator/gasestimator.go index 98a4f74b3e4..7e9d8125de8 100644 --- a/eth/gasestimator/gasestimator.go +++ b/eth/gasestimator/gasestimator.go @@ -170,7 +170,7 @@ func Estimate(ctx context.Context, call *core.Message, opts *Options, gasCap uin break } } - mid := (hi + lo) / 2 + mid := lo + (hi-lo)/2 if mid > lo*2 { // Most txs don't need much higher gas limit than their gas used, and most txs don't // require near the full block limit of gas, so the selection of where to bisect the