Skip to content

Use Alchemy for Polygon Amoy RPC - #1302

Merged
ebma merged 3 commits into
stagingfrom
claude/pr-1301-security-review-fdc9e7
Aug 3, 2026
Merged

Use Alchemy for Polygon Amoy RPC#1302
ebma merged 3 commits into
stagingfrom
claude/pr-1301-security-review-fdc9e7

Conversation

@ebma

@ebma ebma commented Aug 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Route Polygon Amoy RPC calls through Alchemy when ALCHEMY_API_KEY is configured, replacing the rate-limited public OnFinality endpoint, with viem's default transport as the fallback — in both EvmClientManager and the signUnsignedTransactions helper.
  • This stops backend ephemeral freshness checks from hitting the OnFinality rate limit during 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 uses apiKey ? [Alchemy, ""] : [""], the same pattern as every other Alchemy-backed network. getEvmNetworks is exported for deterministic tests (same precedent as the redaction helpers).
  • signUnsigned.ts: the Polygon Amoy case in createEvmClient follows the identical apiKey ? [...] : [] pattern of its six sibling networks; the viem default transport was already appended unconditionally.
  • Tests assert the exact ordered RPC list with and without an API key (the regression coverage review flagged as missing on fix: use Alchemy for Polygon Amoy RPC #1301), plus redaction coverage for the new Amoy Alchemy URL. The cache-key test moved to Moonbeam since it referenced the removed OnFinality URL.

Test

  • bun test in packages/shared (89 pass)
  • bun lint, tsc --noEmit, bun build:shared

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.
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vrtx-dashboard canceled.

Name Link
🔨 Latest commit 9161b2c
🔍 Latest deploy log https://app.netlify.com/projects/vrtx-dashboard/deploys/6a706f3d46d7bf0008344150

@ebma
ebma requested a review from Copilot August 3, 2026 09:40
@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit 9161b2c
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6a706f3da0bb130007d0cc10
😎 Deploy Preview https://deploy-preview-1302--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Aug 3, 2026

Copy link
Copy Markdown

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit 9161b2c
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6a706f3d46d7bf000834414e
😎 Deploy Preview https://deploy-preview-1302--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@ebma
ebma merged commit 1364cfa into staging Aug 3, 2026
6 checks passed
@ebma
ebma deleted the claude/pr-1301-security-review-fdc9e7 branch August 3, 2026 10:48
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.

2 participants