Skip to content

Commit 512533d

Browse files
committed
Add note for binary search algorithm used for EstimateGas
1 parent e737742 commit 512533d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

services/requester/requester.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ func (e *EVM) EstimateGas(
379379
height uint64,
380380
stateOverrides *ethTypes.StateOverride,
381381
) (uint64, error) {
382+
// Note: The following algorithm, is largely inspired from
383+
// https://github.com/onflow/go-ethereum/blob/master/eth/gasestimator/gasestimator.go#L49-L192,
384+
// and adapted to fit our use-case.
382385
// Binary search the gas limit, as it may need to be higher than the amount used
383386
var (
384387
failingGasLimit uint64 // lowest-known gas limit where tx execution fails

0 commit comments

Comments
 (0)