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

Commit

Permalink
debug evm fixed column variadic issue
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Feb 25, 2024
1 parent 594e7a5 commit 8aaaa0d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
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 @@ -25,6 +25,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 @@ -358,10 +359,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),

Check failure on line 372 in integration-tests/src/integration_test_circuits.rs

View workflow job for this annotation

GitHub Actions / Various lints

this expression creates a reference which is immediately dereferenced by the compiler
"cellv1 {:?} != cellv2 {:?} on index {}",
cellv1,
cellv2,
index
);
},
);
}
});
} else {
self.fixed = Some(fixed.clone());
}
Expand All @@ -383,6 +400,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),

Check failure on line 410 in integration-tests/src/integration_test_circuits.rs

View workflow job for this annotation

GitHub Actions / Various lints

this expression creates a reference which is immediately dereferenced by the compiler
"cellv1 {:?} != cellv2 {:?} on index {}",
cellv1,
cellv2,
index
);
},
);
}
},
);
assert!(
fixed.eq(&prev_fixed),
"root circuit fixed columns are not constant for different witnesses"
Expand Down

0 comments on commit 8aaaa0d

Please sign in to comment.