Skip to content

fix: add costs for writing to storage and logs#346

Merged
neutrinoks merged 1 commit into
devfrom
fix/blk-68-gas-under-metering-in-permit-precompile
May 23, 2025
Merged

fix: add costs for writing to storage and logs#346
neutrinoks merged 1 commit into
devfrom
fix/blk-68-gas-under-metering-in-permit-precompile

Conversation

@neutrinoks

Copy link
Copy Markdown
Contributor
  • affects missing gas costs in evm precompile balances_erc20 method permit
  • added gas costs for writing to storage and emitting the log
  • implementation is aligned to the record_db_read() method in frontier

@neutrinoks neutrinoks requested review from sfffaaa and talhadaar May 16, 2025 12:11
@neutrinoks neutrinoks self-assigned this May 16, 2025
@sfffaaa sfffaaa requested a review from Copilot May 22, 2025 13:28

Copilot AI 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.

Pull Request Overview

This PR adds missing gas cost calculations in the EIP2612 permit method for the balances-erc20 precompile by incorporating storage and log gas cost computations.

  • Added gas cost recording for writing to storage via record_cost and record_external_cost.
  • Introduced gas cost handling for log calls using record_log_costs_manual.

Comment thread precompiles/balances-erc20/src/eip2612.rs Outdated
Comment thread precompiles/balances-erc20/src/eip2612.rs Outdated
@neutrinoks neutrinoks force-pushed the fix/blk-68-gas-under-metering-in-permit-precompile branch 2 times, most recently from cb2e214 to 0098d1b Compare May 22, 2025 15:00
@neutrinoks neutrinoks force-pushed the fix/blk-68-gas-under-metering-in-permit-precompile branch from 0098d1b to a09724c Compare May 23, 2025 05:45
@neutrinoks neutrinoks merged commit 8f9235d into dev May 23, 2025
1 check passed
@neutrinoks neutrinoks deleted the fix/blk-68-gas-under-metering-in-permit-precompile branch May 23, 2025 10:39
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.

4 participants