|
| 1 | +# Solana Validator/RPC Enhancements |
| 2 | + |
| 3 | +This document outlines the enhancements made to the OSVM-CLI for Solana validator and RPC node deployment based on the [Validator Jumpstart](https://github.com/ice-staking/validator-jumpstart) repository. |
| 4 | + |
| 5 | +## Overview of Enhancements |
| 6 | + |
| 7 | +The following enhancements have been implemented: |
| 8 | + |
| 9 | +1. **Hardware Optimization & Disk Configuration** |
| 10 | + - Support for 3-disk setup (OS, Ledger, Accounts/Snapshots) |
| 11 | + - Disk validation and mounting |
| 12 | + - Directory structure creation |
| 13 | + |
| 14 | +2. **System Performance Optimization** |
| 15 | + - Kernel and network parameter tuning |
| 16 | + - CPU governor settings |
| 17 | + - File descriptor limits |
| 18 | + - Memory management |
| 19 | + |
| 20 | +3. **Enhanced Installation Options** |
| 21 | + - Version selection (standard, Jito, Agave) |
| 22 | + - Client type configuration |
| 23 | + - Installation verification |
| 24 | + |
| 25 | +4. **Hot-Swap Capability** |
| 26 | + - Staked/unstaked keypair management |
| 27 | + - Identity transition scripts |
| 28 | + - Automatic failover monitoring |
| 29 | + |
| 30 | +5. **Monitoring & Management** |
| 31 | + - Log rotation configuration |
| 32 | + - System monitoring scripts |
| 33 | + - Metrics dashboard integration |
| 34 | + - Alert system for critical issues |
| 35 | + |
| 36 | +6. **Security Enhancements** |
| 37 | + - Firewall configuration |
| 38 | + - Port management |
| 39 | + - Enhanced service configuration |
| 40 | + |
| 41 | +## Command Line Usage |
| 42 | + |
| 43 | +### Deploy a Solana Validator |
| 44 | + |
| 45 | +```bash |
| 46 | +# Basic validator deployment |
| 47 | +osvm solana validator user@host --network mainnet |
| 48 | + |
| 49 | +# Enhanced validator with disk configuration |
| 50 | +osvm solana validator user@host --network mainnet \ |
| 51 | + --ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 |
| 52 | + |
| 53 | +# Validator with Jito client |
| 54 | +osvm solana validator user@host --network mainnet \ |
| 55 | + --client-type jito --version v1.18.23-jito |
| 56 | + |
| 57 | +# Validator with hot-swap capability |
| 58 | +osvm solana validator user@host --network mainnet \ |
| 59 | + --ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \ |
| 60 | + --hot-swap |
| 61 | + |
| 62 | +# Full configuration with metrics |
| 63 | +osvm solana validator user@host --network mainnet \ |
| 64 | + --ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \ |
| 65 | + --client-type jito --version v1.18.23-jito \ |
| 66 | + --hot-swap \ |
| 67 | + --metrics-config "host=https://metrics.solana.com:8086,db=mainnet-beta,u=mainnet-beta_write,p=password" |
| 68 | +``` |
| 69 | + |
| 70 | +### Deploy a Solana RPC Node |
| 71 | + |
| 72 | +```bash |
| 73 | +# Basic RPC node deployment |
| 74 | +osvm solana rpc user@host --network mainnet |
| 75 | + |
| 76 | +# Enhanced RPC with disk configuration |
| 77 | +osvm solana rpc user@host --network mainnet \ |
| 78 | + --ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 |
| 79 | + |
| 80 | +# RPC with transaction history enabled |
| 81 | +osvm solana rpc user@host --network mainnet \ |
| 82 | + --ledger-disk /dev/nvme0n1 --accounts-disk /dev/nvme1n1 \ |
| 83 | + --enable-history |
| 84 | +``` |
| 85 | + |
| 86 | +## Disk Configuration |
| 87 | + |
| 88 | +The enhanced deployment supports the recommended 3-disk configuration: |
| 89 | + |
| 90 | +1. **OS Disk** - Typically ~500GB SSD for the operating system |
| 91 | +2. **Ledger Disk** - High-performance NVMe (≥2TB) mounted at `/mnt/ledger` |
| 92 | +3. **Accounts Disk** - High-performance NVMe (≥2TB) mounted at `/mnt/extras` with subdirectories: |
| 93 | + - `/mnt/extras/accounts` - For accounts database |
| 94 | + - `/mnt/extras/snapshot` - For snapshots |
| 95 | + |
| 96 | +When using the `--ledger-disk` and `--accounts-disk` options, the system will: |
| 97 | +- Validate disk existence and size requirements |
| 98 | +- Format disks if not already formatted |
| 99 | +- Mount disks to the appropriate locations |
| 100 | +- Create necessary subdirectories |
| 101 | +- Set proper permissions |
| 102 | + |
| 103 | +## System Optimizations |
| 104 | + |
| 105 | +The deployment applies the following system optimizations: |
| 106 | + |
| 107 | +1. **Network Parameters** |
| 108 | + - TCP buffer sizes and congestion control |
| 109 | + - TCP optimization settings |
| 110 | + - Solana-specific network parameters |
| 111 | + |
| 112 | +2. **Kernel Optimizations** |
| 113 | + - Timer migration settings |
| 114 | + - Process limits |
| 115 | + - Task timeout configuration |
| 116 | + |
| 117 | +3. **Virtual Memory Tuning** |
| 118 | + - Swappiness and memory mapping |
| 119 | + - Dirty ratio and background ratio |
| 120 | + - Write-back settings |
| 121 | + |
| 122 | +## Hot-Swap Capability |
| 123 | + |
| 124 | +The hot-swap capability implements the Identity Transition methodology from Pumpkin's Pool: |
| 125 | + |
| 126 | +1. **Keypair Management** |
| 127 | + - Staked keypair for normal operation |
| 128 | + - Unstaked keypair as fallback |
| 129 | + |
| 130 | +2. **Automatic Failover** |
| 131 | + - Monitoring script checks validator health |
| 132 | + - Automatic transition to unstaked identity when falling behind |
| 133 | + - Automatic transition back to staked identity when caught up |
| 134 | + |
| 135 | +3. **Service Coordination** |
| 136 | + - Log rotation with USR1 signal |
| 137 | + - Service management scripts |
| 138 | + |
| 139 | +## Monitoring Setup |
| 140 | + |
| 141 | +The deployment includes: |
| 142 | + |
| 143 | +1. **Basic Monitoring** |
| 144 | + - Regular service health checks |
| 145 | + - Performance metrics collection |
| 146 | + - Disk usage monitoring |
| 147 | + |
| 148 | +2. **Alert System** |
| 149 | + - Critical error detection |
| 150 | + - Disk space warnings |
| 151 | + - Catching-up state monitoring |
| 152 | + |
| 153 | +3. **Optional Grafana + InfluxDB Stack** |
| 154 | + - Docker-based monitoring stack |
| 155 | + - Pre-configured for Solana metrics |
| 156 | + - Dashboard templates |
| 157 | + |
| 158 | +## Limitations and Notes |
| 159 | + |
| 160 | +- Disk configuration requires direct device paths (e.g., `/dev/nvme0n1`) |
| 161 | +- Hot-swap capability is optimized for single-machine operation |
| 162 | +- Metrics configuration requires a valid InfluxDB instance |
| 163 | +- Some optimizations may require system restarts to take full effect |
0 commit comments