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

Chore: sync router configs #313

Merged
merged 5 commits into from
Feb 28, 2024
Merged

Chore: sync router configs #313

merged 5 commits into from
Feb 28, 2024

Conversation

ChiTimesChi
Copy link
Collaborator

@ChiTimesChi ChiTimesChi commented Feb 14, 2024

Description

Fixes # (issue)

Checklist

  • New Contracts have been tested
  • Lint has been run
  • I have checked my code and corrected any misspellings

Summary by CodeRabbit

  • Refactor
    • Simplified the router configuration by removing unused pool filtering logic.
    • Streamlined the setup process by eliminating the SwapQuoter component and its associated setup steps.

Copy link

coderabbitai bot commented Feb 14, 2024

Walkthrough

The recent modifications streamline the router configuration and setup process by eliminating unnecessary components and simplifying data handling. Specifically, the changes involve removing filtering logic for pools, discarding the usage of SwapQuoter, and refining how tokens and pools are serialized. This simplification aims to enhance performance and maintainability of the codebase.

Changes

File Path Change Summary
.../SaveRouterConfig.s.sol - Removed _filterPools function and related logic.
- Updated pools assignment.
- Adjusted serialization of tokens and pools.
.../SetupRouter.s.sol - Removed SwapQuoter import and usage.
- Removed _setupQuoter function and related logic.

🐰✨
Changes in the code, oh so bright,
Simplifying both day and night.
No more filters, quoter's gone,
Streamlined paths we now are on.
Through the fields of code we hop,
With every line, improvements non-stop.
🌟🐾

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>.
    • Generate unit-tests for this file.
  • 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 tests 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 generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

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

Review Status

Actionable comments generated: 1

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 895270c and 60a9e35.
Files ignored due to path filters (21)
  • script/configs/arbitrum/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/aurora/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/avalanche/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/base/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/boba/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/bsc/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/canto/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/cronos/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/dfk/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/dogechain/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/fantom/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/harmony/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/klatyn/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/mainnet/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/metis/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/moonbeam/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/moonriver/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/optimism/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/polygon/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/configs/zkevm/SynapseRouter.dc.json is excluded by: !**/*.json
  • script/networks.json is excluded by: !**/*.json
Files selected for processing (2)
  • script/router/SaveRouterConfig.s.sol (2 hunks)
  • script/router/SetupRouter.s.sol (6 hunks)
Additional comments: 1
script/router/SaveRouterConfig.s.sol (1)
  • 45-45: The loop iterates over all tokens without filtering, which was previously done by _filterPools. Ensure that removing _filterPools does not introduce any unintended side effects, such as including tokens that should not be serialized or saved.

@@ -69,38 +66,11 @@ contract SaveRouterConfigScript is BridgeConfigV3Lens, SynapseScript {
tokensConfig = string("tokens").serialize(tokens[i].id, token);
}
fullConfig.serialize("ids", ids);
fullConfig.serialize("tokens", tokensConfig);
fullConfig = fullConfig.serialize("pools", pools);
fullConfig = fullConfig.serialize("tokens", tokensConfig);
Copy link

Choose a reason for hiding this comment

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

The serialization of tokens directly assigns tokensConfig without apparent aggregation or concatenation logic for multiple tokens. This could lead to only the last token's configuration being saved if multiple tokens exist. Verify the serialization logic to ensure it correctly handles multiple tokens.

- tokensConfig = string("tokens").serialize(tokens[i].id, token);
+ tokensConfig = tokensConfig.serialize(tokens[i].id, token);

Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
fullConfig = fullConfig.serialize("tokens", tokensConfig);
fullConfig = tokensConfig.serialize(tokens[i].id, token);

@coveralls
Copy link

Pull Request Test Coverage Report for Build 7903549874

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 13.01%

Totals Coverage Status
Change from base Build 7180732797: 0.0%
Covered Lines: 664
Relevant Lines: 4653

💛 - Coveralls

@ChiTimesChi ChiTimesChi merged commit fc6386d into master Feb 28, 2024
10 checks passed
@ChiTimesChi ChiTimesChi deleted the chore/sync-router-configs branch February 28, 2024 18:57
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