@@ -369,6 +369,16 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo
369
369
"""At Genesis, only legacy EVM code is supported."""
370
370
return [EVMCodeType .LEGACY ]
371
371
372
+ @classmethod
373
+ def max_code_size (cls ) -> None :
374
+ """At genesis, there is no upper bound for code size (bounded by block gas limit)."""
375
+ return None
376
+
377
+ @classmethod
378
+ def max_initcode_size (cls ) -> None :
379
+ """At genesis, there is no upper bound for initcode size (bounded by block gas limit)."""
380
+ return None
381
+
372
382
@classmethod
373
383
def call_opcodes (
374
384
cls , block_number : int = 0 , timestamp : int = 0
@@ -634,6 +644,12 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]
634
644
block_number , timestamp
635
645
)
636
646
647
+ @classmethod
648
+ def max_code_size (cls ) -> int :
649
+ # NOTE: Move this to Spurious Dragon once this fork is introduced. See EIP-170.
650
+ """At Spurious Dragon, an upper bound was introduced for max contract code size."""
651
+ return int (0x6000 )
652
+
637
653
@classmethod
638
654
def call_opcodes (
639
655
cls , block_number : int = 0 , timestamp : int = 0
@@ -860,6 +876,11 @@ def engine_new_payload_version(
860
876
"""From Shanghai, new payload calls must use version 2."""
861
877
return 2
862
878
879
+ @classmethod
880
+ def max_initcode_size (cls ) -> int :
881
+ """From Shanghai, the initcode size is now limited. See EIP-3860."""
882
+ return int (0xC000 )
883
+
863
884
@classmethod
864
885
def valid_opcodes (
865
886
cls ,
@@ -1317,6 +1338,16 @@ def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) ->
1317
1338
"""At Osaka, the engine get blobs version is 2."""
1318
1339
return 2
1319
1340
1341
+ @classmethod
1342
+ def max_code_size (cls ) -> int :
1343
+ """From Osaka, the max code size is lifted. See EIP-7907."""
1344
+ return int (0x40000 )
1345
+
1346
+ @classmethod
1347
+ def max_initcode_size (cls ) -> int :
1348
+ """At genesis, there is no upper bound for initcode size (bounded by block gas limit)."""
1349
+ return int (0x80000 )
1350
+
1320
1351
@classmethod
1321
1352
def is_deployed (cls ) -> bool :
1322
1353
"""
0 commit comments