Skip to content

Commit 6f092e3

Browse files
Make wait_and_send_proof_to_verify_on_chain into a ProofAggregator instance method
1 parent 846cd98 commit 6f092e3

1 file changed

Lines changed: 10 additions & 16 deletions

File tree

  • aggregation_mode/proof_aggregator/src/backend

aggregation_mode/proof_aggregator/src/backend/mod.rs

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,10 @@ impl ProofAggregator {
235235
) -> Result<TransactionReceipt, AggregatedProofSubmissionError> {
236236
retry_function(
237237
|| {
238-
Self::wait_and_send_proof_to_verify_on_chain(
238+
self.wait_and_send_proof_to_verify_on_chain(
239239
blob.clone(),
240240
blob_versioned_hash,
241241
&aggregated_proof,
242-
self.proof_aggregation_service.clone(),
243-
self.sp1_chunk_aggregator_vk_hash_bytes,
244-
self.risc0_chunk_aggregator_image_id_bytes,
245-
self.config.monthly_budget_eth,
246242
)
247243
},
248244
ETHEREUM_CALL_MIN_RETRY_DELAY,
@@ -375,49 +371,47 @@ impl ProofAggregator {
375371
}
376372

377373
pub async fn wait_and_send_proof_to_verify_on_chain(
374+
&self,
378375
blob: BlobTransactionSidecar,
379376
blob_versioned_hash: [u8; 32],
380377
aggregated_proof: &AlignedProof,
381-
proof_aggregation_service: AlignedProofAggregationServiceContract,
382-
sp1_chunk_aggregator_vk_hash_bytes: [u8; 32],
383-
risc0_chunk_aggregator_image_id_bytes: [u8; 32],
384-
monthly_budget_eth: f64,
385378
) -> Result<TransactionReceipt, RetryError<AggregatedProofSubmissionError>> {
386379
Self::wait_until_can_submit_aggregated_proof(
387-
proof_aggregation_service.clone(),
388-
monthly_budget_eth,
380+
self.proof_aggregation_service.clone(),
381+
self.config.monthly_budget_eth,
389382
)
390383
.await?;
391384

392385
info!("Sending proof to ProofAggregationService contract...");
393386

394387
let tx_req = match aggregated_proof {
395-
AlignedProof::SP1(proof) => proof_aggregation_service
388+
AlignedProof::SP1(proof) => self
389+
.proof_aggregation_service
396390
.verifyAggregationSP1(
397391
blob_versioned_hash.into(),
398392
proof.proof_with_pub_values.public_values.to_vec().into(),
399393
proof.proof_with_pub_values.bytes().into(),
400-
sp1_chunk_aggregator_vk_hash_bytes.into(),
394+
self.sp1_chunk_aggregator_vk_hash_bytes.into(),
401395
)
402396
.sidecar(blob)
403397
.into_transaction_request(),
404398
AlignedProof::Risc0(proof) => {
405399
let encoded_seal = encode_seal(&proof.receipt)
406400
.map_err(|e| AggregatedProofSubmissionError::Risc0EncodingSeal(e.to_string()))
407401
.map_err(RetryError::Permanent)?;
408-
proof_aggregation_service
402+
self.proof_aggregation_service
409403
.verifyAggregationRisc0(
410404
blob_versioned_hash.into(),
411405
encoded_seal.into(),
412406
proof.receipt.journal.bytes.clone().into(),
413-
risc0_chunk_aggregator_image_id_bytes.into(),
407+
self.risc0_chunk_aggregator_image_id_bytes.into(),
414408
)
415409
.sidecar(blob)
416410
.into_transaction_request()
417411
}
418412
};
419413

420-
let provider = proof_aggregation_service.provider();
414+
let provider = self.proof_aggregation_service.provider();
421415
let envelope = provider
422416
.fill(tx_req)
423417
.await

0 commit comments

Comments
 (0)