Skip to content

Commit b602274

Browse files
committed
Log batcher gas cost
1 parent 3ca8bc8 commit b602274

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

  • batcher/aligned-batcher/src

batcher/aligned-batcher/src/lib.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ impl Batcher {
561561
.map(|(i, signature)| SignatureData::new(signature, nonces[i]))
562562
.collect();
563563

564-
if let Err(e) = eth::create_new_task(
564+
match eth::create_new_task(
565565
payment_service,
566566
*batch_merkle_root,
567567
batch_data_pointer,
@@ -572,8 +572,15 @@ impl Batcher {
572572
)
573573
.await
574574
{
575-
error!("Failed to create batch verification task: {}", e);
576-
return Err(BatcherError::TaskCreationError(e.to_string()));
575+
Ok(receipt) => {
576+
if let Some(gas_used) = receipt.gas_used {
577+
info!("Gas used to create new task: {}", gas_used);
578+
}
579+
}
580+
Err(e) => {
581+
error!("Failed to create batch verification task: {}", e);
582+
return Err(BatcherError::TaskCreationError(e.to_string()));
583+
}
577584
}
578585

579586
info!("Batch verification task created on Aligned contract");

0 commit comments

Comments
 (0)