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

Merged
merged 3 commits into from
Jul 29, 2024

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed here 1a88e64

@jrchatruc jrchatruc merged commit 398aeb4 into evm-equivalence-yul Jul 29, 2024
16 of 17 checks passed
@jrchatruc jrchatruc deleted the yul-charge-decommit-fixed branch July 29, 2024 15:01
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