Add config for native price estimator in driver #3316
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
This PR adds configuration for 3 parameters that are used for calculation of priority fee in the native gas price estimator.
Note that the default values are equal to currently hardcoded values in
gas_estimation
crate, so no change in behaviour is expected when PR is merged.I've tested the native gas price estimator on Reth node, and IMO this estimator is indeed usable, however, these configuration parameters currently have bad values - only 20% of the lowest paid transactions are considered for analysis, which is the main factor why suggested gas prices are so low, considering the current gas prices used on mainnet.
When this value is increased to 50%, and other two parameters to 50% - 80%, we get much more appropriate prices, with time limits (0s, 18s, 30s):
These new configuration values practically mean that we don't want to suggest prices that barely bring our transaction onchain, but instead, we want our transaction to aim to be averagely paid (we can even aim to be among highest paid transactions with these parameters).
I will test this and other configuration sets to make sure the values are also meaningful in volatile periods.
IMO, when these parameters are properly set, we will probably be able to completely drop additionalTip and minimalTip, as those params were introduced to adjust the native gas price estimator in a simplest way possible, without having to dig into the complex implementation of the estimator.
Changes
How to test