Skip to content

Conversation

@kernelwhisperer
Copy link
Contributor

@kernelwhisperer kernelwhisperer commented Dec 2, 2025

Summary

This change removes all references to raw.githubusercontent.com and replaces them with files.cow.fi/cow-sdk

Blocked by #723

Testing

Background

This PR is part of https://linear.app/cowswap/issue/COW-136/token-lists-cdn

Moving away from our reliance on github CDN.
This is no longer viable as Github recently changed their rate limiting policy for non-logged in users.

Related PRs:
cowprotocol/cowswap#6591
#723

Summary by CodeRabbit

  • Chores
    • Switched token/logo hosting to the new CDN so token images load from the updated location.
    • Updated configuration paths to reference the new CDN-hosted asset locations and flattened provider paths.
    • Updated mock provider logos to use the new WebP assets.
    • Removed a deprecated raw-hosting configuration constant.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 2, 2025

Walkthrough

Token/logo asset URLs were migrated from GitHub raw URLs to files.cow.fi; one exported constant (RAW_FILES_PATH) was removed and several path constants were updated. Several mock provider logo extensions changed from .png to .webp. No control-flow or API signature changes.

Changes

Cohort / File(s) Summary
React example SwapForms
examples/react/ethers5/src/components/SwapForm/index.tsx, examples/react/ethers6/src/components/SwapForm/index.tsx, examples/react/viem/src/components/SwapForm/index.tsx
Updated USDC_SEPOLIA token logoUrl from raw.githubusercontent.com to files.cow.fi
Config constants (removed/updated)
packages/config/src/constants/path.ts, packages/config/src/constants/paths.ts
Removed exported RAW_FILES_PATH from path.ts; in paths.ts repointed RAW_FILES_PATH to https://files.cow.fi/... and simplified RAW_CHAINS_FILES_PATH to use the new base path
Token images path
packages/config/src/constants/tokens.ts
Repointed TOKEN_LIST_IMAGES_PATH from GitHub raw URL to https://files.cow.fi/token-lists/images
Bridging providers path
packages/bridging/src/const.ts
Adjusted RAW_PROVIDERS_FILES_PATH to remove extra src/ segment (flatter path under the new base)
Mock bridge providers (logos)
packages/bridging/src/providers/mock/BaseMockBridgeProvider.ts, packages/bridging/src/providers/mock/HookMockBridgeProvider.ts, packages/bridging/src/providers/mock/ReceiverAccountMockBridgeProvider.ts
Updated info.logoUrl paths to use the new base and switched mock logo asset extension from .png to .webp

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Areas needing attention:
    • Search the repo for any remaining references to the removed RAW_FILES_PATH symbol (from path.ts) and update/validate usages.
    • Verify composed paths (e.g., RAW_CHAINS_FILES_PATH, RAW_PROVIDERS_FILES_PATH) resolve correctly against files.cow.fi layout.
    • Confirm changed image URLs and .webp logos load correctly in examples and mock providers.

Possibly related PRs

Suggested reviewers

  • shoom3301
  • limitofzero

Poem

🐇 I hopped through code with nimble feet,

Swapped old links for URLs neat.
Cow.fi now holds the shiny art,
New logos gleam — a tiny part.
A bunny cheers with joyful heart! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'feat: use aws for token and chain images' is partially related to the changeset. It mentions AWS and images, but the actual changes show migration to files.cow.fi (not AWS directly), and the PR description clarifies this is about moving from GitHub CDN to files.cow.fi. The title is somewhat misleading about the destination service. Consider clarifying the title to 'feat: migrate token and chain images to files.cow.fi' or 'feat: move token and chain images from GitHub to Cow.fi CDN' for better accuracy about the actual change destination.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/move-from-gh-cdn-to-aws

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 795374f and 69fb0b3.

