diff --git a/evm/src/fixed_recursive_verifier.rs b/evm/src/fixed_recursive_verifier.rs index 79848eca..ba63c0f8 100644 --- a/evm/src/fixed_recursive_verifier.rs +++ b/evm/src/fixed_recursive_verifier.rs @@ -6,6 +6,7 @@ use hashbrown::HashMap; use itertools::{zip_eq, Itertools}; use plonky2::field::extension::Extendable; use plonky2::fri::FriParams; +use plonky2::gates::constant::ConstantGate; use plonky2::gates::noop::NoopGate; use plonky2::hash::hash_types::RichField; use plonky2::iop::challenger::RecursiveChallenger; @@ -491,6 +492,11 @@ where // public inputs for cyclic verification, even though they'll be ignored. let cyclic_vk = builder.add_verifier_data_public_inputs(); + builder.add_gate( + ConstantGate::new(inner_common_data[0].config.num_constants), + vec![], + ); + RootCircuitData { circuit: builder.build::(), proof_with_pis: recursive_proofs, diff --git a/evm/tests/empty_txn_list.rs b/evm/tests/empty_txn_list.rs index 4b2a2762..b745deb1 100644 --- a/evm/tests/empty_txn_list.rs +++ b/evm/tests/empty_txn_list.rs @@ -97,7 +97,7 @@ fn test_empty_txn_list() -> anyhow::Result<()> { let all_circuits = AllRecursiveCircuits::::new( &all_stark, - &[9..18, 9..15, 9..15, 9..10, 9..12, 9..18], // Minimal ranges to prove an empty list + &[16..17, 14..15, 14..15, 9..10, 12..13, 18..19], // Minimal ranges to prove an empty list &config, ); diff --git a/plonky2/src/gates/constant.rs b/plonky2/src/gates/constant.rs index 5fac1f00..dba65258 100644 --- a/plonky2/src/gates/constant.rs +++ b/plonky2/src/gates/constant.rs @@ -26,6 +26,10 @@ pub struct ConstantGate { } impl ConstantGate { + pub fn new(num_consts: usize) -> Self { + Self { num_consts } + } + pub fn const_input(&self, i: usize) -> usize { debug_assert!(i < self.num_consts); i