From d74a6501e89a5bbc9b035f45f8aba88d76be7d54 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Thu, 14 May 2026 14:02:53 -0500 Subject: [PATCH] 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) --- crates/runner/src/lib.rs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/crates/runner/src/lib.rs b/crates/runner/src/lib.rs index d4aaf23a..90b050be 100644 --- a/crates/runner/src/lib.rs +++ b/crates/runner/src/lib.rs @@ -291,14 +291,25 @@ impl Runner { ); let provider: Arc<_> = JsonRpcClient::new(transport).into(); - // Check provider spec version. We only support v0.9. + // Check provider spec version. Torii supports v0.9.0; a mismatch is non-fatal. let supported_spec = "0.9"; - let spec_version = provider.spec_version().await?; - if !spec_version.starts_with(supported_spec) { - return Err(anyhow::anyhow!( - "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.", - supported_spec.replace('.', "_") - )); + match provider.spec_version().await { + Ok(spec_version) => { + if !spec_version.starts_with(supported_spec) { + warn!( + target: LOG_TARGET, + spec_version = %spec_version, + "Provider spec version mismatch. Torii supports v0.9.0. Continuing anyway; you may experience unexpected behaviours.", + ); + } + } + Err(e) => { + warn!( + target: LOG_TARGET, + error = ?e, + "Could not query Starknet RPC spec version. Torii supports v0.9.0. Continuing anyway; you may experience unexpected behaviours.", + ); + } } // Verify contracts are deployed