test_max_code_size_high_jumpdest()¶
Documentation for tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py::test_max_code_size_high_jumpdest@c74f1a67.
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_high_jumpdest --fork Amsterdam
Ensure jump destination validity is enforced past the old size limits.
Deploy a MAX_CODE_SIZE contract that stores a sentinel and then jumps
near the new limit, far beyond the old 24 KiB code and 48 KiB initcode
limits, then call it through a caller that records the call's success:
valid_high_jumpdest: the target byte is a realJUMPDEST, so the jump succeeds, the frame returns, and the sentinel store is kept.invalid_high_dest: the target byte is aSTOP(not aJUMPDEST), so the jump is rejected, the frame reverts, and the sentinel store is discarded.
A client whose jumpdest analysis or code execution does not cover the full new code range fails one of the two cases. No existing test executes a contract at a program counter beyond the old limit.
Source code in tests/amsterdam/eip7954_increase_max_contract_size/test_max_code_size.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
Parametrized Test Cases¶
This test generates 2 parametrized test cases across 1 fork.