📒 Files selected for processing (4)
  • packages/bridging/src/const.ts (1 hunks)
  • packages/bridging/src/providers/mock/BaseMockBridgeProvider.ts (1 hunks)
  • packages/bridging/src/providers/mock/HookMockBridgeProvider.ts (1 hunks)
  • packages/bridging/src/providers/mock/ReceiverAccountMockBridgeProvider.ts (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-06T11:26:21.337Z
Learnt from: shoom3301
Repo: cowprotocol/cow-sdk PR: 642
File: packages/bridging/src/BridgingSdk/BridgingSdk.ts:124-144
Timestamp: 2025-11-06T11:26:21.337Z
Learning: In the cow-sdk bridging module (packages/bridging/), all bridge providers return ChainInfo objects that are singleton instances imported from cowprotocol/sdk-config. The chain objects (mainnet, arbitrumOne, base, optimism, polygon, avalanche, gnosisChain, etc.) are exported as constants from packages/config/src/chains/details/ and are shared across all providers. This singleton pattern makes object reference comparison (e.g., with Array.includes()) safe for deduplicating networks returned by multiple providers, as the same chain will always be represented by the same object reference.
<!--

Applied to files:

  • packages/bridging/src/const.ts
🧬 Code graph analysis (4)
packages/bridging/src/providers/mock/HookMockBridgeProvider.ts (1)
packages/bridging/src/const.ts (1)
  • RAW_PROVIDERS_FILES_PATH (3-3)
packages/bridging/src/providers/mock/ReceiverAccountMockBridgeProvider.ts (1)
packages/bridging/src/const.ts (1)
  • RAW_PROVIDERS_FILES_PATH (3-3)
packages/bridging/src/providers/mock/BaseMockBridgeProvider.ts (1)
packages/bridging/src/const.ts (1)
  • RAW_PROVIDERS_FILES_PATH (3-3)
packages/bridging/src/const.ts (1)
packages/config/src/constants/paths.ts (1)
  • RAW_FILES_PATH (2-2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: test
  • GitHub Check: eslint
  • GitHub Check: Publish to GitHub Packages
🔇 Additional comments (4)
packages/bridging/src/const.ts (1)

3-3: RAW_PROVIDERS_FILES_PATH composition matches new CDN layout

Using ${RAW_FILES_PATH}/bridging/providers correctly targets the flattened bridging/providers tree under the new files.cow.fi/cow-sdk base and stays consistent with the hook prefix below. No further changes needed here.

packages/bridging/src/providers/mock/ReceiverAccountMockBridgeProvider.ts (1)

24-24: MockReceiverAccountBridgeProvider logo URL update looks correct

Switching to ${RAW_PROVIDERS_FILES_PATH}/mock/mock-logo.webp is consistent with the shared providers path and with the other mock bridge providers’ logo URLs in this PR. No issues from the SDK side as long as the WEBP asset exists at that location.

packages/bridging/src/providers/mock/HookMockBridgeProvider.ts (1)

17-17: Hook mock provider logo URL aligned with shared mock asset

The WEBP logo at ${RAW_PROVIDERS_FILES_PATH}/mock/mock-logo.webp keeps this mock in sync with the base and receiver mocks and with the new providers asset root. Change is straightforward and safe.

packages/bridging/src/providers/mock/BaseMockBridgeProvider.ts (1)

32-32: Base mock provider logo path updated consistently

Pointing the base provider’s info.logoUrl to ${RAW_PROVIDERS_FILES_PATH}/mock/mock-logo.webp ensures any subclasses that reuse the base info pick up the new CDN + format automatically. This is consistent with the other mock providers’ updates.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions
Copy link
Contributor

github-actions bot commented Dec 2, 2025

📦 GitHub Packages Published

Last updated: Dec 3, 2025, 01:07:51 PM UTC

The following packages have been published to GitHub Packages with pre-release version pr-724-a028169d:


Installation

These packages require authentication to install from GitHub Packages. First, create a .npmrc file:

# Create .npmrc file in your project root
echo "@cowprotocol:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrc

To get your GitHub token:

  1. Go to https://github.com/settings/tokens
  2. Click "Generate new token (classic)"
  3. Check only the "read:packages" scope
  4. Copy the token and replace YOUR_GITHUB_TOKEN in the .npmrc file

Then install any of the packages above, either by exact version (i.e. @cowprotocol/[email protected]) or more conveniently by using the tag (@cowprotocol/cow-sdk@pr-724):

# Yarn
yarn add npm:@cowprotocol/cow-sdk@pr-724

# pnpm
pnpm install npm:@cowprotocol/cow-sdk@pr-724

# NPM
npm install npm:@cowprotocol/cow-sdk@pr-724

Update to the latest version (only if you used the tag)

Every commit will publish a new package. To upgrade to the latest version, run:

# Yarn
yarn upgrade @cowprotocol/cow-sdk

# pnpm
pnpm update @cowprotocol/cow-sdk

# NPM
npm update @cowprotocol/cow-sdk

View Packages

You can view the published packages at: https://github.com/cowprotocol/cow-sdk/packages

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (3)
examples/react/viem/src/components/SwapForm/index.tsx (1)

18-25: USDC_SEPOLIA logo URL migration looks consistent with new token-list host

The new logoUrl points to the files.cow.fi/token-lists/images/... path, which matches the pattern used in TOKEN_LIST_IMAGES_PATH-derived URLs elsewhere. As an optional cleanup, you could centralize the base URL (if exported from @cowprotocol/cow-sdk) to avoid future drift between examples and config constants.

examples/react/ethers5/src/components/SwapForm/index.tsx (1)

17-25: Aligns with shared token-list image base; consider avoiding hard‑coded base

This logoUrl now matches the files.cow.fi/token-lists/images/... pattern used in config, which is good for consistency. Optionally, if TOKEN_LIST_IMAGES_PATH (or similar) is available from @cowprotocol/cow-sdk, you could build this URL from that constant to reduce duplication across the different SwapForm examples.

examples/react/ethers6/src/components/SwapForm/index.tsx (1)

17-25: Consistent USDC_SEPOLIA logo URL across all SwapForm variants

This logoUrl now matches the files.cow.fi/token-lists/images/... pattern and is consistent with the viem and ethers5 examples. Optionally, to avoid three hard‑coded copies of the same base URL, you could derive this from a shared constant (if exported) to keep examples in sync with config.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8cb9ec and 1155b90.

📒 Files selected for processing (6)
  • examples/react/ethers5/src/components/SwapForm/index.tsx (1 hunks)
  • examples/react/ethers6/src/components/SwapForm/index.tsx (1 hunks)
  • examples/react/viem/src/components/SwapForm/index.tsx (1 hunks)
  • packages/config/src/constants/path.ts (0 hunks)
  • packages/config/src/constants/paths.ts (1 hunks)
  • packages/config/src/constants/tokens.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/config/src/constants/path.ts
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-08-12T09:15:28.459Z
Learnt from: alfetopito
Repo: cowprotocol/cow-sdk PR: 391
File: src/trading/getEthFlowTransaction.ts:80-85
Timestamp: 2025-08-12T09:15:28.459Z
Learning: In the CoW SDK codebase, ETH_FLOW_ADDRESSES and BARN_ETH_FLOW_ADDRESSES are typed as Record<SupportedChainId, string>, which requires all SupportedChainId enum values to have corresponding string entries. TypeScript compilation will fail if any chainId is missing from these mappings, making runtime guards for missing addresses unnecessary in these specific cases.

Applied to files:

  • packages/config/src/constants/tokens.ts
📚 Learning: 2025-11-06T11:26:21.337Z
Learnt from: shoom3301
Repo: cowprotocol/cow-sdk PR: 642
File: packages/bridging/src/BridgingSdk/BridgingSdk.ts:124-144
Timestamp: 2025-11-06T11:26:21.337Z
Learning: In the cow-sdk bridging module (packages/bridging/), all bridge providers return ChainInfo objects that are singleton instances imported from cowprotocol/sdk-config. The chain objects (mainnet, arbitrumOne, base, optimism, polygon, avalanche, gnosisChain, etc.) are exported as constants from packages/config/src/chains/details/ and are shared across all providers. This singleton pattern makes object reference comparison (e.g., with Array.includes()) safe for deduplicating networks returned by multiple providers, as the same chain will always be represented by the same object reference.
<!--

Applied to files:

  • packages/config/src/constants/paths.ts
🔇 Additional comments (1)
packages/config/src/constants/tokens.ts (1)

4-6: TOKEN_LIST_IMAGES_PATH host switch is consistent; bucket layout verified

Switching TOKEN_LIST_IMAGES_PATH to https://files.cow.fi/token-lists/images keeps the same ${chainId}/${address.toLowerCase()}/logo.png pattern. The new bucket structure is verified—WETH, USDC, and native currency logos all resolve correctly on mainnet.

@kernelwhisperer kernelwhisperer self-assigned this Dec 2, 2025
@kernelwhisperer kernelwhisperer requested a review from a team December 2, 2025 09:00
Copy link
Contributor

@shoom3301 shoom3301 left a comment

Choose a reason for hiding this comment

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

Checked the new URLs, everyting is valid

@kernelwhisperer kernelwhisperer merged commit 2a8e220 into main Dec 3, 2025
9 checks passed
@kernelwhisperer kernelwhisperer deleted the feat/move-from-gh-cdn-to-aws branch December 3, 2025 13:12
@github-actions github-actions bot locked and limited conversation to collaborators Dec 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants