Skip to content

Conversation

@limitofzero
Copy link
Contributor

@limitofzero limitofzero commented Oct 6, 2025

Summary

Fixes issue with Sepolia and Moralis API (details)

Due to incorrect balances list for Sepolia I disabled this API for the network

Switch to Sepolia with enabled ff for Moralis

  • There is no request to balances api

Summary by CodeRabbit

  • Bug Fixes

    • Adjusted network compatibility: Sepolia is now treated as unsupported for backend-powered features. Users on Sepolia will no longer trigger actions that rely on backend services, reducing failed requests and confusion.
  • Chores

    • Updated the internal list of unsupported networks to reflect current environments and ensure consistent behavior across networks.

@vercel
Copy link

vercel bot commented Oct 6, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
cowfi Building Building Preview Oct 6, 2025 10:37am
explorer-dev Ready Ready Preview Oct 6, 2025 10:37am
swap-dev Building Building Preview Oct 6, 2025 10:37am
widget-configurator Ready Ready Preview Oct 6, 2025 10:37am
2 Skipped Deployments
Project Deployment Preview Updated (UTC)
cosmos Ignored Ignored Oct 6, 2025 10:37am
sdk-tools Ignored Ignored Preview Oct 6, 2025 10:37am

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 6, 2025

Walkthrough

Added SEPOLIA to the hard-coded UNSUPPORTED_BFF_NETWORKS in isBffSupportedNetwork.ts. The function behavior is unchanged except it now treats SEPOLIA as unsupported, alongside existing entries. No API/signature changes.

Changes

Cohort / File(s) Summary of Change
BFF network support
libs/balances-and-allowances/src/utils/isBffSupportedNetwork.ts
Added SupportedChainId.SEPOLIA to UNSUPPORTED_BFF_NETWORKS; isBffSupportedNetwork logic unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • cowdan
  • elena-zh

Poem

I hop through chains with careful sight,
Marking SEPOLIA as “not tonight.”
My whiskers twitch—support denied,
The BFF burrow won’t provide.
Onward I bound, with configs tight,
A tidy patch, quick as a byte! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The description provides a summary of the change but omits the required “# To Test” section with detailed test steps and expected outcomes and also lacks the optional “# Background” section as specified by the repository’s template. Please add a “# To Test” section with numbered steps and checkboxes along with expected results, include any relevant context under an optional “# Background” section, and if there is an associated GitHub issue reference it using “Fixes #issueNumber” to fully comply with the PR template.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed This title clearly and concisely summarizes the core change of disabling support for Sepolia in the BFF balances API by labeling it as deprecated.
✨ 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/deprecate-sepolia-for-bff

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.

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0b05e96 and b3b6c28.

📒 Files selected for processing (1)
  • libs/balances-and-allowances/src/utils/isBffSupportedNetwork.ts (1 hunks)
⏰ 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). (2)
  • GitHub Check: Cypress
  • GitHub Check: Setup

import { SupportedChainId } from '@cowprotocol/cow-sdk'

const UNSUPPORTED_BFF_NETWORKS = [SupportedChainId.LENS]
const UNSUPPORTED_BFF_NETWORKS = [SupportedChainId.LENS, SupportedChainId.SEPOLIA]
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

LGTM! Change correctly disables BFF for Sepolia.

The addition of SEPOLIA to the unsupported networks list aligns with the PR objective to prevent balances API requests for Sepolia due to Moralis API issues.

Please verify:

  1. That all call sites of isBffSupportedNetwork handle Sepolia being unsupported correctly
  2. That tests are updated to cover Sepolia as an unsupported network

Run the following script to check usage:


🏁 Script executed:

#!/bin/bash
# Description: Find all usages of isBffSupportedNetwork and verify they handle SEPOLIA correctly

# Find all files that import or call isBffSupportedNetwork
rg -n --type=ts --type=tsx -C 3 'isBffSupportedNetwork'

# Find test files that might need updates
fd -e test.ts -e spec.ts -e test.tsx -e spec.tsx -x rg -l 'isBffSupportedNetwork|SEPOLIA'

Length of output: 1116


🏁 Script executed:

#!/bin/bash
# 1. Find all call sites of isBffSupportedNetwork
rg -n -C3 'isBffSupportedNetwork'

# 2. Find all references to SEPOLIA in code & tests
rg -n 'SEPOLIA' -g '*.ts' -g '*.tsx' -g '*.test.ts' -g '*.test.tsx' -g '*.spec.ts' -g '*.spec.tsx'

Length of output: 28393


Add test coverage for Sepolia unsupported scenario in BFF logic
Cover SupportedChainId.SEPOLIA being excluded by isBffSupportedNetwork in:

  • libs/balances-and-allowances/src/hooks/usePersistBalancesFromBff.test.tsx
  • apps/cowswap-frontend/src/modules/balancesAndAllowances/updaters/CommonPriorityBalancesAndAllowancesUpdater.tsx

@elena-zh elena-zh self-requested a review October 6, 2025 09:28
@limitofzero limitofzero enabled auto-merge (squash) October 6, 2025 10:33
@limitofzero limitofzero merged commit bfefda8 into develop Oct 6, 2025
13 of 15 checks passed
@limitofzero limitofzero deleted the feat/deprecate-sepolia-for-bff branch October 6, 2025 10:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 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