Skip to content

refactor: Better RPC handling#1373

Merged
jiexi merged 7 commits into
mainfrom
ts/proper-rpc-handling
Oct 16, 2025
Merged

refactor: Better RPC handling#1373
jiexi merged 7 commits into
mainfrom
ts/proper-rpc-handling

Conversation

@chakra-guy

@chakra-guy chakra-guy commented Oct 15, 2025

Copy link
Copy Markdown
Collaborator

Explanation

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate

Note

Refactors RPC handling to a strategy-based router that defaults to wallet passthrough, removes direct Infura/readonly fetch logic, adds a routing strategy module, and updates/adjusts tests (including skipping a readonly RPC test).

  • Core RPC Refactor:
    • Introduce RequestHandlingStrategy with WALLET, RPC, and SDK routes via multichain/rpc/strategy.ts.
    • Rework RPCClient.invokeMethod to route by strategy; implement wallet passthrough and stub handlers for RPC/SDK.
    • Remove direct readonly RPC fetching, Infura URL/header handling, and related code paths.
    • Reduce deeplink open delay from 250ms to 10ms in wallet handling.
  • Tests:
    • Rewrite multichain/rpc/client.test.ts to validate wallet routing and error handling; drop tests for fetch/headers/readonly RPC behavior.
    • In invoke.test.ts, skip the readonly RPC client test pending RPC node routing and keep other invoke error/success paths.
  • Misc:
    • Internal imports adjusted to new module locations (e.g., config/logger).

Written by Cursor Bugbot for commit 19a136d. This will update automatically on new commits. Configure here.

@chakra-guy chakra-guy requested a review from a team as a code owner October 15, 2025 11:51
@codecov

codecov Bot commented Oct 15, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.99%. Comparing base (7fb2175) to head (19a136d).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1373   +/-   ##
=======================================
  Coverage   74.99%   74.99%           
=======================================
  Files         184      184           
  Lines        4519     4519           
  Branches     1108     1108           
=======================================
  Hits         3389     3389           
  Misses       1130     1130           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/client.ts
cursor[bot]

This comment was marked as outdated.

Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts Outdated
Comment thread packages/sdk-multichain/src/multichain/rpc/strategy.ts
@jiexi jiexi merged commit aa521c8 into main Oct 16, 2025
10 checks passed
@jiexi jiexi deleted the ts/proper-rpc-handling branch October 16, 2025 19:45
@sonarqubecloud

Copy link
Copy Markdown

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.

3 participants