Skip to content

Commit

Permalink
evm/verkle: fix charging base gas for address accessing opcodes
Browse files Browse the repository at this point in the history
  • Loading branch information
jochem-brouwer committed Dec 26, 2024
1 parent 92ff519 commit e2d2cb7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/evm/src/opcodes/EIP2929.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export function accessAddressEIP2929(
// if verkle not activated
if (chargeGas && !common.isActivatedEIP(6800)) {
return common.param('coldaccountaccessGas')
} else if (chargeGas && common.isActivatedEIP(6800)) {
// If Verkle is active, then the warmstoragereadGas should still be charged
// This is because otherwise opcodes will have cost 0 (this is thus the base fee)
return common.param('warmstoragereadGas')

Check warning on line 37 in packages/evm/src/opcodes/EIP2929.ts

View check run for this annotation

Codecov / codecov/patch

packages/evm/src/opcodes/EIP2929.ts#L37

Added line #L37 was not covered by tests
}
// Warm: (selfdestruct beneficiary address reads are not charged when warm)
} else if (chargeGas && !isSelfdestruct) {
Expand Down

0 comments on commit e2d2cb7

Please sign in to comment.