| Crates.io | solana-validator-optimizer |
| lib.rs | solana-validator-optimizer |
| version | 1.2.2 |
| created_at | 2025-04-18 15:16:27.536081+00 |
| updated_at | 2026-01-25 15:59:41.002863+00 |
| description | Optimized Solana validator tool with snapshot prefetching, RPC caching, and Prometheus metrics. |
| homepage | https://github.com/0rlych1kk4/solana-validator-optimizer |
| repository | https://github.com/0rlych1kk4/solana-validator-optimizer |
| max_upload_size | |
| id | 1639538 |
| size | 258,667 |
A production-grade Rust toolkit to enhance Solana validator performance by reducing sync latency and improving RPC responsiveness.
solana-validator-optimizer is a modular enhancement suite for Solana validator infrastructure. It helps operators by:
/metrics endpoint| Feature | Description |
|---|---|
| Snapshot Prefetching | Downloads or copies snapshots locally with optional SHA-256 validation |
| RPC LRU Cache | Reduces redundant RPC calls like getBalance, getEpochInfo, etc. |
| Prometheus Metrics | /metrics endpoint for cache hits, misses, request counts, and latency |
| Config Auto-Tuner | Adjusts validator configuration based on CPU, RAM, disk, and network |

git clone https://github.com/0rlych1kk4/solana-validator-optimizer.git
cd solana-validator-optimizer
Create a Config.toml file in the project root:
# Config.toml
# Snapshot settings
snapshot_url = "" # e.g. "https://snapshots.myvalidator.com/latest.tar.zst"
snapshot_sha256 = "" # optional SHA-256 checksum for validation
# RPC and Metrics
rpc_url = "https://api.mainnet-beta.solana.com"
metrics_port = 9090 # Prometheus scrapes at http://<host>:9090/metrics
# Cache settings
cache_size = 128 # Number of entries in the RPC LRU cache
Run all modules (snapshot, RPC cache, auto-tuner, metrics):
cargo run -p solana-validator-optimizer-cli --release
Add this to your Cargo.toml:
[dependencies]
solana-validator-optimizer = "1"
tokio = { version = "1", features = ["full"] }
anyhow = "1"
Example usage:
use solana_validator_optimizer::{Optimizer, Config};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let cfg = Config::from_file("Config.toml")?;
let mut optimizer = Optimizer::new(cfg).await?;
optimizer.start().await?;
Ok(())
}
You can override any Config.toml values using environment variables.
| Config Key | Environment Variable |
|---|---|
| snapshot_url | OPTIMIZER_SNAPSHOT_URL |
| rpc_url | OPTIMIZER_RPC_URL |
| metrics_port | OPTIMIZER_METRICS_PORT |
| cache_size | OPTIMIZER_CACHE_SIZE |
Example:
OPTIMIZER_RPC_URL=https://api.mainnet-beta.solana.com OPTIMIZER_CACHE_SIZE=256 cargo run -p solana-validator-optimizer-cli --release
Contributions are welcome!
Feel free to open issues, feature requests, or pull requests.
Licensed under the MIT License.