Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

[WIP] [integration test] verify integratoin test on main branch #1782

Closed
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ rand_chacha = "0.3"
paste = "1.0"
rand_xorshift = "0.3.0"
rand_core = "0.6.4"
itertools = "0.10"
mock = { path = "../mock" }

[dev-dependencies]
Expand Down
43 changes: 39 additions & 4 deletions integration-tests/src/integration_test_circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ use halo2_proofs::{
},
},
};
use itertools::Itertools;
use lazy_static::lazy_static;
use mock::TestContext;
use rand_chacha::rand_core::SeedableRng;
Expand Down Expand Up @@ -351,10 +352,26 @@ impl<C: SubCircuit<Fr> + Circuit<Fr>> IntegrationTest<C> {
let fixed = mock_prover.fixed();

if let Some(prev_fixed) = self.fixed.clone() {
assert!(
fixed.eq(&prev_fixed),
"circuit fixed columns are not constant for different witnesses"
);
fixed
.iter()
.enumerate()
.zip_eq(prev_fixed.iter())
.for_each(|((index, col1), col2)| {
if !col1.eq(col2) {
println!("on column index {} not equal", index);
col1.iter().enumerate().zip_eq(col2.iter()).for_each(
|((index, cellv1), cellv2)| {
assert!(
cellv1.eq(&cellv2),
"cellv1 {:?} != cellv2 {:?} on index {}",
cellv1,
cellv2,
index
);
},
);
}
});
} else {
self.fixed = Some(fixed.clone());
}
Expand All @@ -376,6 +393,24 @@ impl<C: SubCircuit<Fr> + Circuit<Fr>> IntegrationTest<C> {

match self.root_fixed.clone() {
Some(prev_fixed) => {
fixed.iter().enumerate().zip_eq(prev_fixed.iter()).for_each(
|((index, col1), col2)| {
if !col1.eq(col2) {
println!("on column index {} not equal", index);
col1.iter().enumerate().zip_eq(col2.iter()).for_each(
|((index, cellv1), cellv2)| {
assert!(
cellv1.eq(&cellv2),
"cellv1 {:?} != cellv2 {:?} on index {}",
cellv1,
cellv2,
index
);
},
);
}
},
);
assert!(
fixed.eq(&prev_fixed),
"root circuit fixed columns are not constant for different witnesses"
Expand Down
2 changes: 2 additions & 0 deletions zkevm-circuits/src/evm_circuit/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ pub(crate) trait ExecutionGadget<F: Field> {
) -> Result<(), Error>;
}

// verify integration test on main branch

#[derive(Clone, Debug)]
pub struct ExecutionConfig<F> {
// EVM Circuit selector, which enables all usable rows. The rows where this selector is
Expand Down
Loading