subsystem-summary-of-rust
Rust Subsystem (Non-Soroban) — Technical Summary
Overview
The rust subsystem provides a Rust static library (rust_stellar_core) that is linked into the stellar-core C++ binary. It uses the cxx crate (v1.0.97) to define a bidirectional FFI bridge between C++ and Rust. The subsystem's primary responsibilities are:
- Soroban host function invocation — dispatching to the correct protocol-versioned soroban host.
- Fee computation — transaction resource fees, rent fees, and rent write fees.
- Module caching — pre-compiled WASM module cache for Soroban contracts.
- 128-bit integer arithmetic — exposing Rust's native
i128to C++. - Base64 encoding/decoding — used for XDR serialization interop.
- Ed25519 signature verification — using
ed25519-dalekfor faster verification. - Logging bridge — routing Rust
logcrate output to the C++ spdlog system. - Quorum intersection checking — using the
stellar-quorum-analyzerSAT solver. - Utility functions — rustc version, executable path, backtrace capture, XDR version checks.
The crate is built as crate-type = ["staticlib"] (edition 2021, rust-version 1.82.0). Optional features include tracy (profiling), next (pre-release protocol), testutils (test-only code), and unified (IDE-friendly single cargo build).
File Layout
More from stellar/stellar-core
running-tests
running tests at various levels from smoke tests to full suite to randomized tests
1subsystem-summary-of-test
read this skill for a token-efficient summary of the test subsystem
1subsystem-summary-of-scp
read this skill for a token-efficient summary of the scp subsystem
1running-make-to-build
how to run make correctly to get a good build, and otherwise understand the build system
1subsystem-summary-of-history
read this skill for a token-efficient summary of the history subsystem
1subsystem-summary-of-invariant
read this skill for a token-efficient summary of the invariant subsystem
1