Add GasEstimation based on actual transaction block inclusion latency #14671
+1,084
−425
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
There are various different components that affect transaction inclusion in the block - backpressures, block gas limit, reordering, etc. It is very hard and fragile (in some cases impossible) to reverse-engineer all that form onchain information, and provide appropriate gas estimation.
Much more robust way is to use actual latency from transaction being ready in mempool (i.e. not being parked) to the time it is included in the block that commits it (as that is the part that gas price affects)
So add logic to track such information and provide it to the API implementation, which can then use it to produce better gas estimation.
One negative is that enough traffic needs to go through a particular endpoint for it to have enough information to use it for the gas estimation. So making it configurable in the node config, so that only nodes receiving enough traffic can enable it for better estimation.
Type of Change
Which Components or Systems Does This Change Impact?
How Has This Been Tested?
will enable and test on forge workload sweep
Key Areas to Review
Checklist