This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Commit 7752f05
committed
eth/precompiles/modexp: fix complexity calc (length^2, not 2^2).
There was a typo in the "complexity" calculation function, a
special interim value from EIP-198 used to determine total gas
use.
The code path was never previously exercised.
NOTE: previous-commit "fixtures bump" was to commit:
9b1f07c58a70d1b17c4489c49eb9bebf4a27d290
Squashed commit:
tests: update "very big number" in test_modexp_gas_fee_calculation().
... and also fix that test's name, from "calculTation".
The very-big-number is not actually in EIP-198; the latter has
this to say:
> it’s not possible to provide enough gas to make that computation.
That's a bit cryptic, but the gist is that the most that can be
represented in a 256-bit number is
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
which is
115792089237316195423570985008687907853269984665640564039457584007913129639935
and that's less than the
10684346944173007063723051170445283632835119638284563472873463025465780712173320789629146724657549280936306536701227228889744512638312451529980055895215896
required by this vector, or even the (erroneous)
708647586132375115992254428253169996062012306153720251921480414128428353393856280
that was in the test previously.1 parent b11a7b8 commit 7752f05
File tree
3 files changed
+3
-8
lines changed- eth/precompiles
- tests
- core/vm
- json-fixtures
3 files changed
+3
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | 141 | | |
147 | 142 | | |
148 | 143 | | |
| |||
0 commit comments