subsystem-summary-of-rust

Installation
SKILL.md

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:

  1. Soroban host function invocation — dispatching to the correct protocol-versioned soroban host.
  2. Fee computation — transaction resource fees, rent fees, and rent write fees.
  3. Module caching — pre-compiled WASM module cache for Soroban contracts.
  4. 128-bit integer arithmetic — exposing Rust's native i128 to C++.
  5. Base64 encoding/decoding — used for XDR serialization interop.
  6. Ed25519 signature verification — using ed25519-dalek for faster verification.
  7. Logging bridge — routing Rust log crate output to the C++ spdlog system.
  8. Quorum intersection checking — using the stellar-quorum-analyzer SAT solver.
  9. 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

Related skills
Installs
1
GitHub Stars
3.3K
First Seen
14 days ago