Skip to content

Commit

Permalink
Address Alex's code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeza committed Dec 3, 2024
1 parent bef72a4 commit 6796543
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/lib/dal/src/tee_proof_generation_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ impl TeeProofGenerationDal<'_, '_> {
let processing_timeout = pg_interval_from_duration(processing_timeout);
let min_batch_number = i64::from(min_batch_number.0);
let mut transaction = self.storage.start_transaction().await?;

// Lock rows in the proof_generation_details table to prevent race conditions. The
// tee_proof_generation_details table may not have corresponding entries yet if this is the
// first time the query is invoked for a batch. Locking rows in proof_generation_details
// ensures that two different TEE prover instances will not try to prove the same batch.
let batch_number = sqlx::query!(
r#"
SELECT
Expand Down

0 comments on commit 6796543

Please sign in to comment.