Skip to content

Check intrinsic gas in EVM-only CheckTx - #4895

Merged
masih merged 1 commit into
mainfrom
masih/1794907488-evmonly-checktx-intrinsic-gas
Nov 17, 2026
Merged

masih merged 1 commit into
mainfrom
masih/1794907488-evmonly-checktx-intrinsic-gas

Conversation

@masih

@masih masih commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

EVM-only CheckTx validated the signature, fee cap and that the sender could cover gas * price + value, but it did not check the gas limit against the intrinsic gas the executor deducts before running a transaction. A transaction with too little gas for that was admitted and only rejected once it reached block execution.

CheckTx now computes the intrinsic gas with go-ethereum's core.IntrinsicGas, and the EIP-7623 calldata floor with core.FloorDataGas when Prague is active, under the rules of the block after the committed one. It refuses a transaction whose gas limit is below either, using the same errors the state transition returns, before the balance check runs.

CheckTx now computes the transaction's intrinsic gas, and the EIP-7623 calldata floor when Prague is active, under the next block's rules, and refuses a transaction whose gas limit is below either. These are the same limits the executor applies before running the transaction, so admission now agrees with block execution on them.
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedNov 17, 2026, 9:31 AM

@codecov

codecov Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 77.27273% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.65%. Comparing base (c7d841c) to head (e92ee6c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
sei-tendermint/internal/evmonlyapp/app.go 77.27% 5 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4895      +/-   ##
==========================================
+ Coverage   61.62%   61.65%   +0.02%     
==========================================
  Files        2080     2080              
  Lines      162041   162063      +22     
==========================================
+ Hits        99865    99914      +49     
+ Misses      62171    62144      -27     
  Partials        5        5              
Flag Coverage Δ
sei-chain 59.85% <77.27%> (+0.02%) ⬆️
sei-db 75.17% <ø> (ø)
sei-db-state-db 81.61% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
sei-tendermint/internal/evmonlyapp/app.go 87.87% <77.27%> (-0.43%) ⬇️

... and 21 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.

@masih
masih marked this pull request as ready for review November 17, 2026 09:34
@cursor

cursor Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

PR Summary

Medium Risk
Tightens mempool admission on a critical path; misaligned fork rules or gas math could wrongly admit or reject txs, though logic mirrors go-ethereum execution checks.

Overview
EVM-only CheckTx now rejects transactions whose gas limit does not cover the intrinsic gas (and, under Prague, the EIP-7623 calldata floor) that block execution would charge before the existing balance check.

Admission uses go-ethereum’s IntrinsicGas / FloorDataGas with fork rules for the next block (nextBlockRules), returning the same errors as state transition when gas is too low.

A new table-driven test covers zero gas, transfer/create thresholds, and calldata-floor cases.

Reviewed by Cursor Bugbot for commit e92ee6c. Bugbot is set up for automated code reviews on this repo. Configure here.

@seidroid seidroid Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

EVM-only CheckTx now rejects transactions whose gas limit is below the intrinsic gas, or below the EIP-7623 calldata floor when Prague is active. It uses the same rules and error wrapping as the go-ethereum fork's state transition, so admission matches what execution charges, and the change comes with table tests at each boundary; I found nothing blocking. The only other reader, codex, found nothing, which agrees with this review, so there was nothing from it to keep or drop.

seidroid review · decision approve · session e17214add73248f89a7a00bcf33cafc1 · turn resp_claude_fb3b4341e9c87d1e313a6f1f20752b8b · item 83563f7ca1b051bb81b9e4657499e536

Findings: 0 blocking | 0 non-blocking | 0 posted inline

@masih
masih requested review from codchen and sei-will November 17, 2026 09:45
@masih
masih added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 90b7acf Nov 17, 2026
92 of 94 checks passed
@masih
masih deleted the masih/1794907488-evmonly-checktx-intrinsic-gas branch November 17, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants