How keep-starknet-strange/snos works
Project type and purpose
• This is a Rust workspace that provides:
• A core library (“crates/starknet-os”) implementing the Starknet OS logic in Rust
• Supporting libraries (e.g., “starknet-os-types”, “cairo-type-derive”)
• CLI tools (binaries under “crates/bin” such as prove_block, hint_tool, output_segment)
• An RPC client (“crates/rpc-client”) and an RPC replay helper (“crates/rpc-replay”)
• Purpose: re-execute Starknet transactions from a block, verify state transitions via the Cairo OS program, and produce a PIE (Program Independent Execution) for STARK proof generation.
File structure
• Top-level directories:
• cairo-lang: submodule for the Cairo compiler sources
• crates/: workspace members
– starknet-os: core OS logic (hints, syscalls, execution engine)
– starknet-os-types: data structures for contract classes, state diffs, hashes, etc.
– rpc-client: HTTP client targeting full nodes (Pathfinder)
– rpc-replay: builds OSInput from raw RPC data (state diffs, proofs, transactions)
– bin/: CLI entry points (prove_block, hint_tool, output_segment)
• scripts/ & setup-scripts/: environment setup, test orchestration
• tests/: integration tests that exercise the entire flow
• Key config files:
• Cargo.toml & rust-toolchain: Rust workspace configuration
• pyproject.toml, requirements.txt: Python venv for Cairo compiler
• .github/workflows/: CI pipelines (lint, test, block proofs)
README for additional insights
• Describes the high-level flow: CLI → gather state/transaction data → feed the Starknet OS → produce PIE → STARK proof
• Highlights dependencies: Rust ≥1.76, a synced Pathfinder archive node, Cairo compiler environment
• Explains the prove_block binary end-to-end use case