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

use partial gas price percentiles #1506

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

use partial gas price percentiles #1506

wants to merge 1 commit into from

Conversation

Tofel
Copy link
Contributor

@Tofel Tofel commented Dec 19, 2024

if some percentile calculations fail due to insufficient data we will still try to use what we could calculate instead of erroring


Below is a summarization created by an LLM (gpt-4-0125-preview). Be mindful of hallucinations and verify accuracy.

Why

The changes improve the robustness and functionality of gas estimation in the blockchain client application by handling partial or incorrect gas estimation data more gracefully and enhancing error handling and logging.

What

  • seth/client.go
    • Improved error handling by considering "Partial data received" as a condition to disable gas price estimations and fallback to hardcoded values.
    • Enhanced logging messages when receiving incorrect gas estimations or when EIP1559 fees are not supported by the network, including conditions where the gas price is set to 0.
  • seth/gas.go
    • Modified error handling in the Stats function to log errors and continue instead of returning immediately upon encountering errors calculating gas percentiles.
    • In quantilesFromFloatArray, replaced direct error returns with logging the error and continuing, facilitating the use of partial data for gas estimation.
  • seth/gas_adjuster.go
    • Introduced checks for NaN values in gas price and tip cap calculations to handle partial data scenarios more effectively. It logs an error and skips automation gas estimation in case of NaN values, indicating partial data reception.

@cl-sonarqube-production
Copy link

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.

1 participant