Skip to content

Commit 0865d6e

Browse files
committed
Revert "run -> loop"
This reverts commit c4eacbf.
1 parent c4eacbf commit 0865d6e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

script/bin/operator.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ where
221221
///
222222
/// # Errors
223223
/// - If any errors occur while making the batch proof.
224-
async fn run(self: Arc<Self>) -> Result<()> {
224+
async fn run_inner(self: Arc<Self>) -> Result<()> {
225225
let data_commitment_max = self.check_contracts().await?;
226226

227227
// How often new tendermint blocks are created.
@@ -276,7 +276,7 @@ where
276276
continue;
277277
}
278278

279-
// If the `block_to_request` doesn't have enough overlapping validators with the `last_known_block`, the `block_to_request` needs to be reduced to a block where the validators have enough overlap.
279+
// Blocks may be skipped if they dont meet consensus thresholds.
280280
let block_to_request =
281281
find_block_to_request(&self.client, last_known_block, block_to_request).await?;
282282

@@ -315,7 +315,7 @@ where
315315

316316
// Errors either occur when creating proofs or when relaying proofs.
317317
//
318-
// In either case, return an error. In the outer loop, the operator will not "sleep" for the loop interval if there was an error and will retry immediately.
318+
// In either case, indicate that the operator should retry sooner.
319319
let mut has_err = false;
320320
for batch_result in results {
321321
match batch_result {
@@ -345,7 +345,7 @@ where
345345
}
346346

347347
/// Run the operator, indefinitely.
348-
async fn loop(self) {
348+
async fn run(self) {
349349
let this = Arc::new(self);
350350

351351
tracing::info!("Operator running with chains {:?}", this.contracts.keys());
@@ -362,7 +362,7 @@ where
362362
if let Err(e) = res {
363363
tracing::error!("Error running operator: {:?}", e);
364364

365-
// If there's an error, sleep for only 10 seconds. This will avoid transient RPC downtime while ensuring that the operator recovers quickly.
365+
// Sleep for less time on errors.
366366
tokio::time::sleep(tokio::time::Duration::from_secs(10)).await;
367367
continue;
368368
}
@@ -657,5 +657,5 @@ async fn main() {
657657
operator = operator.with_chain(provider, c.blobstream_address).await;
658658
}
659659

660-
operator.loop().await;
660+
operator.run().await;
661661
}

0 commit comments

Comments
 (0)