@@ -370,14 +370,16 @@ def evm_code_types(cls, block_number: int = 0, timestamp: int = 0) -> List[EVMCo
370
370
return [EVMCodeType .LEGACY ]
371
371
372
372
@classmethod
373
- def max_code_size (cls ) -> int | None :
373
+ def max_code_size (cls ) -> int :
374
374
"""At genesis, there is no upper bound for code size (bounded by block gas limit)."""
375
- return None
375
+ """However, the default is set to the limit of EIP-170 (Spurious Dragon)"""
376
+ return 0x6000
376
377
377
378
@classmethod
378
- def max_initcode_size (cls ) -> int | None :
379
- """At genesis, there is no upper bound for initcode size (bounded by block gas limit)."""
380
- return None
379
+ def max_initcode_size (cls ) -> int :
380
+ """At genesis, there is no upper bound for initcode size."""
381
+ """However, the default is set to the limit of EIP-3860 (Shanghai)"""
382
+ return 0xC000
381
383
382
384
@classmethod
383
385
def call_opcodes (
@@ -645,7 +647,7 @@ def precompiles(cls, block_number: int = 0, timestamp: int = 0) -> List[Address]
645
647
)
646
648
647
649
@classmethod
648
- def max_code_size (cls ) -> int | None :
650
+ def max_code_size (cls ) -> int :
649
651
# NOTE: Move this to Spurious Dragon once this fork is introduced. See EIP-170.
650
652
"""At Spurious Dragon, an upper bound was introduced for max contract code size."""
651
653
return 0x6000
@@ -877,9 +879,9 @@ def engine_new_payload_version(
877
879
return 2
878
880
879
881
@classmethod
880
- def max_initcode_size (cls ) -> int | None :
882
+ def max_initcode_size (cls ) -> int :
881
883
"""From Shanghai, the initcode size is now limited. See EIP-3860."""
882
- return int ( 0xC000 )
884
+ return 0xC000
883
885
884
886
@classmethod
885
887
def valid_opcodes (
@@ -1339,13 +1341,13 @@ def engine_get_blobs_version(cls, block_number: int = 0, timestamp: int = 0) ->
1339
1341
return 2
1340
1342
1341
1343
@classmethod
1342
- def max_code_size (cls ) -> int | None :
1344
+ def max_code_size (cls ) -> int :
1343
1345
"""From Osaka, the max code size is lifted. See EIP-7907."""
1344
1346
return int (0x40000 )
1345
1347
1346
1348
@classmethod
1347
- def max_initcode_size (cls ) -> int | None :
1348
- """At genesis, there is no upper bound for initcode size (bounded by block gas limit) ."""
1349
+ def max_initcode_size (cls ) -> int :
1350
+ """From Osaka, the max initcode size is lifted. See EIP-7907 ."""
1349
1351
return int (0x80000 )
1350
1352
1351
1353
@classmethod
0 commit comments