Use Alchemy for Polygon Amoy RPC - #1302
Merged
Merged
Conversation
The public OnFinality Amoy endpoint rate-limits backend ephemeral freshness checks during registerRamp. Prefer Alchemy when an API key is configured, matching every other Alchemy-backed network, and fall back to viem's default transport otherwise. Recreates the intent of #1301 on current staging without its stale-base regressions.
✅ Deploy Preview for vrtx-dashboard canceled.
|
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Routes Polygon Amoy RPC traffic through Alchemy with viem’s default transport as fallback.
Changes:
- Updates RPC selection in both EVM client paths.
- Adds configuration and URL-redaction tests.
- Exports network configuration for deterministic testing.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
packages/shared/src/services/evm/clientManager.ts |
Configures Alchemy and default Amoy transports. |
packages/shared/src/services/evm/clientManager.test.ts |
Tests RPC ordering and redaction. |
packages/shared/src/helpers/signUnsigned.ts |
Updates the signing helper’s Amoy transport. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| case Networks.PolygonAmoy: | ||
| chain = polygonAmoy; | ||
| rpcUrls = ["https://polygon-amoy.api.onfinality.io/public"]; | ||
| rpcUrls = apiKey ? [`https://polygon-amoy.g.alchemy.com/v2/${apiKey}`] : []; |
Review on the RPC change asked for coverage of the signing helper itself, not just getEvmNetworks. Assert the wallet client's actual fallback transport order for Polygon Amoy with and without an Alchemy key; createEvmClient is exported for the test, matching the existing testability exports.
…urity-review-fdc9e7 # Conflicts: # packages/shared/src/helpers/signUnsigned.test.ts
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.
Summary
ALCHEMY_API_KEYis configured, replacing the rate-limited public OnFinality endpoint, with viem's default transport as the fallback — in bothEvmClientManagerand thesignUnsignedTransactionshelper.registerRamp.Replaces #1301, recreated on current staging: that branch is based ~960 commits behind and would revert the recent "treat execution reverts as non-retryable" fix (5ca4d3e) and re-touch transaction grouping that staging has since changed. This PR contains only the RPC routing change.
Changes
clientManager.ts: Polygon Amoy now usesapiKey ? [Alchemy, ""] : [""], the same pattern as every other Alchemy-backed network.getEvmNetworksis exported for deterministic tests (same precedent as the redaction helpers).signUnsigned.ts: the Polygon Amoy case increateEvmClientfollows the identicalapiKey ? [...] : []pattern of its six sibling networks; the viem default transport was already appended unconditionally.Test
bun testinpackages/shared(89 pass)bun lint,tsc --noEmit,bun build:shared