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

Update sidecar to connect v2 #2458

Merged
merged 1 commit into from
Oct 3, 2024
Merged

Conversation

chenyaoy
Copy link
Contributor

@chenyaoy chenyaoy commented Oct 3, 2024

Changelist

With the protocol update to use the connect v2 package, we also need to update the sidecar because endpoints have changed.

Test Plan

[Describe how this PR was tested (if applicable)]

Author/Reviewer Checklist

  • If this PR has changes that result in a different app state given the same prior state and transaction list, manually add the state-breaking label.
  • If the PR has breaking postgres changes to the indexer add the indexer-postgres-breaking label.
  • If this PR isn't state-breaking but has changes that modify behavior in PrepareProposal or ProcessProposal, manually add the label proposal-breaking.
  • If this PR is one of many that implement a specific feature, manually label them all feature:[feature-name].
  • If you wish to for mergify-bot to automatically create a PR to backport your change to a release branch, manually add the label backport/[branch-name].
  • Manually add any of the following labels: refactor, chore, bug.

Summary by CodeRabbit

  • New Features

    • Introduced a new service connect0 to replace slinky0 in the multi-service setup.
    • Updated the configuration for local testing to reflect the new connect service.
  • Bug Fixes

    • Adjusted Prometheus scraping target to ensure accurate metric collection.
  • Chores

    • Updated environment variable prefixes and volume paths to align with the new service structure.

@chenyaoy chenyaoy requested a review from a team as a code owner October 3, 2024 20:13
Copy link
Contributor

coderabbitai bot commented Oct 3, 2024

Walkthrough

The changes involve modifications to several configuration files to transition from a service named "slinky" to a new service called "connect." The prometheus.yml file updates the scrape target for metrics, while the docker-compose.yml file adds the connect0 service, replacing slinky0 and adjusting related configurations. Additionally, the local.sh script reflects this transition by renaming functions and updating oracle addresses. Overall, these changes signify a shift in the underlying service architecture.

Changes

File Path Change Summary
protocol/contrib/prometheus/prometheus.yml Updated scrape target from slinky0:8002 to connect0:8002 in scrape_configs.
protocol/docker-compose.yml Added connect0 service, removed slinky0, updated image and entrypoint, changed environment variable prefix, and adjusted volume path.
protocol/testing/testnet-local/local.sh Renamed function from use_slinky to use_connect, updated oracle address, and modified create_validators function.

Possibly related PRs

  • update sidecar in localnet to support polymarket #2043: The changes in docker-compose.yml regarding the slinky0 service are related to the main PR's update of the Prometheus configuration, as both involve transitioning from the slinky service to the connect service, indicating a broader shift in service architecture.

Suggested labels

protocol

Suggested reviewers

  • vincentwschau

Poem

🐇 In the meadow where bunnies hop,
A new friend named Connect takes the top.
Slinky has gone, but don't you fret,
With changes so bright, we won't forget!
Metrics and services dance in delight,
As we leap into the future, oh what a sight! 🌼


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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • 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/schema.v2.json

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

🧹 Outside diff range and nitpick comments (2)
protocol/docker-compose.yml (1)

Line range hint 1-129: Summary of changes to docker-compose.yml

This update primarily focuses on transitioning from the slinky sidecar to the connect sidecar:

  1. The slinky0 service has been replaced with connect0, using a new Docker image and updated configuration.
  2. Environment variables and volume paths have been adjusted to reflect this change.
  3. The dydxprotocold0 service now has a different log level (info) compared to other validators (error), which is clearly commented.

These changes appear to be part of a planned upgrade to the sidecar component. While the changes seem consistent, it's important to ensure that:

  1. All necessary configuration files are in place for the new connect sidecar.
  2. Any breaking changes or migration steps are documented and addressed.
  3. The impact of these changes on the overall system is understood and tested.

Consider updating the project documentation to reflect these changes, including any necessary steps for developers to update their local environments or for operators to migrate existing deployments.

protocol/testing/testnet-local/local.sh (1)

170-175: LGTM: Function updated to use new connect address.

The use_connect function has been successfully implemented, replacing the previous use_slinky function. The oracle address has been updated to 'connect0:8080', which is in line with the PR objective of updating the sidecar to connect v2.

Consider using the CONFIG_FOLDER variable consistently throughout the function. On line 174, $VAL_CONFIG_DIR is used instead of $CONFIG_FOLDER. While this doesn't affect functionality, using consistent variable names improves readability.

-	dasel put -t string -f "$VAL_CONFIG_DIR"/app.toml 'oracle.oracle_address' -v 'connect0:8080'
+	dasel put -t string -f "$CONFIG_FOLDER"/app.toml 'oracle.oracle_address' -v 'connect0:8080'
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 52d48f8 and 3868969.

📒 Files selected for processing (3)
  • protocol/contrib/prometheus/prometheus.yml (1 hunks)
  • protocol/docker-compose.yml (1 hunks)
  • protocol/testing/testnet-local/local.sh (2 hunks)
