Skip to content

Commit d74a650

Browse files
kariyclaude
andcommitted
fix(runner): relax Starknet RPC spec version check
A node reporting a non-0.9 spec_version (or failing to respond to spec_version at all) currently aborts torii startup. In practice most JSON-RPC methods torii uses are stable across minor spec bumps, so a strict check blocks valid setups whenever a node ships a newer spec. Replace the hard error with a tracing warning and continue. Real incompatibilities will still surface at the actual RPC call site with a more specific error. Mirrors dojoengine/dojo#3402 for sozo. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2193fc5 commit d74a650

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

crates/runner/src/lib.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -291,14 +291,25 @@ impl Runner {
291291
);
292292
let provider: Arc<_> = JsonRpcClient::new(transport).into();
293293

294-
// Check provider spec version. We only support v0.9.
294+
// Check provider spec version. Torii supports v0.9.0; a mismatch is non-fatal.
295295
let supported_spec = "0.9";
296-
let spec_version = provider.spec_version().await?;
297-
if !spec_version.starts_with(supported_spec) {
298-
return Err(anyhow::anyhow!(
299-
"Provider spec version is not supported. Please use a provider that supports v{supported_spec}. Got: {spec_version}. You might need to add a `rpc/v{}` to the end of the URL.",
300-
supported_spec.replace('.', "_")
301-
));
296+
match provider.spec_version().await {
297+
Ok(spec_version) => {
298+
if !spec_version.starts_with(supported_spec) {
299+
warn!(
300+
target: LOG_TARGET,
301+
spec_version = %spec_version,
302+
"Provider spec version mismatch. Torii supports v0.9.0. Continuing anyway; you may experience unexpected behaviours.",
303+
);
304+
}
305+
}
306+
Err(e) => {
307+
warn!(
308+
target: LOG_TARGET,
309+
error = ?e,
310+
"Could not query Starknet RPC spec version. Torii supports v0.9.0. Continuing anyway; you may experience unexpected behaviours.",
311+
);
312+
}
302313
}
303314

304315
// Verify contracts are deployed

0 commit comments

Comments
 (0)