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

Improve the gas estimation algorithm #4261

Open
rach-id opened this issue Jan 23, 2025 · 1 comment
Open

Improve the gas estimation algorithm #4261

rach-id opened this issue Jan 23, 2025 · 1 comment
Labels
enhancement New feature or request WS: BestTxs Reliable and seamless transaction flow

Comments

@rach-id
Copy link
Member

rach-id commented Jan 23, 2025

          > Before we use Z score, IMO we should verify that the gas prices in historical blocks form a normal distribution.

Having a normal distribution is optional in our case IMO since we don't need spot on values. There are three cases:

  • a flat distribution: where the values will generally be close the to the mean which is fine
  • a U distribution (I mean just the shape of the distribution forming an U or a W or similar): where we have two cases: either the low prices will be higher than 10%. Or the high prices will be lower than 90%. but I guess that's fine.

I tried to convey in the ADR that median of top 10% is likely easier and good enough so we don't need to use z scores.

got you 👍 I avoided implementing the percentile because it means implementing a bit of complicated math method and maintaining it and I wanted to avoid that. If we can find a library we can use, that has an open source license, I'll definitely change this implementation.

Originally posted by @rach-id in #4257 (comment)

@rach-id
Copy link
Member Author

rach-id commented Jan 23, 2025

also relevant: #4238 (comment)

@rach-id rach-id added enhancement New feature or request WS: BestTxs Reliable and seamless transaction flow and removed needs:triage labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WS: BestTxs Reliable and seamless transaction flow
Projects
None yet
Development

No branches or pull requests

1 participant