refactor: single RPC endpoint per chain, remove round-robin fallback#85
Draft
MaximusHaximus wants to merge 2 commits into
Draft
refactor: single RPC endpoint per chain, remove round-robin fallback#85MaximusHaximus wants to merge 2 commits into
MaximusHaximus wants to merge 2 commits into
Conversation
Claude Code worktrees live under /.claude/worktrees/ per workspace convention; without this entry they show as untracked in the canonical clone. Claude-Session: https://claude.ai/code/session_01928TnCS4kMQPd6uVTewNSN
|
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.


Why
Team ruling: every service uses one and only one RPC endpoint per chain — the internal eRPC proxy, which owns provider redundancy and failover. Client-side multi-endpoint rotation is removed from all services; this repo was the only one with real round-robin fallback.
What changed
ETHEREUM_RPC,SEPOLIA_RPC,MATIC_RPC,AMOY_RPCnow take a single URL string instead of a JSON array of URLs. The JSON-array parsing (parseRpcUrlArray) and the pair-length coupling checks (ETHEREUM↔MATIC, SEPOLIA↔AMOY) are removed. Single-URL validation semantics are unchanged (http/https check;rpc.polygon.toolsmust be https).mainnetRpcIndex/testnetRpcIndexdeleted fromsrc/config.ts;rpcLength/per-networkmaxRetriescomputation deleted fromgetVersionDetails; the four service-function loops no longer rotate through endpoint pairs.HTTPErrordomain errors (BlockNotIncludedError,IncorrectTxError,TxNotCheckpointedError) propagate immediately without retry; the final attempt rethrows/maps exactly as today.logger.warnon retried attempts andrpcOriginlog hygiene (origins only, never full URLs) are unchanged.POSClientpromise-cache insrc/maticClient.ts(the OOM fix) stays as is..env.example,README.md,CLAUDE.md, andsrc/scripts/get-receipts-root.ts(read the env var as a plain URL).⚠ Deploy coordination required
The deployed secrets currently hold JSON-array values (e.g.
'["https://..."]'). They must be changed to plain single URLs (pointing at the internal eRPC proxy per team standards) in the same rollout as this change, in both production and development. Merging without the secret change will fail env validation at startup — that is the safe failure mode (the service refuses to boot rather than running misconfigured), but the rollouts must be coordinated.Verification
pnpm run lint(ESLint + typecheck + prettier + markdownlint): pass.pnpm test(live-RPC suite): 33/34 pass. The one failure (exit-payload-state-sync.test.ts, amoy) is environmental —rpc-amoy.polygon.technologycurrently does not resolve in DNS at all (verified via directcurl/dig), so master fails this test identically against the same single configured amoy endpoint.https://claude.ai/code/session_01928TnCS4kMQPd6uVTewNSN