diff --git a/eth/precompiles/modexp.py b/eth/precompiles/modexp.py index f971bd4b93..e477ce6013 100644 --- a/eth/precompiles/modexp.py +++ b/eth/precompiles/modexp.py @@ -35,7 +35,7 @@ def _compute_complexity(length): length ** 2 // 4 + 96 * length - 3072 ) else: - return 2 ** 2 // 16 + 480 * length - 199680 + return length ** 2 // 16 + 480 * length - 199680 def _extract_lengths(data): diff --git a/tests/json-fixtures/test_state.py b/tests/json-fixtures/test_state.py index 9e42524b5b..71d0ee0159 100644 --- a/tests/json-fixtures/test_state.py +++ b/tests/json-fixtures/test_state.py @@ -138,11 +138,6 @@ def expand_fixtures_forks(all_fixtures): # Ideally, this list should be empty. # WHEN ADDING ENTRIES, ALWAYS PROVIDE AN EXPLANATION! INCORRECT_UPSTREAM_TESTS = { - # Upstream seems to specify that the precompile call fails, but `py-evm` - # handles it just fine. - # * https://github.com/ethereum/py-evm/pull/1224#issuecomment-417351843 - # * https://github.com/ethereum/tests/pull/405#issuecomment-417855812 - ('stReturnDataTest/modexp_modsize0_returndatasize.json', 'modexp_modsize0_returndatasize', 'Byzantium', 4), # noqa: E501 }