Skip to content

Commit

Permalink
fix(house_keeper): Emit the correct circuit_id for aggregation round 2 (
Browse files Browse the repository at this point in the history
#547)

## What ❔

This is us hardcoding the circuit_id to 2 for aggregation_round 2. This
fix is useless as soon as we change the config (not expected anytime
soon).

A real fix will follow where we address what is saved in database layer
and this patch will be removed altogether.

## Why ❔

This is necessary to enable autoscaler to work (emits the correct data
for prover groups, which in turn can be picked by autoscaler).

## Checklist

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] 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`.
  • Loading branch information
EmilLuta authored Nov 27, 2023
1 parent 0e45dea commit 9cada1a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/lib/zksync_core/src/house_keeper/fri_prover_queue_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,19 @@ impl PeriodicJob for FriProverStatsReporter {
let stats = conn.fri_prover_jobs_dal().get_prover_jobs_stats().await;

for ((circuit_id, aggregation_round), stats) in stats.into_iter() {
// BEWARE, HERE BE DRAGONS.
// In database, the circuit_id stored is the circuit for which the aggregation is done,
// not the circuit which is running.
// There is a single node level aggregation circuit, which is circuit 2.
// This can aggregate multiple leaf nodes (which may belong to different circuits).
// This reporting is a hacky forced way to use circuit_id 2 which will solve autoscalers.
// A proper fix will be later provided to solve this at database level.
let circuit_id = if aggregation_round == 2 {
2
} else {
circuit_id
};

let group_id = self
.config
.get_group_id_for_circuit_id_and_aggregation_round(circuit_id, aggregation_round)
Expand Down

0 comments on commit 9cada1a

Please sign in to comment.