Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EVM-Equivalence] Charge for zkEVM Contract Decommits #481

Open
wants to merge 2 commits into
base: evm-equivalence-yul
Choose a base branch
from

Conversation

jrchatruc
Copy link
Contributor

What ❔

Following CodeOracle contract, charge for zkEVM contracts decommits

Why ❔

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.

@jrchatruc jrchatruc changed the title Charge for zkEVM Contract Decommits [EVM-Equivalence] Charge for zkEVM Contract Decommits Jun 5, 2024
zkevmGas := mul(_evmGas, GAS_DIVISOR())
let byteSize := extcodesize(addr)
zkevmGas := add(zkevmGas, mul(byteSize, DECOMMIT_COST_PER_WORD()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

  1. the cost is per word (as the name implies). I.e. it is not byteSize * DECOMMIT_COST_PER_WORD, it is ceil(byteSize / 32) * DECOMMIT_COST_PER_WORD.
  2. the cost should be charged and not added to the user.

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.

None yet

2 participants