Skip to content

fix: use Alchemy for Polygon Amoy RPC - #1301

Closed
naka-bot wants to merge 5 commits into
pendulum-chain:stagingfrom
naka-bot:naka/use-alchemy-polygon-amoy
Closed

fix: use Alchemy for Polygon Amoy RPC#1301
naka-bot wants to merge 5 commits into
pendulum-chain:stagingfrom
naka-bot:naka/use-alchemy-polygon-amoy

Conversation

@naka-bot

Copy link
Copy Markdown
Collaborator

Summary

  • route Polygon Amoy RPC calls through Alchemy when ALCHEMY_API_KEY is configured
  • keep viem default RPC as the fallback instead of public OnFinality
  • apply the same Amoy RPC behavior in the SDK signing helper

Test

  • bun test src/services/evm/clientManager.test.ts
  • bun run verify packages/shared/src/services/evm/clientManager.ts packages/shared/src/helpers/signUnsigned.ts packages/shared/src/services/evm/clientManager.test.ts
  • curl eth_chainId against the Alchemy Polygon Amoy endpoint returned 0x13882

Note: this is meant to stop backend ephemeral freshness checks from hitting the public OnFinality rate limit during registerRamp.

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

👷 Deploy request for vortex-sandbox pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c469709

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

‼️ Deploy request for vortexfi rejected.

Name Link
🔨 Latest commit 54d9c5e

@netlify

netlify Bot commented Jul 31, 2026

Copy link
Copy Markdown

👷 Deploy request for vrtx-dashboard pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit c469709

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 while retaining viem’s default transport as fallback.

Changes:

  • Configure Alchemy as the preferred Polygon Amoy RPC.
  • Apply equivalent behavior to transaction signing.
  • Update RPC redaction and fallback tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
clientManager.ts Updates Polygon Amoy RPC ordering.
clientManager.test.ts Updates redaction and fallback tests.
signUnsigned.ts Uses Alchemy for Amoy signing clients.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/shared/src/services/evm/clientManager.test.ts Outdated

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Suppressed comments (1)

packages/shared/src/helpers/signUnsigned.ts:98

  • The regression tests only inspect getEvmNetworks; none exercises the changed Polygon Amoy branch in signUnsignedTransactions. Add a focused signing-helper test that verifies Alchemy is preferred when a key is supplied and viem's default transport remains the no-key fallback, so the SDK behavior claimed by this fix cannot regress independently of the client manager.
      rpcUrls = apiKey ? [`https://polygon-amoy.g.alchemy.com/v2/${apiKey}`] : [];

const NON_RETRYABLE_READ_CONTRACT_REVERTS = ["EXCEEDS_MAX_COVERAGE_RATIO"];
// Any on-chain revert is deterministic for a given block state: retrying against a different RPC
// node will not change the outcome, so retrying just wastes calls and delays failure reporting.
const NON_RETRYABLE_READ_CONTRACT_ERROR_PATTERNS = [/execution reverted/i];
Comment on lines +215 to +218
tx.network === Networks.Arbitrum ||
tx.network === Networks.Avalanche ||
tx.network === Networks.BSC ||
tx.network === Networks.Ethereum
@ebma ebma closed this Aug 3, 2026
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