Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
feat: using sign_verify for sig_circuit, compilation error free
Browse files Browse the repository at this point in the history
  • Loading branch information
KimiWu123 committed Jan 26, 2024
1 parent 0e7d8a1 commit ecbc924
Show file tree
Hide file tree
Showing 10 changed files with 985 additions and 1,329 deletions.
8 changes: 8 additions & 0 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ pub struct FixedCParams {
/// calculated, so the same circuit will not be able to prove different
/// witnesses.
pub max_keccak_rows: usize,
/// This number indicate what 100% usage means, for example if we can support up to 2
/// ecPairing inside circuit, and max_vertical_circuit_rows is set to 1_000_000,
/// then if there is 1 ecPairing in the input, we will return 500_000 as the "row usage"
/// for the ec circuit.
pub max_vertical_circuit_rows: usize,
}

/// Unset Circuits Parameters
Expand Down Expand Up @@ -117,6 +122,7 @@ impl Default for FixedCParams {
max_bytecode: 512,
max_evm_rows: 0,
max_keccak_rows: 0,
max_vertical_circuit_rows: 0,
}
}
}
Expand Down Expand Up @@ -435,6 +441,7 @@ impl CircuitInputBuilder<DynamicCParams> {
// When the evm circuit receives a 0 value it dynamically computes the minimum
// number of rows necessary.
let max_evm_rows = 0;
let max_vertical_circuit_rows = 0;
// Similarly, computing the number of rows for the Keccak circuit requires
// constants that cannot be accessed from here (NUM_ROUNDS and KECCAK_ROWS).
// With a 0 value the keccak circuit computes dynamically the minimum number of rows
Expand All @@ -450,6 +457,7 @@ impl CircuitInputBuilder<DynamicCParams> {
max_bytecode,
max_evm_rows,
max_keccak_rows,
max_vertical_circuit_rows,
}
};
let mut cib = CircuitInputBuilder::<FixedCParams> {
Expand Down
3 changes: 3 additions & 0 deletions integration-tests/src/integration_test_circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ const MAX_EVM_ROWS: usize = 10000;
const MAX_EXP_STEPS: usize = 1000;

const MAX_KECCAK_ROWS: usize = 38000;
/// MAX_VERTICAL_CIRCUIT_ROWS
const MAX_VERTICAL_CIRCUIT_ROWS: usize = 0;

const CIRCUITS_PARAMS: FixedCParams = FixedCParams {
max_rws: MAX_RWS,
Expand All @@ -77,6 +79,7 @@ const CIRCUITS_PARAMS: FixedCParams = FixedCParams {
max_evm_rows: MAX_EVM_ROWS,
max_exp_steps: MAX_EXP_STEPS,
max_keccak_rows: MAX_KECCAK_ROWS,
max_vertical_circuit_rows: MAX_VERTICAL_CIRCUIT_ROWS,
};

const EVM_CIRCUIT_DEGREE: u32 = 18;
Expand Down
2 changes: 2 additions & 0 deletions testool/src/statetest/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ pub fn run_test(
max_evm_rows: 0,
max_exp_steps: 5000,
max_keccak_rows: 0,
max_vertical_circuit_rows: 0,
};
let block_data = BlockData::new_from_geth_data_with_params(geth_data, circuits_params);

Expand Down Expand Up @@ -375,6 +376,7 @@ pub fn run_test(
max_bytecode: 512,
max_evm_rows: 0,
max_keccak_rows: 0,
max_vertical_circuit_rows: 0,
};
let (k, circuit, instance, _builder) =
SuperCircuit::<Fr>::build(geth_data, circuits_params, Fr::from(0x100)).unwrap();
Expand Down
1 change: 1 addition & 0 deletions zkevm-circuits/src/root_circuit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ fn test_root_circuit() {
max_bytecode: 512,
max_evm_rows: 0,
max_keccak_rows: 0,
max_vertical_circuit_rows: 0,
};
let (k, circuit, instance, _) =
SuperCircuit::<_>::build(block_1tx(), circuits_params, TEST_MOCK_RANDOMNESS.into())
Expand Down
Loading

0 comments on commit ecbc924

Please sign in to comment.