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

Commit 8aaaa0d

Browse files
committed
debug evm fixed column variadic issue
1 parent 594e7a5 commit 8aaaa0d

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration-tests/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ rand_chacha = "0.3"
2424
paste = "1.0"
2525
rand_xorshift = "0.3.0"
2626
rand_core = "0.6.4"
27+
itertools = "0.10"
2728
mock = { path = "../mock" }
2829

2930
[dev-dependencies]

integration-tests/src/integration_test_circuits.rs

+39-4
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use halo2_proofs::{
2525
},
2626
},
2727
};
28+
use itertools::Itertools;
2829
use lazy_static::lazy_static;
2930
use mock::TestContext;
3031
use rand_chacha::rand_core::SeedableRng;
@@ -358,10 +359,26 @@ impl<C: SubCircuit<Fr> + Circuit<Fr>> IntegrationTest<C> {
358359
let fixed = mock_prover.fixed();
359360

360361
if let Some(prev_fixed) = self.fixed.clone() {
361-
assert!(
362-
fixed.eq(&prev_fixed),
363-
"circuit fixed columns are not constant for different witnesses"
364-
);
362+
fixed
363+
.iter()
364+
.enumerate()
365+
.zip_eq(prev_fixed.iter())
366+
.for_each(|((index, col1), col2)| {
367+
if !col1.eq(col2) {
368+
println!("on column index {} not equal", index);
369+
col1.iter().enumerate().zip_eq(col2.iter()).for_each(
370+
|((index, cellv1), cellv2)| {
371+
assert!(
372+
cellv1.eq(&cellv2),
373+
"cellv1 {:?} != cellv2 {:?} on index {}",
374+
cellv1,
375+
cellv2,
376+
index
377+
);
378+
},
379+
);
380+
}
381+
});
365382
} else {
366383
self.fixed = Some(fixed.clone());
367384
}
@@ -383,6 +400,24 @@ impl<C: SubCircuit<Fr> + Circuit<Fr>> IntegrationTest<C> {
383400

384401
match self.root_fixed.clone() {
385402
Some(prev_fixed) => {
403+
fixed.iter().enumerate().zip_eq(prev_fixed.iter()).for_each(
404+
|((index, col1), col2)| {
405+
if !col1.eq(col2) {
406+
println!("on column index {} not equal", index);
407+
col1.iter().enumerate().zip_eq(col2.iter()).for_each(
408+
|((index, cellv1), cellv2)| {
409+
assert!(
410+
cellv1.eq(&cellv2),
411+
"cellv1 {:?} != cellv2 {:?} on index {}",
412+
cellv1,
413+
cellv2,
414+
index
415+
);
416+
},
417+
);
418+
}
419+
},
420+
);
386421
assert!(
387422
fixed.eq(&prev_fixed),
388423
"root circuit fixed columns are not constant for different witnesses"

0 commit comments

Comments
 (0)