Skip to content

ship: bench 086 polkadot-rpc to main (Railway rpc-capabilities pickup)#1183

Merged
Flotapponnier merged 1 commit into
mainfrom
ship/polkadot-rpc-main
Jul 15, 2026
Merged

ship: bench 086 polkadot-rpc to main (Railway rpc-capabilities pickup)#1183
Flotapponnier merged 1 commit into
mainfrom
ship/polkadot-rpc-main

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

Cherry-pick of #1179 (Polkadot RPC bench), adapted to main's rpc-capabilities shape (main does not carry the bench 083 consensus/hash-quorum machinery yet, so my polkadot changes drop the consensus.observe skip and the extra hash return from callSubstrateHeader, keeping the 4-value signature main uses).

Motivation: Railway rpc-capabilities-{us,eu,sgp} watch main, so the Polkadot code needs to land here for the harness to pick it up on next auto-build.

What lands

  • harnesses/rpc-capabilities/cmd/script/config.go: new polkadot chain block with 3 audited providers (Parity official, OnFinality, PublicNode), Kind comment extended
  • harnesses/rpc-capabilities/cmd/script/probe.go: polkadotStaleBlockGap = 40, new callSubstrateHeader (chain_getHeader POST + hex block-number parse), probeOne switches on Kind
  • harnesses/rpc-capabilities/cmd/script/archive.go: skip archive loop for polkadot alongside solana
  • benchmarks/polkadot-rpc.yml: identical to the file that landed on dev in add bench 086 polkadot-rpc: first Substrate chain in the RPC cluster #1179

Test plan

  • go build ./... clean in harnesses/rpc-capabilities
  • bun test src/ - 89/89 pass across 9 files (main-side test count, no bench 083 tests here yet)
  • 4 live probes each verified against the 3 launch endpoints on 2026-07-15 (all returned block 0x1ea223d)

Runtime impact

After merge, Railway will auto-rebuild the 3 rpc-capabilities services from this main SHA and the Polkadot probes will start feeding Prom (rpc_latency_milliseconds{chain="polkadot", provider=...}). The /benchmarks/polkadot-rpc bench page renders "Awaiting first run" until Prom captures samples (~24h before percentiles are meaningful).

Cherry-picked from dev (#1179), adapted to main's rpc-capabilities
shape (no bench 083 consensus/hash-quorum machinery on main yet).

Extends rpc-capabilities to Polkadot, the first non-EVM, non-Solana
chain in the cluster. Substrate JSON-RPC via chain_getHeader (returns
hex-encoded block number matching EVM's eth_getBlockByNumber shape),
staleness by relay-block gap (40 blocks, ~4 min at Polkadot's ~6 s
cadence).

Harness changes:
- Chain.Kind gains "polkadot" alongside "solana" and default (EVM).
- New callSubstrateHeader: chain_getHeader POST, parses hex block
  number, same latency measurement + result classification as EVM.
- probeOne switches on Kind (was if solana / else). polkadot uses
  polkadotStaleBlockGap = 40.
- Archive loop skipped for polkadot alongside solana: no eth_getBalance-
  by-depth equivalent on Substrate public endpoints.

Providers at launch (3, live-verified 2026-07-15 with 4 consecutive
chain_getHeader probes each, all returning block 0x1ea223d):
- polkadot-official (Parity, rpc.polkadot.io)
- onfinality (public gateway, Web3 Foundation grantee)
- publicnode (Allnodes)

Excluded by the launch audit:
- 1RPC: filters chain_getHeader as "Not Allowed" on privacy relay
- Dwellir: 503 during audit sweep, revisit
- Ankr / Chainstack: paid tier / key-gated on Substrate
- RadiumBlock / Grove / Thirdweb: referral header / invalid chain / key-gated

Spec (benchmarks/polkadot-rpc.yml, bench № 086) copied from #1179
unchanged: 3-provider cohort, same schema as moonbeam-rpc etc.

Post-merge:
- Railway rpc-capabilities-{us,eu,sgp} auto-rebuild on this main push
  and start emitting rpc_latency_milliseconds{chain="polkadot"}
  metrics.
- The bench 083 consensus path (dev-only for now) is not wired here;
  when dev syncs to main naturally, the polkadot switch case in
  probeOne already excludes consensus.observe correctly on that path.
@Flotapponnier
Flotapponnier merged commit 2078045 into main Jul 15, 2026
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.

1 participant