From 74f2010f4ac4555af060fe1d789b03afa990dd6c Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Sun, 16 Jul 2023 11:57:59 -0400 Subject: [PATCH 1/2] Ignore failing tests from bad gas limit config --- evm_test_runner/src/persistent_run_state.rs | 2 ++ evm_test_runner/src/plonky2_runner.rs | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/evm_test_runner/src/persistent_run_state.rs b/evm_test_runner/src/persistent_run_state.rs index 1af0e6b..fb91541 100644 --- a/evm_test_runner/src/persistent_run_state.rs +++ b/evm_test_runner/src/persistent_run_state.rs @@ -91,6 +91,7 @@ impl From> for TestRunEntries { #[derive(Copy, Clone, Debug, Deserialize, Default, Serialize)] pub(crate) enum PassState { Passed, + Ignored, Failed, #[default] NotRun, @@ -100,6 +101,7 @@ impl From for PassState { fn from(v: TestStatus) -> Self { match v { TestStatus::Passed => PassState::Passed, + TestStatus::Ignored => PassState::Ignored, TestStatus::EvmErr(_) | TestStatus::IncorrectAccountFinalState(_) | TestStatus::TimedOut => PassState::Failed, diff --git a/evm_test_runner/src/plonky2_runner.rs b/evm_test_runner/src/plonky2_runner.rs index 71fe989..88230f0 100644 --- a/evm_test_runner/src/plonky2_runner.rs +++ b/evm_test_runner/src/plonky2_runner.rs @@ -74,6 +74,7 @@ impl TestProgressIndicator for FancyProgressIndicator { #[derive(Clone, Debug)] pub(crate) enum TestStatus { Passed, + Ignored, EvmErr(String), IncorrectAccountFinalState(TrieFinalStateDiff), TimedOut, @@ -83,6 +84,7 @@ impl Display for TestStatus { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { TestStatus::Passed => write!(f, "Passed"), + TestStatus::Ignored => write!(f, "Ignored"), TestStatus::EvmErr(err) => write!(f, "Evm error: {}", err), TestStatus::IncorrectAccountFinalState(diff) => { write!(f, "Expected trie hash mismatch: {}", diff) @@ -294,6 +296,11 @@ fn run_test_or_fail_on_timeout( /// Run a test against `plonky2` and output a result based on what happens. fn run_test_and_get_test_result(test: TestVariantRunInfo) -> TestStatus { + if TryInto::::try_into(test.gen_inputs.block_metadata.block_gaslimit).is_err() { + // Gas limit of more than 32 bits is not supported by the zkEVM. + return TestStatus::Ignored; + } + let timing = TimingTree::new("prove", log::Level::Debug); let proof_run_res = prove_with_outputs::( From 155568998fe556facff11ae185c74e5cdba225bc Mon Sep 17 00:00:00 2001 From: Robin Salen Date: Sun, 16 Jul 2023 14:39:20 -0400 Subject: [PATCH 2/2] Skip Ignored tests when using skip_passed too --- evm_test_runner/src/arg_parsing.rs | 3 ++- evm_test_runner/src/persistent_run_state.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/evm_test_runner/src/arg_parsing.rs b/evm_test_runner/src/arg_parsing.rs index ad68b7e..444eea0 100644 --- a/evm_test_runner/src/arg_parsing.rs +++ b/evm_test_runner/src/arg_parsing.rs @@ -37,7 +37,8 @@ pub(crate) struct ProgArgs { #[arg(short = 'f', long)] pub(crate) test_filter: Option, - /// Do not run tests that have already passed in the past. + /// Do not run tests that have already passed in the past or that are + /// ignored. #[arg(short = 'p', long)] pub(crate) skip_passed: bool, diff --git a/evm_test_runner/src/persistent_run_state.rs b/evm_test_runner/src/persistent_run_state.rs index fb91541..0f4be5b 100644 --- a/evm_test_runner/src/persistent_run_state.rs +++ b/evm_test_runner/src/persistent_run_state.rs @@ -69,7 +69,7 @@ impl TestRunEntries { pub(crate) fn get_tests_that_have_passed(&self) -> impl Iterator { self.0.iter().filter_map(|(name, info)| { - matches!(info.pass_state, PassState::Passed).then(|| name.as_str()) + matches!(info.pass_state, PassState::Passed | PassState::Ignored).then(|| name.as_str()) }) } }