solana-rpc-reviewlisted
Install: claude install-skill Xipher-Labs/walter-os
# Solana RPC Review
Review skill for the specific class of code [Company] ships: RPC infrastructure
serving 100k+ msg/sec to trading firms, indexers, and oracles. Different
review priorities than typical web code — latency at p99 matters more than
features, and a 2ms regression in the hot path is a blocker.
## Hot path discipline
Any code in the request/message handling path is "hot". For these paths:
### Allocations
- **Zero allocations per message** is the goal in steady state. Reuse
buffers, use object pools, prefer `&[u8]` over `Vec<u8>` when not consumed.
- Look for: `format!`, `to_string()`, `clone()`, `Vec::new()` inside loops,
`Box::new()`, lazy `String` concatenation. All suspect.
- Profile with `dhat`, `heaptrack`, or `cargo flamegraph` before claiming
perf is fine.
- Strings: prefer `&str` over `String`, `Cow<'_, str>` when sometimes-owned.
- Numbers in messages: use `Bytes` from `bytes` crate for zero-copy slicing.
### Locks and contention
- `Mutex`/`RwLock` in the hot path = stop and justify. Use `parking_lot`
variants (faster) or `arc-swap`/`atomic` types for read-heavy state.
- `tokio::sync::Mutex` is async-aware but slower than `parking_lot::Mutex`
for short critical sections. Use the right one.
- Sharded locks (`DashMap`) often beat `Arc<RwLock<HashMap>>` when contention
is real. But profile, don't guess.
- Check for accidental serialization: futures awaiting a global resource
serialize concurrent requests.
### Async correctness
- **Nev