Skip to content

Commit

Permalink
Set keccak logs to debug level (privacy-scaling-explorations#1405)
Browse files Browse the repository at this point in the history
### Description

Keccak circuit logs messages that make CI logs hard to reason.

We can set it from "INFO" level to "DEBUG" level to suppress the
messages in the CI output but still keep it for develoepers.



https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:50

<details><summary>Details</summary>
<p>

```
test mock_prover::serial_test_exp_circuit_multiple_transfers_0 ... ok
[2023-05-12T05:00:22Z INFO  integration_tests::integration_test_circuits] test Keccak circuit, block: #1 - Transfer 0
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post absorb:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 2
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 7
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post padding:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 1
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 10
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post theta:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 14
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 38
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post rho/pi:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 53
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 191
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post chi:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: [52](https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:53)
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 195
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] - Post squeeze:
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Lookups: 1
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Columns: 198
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Degree: 4
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Minimum rows: [61](https://github.com/privacy-scaling-explorations/zkevm-circuits/actions/runs/4955284960/jobs/8864549606#step:13:62)
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Total Lookups: 123
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] Total Columns: 198
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] num unused cells: 229
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size absorb: 4
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta: 2
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta c: 2
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size theta t: 3
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size rho/pi: 3
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] part_size chi base: 3
[2023-05-12T05:00:22Z INFO  zkevm_circuits::keccak_circuit] uniform part sizes: [2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
```

</p>
</details> 


### Issue Link


### Type of change

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
  • Loading branch information
ChihChengLiang authored May 15, 2023
1 parent 0e1d230 commit 5dba7f7
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions zkevm-circuits/src/keccak_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ use halo2_proofs::{
plonk::{Column, ConstraintSystem, Error, Expression, Fixed, TableColumn, VirtualCells},
poly::Rotation,
};
use log::info;
use log::debug;

/// KeccakConfig
#[derive(Clone, Debug)]
Expand Down Expand Up @@ -178,9 +178,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
decode::expr(absorb_res),
absorb_result.expr(),
);
info!("- Post absorb:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post absorb:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

// Process inputs.
Expand Down Expand Up @@ -220,9 +220,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
for _ in input_bytes.iter() {
is_paddings.push(cell_manager.query_cell(meta));
}
info!("- Post padding:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post padding:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

// Theta
Expand Down Expand Up @@ -278,9 +278,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
}
}
s = os.clone();
info!("- Post theta:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post theta:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

// Rho/Pi
Expand Down Expand Up @@ -366,9 +366,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
});
lookup_counter += 1;
}
info!("- Post rho/pi:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post rho/pi:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

// Chi
Expand Down Expand Up @@ -446,9 +446,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
cb.require_equal("next row check", s[i][j].clone(), s_next[i][j].clone());
}
}
info!("- Post chi:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post chi:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

let mut lookup_counter = 0;
Expand Down Expand Up @@ -486,9 +486,9 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
.unwrap(),
true,
);
info!("- Post squeeze:");
info!("Lookups: {}", lookup_counter);
info!("Columns: {}", cell_manager.get_width());
debug!("- Post squeeze:");
debug!("Lookups: {}", lookup_counter);
debug!("Columns: {}", cell_manager.get_width());
total_lookup_counter += lookup_counter;

// The round constraints that we've been building up till now
Expand Down Expand Up @@ -823,21 +823,21 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
meta.annotate_lookup_column(col, || format!("KECCAK_pack_table_{}", idx))
});

info!("Degree: {}", meta.degree());
info!("Minimum rows: {}", meta.minimum_rows());
info!("Total Lookups: {}", total_lookup_counter);
info!("Total Columns: {}", cell_manager.get_width());
info!("num unused cells: {}", cell_manager.get_num_unused_cells());
info!("part_size absorb: {}", get_num_bits_per_absorb_lookup());
info!("part_size theta: {}", get_num_bits_per_theta_c_lookup());
info!(
debug!("Degree: {}", meta.degree());
debug!("Minimum rows: {}", meta.minimum_rows());
debug!("Total Lookups: {}", total_lookup_counter);
debug!("Total Columns: {}", cell_manager.get_width());
debug!("num unused cells: {}", cell_manager.get_num_unused_cells());
debug!("part_size absorb: {}", get_num_bits_per_absorb_lookup());
debug!("part_size theta: {}", get_num_bits_per_theta_c_lookup());
debug!(
"part_size theta c: {}",
get_num_bits_per_lookup(THETA_C_LOOKUP_RANGE)
);
info!("part_size theta t: {}", get_num_bits_per_lookup(4));
info!("part_size rho/pi: {}", get_num_bits_per_rho_pi_lookup());
info!("part_size chi base: {}", get_num_bits_per_base_chi_lookup());
info!(
debug!("part_size theta t: {}", get_num_bits_per_lookup(4));
debug!("part_size rho/pi: {}", get_num_bits_per_rho_pi_lookup());
debug!("part_size chi base: {}", get_num_bits_per_base_chi_lookup());
debug!(
"uniform part sizes: {:?}",
target_part_sizes(get_num_bits_per_theta_c_lookup())
);
Expand Down

0 comments on commit 5dba7f7

Please sign in to comment.