🔇 Additional comments (5)
protocol/contrib/prometheus/prometheus.yml (1)

7-7: LGTM. Verify related configurations and update documentation.

The change from "slinky0:8002" to "connect0:8002" aligns with the PR objective of updating the sidecar to connect v2. This modification appears to be part of a broader update in the system architecture or naming convention.

To ensure consistency across the project, please:

  1. Verify if similar changes are needed in other configuration files or services.
  2. Update relevant documentation to reflect this architectural shift from "slinky" to "connect".
  3. Confirm that the new endpoint (connect0:8002) is functional and accessible in the docker-compose environment.

Run the following script to check for other occurrences of "slinky" that might need updating:

Could you please provide information on how this change has been tested to ensure the new endpoint is working correctly?

protocol/docker-compose.yml (2)

Line range hint 10-12: LGTM: Log level change for dydxprotocold0

The change to set the log level to "info" for dydxprotocold0 is well-documented with the added comment. This differentiation from other validators using the "error" log level is clear and intentional.


118-129: Major update: Transition from slinky to connect sidecar

The replacement of the slinky0 service with connect0 represents a significant change:

  1. The image has been updated to ghcr.io/skip-mev/connect-sidecar:v2.1.0.
  2. The entrypoint now uses the connect command instead of slinky.
  3. Environment variable prefixes have changed from SLINKY_CONFIG_PROVIDERS_ to CONNECT_CONFIG_PROVIDERS_.
  4. The volume path has been updated from ./contrib/slinky to ./contrib/connect.

These changes appear consistent with the transition from slinky to connect. However, to ensure a smooth transition:

  1. Has the ./contrib/connect directory been properly set up with the necessary configuration files, especially the oracle.json file referenced in the entrypoint command?
  2. Are there any breaking changes or migration steps required when moving from slinky to connect that should be documented?
  3. Have the new command-line parameters in the entrypoint (e.g., --marketmap-provider dydx_migration_api) been verified for correctness?

To confirm the setup, please run the following commands:

protocol/testing/testnet-local/local.sh (2)

110-111: LGTM: Function call updated to reflect new naming.

The change from use_slinky to use_connect is consistent with the PR objective of updating the sidecar to connect v2. This update appears to be intentional and aligns with the changes described in the AI-generated summary.


Line range hint 1-200: Summary of changes and recommendations

The changes in this file are consistent with the PR objective of updating the sidecar to connect v2. Key modifications include:

  1. Renaming use_slinky to use_connect and updating the oracle address.
  2. Removing TEST_ACCOUNTS from the edit_genesis function call.

Recommendations:

  1. Ensure consistent use of the CONFIG_FOLDER variable in the use_connect function.
  2. Provide clarification on the impact of removing TEST_ACCOUNTS from the genesis setup process.

Overall, the changes appear to be well-implemented, but addressing the above points will improve code consistency and provide better context for the modifications made.

@@ -107,7 +107,7 @@ create_validators() {
cat <<<"$new_file" >"$VAL_CONFIG_DIR"/node_key.json

edit_config "$VAL_CONFIG_DIR"
use_slinky "$VAL_CONFIG_DIR"
use_connect "$VAL_CONFIG_DIR"

# Using "*" as a subscript results in a single arg: "dydx1... dydx1... dydx1..."
# Using "@" as a subscript results in separate args: "dydx1..." "dydx1..." "dydx1..."
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

TEST_ACCOUNTS are still referenced in multiple scripts.

Removing "${TEST_ACCOUNTS[*]}" from the edit_genesis function in local.sh may affect other environments that rely on TEST_ACCOUNTS. Please ensure that this change is consistently applied across all relevant scripts or provide clarification on how TEST_ACCOUNTS is being managed moving forward.

🔗 Analysis chain

Verify impact of removing TEST_ACCOUNTS from genesis setup.

The removal of "${TEST_ACCOUNTS[*]}" from the edit_genesis function call aligns with the changes described in the AI-generated summary. This modification appears to be part of simplifying the genesis setup process.

Could you please clarify the impact of removing the TEST_ACCOUNTS from the genesis setup? Are these accounts now being initialized through a different process, or are they no longer needed in the new setup?

To verify the changes in account initialization, please run the following script:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any references to TEST_ACCOUNTS in the genesis setup process

# Search for TEST_ACCOUNTS usage in the file
echo "Occurrences of TEST_ACCOUNTS in local.sh:"
grep -n "TEST_ACCOUNTS" protocol/testing/testnet-local/local.sh

# Check if TEST_ACCOUNTS are used in other parts of the codebase
echo "Occurrences of TEST_ACCOUNTS in other files:"
rg "TEST_ACCOUNTS" --type sh

Length of output: 2297

@chenyaoy chenyaoy merged commit 64fa696 into main Oct 3, 2024
22 checks passed
@chenyaoy chenyaoy deleted the chenyao/upgrade-sidecar-to-connect-v2 branch October 3, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

2 participants