Skip to content

Commit b6caaae

Browse files
committed
fix: select on run so propagate error, bump vkey in contract
1 parent 8358b2d commit b6caaae

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

contracts/script/UpdateVkey.s.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ contract UpdateVkeyScript is BaseScript {
2424
SP1Blobstream sp1Blobstream = SP1Blobstream(address(existingProxyAddress));
2525

2626
// v4 program vkey
27-
sp1Blobstream.updateProgramVkey(0x00e30cadab0b8ad6a5f115c5131a14afce4ec4bbf8acf7c821951778a2d97660);
27+
sp1Blobstream.updateProgramVkey(0x00b6c8c78a73630fae80e45b2888a00d9ab0cc05a77cd7c027446a6ae2289928);
2828
}
2929
}

script/bin/operator.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ impl SP1BlobstreamOperator {
8686

8787
/// Check the verifying key in the contract matches the verifying key in the prover.
8888
async fn check_vkey(&self) -> Result<()> {
89+
println!("Checking vkey here");
8990
let provider = ProviderBuilder::new().on_http(self.rpc_url.clone());
9091
let contract = SP1Blobstream::new(self.contract_address, provider);
9192
let verifying_key = contract
@@ -197,6 +198,7 @@ impl SP1BlobstreamOperator {
197198

198199
async fn run(&self) -> Result<()> {
199200
self.check_vkey().await?;
201+
println!("vkey check passed");
200202

201203
let fetcher = TendermintRPCClient::default();
202204
let block_update_interval = get_block_update_interval();
@@ -296,14 +298,17 @@ async fn main() {
296298
let request_interval_mins = get_loop_interval_mins();
297299
// If the operator takes longer than LOOP_TIMEOUT_MINS for a single invocation, or there's
298300
// an error, sleep for the loop interval and try again.
299-
if let Err(e) = tokio::time::timeout(
300-
tokio::time::Duration::from_secs(60 * LOOP_TIMEOUT_MINS),
301-
operator.run(),
302-
)
303-
.await
304-
{
305-
error!("Error running operator: {}", e);
301+
tokio::select! {
302+
_ = tokio::time::sleep(tokio::time::Duration::from_secs(60 * LOOP_TIMEOUT_MINS)) => {
303+
continue;
304+
}
305+
e = operator.run() => {
306+
if let Err(e) = e {
307+
error!("Error running operator: {}", e);
308+
}
309+
}
306310
}
311+
307312
tokio::time::sleep(tokio::time::Duration::from_secs(60 * request_interval_mins)).await;
308313
}
309314
}

0 commit comments

Comments
 (0)