Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sudont.xyz/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Sudont’s Cage is a dual-engine physics simulator. Every transaction is dropped into a local revm (EVM) or LiteSVM (SVM) memory sandbox before it hits the chain. Both engines are first-class citizens.
A single CanonicalIntent carries a vm_type field that routes it to the correct Cage implementation. The architecture is unified at the type level — the Judge and the rest of the pipeline are completely VM-agnostic.

The SimulationEngine Trait

Defined in sudont-types, SimulationEngine is the contract both Cage implementations fulfill:
SimulationEngine — VM-Agnostic Interface
/// Both EVM and SVM cages implement this trait.
pub trait SimulationEngine: Send + Sync {
    fn simulate(&self, intent: &CanonicalIntent) -> Result<SimOutcome, String>;
}
The CanonicalIntent input carries the vm_type discriminant:
VmType Enum
pub enum VmType {
    Evm,
    Svm,
}
The RPC layer reads vm_type and dispatches to the correct SimulationEngine implementation at runtime — no conditional logic needed in the Judge or policy layers.

VM Implementations

EVM engine is on the roadmap — Wave 14+. The shipped private alpha is Solana-only via LiteSVM. The integration points described below (revm, reth-backed state, Uniswap V3, Aerodrome adapters) are the planned design and are not yet wired into the demo. Treat this section as forward-looking architecture documentation.
Rust crate (planned): sudont-cage Dependency (planned): revm = "14.0"The EVM Cage will use revm — a pure-Rust, production-grade Ethereum Virtual Machine implementation.

Exact Semantics

Byte-for-byte compatible with geth/reth execution

Full State Access

Storage slots, emitted logs, and state diffs

Gas Accounting

Precise gas computation and revert reason extraction

EIP Support

EIP-3607 and active EIPs via feature flags
State source (planned): Local Base reth node with Flashblocks support. The simulation will reflect the pending world, not a stale cache.Planned protocol adapters: Uniswap V3 (planned) (exactInputSingle, exactInput), Aerodrome (planned) router swap flows.
SimOutcome
pub struct SimOutcome {
    pub success: bool,
    pub exit_reason: String,       // e.g. "Revert(0x...)" or "Stop"
    pub logs: Vec<SimLog>,         // Transfer events, Swap events
    pub asset_changes: Vec<AssetChange>, // token_in/token_out amounts
    pub state_diff: Vec<StateDiff>,      // storage slot changes
}
The Judge uses asset_changes to compute effective slippage and price impact against the CanonicalIntent’s amount_out_min and slippage_bps fields.

RPC Routing by VM Type

The Sudont RPC proxy reads the VM discriminant directly from the incoming request and dispatches to the correct engine:
Endpoint familyEngineCrate
eth_*, sudont_* (EVM)revmsudont-cage
solana_*, sudont_* (SVM)LiteSVMsudont-cage-svm
The Judge, Constitution, and diagnostic machinery are shared — only the simulation backend differs. Point a standard Ethers or Solana Web3 client at the proxy and the correct engine is selected automatically.

Extending to New VMs

Define VmType Variant

Add a new variant to the VmType enum in sudont-types.

Implement SimulationEngine

Create a new Cage crate implementing the SimulationEngine trait for your VM.

Register in RPC Dispatch

Register the implementation in the sudont-rpc dispatch table.

Done — No Other Changes

No changes needed to sudont-judge, sudont-constitution, or sudont-cortex. The firewall logic stays stable as new chains are added.