From db8e71b55393b3d0e419886b62712b61305ac030 Mon Sep 17 00:00:00 2001 From: Joaquin Carletti <56092489+ColoCarletti@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:09:19 -0300 Subject: [PATCH] fix(prover_cli): Remove outdated fix for circuit id in node wg (#2248) 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`. --- core/lib/basic_types/src/prover_dal.rs | 12 ------------ prover/prover_dal/src/fri_prover_dal.rs | 6 ++---- prover/prover_dal/src/fri_witness_generator_dal.rs | 11 +++++------ 3 files changed, 7 insertions(+), 22 deletions(-) diff --git a/core/lib/basic_types/src/prover_dal.rs b/core/lib/basic_types/src/prover_dal.rs index 1d741fac508c..5eb00dc63a4f 100644 --- a/core/lib/basic_types/src/prover_dal.rs +++ b/core/lib/basic_types/src/prover_dal.rs @@ -382,15 +382,3 @@ pub struct ProofCompressionJobInfo { pub time_taken: Option, pub picked_by: Option, } - -// 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, - } -} diff --git a/prover/prover_dal/src/fri_prover_dal.rs b/prover/prover_dal/src/fri_prover_dal.rs index f6c0379ee8a0..419cb635ac53 100644 --- a/prover/prover_dal/src/fri_prover_dal.rs +++ b/prover/prover_dal/src/fri_prover_dal.rs @@ -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, }; @@ -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, diff --git a/prover/prover_dal/src/fri_witness_generator_dal.rs b/prover/prover_dal/src/fri_witness_generator_dal.rs index 14d47beed1a0..8db30e5a7f11 100644 --- a/prover/prover_dal/src/fri_witness_generator_dal.rs +++ b/prover/prover_dal/src/fri_witness_generator_dal.rs @@ -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, }; @@ -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,