This repository has been archived by the owner on Jul 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 844
backlog: unify circuits naming #650
Comments
roynalnaruto
referenced
this issue
in scroll-tech/zkevm-circuits
Nov 14, 2022
Merged
roynalnaruto
referenced
this issue
in scroll-tech/zkevm-circuits
Nov 14, 2022
ChihChengLiang
pushed a commit
that referenced
this issue
Nov 14, 2022
Besides the above, also unify the name of the functions for how a circuit is configured and assigned. This is helpful to simplify the testnet. As there are many possible standards, get some consensus of naming before making the changes. |
Here's a summary of the current status:
Aux tables assignment:
|
another issue is the capacity/size/padding_to/max_rws of circuits. |
I've come up with these two traits that would be used to unify all circuits: /// 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).
pub trait SubCircuit<F: Field> {
/// Configuration of the SubCircuit.
type Config: SubCircuitConfig<F>;
/// Returns the instance columns required for this circuit.
fn instance(&self) -> Vec<Vec<F>> {
vec![]
}
/// Assign the columns used by this circuit. This includes the columns that
/// belong to the exposed lookup table contained within, if any.
fn synthesize(
&self,
config: &Self::Config,
challenges: &Challenges<Value<F>>,
layouter: &mut impl Layouter<F>,
) -> Result<(), Error>;
}
/// SubCircuit configuration
pub trait SubCircuitConfig<F: Field> {
/// Config constructor arguments
type ConfigArgs;
/// Type constructor
fn new(meta: &mut ConstraintSystem<F>, args: Self::ConfigArgs) -> Self;
} |
Resolved via #937 |
lispc
referenced
this issue
in scroll-tech/zkevm-circuits
Jan 7, 2023
* feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * feat: tx circuit lookup to rlp table * feat: configure lookups from tx circuit * feat: add calldata length and gas cost to rlp table * fix: lookups from tx circuit and tests * fix: handle calldata length == 0 case in lookups * fix: account for chainid and 0, 0 * fix: clippy * fix: constraints for tx_id * fix: additional constraints around last row * chore: rename rlp circuit based on #650 * fix: calldatalength and gas cost in tx circuit * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * fix: next tx id assignment * fix: lookup for call data bytes * fix: make assignments to tx table * feat: lookups for msg len/rlc and sig fields * fix: add constraint for tx_id increment at nonce row * feat: tag equality check * fix: resolve issues after merging * feat: lookup to check that call data bytes exist in tx table * rewrite pi circuit to use rlp-based approach * pi circuit assignment, clippy fixes * lookup to rlp table for tx hash in tx circuit * chore: clippy fix * add copy constraints between pi and block/tx table * add lookup to keccak for final public input in pi circuit * chore: clippy fix * fix: compilation after update against upstream * feat: updates to RLP circuit/table * fix: compilation * chore: clippy fix * refactor pi circuit to use challenge api and expose keccak (hi,lo) * refactor pi circuit to use challenge api and change pi to keccak hi&lo * refactor witness of rlp circuit to use value api * refactor rlp_circuit to use single set of constraints to handle tags * fix clippy errors * fix * add padding constraints * reduce degree to 9 * fix * add rlp_circuit to super_circuit * disable lt/cmp chips for padding rows to reduce witness assign time * fix: get chain_id from block header * fix * fix clippy error * skip tx without sigs * fmt * skip tx/block table load in pi_circuit's synthesize_sub * add max_inner_blocks * fix clippy * feat: padding blocks will not increase keccak input's size * add TODO in pi circuit * enable pi circuit in super_circuit Co-authored-by: Rohit Narurkar <[email protected]> Co-authored-by: kunxian-xia <[email protected]>
lispc
referenced
this issue
in scroll-tech/zkevm-circuits
Jan 11, 2023
* feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * feat: tx circuit lookup to rlp table * feat: configure lookups from tx circuit * feat: add calldata length and gas cost to rlp table * fix: lookups from tx circuit and tests * fix: handle calldata length == 0 case in lookups * fix: account for chainid and 0, 0 * fix: clippy * fix: constraints for tx_id * fix: additional constraints around last row * chore: rename rlp circuit based on #650 * fix: calldatalength and gas cost in tx circuit * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * fix: next tx id assignment * fix: lookup for call data bytes * fix: make assignments to tx table * feat: lookups for msg len/rlc and sig fields * fix: add constraint for tx_id increment at nonce row * feat: tag equality check * fix: resolve issues after merging * feat: lookup to check that call data bytes exist in tx table * rewrite pi circuit to use rlp-based approach * pi circuit assignment, clippy fixes * lookup to rlp table for tx hash in tx circuit * chore: clippy fix * add copy constraints between pi and block/tx table * add lookup to keccak for final public input in pi circuit * chore: clippy fix * fix: compilation after update against upstream * feat: updates to RLP circuit/table * fix: compilation * chore: clippy fix * refactor pi circuit to use challenge api and expose keccak (hi,lo) * refactor pi circuit to use challenge api and change pi to keccak hi&lo * refactor witness of rlp circuit to use value api * refactor rlp_circuit to use single set of constraints to handle tags * fix clippy errors * fix * add padding constraints * reduce degree to 9 * fix * add rlp_circuit to super_circuit * disable lt/cmp chips for padding rows to reduce witness assign time * fix: get chain_id from block header * fix * fix clippy error * skip tx without sigs * fmt * skip tx/block table load in pi_circuit's synthesize_sub * add max_inner_blocks * fix clippy * feat: padding blocks will not increase keccak input's size * add TODO in pi circuit * enable pi circuit in super_circuit * reduce lookups and fix other issues in tx circuit * chore: fix comment * fix * fix wrong tx hash * add tx circuit to super circuit * reduce degree of tx circuit * add feature to decide if we enable sign_verify synthesis * reduce lookups and fix other issues in tx circuit * chore: fix comment * fix * fix wrong tx hash * add tx circuit to super circuit * reduce degree of tx circuit * add feature to decide if we enable sign_verify synthesis * fix: handle the case txs.len() < max_tx * fix * add padding tx in rlp circuit and add padding tx to keccak_inputs * fix tx circuit witness gen bugs * fix * fmt * Allow tx.to address to be different from call.callee_address * Fix caller -> callee typo * Use tx.is_create instead of another IsZeroGadget * clippy * change tag in tx table to fixed col * fix * fix: state circuit load u16 table * add contract deploy tx test in super circuit * bug-fix: the rlp(tx.to) is 0x80 when tx.to is zero * fix clippy Co-authored-by: kunxian-xia <[email protected]> Co-authored-by: Zhang Zhuo <[email protected]> Co-authored-by: Mason Liang <[email protected]>
lispc
referenced
this issue
in scroll-tech/zkevm-circuits
Jan 12, 2023
* squash scroll fork diffs * disable some constraints for super circuit * RLP Circuit and RLP Table (#225) * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * feat: updates to RLP circuit/table * fix: compilation * chore: clippy fix * refactor witness of rlp circuit to use value api * refactor rlp_circuit to use single set of constraints to handle tags * fix clippy errors * fix * add padding constraints * reduce degree to 9 * fix * add rlp_circuit to super_circuit * disable lt/cmp chips for padding rows to reduce witness assign time * fix: get chain_id from block header * fix Co-authored-by: kunxian xia <[email protected]> * fix conflicts after merge * fix native transfer * add mock prove rlp circuit * mock prove rlp * bug fix: tag_rindex can be as large as 2^24-1 * clippy * fix LOG reversion; log msize when trace * fix tx.id for multi block * add "onephase" feature to disable multi phase behavior. Debug only * speedup bytecode circuit assignment * opt(assignment): speedup EndBlock padding * Public Inputs Circuit (#238) * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * feat: tx circuit lookup to rlp table * feat: configure lookups from tx circuit * feat: add calldata length and gas cost to rlp table * fix: lookups from tx circuit and tests * fix: handle calldata length == 0 case in lookups * fix: account for chainid and 0, 0 * fix: clippy * fix: constraints for tx_id * fix: additional constraints around last row * chore: rename rlp circuit based on #650 * fix: calldatalength and gas cost in tx circuit * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * fix: next tx id assignment * fix: lookup for call data bytes * fix: make assignments to tx table * feat: lookups for msg len/rlc and sig fields * fix: add constraint for tx_id increment at nonce row * feat: tag equality check * fix: resolve issues after merging * feat: lookup to check that call data bytes exist in tx table * rewrite pi circuit to use rlp-based approach * pi circuit assignment, clippy fixes * lookup to rlp table for tx hash in tx circuit * chore: clippy fix * add copy constraints between pi and block/tx table * add lookup to keccak for final public input in pi circuit * chore: clippy fix * fix: compilation after update against upstream * feat: updates to RLP circuit/table * fix: compilation * chore: clippy fix * refactor pi circuit to use challenge api and expose keccak (hi,lo) * refactor pi circuit to use challenge api and change pi to keccak hi&lo * refactor witness of rlp circuit to use value api * refactor rlp_circuit to use single set of constraints to handle tags * fix clippy errors * fix * add padding constraints * reduce degree to 9 * fix * add rlp_circuit to super_circuit * disable lt/cmp chips for padding rows to reduce witness assign time * fix: get chain_id from block header * fix * fix clippy error * skip tx without sigs * fmt * skip tx/block table load in pi_circuit's synthesize_sub * add max_inner_blocks * fix clippy * feat: padding blocks will not increase keccak input's size * add TODO in pi circuit * enable pi circuit in super_circuit Co-authored-by: Rohit Narurkar <[email protected]> Co-authored-by: kunxian-xia <[email protected]> * (1) make keccak witgen parallel (2) fix TransactionRequest from Transaction (3) other logging improverments * fix conflicts after merge * CI: update to use self-hosted runner (#240) * Update CI to use self-hosted runner, and set push branch to `scroll-stable`. * Fix fmt. * Ignore expired test case. * add "codehash" feature; reduce the SecondPhase code diffs * Fix to ignore CI actions when target is `main` branch (source is `scroll-stable`). * improve mainnet fuzz tests * Fix/rlp data prefix (#243) * bug-fix: add placeholder row for DataPrefix if |tx.data|=1 * add fn min_num_rows_block * byte_value < 0x80 * add precompile (#237) * add precompile * update circuits * downgrade * fix clippy * constraint is_precompile * add todo * assert no fail * compress tests * calc gas_cost * clippy * fmt * add zero check * fix zero check * add negative test * fix return data * fix clippy * fix ci test * disable profile by default * fix merge Co-authored-by: Zhang Zhuo <[email protected]> * fail fast for bytecode circuit * add rwc in bus mapping log * better check_rw_lookup log: avoid repeated ctx * fix circuits for precompile; re-enable all state circuit constraints (#244) * fix circuits for precompile; re-enable all state circuit constraints * fix * fix bytecode circuit... * Tx Circuit (#220) * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * feat: tx circuit lookup to rlp table * feat: configure lookups from tx circuit * feat: add calldata length and gas cost to rlp table * fix: lookups from tx circuit and tests * fix: handle calldata length == 0 case in lookups * fix: account for chainid and 0, 0 * fix: clippy * fix: constraints for tx_id * fix: additional constraints around last row * chore: rename rlp circuit based on #650 * fix: calldatalength and gas cost in tx circuit * feat: RLP encoding verification circuit * fix: compilation and tx rlp encode tests * fix: refactor redundant columns, is_first and is_last are advices * fix: assign dummy rows front and back * feat: assign multiple inputs to rlp circuit * feat: add tx table lookup from rlp circuit * fix: lookup for all fields of tx * fix: calldata rlc lookup * hash of rlp encoding * refactor: remove receipt related verification * fix: remove lookups from rlp circuit * refactor: separate out rlp table and embed in circuit * feat: add eip-155 support for unsigned tx * chore: refactor tag_index into RLP table * chore: refactor constraints into TxSign and TxHash * feat: signed tx support * feat: verify sig_r and sig_s fields * fix: add missing check for only one tag * chore: remove unused gadget * fix: randomness | add rlp table to tx circuit * fix: next tx id assignment * fix: lookup for call data bytes * fix: make assignments to tx table * feat: lookups for msg len/rlc and sig fields * fix: add constraint for tx_id increment at nonce row * feat: tag equality check * fix: resolve issues after merging * feat: lookup to check that call data bytes exist in tx table * rewrite pi circuit to use rlp-based approach * pi circuit assignment, clippy fixes * lookup to rlp table for tx hash in tx circuit * chore: clippy fix * add copy constraints between pi and block/tx table * add lookup to keccak for final public input in pi circuit * chore: clippy fix * fix: compilation after update against upstream * feat: updates to RLP circuit/table * fix: compilation * chore: clippy fix * refactor pi circuit to use challenge api and expose keccak (hi,lo) * refactor pi circuit to use challenge api and change pi to keccak hi&lo * refactor witness of rlp circuit to use value api * refactor rlp_circuit to use single set of constraints to handle tags * fix clippy errors * fix * add padding constraints * reduce degree to 9 * fix * add rlp_circuit to super_circuit * disable lt/cmp chips for padding rows to reduce witness assign time * fix: get chain_id from block header * fix * fix clippy error * skip tx without sigs * fmt * skip tx/block table load in pi_circuit's synthesize_sub * add max_inner_blocks * fix clippy * feat: padding blocks will not increase keccak input's size * add TODO in pi circuit * enable pi circuit in super_circuit * reduce lookups and fix other issues in tx circuit * chore: fix comment * fix * fix wrong tx hash * add tx circuit to super circuit * reduce degree of tx circuit * add feature to decide if we enable sign_verify synthesis * reduce lookups and fix other issues in tx circuit * chore: fix comment * fix * fix wrong tx hash * add tx circuit to super circuit * reduce degree of tx circuit * add feature to decide if we enable sign_verify synthesis * fix: handle the case txs.len() < max_tx * fix * add padding tx in rlp circuit and add padding tx to keccak_inputs * fix tx circuit witness gen bugs * fix * fmt * Allow tx.to address to be different from call.callee_address * Fix caller -> callee typo * Use tx.is_create instead of another IsZeroGadget * clippy * change tag in tx table to fixed col * fix * fix: state circuit load u16 table * add contract deploy tx test in super circuit * bug-fix: the rlp(tx.to) is 0x80 when tx.to is zero * fix clippy Co-authored-by: kunxian-xia <[email protected]> Co-authored-by: Zhang Zhuo <[email protected]> Co-authored-by: Mason Liang <[email protected]> * Fix cache-restore conflict in CI. (#245) * Feat/scroll create (#247) * wip * tests pass * Add stack constraints * tx_id * reversion * wip * wip * wip * wip * fmt * wip * wip * wip * wip * wip * fmt * memory_expansion * gas_left * memory word size * reversible write counter * wip * wip * wip * fix and fmt * wip * Add memory word size function * Add init code copy lookup * cleanup * wip * convert to rlcs * wip * wip * Fix gas cost * wip * wip * fix endianess * Add constraint between hash and address * fix * bus_mapping * wip * kecak input for CREATE * wip rlpu64 * wip * use rlc * rlp length * rlp length * wip * wip * wip * wip * wip * wip * Re-add gas constraint * undo * cleanup * Remove dummy * cleanup * cleanup * Remove redundant address cells * Simplify tests * Add rlp nonce test * Handle case of empty initilization code * Constraint step state transition for empty initilization code * Fix clippy * Add 127 and 128 to nonce test cases * Minimize changes to other files * Undo state circuit change * Simplify logic and add comments * Add reversion info constraints and call information lookups * fmt Co-authored-by: Mason Liang <[email protected]> * opt 1st pass assignment of keccak; more assignment log of rlp/state * update fft optimized halo2 Co-authored-by: Rohit Narurkar <[email protected]> Co-authored-by: kunxian xia <[email protected]> Co-authored-by: Steven <[email protected]> Co-authored-by: Akase Cho <[email protected]> Co-authored-by: Mason Liang <[email protected]> Co-authored-by: z2trillion <[email protected]>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Sometimes we use "XXCircuitConfig" as the struct containing columns and "XXCircuit" as the struct to containing witness(block), while sometime we use "XXCircuit" as the struct containing columns.
There are more inconsistency. Eg: EvmCircuit is the "proper" circuit without shared tables, and "TestCircuit" in evm_circuit.rs is the "full(runnable)" circuit. While for StateCircuit there is no "proper" circuit without shared tables. "StateCircuit" is the "full" circuit.
I suggest XXCircuitConfig will be columns while XXCircuit be witness(block). And we should unify names like "MyCircuit"/"TestCircuit" to "BytecodeTestCircuit"/"EvmTestCircuit" later.
The text was updated successfully, but these errors were encountered: