Skip to content

Declare a smaller gas limit for bounded read-only EVM calls - #216

Open
turbolent wants to merge 1 commit into
mainfrom
bastian/reduce-read-call-gas-reservation
Open

Declare a smaller gas limit for bounded read-only EVM calls#216
turbolent wants to merge 1 commit into
mainfrom
bastian/reduce-read-call-gas-reservation

Conversation

@turbolent

Copy link
Copy Markdown
Member

Description

Optimize gas usage for read-only calls.

Read-only EVM calls in FlowEVMBridgeUtils all declared FlowEVMBridgeConfig.gasLimit (15,000,000),
including calls whose cost is fixed by the ERC20/ERC721 standards.

The FVM admits an EVM call only if the remaining Cadence computation budget covers the declared
gas limit, not the gas the call consumes. At Mainnet's effort weight for EVM gas, 15,000,000 reserves
~1,603 of the 9,999 units a transaction may spend, so a decimals() read burning ~25k gas can be
refused with ~1,500 units unspent — and the payer cannot buy headroom, since 9,999 is the maximum
limit.


For contributor use:

  • Targeted PR against main branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@turbolent turbolent self-assigned this Aug 20, 2026
@turbolent
turbolent requested a review from a team as a code owner August 20, 2026 18:27
@github-project-automation github-project-automation Bot moved this to 👀 In Review in 🌊 Flow 4D Aug 20, 2026
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status
Status: 👀 In Review

Development

Successfully merging this pull request may close these issues.

2 participants