Add Solana RPC reliability skill#25
Open
RachGranville wants to merge 1 commit into
Open
Conversation
|
@RachGranville is attempting to deploy a commit to the STBR TRUE Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
Adds a new solana-rpc-reliability skill to the Solana AI Kit, focused on diagnosing production RPC issues and improving transaction send/confirm reliability (blockhash expiry, rebroadcast, priority fees, and provider failover), including a small dependency-free RPC diagnostic script.
Changes:
- Introduces the
solana-rpc-reliabilityskill with core workflow, references, rules, and an incident-debug command. - Adds
scripts/rpc-health-check.mjsto compare RPC endpoint health/latency/blockhash status and emit JSON/text output. - Links the new skill from the local skills hub (
.claude/skills/SKILL.md).
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| .claude/skills/solana-rpc-reliability/SKILL.md | Skill entry point with workflow, recommendations, and checklist. |
| .claude/skills/solana-rpc-reliability/scripts/rpc-health-check.mjs | Dependency-free Node script to probe Solana RPC health and key reliability signals. |
| .claude/skills/solana-rpc-reliability/rules/typescript.md | TypeScript-oriented reliability rules for review/generation. |
| .claude/skills/solana-rpc-reliability/references/transaction-send-patterns.md | Reference patterns for robust send/confirm and fee strategy. |
| .claude/skills/solana-rpc-reliability/references/provider-abstraction.md | Guidance for provider abstraction and failover behavior. |
| .claude/skills/solana-rpc-reliability/references/diagnostic-workflow.md | Incident triage + diagnostic interpretation workflow. |
| .claude/skills/solana-rpc-reliability/README.md | Skill packaging and usage instructions. |
| .claude/skills/solana-rpc-reliability/examples/devnet-health.json | Example JSON output from the diagnostic script. |
| .claude/skills/solana-rpc-reliability/commands/debug-solana-rpc.md | Structured command workflow for RPC/tx reliability incidents. |
| .claude/skills/solana-rpc-reliability/agents/openai.yaml | Agent interface metadata/prompt for this skill. |
| .claude/skills/SKILL.md | Adds the new skill link under Local Infrastructure & Deployment section. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,60 @@ | |||
| --- | |||
| name: solana-rpc-reliability | |||
| description: Diagnose and improve Solana RPC, transaction send, confirmation, priority fee, blockhash expiry, endpoint failover, and production transaction reliability. Use when Codex is debugging flaky Solana dapps, wallets, bots, indexers, or backend send flows; designing reliable broadcast/confirm logic; comparing RPC providers; or adding monitoring for slot lag, health, latency, and transaction landing failures. | |||
Comment on lines
+28
to
+31
| - `healthOk=false`: endpoint is not healthy enough for production sends. | ||
| - `latencyMs > 800`: acceptable for some reads, risky for time-sensitive sends. | ||
| - `slotLag` compared to another endpoint: if one endpoint is consistently behind, avoid it for confirmation. | ||
| - `tpsSample=0`: performance sample request failed or endpoint is degraded. |
Comment on lines
+8
to
+13
| const config = { rpcs: [], json: false, samples: 5 }; | ||
| for (let i = 0; i < args.length; i += 1) { | ||
| if (args[i] === "--rpc") config.rpcs.push(args[++i]); | ||
| else if (args[i] === "--json") config.json = true; | ||
| else if (args[i] === "--samples") config.samples = Number(args[++i]); | ||
| } |
Comment on lines
+18
to
+24
| async function rpc(url, method, params = []) { | ||
| const started = performance.now(); | ||
| const response = await fetch(url, { | ||
| method: "POST", | ||
| headers: { "Content-Type": "application/json" }, | ||
| body: JSON.stringify({ jsonrpc: "2.0", id: method, method, params }) | ||
| }); |
| if (!checks.healthOk) tips.push("Do not use this endpoint for production sends until getHealth is ok."); | ||
| if (checks.maxLatencyMs > 1_000) tips.push("Latency is high; use a dedicated send provider for user-facing transactions."); | ||
| if (!checks.latestBlockhash) tips.push("Could not fetch latest blockhash; transaction builders will fail or use stale data."); | ||
| if (!checks.performanceSamples) tips.push("Could not fetch performance samples; monitor provider health separately."); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
solana-rpc-reliabilityskill for production Solana RPC and transaction reliability work.The skill covers:
rpc-health-check.mjsdiagnostic scriptWhy
A recurring production failure mode for Solana apps is treating
sendTransactionas finality, waiting indefinitely on confirmations, reusing expired blockhashes, or routing all reads/sends through one endpoint. This skill gives agents a focused workflow for diagnosing and fixing those issues.Validation
python3 .../quick_validate.py .claude/skills/solana-rpc-reliability->Skill is valid!node .claude/skills/solana-rpc-reliability/scripts/rpc-health-check.mjs --rpc https://api.devnet.solana.com --json-> returnedhealthyNote:
tests/test_skills.shin a fresh shallow clone failed on existing external submodule links before this change because submodules were not initialized / one shallow submodule fetch failed. The new hub link itself resolves:solana-rpc-reliability/SKILL.md.