Skip to content

feat(rpc): add remove-network-rpc script for RpcEndpoints (EXSC-1216) - #2560

Merged
gvladika merged 2 commits into
mainfrom
feature/exsc-1216-clean-up-dead-slow-and-misconfigured-rpc-endpoints-in
Oct 15, 2026
Merged

gvladika merged 2 commits into
mainfrom
feature/exsc-1216-clean-up-dead-slow-and-misconfigured-rpc-endpoints-in

Conversation

@gvladika

Copy link
Copy Markdown
Contributor

Which Linear task belongs to this PR?

Ref EXSC-1216

Why did I implement it this way?

Adds bun remove-network-rpc --network <name> --host <host> [--environment <env>] [--apply], the counterpart to add-network-rpc. The endpoint is named by host (as audit-rpc-priorities prints it) so a keyed URL never has to be pasted into a terminal. It is a dry run unless --apply is passed, it refuses a host that matches more than one stored endpoint on the chain, and it refuses to remove a chain's last endpoint for the environment. A production removal also matches records that predate the environment field, and never touches the same URL stored under another environment. The matching lives in findEndpointsByHost in rpcEndpoints.ts with unit tests; it never matches an unparsable stored URL by its placeholder host. The script was used to remove 31 dead or misconfigured RpcEndpoints entries (dead Pokt gateways, DNS-dead and 401/403 hosts, and a Chiado testnet endpoint in the gnosis mainnet list); the probe of the regenerated .env went from 39 endpoints failing both rounds to 5. EXSC-1216 stays open for the follow-ups.

Checklist before requesting a review

Checklist for reviewer (DO NOT DEPLOY and contracts BEFORE CHECKING THIS!!!)

  • I have checked that any arbitrary calls to external contracts are validated and or restricted
  • I have checked that any privileged calls (i.e. storage modifications) are validated and or restricted
  • I have ensured that any new contracts have had AT A MINIMUM 1 preliminary audit conducted on by <company/auditor>

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gvladika
gvladika requested a review from a team October 15, 2026 12:39
@lifi-action-bot
lifi-action-bot marked this pull request as draft October 15, 2026 12:39
@github-actions github-actions Bot added the requires-types Trigger Types Bindings CI (ABI/type generation for lifi-contract-types) label Oct 15, 2026
@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

We couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4242bb1-b213-4436-b744-445d8d31a634
📥 Commits

Reviewing files that changed from the base of the PR and between 8fd90ff and 9d96ad1.

📒 Files selected for processing: 1
  • script/mongoDb/remove-network-rpc.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

Walkthrough

Adds host-based RPC endpoint lookup and a remove-network-rpc command. The command defaults to production and dry-run mode. With --apply, it removes a uniquely matching endpoint from MongoDB.

Changes

Network RPC endpoint removal

Layer / File(s) Summary
Host and environment endpoint lookup
script/mongoDb/rpcEndpoints.ts, script/mongoDb/rpcEndpoints.test.ts
Adds findEndpointsByHost to match normalized hosts within an environment. Missing endpoint environments count as production; invalid URLs do not match. Tests cover host normalization, ports, environment filtering, and multiple matches.
Endpoint removal CLI
script/mongoDb/remove-network-rpc.ts, package.json
Adds a CLI that requires a network and host, validates that one matching endpoint exists and that its removal leaves endpoints in the environment, and reports the result. The command defaults to dry-run mode; --apply updates MongoDB and requires exactly one modified document.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to 9d96a

The removal command preserves legacy endpoint fallbacks and limits updates to the selected environment. No concrete merge-blocking risk remains.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly identifies the primary change: adding the remove-network-rpc script for RpcEndpoints.
Description check Passed The description includes the Linear task, implementation rationale, scope, testing details, and all template checklist sections. The documentation and reviewer checklist items remain unchecked, but th…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Comment thread script/mongoDb/remove-network-rpc.ts
Comment thread script/mongoDb/remove-network-rpc.ts
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@gvladika
gvladika marked this pull request as ready for review October 15, 2026 13:10
@gvladika
gvladika enabled auto-merge (squash) October 15, 2026 13:17
@gvladika
gvladika merged commit cb81aab into main Oct 15, 2026
80 checks passed
@gvladika
gvladika deleted the feature/exsc-1216-clean-up-dead-slow-and-misconfigured-rpc-endpoints-in branch October 15, 2026 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AuditNotRequired requires-types Trigger Types Bindings CI (ABI/type generation for lifi-contract-types)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants