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

Ignore failing tests from bad gas limit config #29

Merged
merged 2 commits into from
Jul 17, 2023
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
3 changes: 2 additions & 1 deletion evm_test_runner/src/arg_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ pub(crate) struct ProgArgs {
#[arg(short = 'f', long)]
pub(crate) test_filter: Option<String>,

/// 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,

Expand Down
4 changes: 3 additions & 1 deletion evm_test_runner/src/persistent_run_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl TestRunEntries {

pub(crate) fn get_tests_that_have_passed(&self) -> impl Iterator<Item = &str> {
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())
})
}
}
Expand All @@ -91,6 +91,7 @@ impl From<Vec<SerializableRunEntry>> for TestRunEntries {
#[derive(Copy, Clone, Debug, Deserialize, Default, Serialize)]
pub(crate) enum PassState {
Passed,
Ignored,
Failed,
#[default]
NotRun,
Expand All @@ -100,6 +101,7 @@ impl From<TestStatus> 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,
Expand Down
7 changes: 7 additions & 0 deletions evm_test_runner/src/plonky2_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ impl TestProgressIndicator for FancyProgressIndicator {
#[derive(Clone, Debug)]
pub(crate) enum TestStatus {
Passed,
Ignored,
EvmErr(String),
IncorrectAccountFinalState(TrieFinalStateDiff),
TimedOut,
Expand All @@ -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)
Expand Down Expand Up @@ -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::<u32>::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::<GoldilocksField, KeccakGoldilocksConfig, 2>(
Expand Down