Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/ethereum/osaka/vm/precompiled_contracts/modexp.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,10 @@ def complexity(base_length: U256, modulus_length: U256) -> Uint:
"""
max_length = max(Uint(base_length), Uint(modulus_length))
words = (max_length + Uint(7)) // Uint(8)
complexity = words ** Uint(2)
if max_length <= Uint(32):
return complexity
else:
return Uint(2) * complexity
complexity = Uint(16)
if max_length > Uint(32):
complexity = Uint(2) * words ** Uint(2)
return complexity


def iterations(exponent_length: U256, exponent_head: U256) -> Uint:
Expand Down
6 changes: 6 additions & 0 deletions tests/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,14 @@ class _FixtureSource(TypedDict):
"url": "https://github.com/ethereum/execution-spec-tests/releases/download/v4.5.0/fixtures_stable.tar.gz",
"fixture_path": "tests/fixtures/latest_fork_tests",
},
"osaka_tests": {
"url": "https://github.com/ethereum/execution-spec-tests/releases/download/fusaka-devnet-2%40v1.1.0/fixtures_fusaka-devnet-2.tar.gz",
"fixture_path": "tests/fixtures/osaka_tests",
},
}


ETHEREUM_TESTS_PATH = TEST_FIXTURES["ethereum_tests"]["fixture_path"]
EEST_TESTS_PATH = TEST_FIXTURES["latest_fork_tests"]["fixture_path"]

OSAKA_TEST_PATH = TEST_FIXTURES["osaka_tests"]["fixture_path"]
4 changes: 2 additions & 2 deletions tests/osaka/test_evm_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

import pytest

from tests.helpers import EEST_TESTS_PATH, ETHEREUM_TESTS_PATH
from tests.helpers import ETHEREUM_TESTS_PATH, OSAKA_TEST_PATH
from tests.helpers.load_evm_tools_tests import (
fetch_evm_tools_tests,
idfn,
load_evm_tools_test,
)

ETHEREUM_STATE_TESTS_DIR = f"{ETHEREUM_TESTS_PATH}/GeneralStateTests/"
EEST_STATE_TESTS_DIR = f"{EEST_TESTS_PATH}/state_tests/"
EEST_STATE_TESTS_DIR = f"{OSAKA_TEST_PATH}/fixtures/state_tests/"
FORK_NAME = "Osaka"


Expand Down
4 changes: 2 additions & 2 deletions tests/osaka/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import pytest

from tests.helpers import EEST_TESTS_PATH, ETHEREUM_TESTS_PATH
from tests.helpers import ETHEREUM_TESTS_PATH, OSAKA_TEST_PATH
from tests.helpers.load_state_tests import (
Load,
fetch_state_test_files,
Expand All @@ -12,7 +12,7 @@
)

ETHEREUM_BLOCKCHAIN_TESTS_DIR = f"{ETHEREUM_TESTS_PATH}/BlockchainTests/"
EEST_BLOCKCHAIN_TESTS_DIR = f"{EEST_TESTS_PATH}/blockchain_tests/"
EEST_BLOCKCHAIN_TESTS_DIR = f"{OSAKA_TEST_PATH}/fixtures/blockchain_tests/"
NETWORK = "Osaka"
PACKAGE = "osaka"

Expand Down
Loading