Trait zkevm_circuits::util::SubCircuit
source · pub trait SubCircuit<F: Field> {
type Config: SubCircuitConfig<F>;
// Required methods
fn unusable_rows() -> usize;
fn new_from_block(block: &Block<F>, chunk: &Chunk<F>) -> Self;
fn synthesize_sub(
&self,
config: &Self::Config,
challenges: &Challenges<Value<F>>,
layouter: &mut impl Layouter<F>
) -> Result<(), Error>;
fn min_num_rows_block(block: &Block<F>, chunk: &Chunk<F>) -> (usize, usize);
// Provided method
fn instance(&self) -> Vec<Vec<F>> { ... }
}
Expand description
SubCircuit is a circuit that performs the verification of a specific part of the full Ethereum block verification. The SubCircuit’s interact with each other via lookup tables and/or shared public inputs. This type must contain all the inputs required to synthesize this circuit (and the contained table(s) if any).
Required Associated Types§
sourcetype Config: SubCircuitConfig<F>
type Config: SubCircuitConfig<F>
Configuration of the SubCircuit.
Required Methods§
sourcefn unusable_rows() -> usize
fn unusable_rows() -> usize
Returns number of unusable rows of the SubCircuit, which should be
meta.blinding_factors() + 1
.
sourcefn new_from_block(block: &Block<F>, chunk: &Chunk<F>) -> Self
fn new_from_block(block: &Block<F>, chunk: &Chunk<F>) -> Self
Create a new SubCircuit from a witness Block
sourcefn synthesize_sub(
&self,
config: &Self::Config,
challenges: &Challenges<Value<F>>,
layouter: &mut impl Layouter<F>
) -> Result<(), Error>
fn synthesize_sub( &self, config: &Self::Config, challenges: &Challenges<Value<F>>, layouter: &mut impl Layouter<F> ) -> Result<(), Error>
Assign only the columns used by this sub-circuit. This includes the columns that belong to the exposed lookup table contained within, if any; and excludes external tables that this sub-circuit does lookups to.
Provided Methods§
Object Safety§
This trait is not object safe.