-
Notifications
You must be signed in to change notification settings - Fork 128
Open
Description
Currently, the gas tip estimator performs about 40 queries to
the DB for every updates. While it caches the latest value, it
could be made much more efficient with little effort.
The general flow of gas estimation as it is now is as follows:
- From the latest 20 canonical blocks, get the base fee and the
three cheapest transactions (in terms of gas tip); - Of those (at most) 60 values, take the median.
Now, for that number of values all we really need is to keep a
window of those ordered by block number, with a safety margin
for reorgs, in memory, which amounts to at most a few kiB.
If we update this array on every canonical block, we avoid
accessing the DB entirely to estimate gas tips.
Metadata
Metadata
Assignees
Labels
No labels