test_max_code_size_jumpdest_in_immediate()¶
Documentation for tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py::test_max_code_size_jumpdest_in_immediate@5c024cbb.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py::test_max_code_size_jumpdest_in_immediate --fork Amsterdam
Ensure jumpdest analysis classifies a 0x5B immediate byte correctly at
the new max code size.
A 0x5B sits as the last byte of a MAX_CODE_SIZE contract, right after
an immediate-carrying opcode, and the contract jumps to it:
push1_data_rejected: the0x5BisPUSHdata, always skipped by the analysis, so it is not aJUMPDESTand the jump is rejected.dupn/swapn/exchange: per EIP-80240x5Bis an invalid immediate for these opcodes, so it is not skipped and stays a validJUMPDEST, and the jump is accepted.
Exercises the immediate-skipping branches of jumpdest analysis well past the old 24 KiB code and 48 KiB initcode limits.
Source code in tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
Parametrized Test Cases¶
This test generates 4 parametrized test cases across 1 fork.