Skip to content

Add Solana RPC reliability skill#25

Open
RachGranville wants to merge 1 commit into
solanabr:mainfrom
RachGranville:add-solana-rpc-reliability
Open

Add Solana RPC reliability skill#25
RachGranville wants to merge 1 commit into
solanabr:mainfrom
RachGranville:add-solana-rpc-reliability

Conversation

@RachGranville

Copy link
Copy Markdown

Summary

Adds a new solana-rpc-reliability skill for production Solana RPC and transaction reliability work.

The skill covers:

  • RPC health diagnostics and endpoint comparison
  • transaction send/confirm failure triage
  • blockhash expiry and rebroadcast patterns
  • priority fee / compute budget review
  • provider abstraction and failover guidance
  • TypeScript reliability rules
  • a dependency-free rpc-health-check.mjs diagnostic script

Why

A recurring production failure mode for Solana apps is treating sendTransaction as 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 -> returned healthy

Note: tests/test_skills.sh in 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.

Copilot AI review requested due to automatic review settings June 21, 2026 07:04
@vercel

vercel Bot commented Jun 21, 2026

Copy link
Copy Markdown

@RachGranville is attempting to deploy a commit to the STBR TRUE Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-reliability skill with core workflow, references, rules, and an incident-debug command.
  • Adds scripts/rpc-health-check.mjs to 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.");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants