Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions zkevm-circuits/src/super_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,22 @@ pub struct SuperCircuitConfig<F: Field, const MAX_TXS: usize, const MAX_CALLDATA
}

/// The Super Circuit contains all the zkEVM circuits
#[derive(Default)]
#[derive(Default, Debug)]
pub struct SuperCircuit<F: Field, const MAX_TXS: usize, const MAX_CALLDATA: usize> {
// EVM Circuit
block: Block<F>,
fixed_table_tags: Vec<FixedTableTag>,
/// Block witness. Usually derived via
/// `evm_circuit::witness::block_convert`.
pub block: Block<F>,
/// Passed down to the evm_circuit. Usually that will be
/// `FixedTableTag::iter().collect()`.
pub fixed_table_tags: Vec<FixedTableTag>,
// Tx Circuit
tx_circuit: TxCircuit<F, MAX_TXS, MAX_CALLDATA>,
/// The transaction circuit that will be used in the `synthesize` step.
pub tx_circuit: TxCircuit<F, MAX_TXS, MAX_CALLDATA>,
// Bytecode Circuit
// bytecodes: Vec<UnrolledBytecode<F>>,
bytecode_size: usize,
/// The maximium size for the underlying bytecode circuit.
pub bytecode_size: usize,
}

impl<F: Field, const MAX_TXS: usize, const MAX_CALLDATA: usize>
Expand Down
8 changes: 5 additions & 3 deletions zkevm-circuits/src/tx_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ use num::Integer;
use num_bigint::BigUint;
// use rand_core::RngCore;
use rlp::RlpStream;
pub use secp256k1::Secp256k1Affine;
use sha3::{Digest, Keccak256};
use sign_verify::{pk_bytes_swap_endianness, SignData, SignVerifyChip, SignVerifyConfig};
pub use sign_verify::{POW_RAND_SIZE, VERIF_HEIGHT};
use std::marker::PhantomData;
use subtle::CtOption;

pub use group::{Curve, Group};
pub use secp256k1::Secp256k1Affine;
pub use sign_verify::{POW_RAND_SIZE, VERIF_HEIGHT};

lazy_static! {
// Curve Scalar. Referece: Section 2.4.1 (parameter `n`) in "SEC 2: Recommended Elliptic Curve
// Domain Parameters" document at http://www.secg.org/sec2-v2.pdf
Expand Down Expand Up @@ -207,7 +209,7 @@ impl<F: Field> TxCircuitConfig<F> {
}

/// Tx Circuit for verifying transaction signatures
#[derive(Clone, Default)]
#[derive(Clone, Default, Debug)]
pub struct TxCircuit<F: Field, const MAX_TXS: usize, const MAX_CALLDATA: usize> {
/// SignVerify chip
pub sign_verify: SignVerifyChip<F, MAX_TXS>,
Expand Down