Skip to content

Support cairo_native in rpc-client#506

Open
heemankv wants to merge 3 commits intomainfrom
codex/rpc-client-cairo-native-minimal
Open

Support cairo_native in rpc-client#506
heemankv wants to merge 3 commits intomainfrom
codex/rpc-client-cairo-native-minimal

Conversation

@heemankv
Copy link
Copy Markdown
Collaborator

@heemankv heemankv commented Mar 30, 2026

Summary

  • wire rpc-client's existing cairo_native feature through to blockifier/cairo_native
  • handle RunnableCompiledClass::V1Native when computing compiled class hash v2
  • enable rpc-client's cairo_native feature from generate-pie
  • align SNOS's direct reqwest dependency with starknet-rust-providers so rpc-client can construct a custom HttpTransport client
  • bound SNOS RPC transport calls with connect/request timeouts so the retry wrapper can recover instead of hanging forever

Why

Madara now builds madara and orchestrator in a unified workspace dependency graph. In that graph, blockifier is built with cairo_native, which exposes RunnableCompiledClass::V1Native.

Upstream rpc-client still assumed only V0 / V1 in get_compiled_class_hash_v2, so downstream consumers had to patch SNOS locally. This PR started as the smallest upstream fix needed to let downstreams consume SNOS without a vendored rpc-client override.

After wiring Madara directly to this branch and running orchestrator::tests::jobs::snos_job::test_process_job against Sepolia block 2934726, there was still a separate runtime issue: the native path could hang indefinitely on the first get_nonce_at state read. The underlying JSON-RPC call returned immediately with curl, but SNOS's Rust transport had no bounded connect/request timeout, so a stuck HTTP future never errored and the retry logic in state_reader never regained control.

The additional timeout fix in this branch addresses that runtime failure mode. Aligning SNOS's direct reqwest dependency with starknet-rust-providers was required to use HttpTransport::new_with_client(...) with a bounded client.

Validation

  • cargo check -p rpc-client
  • cargo check -p rpc-client --features cairo_native
  • cargo check -p generate-pie
    • currently blocked in this environment because apollo_starknet_os_program requires cairo-compile from the sequencer venv/toolchain (Failed to get cairo-compile version: No such file or directory)
  • Madara exact orchestrator test with SNOS pinned to this branch/commit:
    • cargo test -p orchestrator --features testing tests::jobs::snos_job::test_process_job -- --exact --nocapture
    • passed locally once SNOS was consumed from this branch with the timeout change

@heemankv heemankv force-pushed the codex/rpc-client-cairo-native-minimal branch from 05a1569 to e1f2ea1 Compare March 30, 2026 10:22
@heemankv heemankv self-assigned this Mar 30, 2026
@heemankv heemankv marked this pull request as ready for review March 30, 2026 11:16
Copy link
Copy Markdown
Collaborator

@prkpndy prkpndy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

use crate::constants::{MAX_CONCURRENT_PROOF_REQUESTS, MAX_STORAGE_KEYS_PER_REQUEST, STARKNET_RPC_VERSION};
use crate::types::{ClassProof, ContractProof};

const RPC_REQUEST_TIMEOUT_SECS: u64 = 15;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we increase it? might be small for larger proofs on slow connections!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants