Skip to content

Commit

Permalink
Apply Emil's cherrypicked changes (#3594)
Browse files Browse the repository at this point in the history
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- The `Why` has to be clear to non-Matter Labs entities running their
own ZK Chain -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Is this a breaking change?
- [ ] Yes
- [ ] No

## Operational changes
<!-- Any config changes? Any new flags? Any changes to any scripts? -->
<!-- Please add anything that non-Matter Labs entities running their own
ZK Chain may need to know -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] 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.
- [ ] Code has been formatted via `zkstack dev fmt` and `zkstack dev
lint`.

Co-authored-by: EmilLuta <virgil.luta@gmail.com>
  • Loading branch information
Artemka374 and EmilLuta authored Feb 11, 2025
1 parent ba3136c commit c97f7e6
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/lib/object_store/src/retries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ impl Request<'_> {
Ok(result) => break Ok(result),
Err(err) if err.is_retriable() => {
if retries > max_retries {
tracing::warn!(%err, "Exhausted {max_retries} retries performing request; returning last error");
tracing::warn!(?err, "Exhausted {max_retries} retries performing request; returning last error");
break Err(err);
}
tracing::info!(%err, "Failed request, retries: {retries}/{max_retries}");
tracing::info!(?err, "Failed request, retries: {retries}/{max_retries}");
retries += 1;
// Randomize sleep duration to prevent stampeding the server if multiple requests are initiated at the same time.
let sleep_duration = Duration::from_secs(backoff_secs)
Expand Down
3 changes: 3 additions & 0 deletions prover/crates/bin/witness_generator/src/rounds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ where
artifacts,
)
.await?;

tracing::info!("Saved {:?} to database for job {:?}", R::ROUND, job_id);

Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
CREATE INDEX IF NOT EXISTS ix_prover_jobs_fri_t1
ON prover_jobs_fri (circuit_id, aggregation_round, l1_batch_number, id)
WHERE (status = 'queued'::text);

CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_status
ON prover_jobs_fri (circuit_id, aggregation_round, status)
WHERE ((status <> 'successful'::text) AND (status <> 'skipped'::text));

CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_queued_order2
ON prover_jobs_fri (l1_batch_number, aggregation_round DESC, id)
WHERE (status = 'queued'::text);

CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_queued_order
ON prover_jobs_fri (aggregation_round DESC, l1_batch_number, id)
WHERE (status = 'queued'::text);

CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_circuit_id_agg_batch_num
ON prover_jobs_fri (circuit_id, aggregation_round, l1_batch_number)
WHERE (status = ANY (ARRAY['queued'::text, 'in_progress'::text, 'in_gpu_proof'::text, 'failed'::text]));

DROP INDEX IF EXISTS idx_prover_jobs_fri_get_next_job;
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CREATE INDEX IF NOT EXISTS idx_prover_jobs_fri_get_next_job
ON prover_jobs_fri USING btree (l1_batch_number, aggregation_round, circuit_id, id)
WHERE (status = 'queued'::text);

DROP INDEX IF EXISTS idx_prover_jobs_fri_circuit_id_agg_batch_num;

DROP INDEX IF EXISTS idx_prover_jobs_fri_queued_order;

DROP INDEX IF EXISTS idx_prover_jobs_fri_queued_order2;

DROP INDEX IF EXISTS idx_prover_jobs_fri_status;

DROP INDEX IF EXISTS ix_prover_jobs_fri_t1;

0 comments on commit c97f7e6

Please sign in to comment.