Skip to content

Gas tracker optimization - #7420

Merged
sstanculeanu merged 10 commits into
feat/supernova-async-execfrom
gas-tracker-optimization
Nov 14, 2025
Merged

Gas tracker optimization#7420
sstanculeanu merged 10 commits into
feat/supernova-async-execfrom
gas-tracker-optimization

Conversation

@sstanculeanu

Copy link
Copy Markdown
Collaborator

Reasoning behind the pull request

  • avoid spamming epochs handler and rounds handler for each tx, initially reported here

Proposed changes

  • implemented mechanism to only call them until supernova si active

Testing procedure

  • with feat branch

Pre-requisites

Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:

  • was the PR targeted to the correct branch?
  • if this is a larger feature that probably needs more than one PR, is there a feat branch created?
  • if this is a feat branch merging, do all satellite projects have a proper tag inside go.mod?

@sstanculeanu sstanculeanu self-assigned this Nov 11, 2025
@sstanculeanu sstanculeanu added the ignore-for-release-notes Do not include item in release notes label Nov 11, 2025
@codecov

codecov Bot commented Nov 11, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.46%. Comparing base (6b86d8d) to head (a9eb2be).

Files with missing lines Patch % Lines
process/block/preprocess/gasTracker.go 89.18% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@                    Coverage Diff                     @@
##           feat/supernova-async-exec    #7420   +/-   ##
==========================================================
  Coverage                      77.45%   77.46%           
==========================================================
  Files                            869      869           
  Lines                         118182   118237   +55     
==========================================================
+ Hits                           91540    91587   +47     
- Misses                         20628    20635    +7     
- Partials                        6014     6015    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines +74 to +77
// if already computed, only store the new round
if gt.overEstimationFactor != noOverestimationFactor {
return
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just to keep in mind.
This logic assumes the overestimation factor is static and only needs to be computed once. But if in the future the overestimation factor becomes epoch-depended/dynamic then the gas tracker will never refresh the factor.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

that's correct

Comment thread process/block/preprocess/gasTracker.go Outdated
}

// RoundConfirmed is called whenever a new round is confirmed
func (gt *gasTracker) RoundConfirmed(round uint64, _ uint64) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

in the end this will be called will on each round, even if it will not call gt.economicsFee.BlockCapacityOverestimationFactor() anymore after activation, it's not computational heavy so not sure if it's a performance improvement compared to the other implementation

how many times per round will computeGasProvided be called? if it's only once per round, it might not be an improvement

not a strong optinion though

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

it was called once for each tx

@sstanculeanu
sstanculeanu merged commit da23b3a into feat/supernova-async-exec Nov 14, 2025
8 of 9 checks passed
@sstanculeanu
sstanculeanu deleted the gas-tracker-optimization branch November 14, 2025 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ignore-for-release-notes Do not include item in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants