Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chain Pauses Update #3468

Merged
merged 2 commits into from
Dec 18, 2024
Merged

Chain Pauses Update #3468

merged 2 commits into from
Dec 18, 2024

Conversation

Defi-Moses
Copy link
Collaborator

@Defi-Moses Defi-Moses commented Dec 18, 2024

This PR does two things:

  1. It pauses Boba on the frontend
  2. It adds a paused chains field into the sdk, allowing us to block certain routes through aggregators as well.
    • Added tests as well here.

Summary by CodeRabbit

  • New Features

    • Introduced a new constant for paused chain IDs, enhancing the filtering of supported chains.
    • Added a new configuration entry for the "boba-chain-pause" in the paused chains JSON.
    • Added a new constant for the BOBA mainnet USDC token address.
  • Bug Fixes

    • Updated logic to ensure paused chains are excluded from supported chain lists.
  • Tests

    • Added a test suite for paused chain scenarios, validating SDK behavior with paused chains.

b230a07: synapse-interface preview link
e15212f: synapse-interface preview link

Copy link
Contributor

coderabbitai bot commented Dec 18, 2024

Walkthrough

This pull request introduces changes to manage paused chain IDs, specifically focusing on the BOBA chain. The modifications span across multiple files in the Synapse SDK and interface. A new constant PAUSED_CHAIN_IDS is added to track paused chains, and existing chain ID constants are updated to filter out these paused chains. Corresponding test cases are implemented to verify the SDK's behavior when interacting with paused chains, ensuring that bridge quotes and other functionalities are appropriately restricted.

Changes

File Change Summary
packages/sdk-router/src/constants/chainIds.ts - Added PAUSED_CHAIN_IDS constant with BOBA chain
- Updated SUPPORTED_CHAIN_IDS, CCTP_SUPPORTED_CHAIN_IDS, and RFQ_SUPPORTED_CHAIN_IDS to filter out paused chains
packages/sdk-router/src/sdk.test.ts Added "Paused Chain Tests" to validate SDK behavior with paused chains
packages/synapse-interface/public/pauses/v1/paused-chains.json Added new configuration entry for BOBA chain pause
packages/sdk-router/src/constants/testValues.ts Added BOBA_USDC constant for USDC token address on BOBA mainnet

Possibly related PRs

Suggested reviewers

  • trajan0x
  • bigboydiamonds
  • abtestingalpha

Poem

🐰 A rabbit's tale of chains at rest,
BOBA paused, put to the test!
No bridges cross, no quotes shall fly,
When certain chains must say goodbye.
In code we trust, with careful might,
Synapse keeps the pathways tight! 🌉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cloudflare-workers-and-pages bot commented Dec 18, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 054f9c9
Status: ✅  Deploy successful!
Preview URL: https://2e52e9be.sanguine-fe.pages.dev
Branch Preview URL: https://fe-pause-boba-indefinitely.sanguine-fe.pages.dev

View logs

Copy link

cloudflare-workers-and-pages bot commented Dec 18, 2024

Deploying sanguine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 054f9c9
Status: ✅  Deploy successful!
Preview URL: https://63303d57.sanguine.pages.dev
Branch Preview URL: https://fe-pause-boba-indefinitely.sanguine.pages.dev

View logs

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: 0

🧹 Nitpick comments (1)
packages/sdk-router/src/constants/testValues.ts (1)

34-35: Add a comment about chain pause status

Since BOBA chain is being added to PAUSED_CHAIN_IDS, consider adding a comment to indicate this status to prevent confusion for developers who might try to use this constant.

 // Token addresses on BOBA mainnet
+// Note: BOBA chain is currently paused. These constants are used for testing pause functionality.
 export const BOBA_USDC = '0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc'
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 99c8f51 and 054f9c9.

📒 Files selected for processing (2)
  • packages/sdk-router/src/constants/testValues.ts (1 hunks)
  • packages/sdk-router/src/sdk.test.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/sdk-router/src/sdk.test.ts
🔇 Additional comments (1)
packages/sdk-router/src/constants/testValues.ts (1)

34-35: Verify BOBA USDC contract address

Let's verify this is the correct USDC contract address on BOBA mainnet.

✅ Verification successful

BOBA USDC address is consistent across codebase

The USDC contract address 0x66a2A913e447d6b4BF33EFbec43aAeF87890FBbc is consistently used across multiple packages in the codebase:

  • Used in bridgeable token configurations
  • Referenced in bridge mapping configurations
  • Used in SDK tests for BOBA chain pause functionality

The address is well-established in the project's token configuration and is being used appropriately in the test values file for verifying the chain pause feature.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify BOBA USDC contract address across the codebase and public sources

# Search for other occurrences of this address in the codebase
rg -i "66a2A913e447d6b4BF33EFbec43aAeF87890FBbc"

# Search for any documentation or config files mentioning BOBA USDC
fd -t f -e md -e json | xargs rg -i "boba.*usdc"

Length of output: 2458


Script:

#!/bin/bash
# Let's search for BOBA chain configuration to verify if this is documented as the official USDC address

# Search for BOBA chain configuration files
rg -A 5 -B 5 "BOBA.*chain" 

# Search for any token lists or configuration mentioning BOBA tokens
fd -t f -e json | xargs rg -i "boba.*token"

# Search for chain configuration files
fd -t f "chain" | xargs rg -i "boba.*usdc"

Length of output: 3073

Copy link

codecov bot commented Dec 18, 2024

Bundle Report

Changes will decrease total bundle size by 22.88MB (-70.15%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm 255.6kB 343 bytes (0.13%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs 117.7kB 153 bytes (0.13%) ⬆️
synapse-interface-server-cjs 1.67MB 258 bytes (0.02%) ⬆️
synapse-interface-client-array-push 7.42MB 256 bytes (0.0%) ⬆️
widget-esm-cjs 276.04kB 2.74kB (1.0%) ⬆️
explorer-ui-server-cjs (removed) 724.31kB (-100.0%) ⬇️
explorer-ui-edge-server-array-push (removed) 83 bytes (-100.0%) ⬇️
explorer-ui-client-array-push (removed) 2.17MB (-100.0%) ⬇️
widget-cjs-esm (removed) 271.27kB (-100.0%) ⬇️
docs-bridge-client-array-push (removed) 7.51MB (-100.0%) ⬇️
docs-bridge-server-cjs (removed) 11.86MB (-100.0%) ⬇️
synapse-constants-esm-cjs (removed) 174.63kB (-100.0%) ⬇️
synapse-constants-cjs-esm (removed) 174.18kB (-100.0%) ⬇️

@Defi-Moses Defi-Moses merged commit cf8cd3e into master Dec 18, 2024
36 of 38 checks passed
@Defi-Moses Defi-Moses deleted the fe/pause-boba-indefinitely branch December 18, 2024 23:24
@coderabbitai coderabbitai bot mentioned this pull request Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants