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

fix: api: compute gasUsedRatio based on max gas in the tipset #11354

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

Stebalien
Copy link
Member

Related Issues

fixes #10515

Proposed Changes

When computing the gasUsedRatio in the Ethereum JSON-RPC APIs use MaxBlockGas * len(TipSet), instead of the max block gas. Otherwise, we get ratios over 1.

The new value isn't entirely correct either (we should probably compute an average of the gas used in each block in the tipset?), but it's good enough.

Checklist

Before you mark the PR ready for review, please make sure that:

  • Commits have a clear commit message.
  • PR title is in the form of of <PR type>: <area>: <change being made>
    • example: fix: mempool: Introduce a cache for valid signatures
    • PR type: fix, feat, build, chore, ci, docs, perf, refactor, revert, style, test
    • area, e.g. api, chain, state, market, mempool, multisig, networking, paych, proving, sealing, wallet, deps
  • If the PR affects users (e.g., new feature, bug fix, system requirements change), update the CHANGELOG.md and add details to the UNRELEASED section.
  • Tests exist for new functionality or change in behavior
  • CI is green

We were computing this based on the max block gas, but this is
incorrect. The new value isn't entirely correct either (we should
probably compute an average of the gas used in each block in the
tipset?), but it's good enough.

fixes #10515
@Stebalien Stebalien requested a review from a team as a code owner October 26, 2023 20:59
@Stebalien Stebalien merged commit 3f00691 into master Oct 27, 2023
87 checks passed
@Stebalien Stebalien deleted the steb/fix-10515 branch October 27, 2023 14:37
jennijuju pushed a commit that referenced this pull request Nov 1, 2023
We were computing this based on the max block gas, but this is
incorrect. The new value isn't entirely correct either (we should
probably compute an average of the gas used in each block in the
tipset?), but it's good enough.

fixes #10515
Stebalien pushed a commit that referenced this pull request Nov 1, 2023
We were computing this based on the max block gas, but this is
incorrect. The new value isn't entirely correct either (we should
probably compute an average of the gas used in each block in the
tipset?), but it's good enough.

fixes #10515
Stebalien added a commit that referenced this pull request Nov 1, 2023
We were computing this based on the max block gas, but this is
incorrect. The new value isn't entirely correct either (we should
probably compute an average of the gas used in each block in the
tipset?), but it's good enough.

fixes #10515
@jennijuju jennijuju mentioned this pull request Nov 1, 2023
jennijuju pushed a commit that referenced this pull request Nov 2, 2023
We were computing this based on the max block gas, but this is
incorrect. The new value isn't entirely correct either (we should
probably compute an average of the gas used in each block in the
tipset?), but it's good enough.

fixes #10515
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.

eth_feeHistory: gasUsedRatio over 1
2 participants