Skip to content

Commit

Permalink
fix(prover_cli): Remove outdated fix for circuit id in node wg (#2248)
Browse files Browse the repository at this point in the history
This PR removes the fixes that were used to correct the circuit_id in
the node witness generator.

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [x] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [x] Code has been formatted via `zk fmt` and `zk lint`.
- [x] Spellcheck has been run via `zk spellcheck`.
  • Loading branch information
ColoCarletti committed Jun 18, 2024
1 parent 2f528ec commit db8e71b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
12 changes: 0 additions & 12 deletions core/lib/basic_types/src/prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,3 @@ pub struct ProofCompressionJobInfo {
pub time_taken: Option<NaiveTime>,
pub picked_by: Option<String>,
}

// This function corrects circuit IDs for the node witness generator.
//
// - Circuit IDs in the node witness generator are 2 higher than in other rounds.
// - The `EIP4844Repack` circuit (ID 255) is an exception and is set to 18.
pub fn correct_circuit_id(circuit_id: i16, aggregation_round: AggregationRound) -> u32 {
match (circuit_id, aggregation_round) {
(18, AggregationRound::NodeAggregation) => 255,
(circuit_id, AggregationRound::NodeAggregation) => (circuit_id as u32) - 2,
_ => circuit_id as u32,
}
}
6 changes: 2 additions & 4 deletions prover/prover_dal/src/fri_prover_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use zksync_basic_types::{
basic_fri_types::{AggregationRound, CircuitIdRoundTuple, JobIdentifiers},
protocol_version::{ProtocolSemanticVersion, ProtocolVersionId},
prover_dal::{
correct_circuit_id, FriProverJobMetadata, JobCountStatistics, ProverJobFriInfo,
ProverJobStatus, StuckJobs,
FriProverJobMetadata, JobCountStatistics, ProverJobFriInfo, ProverJobStatus, StuckJobs,
},
L1BatchNumber,
};
Expand Down Expand Up @@ -659,8 +658,7 @@ impl FriProverDal<'_, '_> {
.map(|row| ProverJobFriInfo {
id: row.id as u32,
l1_batch_number,
// It is necessary to correct the circuit IDs due to the discrepancy between different aggregation rounds.
circuit_id: correct_circuit_id(row.circuit_id, aggregation_round),
circuit_id: row.circuit_id as u32,
circuit_blob_url: row.circuit_blob_url.clone(),
aggregation_round,
sequence_number: row.sequence_number as u32,
Expand Down
11 changes: 5 additions & 6 deletions prover/prover_dal/src/fri_witness_generator_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use zksync_basic_types::{
basic_fri_types::{AggregationRound, Eip4844Blobs},
protocol_version::{ProtocolSemanticVersion, ProtocolVersionId, VersionPatch},
prover_dal::{
correct_circuit_id, BasicWitnessGeneratorJobInfo, JobCountStatistics,
LeafAggregationJobMetadata, LeafWitnessGeneratorJobInfo, NodeAggregationJobMetadata,
NodeWitnessGeneratorJobInfo, RecursionTipWitnessGeneratorJobInfo,
SchedulerWitnessGeneratorJobInfo, StuckJobs, WitnessJobStatus,
BasicWitnessGeneratorJobInfo, JobCountStatistics, LeafAggregationJobMetadata,
LeafWitnessGeneratorJobInfo, NodeAggregationJobMetadata, NodeWitnessGeneratorJobInfo,
RecursionTipWitnessGeneratorJobInfo, SchedulerWitnessGeneratorJobInfo, StuckJobs,
WitnessJobStatus,
},
L1BatchNumber,
};
Expand Down Expand Up @@ -1553,8 +1553,7 @@ impl FriWitnessGeneratorDal<'_, '_> {
.map(|row| NodeWitnessGeneratorJobInfo {
id: row.id as u32,
l1_batch_number,
// It is necessary to correct the circuit IDs due to the discrepancy between different aggregation rounds.
circuit_id: correct_circuit_id(row.circuit_id, AggregationRound::NodeAggregation),
circuit_id: row.circuit_id as u32,
depth: row.depth as u32,
status: WitnessJobStatus::from_str(&row.status).unwrap(),
attempts: row.attempts as u32,
Expand Down

0 comments on commit db8e71b

Please sign in to comment.