Commit 93984e2
authored
feat(tests): port stPreCompiledContracts/modexp 128-byte carry cases (#2753)
Add two MODEXP parametrizations with 128-byte (1024-bit) operands to
test_modexp. Both use modulus 2**1024 - 0x69 and reduce to 9^exp mod m
(in the first case, base = m + 9). The modulus size forces the
implementation through the multi-word Montgomery/Barrett reduction
path rather than any 256-bit specialization.
Also bump the test's gas_limit from 500k to 2M so the Byzantium
pre-EIP-2565 cost (~682k for a 128-byte modulus) fits. The bump is a
no-op for every existing case: the "out-of-gas" params OOG on
modexp's own gas formula (huge declared exp/mod lengths), not on the
tx cap, so they stay OOG at 2M.
Ported from two legacy fillers that the bulk static-filler import in
#1442 did not pull in:
- src/LegacyTests/Constantinople/GeneralStateTestsFiller/
stPreCompiledContracts/modexp_37120_37111_37111_1000000Filler.json
- src/LegacyTests/Constantinople/GeneralStateTestsFiller/
stPreCompiledContracts/modexp_9_37111_37111_1000000Filler.json
Those fillers live in the ethereum/tests LegacyTests submodule
(ethereum/legacytests), which the original port did not descend into.1 parent e7043cc commit 93984e2
1 file changed
Lines changed: 30 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
449 | 449 | | |
450 | 450 | | |
451 | 451 | | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
452 | 475 | | |
453 | 476 | | |
454 | 477 | | |
455 | 478 | | |
456 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
457 | 486 | | |
458 | 487 | | |
459 | 488 | | |
| |||
504 | 533 | | |
505 | 534 | | |
506 | 535 | | |
507 | | - | |
| 536 | + | |
508 | 537 | | |
509 | 538 | | |
510 | 539 | | |
| |||
0 commit comments