Skip to content

Commit f718ddc

Browse files
committed
feat(runner): assert spec version v8 (#160)
1 parent 1b99065 commit f718ddc

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

crates/indexer/engine/src/engine.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::fmt::Debug;
33
use std::sync::Arc;
44
use std::time::Duration;
55

6-
use dojo_utils::provider as provider_utils;
76
use dojo_world::contracts::world::WorldContractReader;
87
use lazy_static::lazy_static;
98
use starknet::core::types::{Event, TransactionContent};
@@ -152,11 +151,6 @@ impl<P: Provider + Send + Sync + std::fmt::Debug + 'static> Engine<P> {
152151
}
153152

154153
pub async fn start(&mut self) -> Result<(), Error> {
155-
if let Err(e) = provider_utils::health_check_provider(self.provider.clone()).await {
156-
error!(target: LOG_TARGET,"Provider health check failed during engine start");
157-
return Err(Error::AnyhowError(e));
158-
}
159-
160154
let mut fetching_backoff_delay = Duration::from_secs(1);
161155
let mut processing_backoff_delay = Duration::from_secs(1);
162156
let max_backoff_delay = Duration::from_secs(60);

crates/indexer/engine/src/error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@ pub enum Error {
55
#[error(transparent)]
66
Fetcher(#[from] torii_indexer_fetcher::Error),
77
#[error(transparent)]
8-
ProcessError(#[from] ProcessError),
8+
Process(#[from] ProcessError),
99
#[error(transparent)]
1010
SqliteError(#[from] torii_sqlite::error::Error),
1111
#[error(transparent)]
12-
ProviderError(#[from] starknet::providers::ProviderError),
13-
#[error(transparent)]
14-
AnyhowError(#[from] anyhow::Error),
12+
Provider(#[from] starknet::providers::ProviderError),
1513
#[error(transparent)]
1614
ControllerSync(#[from] torii_sqlite::error::ControllerSyncError),
1715
}

crates/runner/src/lib.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,14 @@ impl Runner {
106106
);
107107
let provider: Arc<_> = JsonRpcClient::new(transport).into();
108108

109+
// Check provider spec version. We only support v0.8.
110+
let spec_version = provider.spec_version().await?;
111+
if !spec_version.starts_with("0.8") {
112+
return Err(anyhow::anyhow!(
113+
"Provider spec version is not supported. Please use a provider that supports v0.8. Got: {spec_version}. You might need to add a `rpc/v0_8` to the end of the URL."
114+
));
115+
}
116+
109117
// Verify contracts are deployed
110118
if self.args.runner.check_contracts {
111119
let undeployed =

0 commit comments

Comments
 (0)