plugeth/internal/ethapi
Roberto Bayardo 950ccddfc8
internal/ethapi: optimize & clean up EstimateGas (#27710)
Optimizations:

- Previously, if a transaction was reverting, EstimateGas would exhibit worst-case behavior and binary search up to the max gas limit (~40 state-clone + tx executions). This change allows EstimateGas to return after only a single unconstrained execution in this scenario.
- Uses the gas used from the unconstrained execution to bias the remaining binary search towards the likely solution in a simple way that doesn't impact the worst case. For a typical contract-invoking transaction, this reduces the median number of state-clone+executions from 25 to 18 (28% reduction).

Cleanup:

- added & improved function + code comments
- correct the EstimateGas documentation to clarify the gas limit determination is at latest block, not pending, if the blockNr is unspecified.
2023-08-18 03:03:14 -04:00
..
addrlock.go all: update license information (#16089) 2018-02-14 13:49:11 +01:00
api_test.go internal/ethapi: implement eth_getBlockReceipts (#27702) 2023-08-15 14:35:48 +02:00
api.go internal/ethapi: optimize & clean up EstimateGas (#27710) 2023-08-18 03:03:14 -04:00
backend.go all: move main transaction pool into a subpool (#27463) 2023-06-16 15:29:40 +03:00
dbapi.go all: remove concept of public/private API definitions (#25053) 2022-06-21 12:05:43 +03:00
transaction_args_test.go all: move main transaction pool into a subpool (#27463) 2023-06-16 15:29:40 +03:00
transaction_args.go internal/ethapi: add state override to estimateGas (#27845) 2023-08-07 16:03:57 +02:00