Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run all available ValidBlock tests #597

Merged
merged 8 commits into from
Oct 17, 2022
Merged
Show file tree
Hide file tree
Changes from 7 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
34 changes: 20 additions & 14 deletions tests/berlin/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,33 @@ def test_general_state_tests(test_case: Dict) -> None:
# Run legacy valid block tests
test_dir = "tests/fixtures/BlockchainTests/ValidBlocks/"

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
"bcUncleSpecialTests/futureUncleTimestampDifficultyDrop.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",) # type: ignore


@pytest.mark.parametrize(
"test_case",
fetch_berlin_tests(test_dir, only_in=only_in),
fetch_berlin_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_berlin_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_berlin_blockchain_st_tests(test_case)
except KeyError:
gurukamath marked this conversation as resolved.
Show resolved Hide resolved
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
34 changes: 23 additions & 11 deletions tests/byzantium/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,36 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",)

BIG_MEMORY_TESTS = ("randomStatetest94_",)


@pytest.mark.parametrize(
"test_case",
fetch_byzantium_tests(test_dir, only_in=only_in),
fetch_byzantium_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
big_memory_list=BIG_MEMORY_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_byzantium_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_byzantium_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
34 changes: 23 additions & 11 deletions tests/constantinople/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,24 +78,36 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",)

BIG_MEMORY_TESTS = ("randomStatetest94_",)


@pytest.mark.parametrize(
"test_case",
fetch_constantinople_tests(test_dir, only_in=only_in),
fetch_constantinople_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
big_memory_list=BIG_MEMORY_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_constantinople_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_constantinople_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
29 changes: 15 additions & 14 deletions tests/frontier/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,28 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
"bcUncleSpecialTests/futureUncleTimestampDifficultyDrop.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest/",
"bcTotalDifficultyTest/",
)


@pytest.mark.parametrize(
"test_case",
fetch_frontier_tests(test_dir, only_in=only_in),
fetch_frontier_tests(
test_dir,
ignore_list=IGNORE_LIST,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_frontier_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_frontier_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
36 changes: 23 additions & 13 deletions tests/homestead/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,26 +129,36 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest/",
"bcTotalDifficultyTest/",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",) # type: ignore

BIG_MEMORY_TESTS = ("randomStatetest94_",)


@pytest.mark.parametrize(
"test_case",
fetch_homestead_tests(test_dir, only_in=only_in),
fetch_homestead_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
big_memory_list=BIG_MEMORY_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_homestead_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_homestead_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
34 changes: 20 additions & 14 deletions tests/istanbul/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,33 @@ def test_general_state_tests(test_case: Dict) -> None:
# Run legacy valid block tests
test_dir = "tests/fixtures/BlockchainTests/ValidBlocks/"

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
"bcUncleSpecialTests/futureUncleTimestampDifficultyDrop.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",) # type: ignore


@pytest.mark.parametrize(
"test_case",
fetch_istanbul_tests(test_dir, only_in=only_in),
fetch_istanbul_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_istanbul_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_istanbul_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
34 changes: 20 additions & 14 deletions tests/spurious_dragon/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,27 +45,33 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
"bcUncleSpecialTests/futureUncleTimestampDifficultyDrop.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",)


@pytest.mark.parametrize(
"test_case",
fetch_spurious_dragon_tests(test_dir, only_in=only_in),
fetch_spurious_dragon_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_spurious_dragon_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_spurious_dragon_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down
33 changes: 20 additions & 13 deletions tests/tangerine_whistle/test_state_transition.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,33 @@ def test_general_state_tests(test_case: Dict) -> None:
"tests/fixtures/LegacyTests/Constantinople/BlockchainTests/ValidBlocks/"
)

only_in = (
"bcUncleTest/oneUncle.json",
"bcUncleTest/oneUncleGeneration2.json",
"bcUncleTest/oneUncleGeneration3.json",
"bcUncleTest/oneUncleGeneration4.json",
"bcUncleTest/oneUncleGeneration5.json",
"bcUncleTest/oneUncleGeneration6.json",
"bcUncleTest/twoUncle.json",
"bcUncleTest/uncleHeaderAtBlock2.json",
"bcUncleSpecialTests/uncleBloomNot0.json",
IGNORE_LIST = (
"bcForkStressTest/ForkStressTest.json",
"bcGasPricerTest/RPC_API_Test.json",
"bcMultiChainTest",
"bcTotalDifficultyTest",
)

# Every test below takes more than 60s to run and
# hence they've been marked as slow
SLOW_TESTS = ("bcExploitTest/DelegateCallSpam.json",)


@pytest.mark.parametrize(
"test_case",
fetch_tangerine_whistle_tests(test_dir, only_in=only_in),
fetch_tangerine_whistle_tests(
test_dir,
ignore_list=IGNORE_LIST,
slow_list=SLOW_TESTS,
),
ids=idfn,
)
def test_uncles_correctness(test_case: Dict) -> None:
run_tangerine_whistle_blockchain_st_tests(test_case)
def test_valid_block_tests(test_case: Dict) -> None:
try:
run_tangerine_whistle_blockchain_st_tests(test_case)
except KeyError:
# FIXME: Handle tests that don't have post state
pytest.xfail(f"{test_case} doesn't have post state")


# Run legacy invalid block tests
Expand Down