Skip to content

fix: align charged gas with EIP-7623 calldata floor after refunds#1186

Open
mmsqe wants to merge 4 commits into
cosmos:mainfrom
mmsqe:align_refund_main
Open

fix: align charged gas with EIP-7623 calldata floor after refunds#1186
mmsqe wants to merge 4 commits into
cosmos:mainfrom
mmsqe:align_refund_main

Conversation

@mmsqe
Copy link
Copy Markdown
Collaborator

@mmsqe mmsqe commented May 18, 2026

Description

EIP-7623 requires charged gas to be at least the calldata floor. The check was applied up front but not re-enforced after refunds, letting final amount drop below the floor and diverge from go-ethereum. This clamps gasUsed up to floorDataGas after refunds in ApplyMessageWithConfig when rules.IsPrague.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • tackled an existing issue or discussed with a team member
  • left instructions on how to review the changes
  • targeted the main branch

@mmsqe mmsqe requested a review from a team as a code owner May 18, 2026 11:12
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 18, 2026

PR author is not in the allowed authors list.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.92%. Comparing base (008c171) to head (b7d3309).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1186      +/-   ##
==========================================
- Coverage   66.99%   66.92%   -0.07%     
==========================================
  Files         320      320              
  Lines       23433    23436       +3     
==========================================
- Hits        15698    15685      -13     
- Misses       6578     6591      +13     
- Partials     1157     1160       +3     
Files with missing lines Coverage Δ
x/vm/keeper/state_transition.go 85.42% <100.00%> (+0.12%) ⬆️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aljo242
Copy link
Copy Markdown
Contributor

aljo242 commented May 26, 2026

fix looks correct, two nits before merge:

  1. state_transition.go:597: the #nosec G115 on int64(floorDataGas) suppresses the warning but gives no explanation. add a brief comment on why overflow is unreachable (e.g. gas values are bounded by block gas limit, far below MaxInt64).

  2. pr description is still the template placeholder: Closes: #XXXX, all checklist items unchecked, no description of what changed. please fill in before merge.

Copy link
Copy Markdown
Contributor

@aljo242 aljo242 left a comment

Choose a reason for hiding this comment

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

nosec comment missing explanation; pr description is still the template placeholder.

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.

2 participants