-
Notifications
You must be signed in to change notification settings - Fork 391
phase-check related issues #780
base: develop
Are you sure you want to change the base?
Conversation
The false alarm can be avoided by scroll-tech/halo2#61. |
|
This is a very interesting bug and worth some documentation. in halo2-lib there is a function
This function is not deterministic. For multiple phases, this function will return different points. When multi-phase is enabled, the cells will be filled in with different points during different phases. And therefore during the phase check we get errors like
|
fn decompose_ec_add_op_phase_2( | ||
&self, | ||
ctx: &mut Context<F>, | ||
ecc_chip: &EccChip<F, FpConfig<F, Fq>>, | ||
ec_decomposed: &[EcAddDecomposed<F>], | ||
challenges: &Challenges<Value<F>>, | ||
) { | ||
log::trace!("[ECC] ==> EcAdd Assignment START:"); | ||
log_context_cursor!(ctx); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you move the ec addition execution to phase 2, then the above configuration of phase1 & phase2 cols [33, 1]
is not right as it needs much more phase cols now.
let mut buf = F::default(); | ||
challenges.keccak_input().map(|x| buf = x); | ||
let mut rng = ChaCha20Rng::from_seed(buf.to_repr()); | ||
let p = G1Affine::random(&mut rng); | ||
let G1Affine { x, y } = p; | ||
let point = ecc_chip.load_private(ctx, (Value::known(x), Value::known(y))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the mock prover is doing 1st synthesis, the rng is seeded with 0. But for 2nd synthesis, it is then seeded with keccak_input()
.
cargo test --release ecc_circuit 2>&1 | tee ecc.log