@@ -364,6 +364,16 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo
364
364
"""At Genesis, only legacy EVM code is supported."""
365
365
return [EVMCodeType .LEGACY ]
366
366
367
+ @classmethod
368
+ def max_code_size (cls ) -> None :
369
+ """At genesis, there is no upper bound for code size (bounded by block gas limit)."""
370
+ return None
371
+
372
+ @classmethod
373
+ def max_initcode_size (cls ) -> None :
374
+ """At genesis, there is no upper bound for initcode size (bounded by block gas limit)."""
375
+ return None
376
+
367
377
@classmethod
368
378
def call_opcodes (
369
379
cls , block_number : int = 0 , timestamp : int = 0
@@ -629,6 +639,12 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]
629
639
block_number , timestamp
630
640
)
631
641
642
+ @classmethod
643
+ def max_code_size (cls ) -> int :
644
+ # NOTE: Move this to Spurious Dragon once this fork is introduced. See EIP-170.
645
+ """At Spurious Dragon, an upper bound was introduced for max contract code size."""
646
+ return int (0x6000 )
647
+
632
648
@classmethod
633
649
def call_opcodes (
634
650
cls , block_number : int = 0 , timestamp : int = 0
@@ -855,6 +871,11 @@ def engine_new_payload_version(
855
871
"""From Shanghai, new payload calls must use version 2."""
856
872
return 2
857
873
874
+ @classmethod
875
+ def max_initcode_size (cls ) -> int :
876
+ """From Shanghai, the initcode size is now limited. See EIP-3860."""
877
+ return int (0xC000 )
878
+
858
879
@classmethod
859
880
def valid_opcodes (
860
881
cls ,
@@ -1302,6 +1323,16 @@ def engine_get_payload_version(
1302
1323
"""From Osaka, get payload calls must use version 5."""
1303
1324
return 5
1304
1325
1326
+ @classmethod
1327
+ def max_code_size (cls ) -> int :
1328
+ """From Osaka, the max code size is lifted. See EIP-7907."""
1329
+ return int (0x40000 )
1330
+
1331
+ @classmethod
1332
+ def max_initcode_size (cls ) -> int :
1333
+ """At genesis, there is no upper bound for initcode size (bounded by block gas limit)."""
1334
+ return int (0x80000 )
1335
+
1305
1336
@classmethod
1306
1337
def is_deployed (cls ) -> bool :
1307
1338
"""
0 commit comments