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 GasEstimation based on actual transaction block inclusion latency #14671

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

igor-aptos
Copy link
Contributor

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

  • New feature

Which Components or Systems Does This Change Impact?

  • Full Node (API, Indexer, etc.)

How Has This Been Tested?

will enable and test on forge workload sweep

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Sep 18, 2024

⏱️ 8m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 2m 🟥
general-lints 2m 🟩
rust-cargo-deny 2m 🟩
check-dynamic-deps 51s 🟩
semgrep/ci 19s 🟩
file_change_determinator 13s 🟩
file_change_determinator 11s 🟩
permission-check 7s 🟩
permission-check 3s 🟩
permission-check 3s 🟩
permission-check 2s 🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@igor-aptos igor-aptos force-pushed the igor/exclude_majority_traffic_for_gas_estimation branch 2 times, most recently from a2297cd to e4dc9b5 Compare September 19, 2024 19:37
Base automatically changed from igor/exclude_majority_traffic_for_gas_estimation to main September 19, 2024 22:13
Copy link
Contributor

github-actions bot commented Nov 4, 2024

This issue is stale because it has been open 45 days with no activity. Remove the stale label, comment or push a commit - otherwise this will be closed in 15 days.

@github-actions github-actions bot added the Stale label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant