Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config for native price estimator in driver #3316

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sunce86
Copy link
Contributor

@sunce86 sunce86 commented Mar 7, 2025

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):

{"base_fee_per_gas":0.707347445,"max_fee_per_gas":2.414698008,"max_priority_fee_per_gas":0.500001559}
{"base_fee_per_gas":0.707347445,"max_fee_per_gas":1.6323970757835722,"max_priority_fee_per_gas":0.15583408436011478}
{"base_fee_per_gas":0.707347445,"max_fee_per_gas":1.5986310602835723,"max_priority_fee_per_gas":0.1386735564680693}

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

  • Added configuration for NativeGasPriceEstimator

How to test

@sunce86 sunce86 self-assigned this Mar 7, 2025
@sunce86 sunce86 requested a review from a team as a code owner March 7, 2025 12:24
#[default]
Native,
Native {
// effective reward value to be selected from each individual block
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: all our comments usually start with capital letter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants