Skip to content

Commit b75ba80

Browse files
committed
feat(spec-specs, tests): EIP-8037 - CREATE failure refunds state gas to reservoir (ethereum#2704)
1 parent a7a5719 commit b75ba80

3 files changed

Lines changed: 443 additions & 78 deletions

File tree

tests/amsterdam/eip8037_state_creation_gas_cost_increase/spec.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
from dataclasses import dataclass
44

5+
from execution_testing.vm import Bytecode, Op
6+
7+
8+
def init_code_at_high_bytes(
9+
init_code: Op | Bytecode | bytes,
10+
) -> tuple[int, int]:
11+
"""Return (mstore_value, size) to place init_code at memory[0:size]."""
12+
code_bytes = bytes(init_code)
13+
size = len(code_bytes)
14+
return int.from_bytes(code_bytes, "big") << (256 - 8 * size), size
15+
516

617
@dataclass(frozen=True)
718
class ReferenceSpec:

0 commit comments

Comments
 (0)