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

Remove onchain aggregator related codes from /core and /cli #1808

Merged
merged 6 commits into from
Jul 17, 2024

Conversation

nick-bisonai
Copy link
Collaborator

Description

Removes onchain aggregator related codes

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.

Deployment

  • Should publish npm package
  • Should publish Docker image

@nick-bisonai nick-bisonai self-assigned this Jul 15, 2024
@nick-bisonai nick-bisonai requested a review from a team as a code owner July 15, 2024 03:54
Copy link
Contributor

coderabbitai bot commented Jul 15, 2024

Important

Review skipped

Review was skipped due to path filters

Files ignored due to path filters (1)
  • cli/package.json is excluded by !**/*.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Walkthrough

The changes streamline the project's code by removing outdated or unnecessary modules related to data-feed and refocusing on L2 specific services. Key adjustments include updating service URLs in settings.ts, removing old data-feed functionalities, and consolidating health check logic. The primary goal is to enhance maintainability and adapt the system to the new environment requirements.

Changes

File(s) Change Summary
cli/src/index.ts, core/src/listener/main.ts, ... Removed references to adapter, aggregator, fetcher, and data-feed components.
cli/src/settings.ts Updated service URLs and ports for production environment. Removed some redundant declarations.
cli/src/utils.ts Consolidated isOraklFetcherHealthy function into isOraklNetworkApiHealthy function.
core/src/errors.ts Removed InvalidDataFeed and InvalidDataFeedFormat from OraklErrorCode enum.
core/src/listener/types.ts, core/src/types.ts Removed IDataFeedListenerWorker interface and added IDataFeedListenerWorkerL2 interface.
core/src/worker/api.ts Removed functions related to fetching aggregate data by ID and aggregator address.
core/src/worker/main.ts Eliminated dataFeedWorker import and entry from WORKERS object.

Poem

In the code where data danced,
Changes came, a new chance!
URLs shifted, cleaned the slate,
The future now, we anticipate.
L2 services, clear and bright,
CodeRabbit hops, feeling light!
🐇✨


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 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0eaf4de and e052344.

Files ignored due to path filters (1)
  • core/package.json is excluded by !**/*.json
Files selected for processing (3)
  • cli/src/index.ts (3 hunks)
  • cli/src/settings.ts (1 hunks)
  • cli/src/utils.ts (1 hunks)
Files skipped from review due to trivial changes (2)
  • cli/src/index.ts
  • cli/src/utils.ts
Additional comments not posted (6)
cli/src/settings.ts (6)

5-5: LGTM!

The default API URL is correctly set based on the NODE_ENV environment variable.


11-11: LGTM!

The default delegator URL is correctly set based on the NODE_ENV environment variable.


11-11: LGTM!

The default listener host has been correctly updated to reflect the new service name vrf-listener.


16-16: LGTM!

The default worker host has been correctly updated to reflect the new service name vrf-worker.


21-21: LGTM!

The default reporter host has been correctly updated to reflect the new service name vrf-reporter.


26-28: LGTM!

The new environment variables ORAKL_NETWORK_API_URL and ORAKL_NETWORK_DELEGATOR_URL are correctly introduced to allow for configurable URLs.

@Intizar-T
Copy link
Contributor

a few points:

  • how about updating package version in cli, which will publish cli to npm after this PR is merged to the master branch
  • if you search keywords like datafeed and data-feed in core/, you'll see some more references (error variables, types, etc.). Should we remove those in this PR as well?

@nick-bisonai
Copy link
Collaborator Author

a few points:

  • how about updating package version in cli, which will publish cli to npm after this PR is merged to the master branch
  • if you search keywords like datafeed and data-feed in core/, you'll see some more references (error variables, types, etc.). Should we remove those in this PR as well?
  • sure I'll update cli package version
  • there are some code related to l2 integration which can't be removed for now

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

Outside diff range, codebase verification and nitpick comments (1)
core/src/listener/types.ts (1)

References to IDataFeedListenerWorker still exist in the codebase.

The following files contain references to IDataFeedListenerWorker:

  • core/src/types.ts
  • core/src/listener/types.ts
  • core/src/listener/data-feed-L2.ts
  • core/src/worker/data-feed-L2.ts

Please ensure all references are removed if IDataFeedListenerWorker is intended to be deprecated.

Analysis chain

Line range hint 1-52:
LGTM! But verify the removal of IDataFeedListenerWorker usage in the codebase.

The code changes are approved.

However, ensure that all references to IDataFeedListenerWorker have been removed from the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of `IDataFeedListenerWorker` usage in the codebase.

# Test: Search for the `IDataFeedListenerWorker` references. Expect: No occurrences.
rg --type python -A 5 $'IDataFeedListenerWorker'

Length of output: 78


Script:

#!/bin/bash
# Description: Verify the removal of `IDataFeedListenerWorker` usage in the codebase.

# Test: Search for the `IDataFeedListenerWorker` references. Expect: No occurrences.
rg --type typescript -A 5 $'IDataFeedListenerWorker'

Length of output: 86


Script:

#!/bin/bash
# Description: Verify the removal of `IDataFeedListenerWorker` usage in the codebase.

# Test: Search for the `IDataFeedListenerWorker` references. Expect: No occurrences.
rg -A 5 $'IDataFeedListenerWorker'

Length of output: 2701

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e052344 and b37eeaa.

Files ignored due to path filters (1)
  • cli/package.json is excluded by !**/*.json
Files selected for processing (8)
  • core/src/errors.ts (1 hunks)
  • core/src/listener/main.ts (2 hunks)
  • core/src/listener/types.ts (2 hunks)
  • core/src/main.ts (6 hunks)
  • core/src/reporter/main.ts (2 hunks)
  • core/src/types.ts (1 hunks)
  • core/src/worker/api.ts (1 hunks)
  • core/src/worker/main.ts (2 hunks)
Files skipped from review due to trivial changes (2)
  • core/src/errors.ts
  • core/src/reporter/main.ts
Additional comments not posted (7)
core/src/worker/main.ts (1)

Line range hint 1-36:
LGTM! But verify the removal of dataFeedWorker usage in the codebase.

The code changes are approved.

However, ensure that all references to dataFeedWorker have been removed from the codebase.

Verification successful

Verification successful: All references to dataFeedWorker have been removed from the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of `dataFeedWorker` usage in the codebase.

# Test: Search for the `dataFeedWorker` references. Expect: No occurrences.
rg --type python -A 5 $'dataFeedWorker'

Length of output: 69


Script:

#!/bin/bash
# Description: Verify the removal of `dataFeedWorker` usage in the codebase.

# Test: Search for the `dataFeedWorker` references. Expect: No occurrences.
rg --type ts -A 5 $'dataFeedWorker'

Length of output: 34


Script:

#!/bin/bash
# Description: Verify the removal of `dataFeedWorker` usage in the codebase.

# Test: Search for the `dataFeedWorker` references in all file types. Expect: No occurrences.
rg -A 5 $'dataFeedWorker'

Length of output: 24

core/src/listener/main.ts (1)

Line range hint 1-53:
LGTM! But verify the removal of buildDataFeedListener usage in the codebase.

The code changes are approved.

However, ensure that all references to buildDataFeedListener have been removed from the codebase.

Verification successful

Verification successful: All references to buildDataFeedListener have been removed from the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the removal of `buildDataFeedListener` usage in the codebase.

# Test: Search for the `buildDataFeedListener` references. Expect: No occurrences.
rg --type python -A 5 $'buildDataFeedListener'

Length of output: 76


Script:

#!/bin/bash
# Description: Verify the removal of `buildDataFeedListener` usage in the codebase.

# Test: Search for the `buildDataFeedListener` references. Expect: No occurrences.
rg --type ts -A 5 $'buildDataFeedListener'

Length of output: 41

core/src/worker/api.ts (1)

Line range hint 1-69:
LGTM! But verify the removal of fetchDataFeedByAggregatorId and getAggregatorGivenAddress usage in the codebase.

The code changes are approved.

However, ensure that all references to fetchDataFeedByAggregatorId and getAggregatorGivenAddress have been removed from the codebase.

core/src/main.ts (3)

4-4: LGTM! Import changes align with the PR objective.

The import statements have been updated to reflect the removal of data-feed and the inclusion of data-feed-L2.

Also applies to: 7-7, 10-10, 13-13, 16-16, 19-19, 22-22, 25-25


28-28: LGTM! Constant changes align with the PR objective.

The constants have been updated to reflect the removal of data-feed and the inclusion of data-feed-L2.

Also applies to: 31-31, 34-34


37-37: LGTM! Function changes align with the PR objective.

The functions have been updated to use the new constants reflecting the removal of data-feed and the inclusion of data-feed-L2.

Also applies to: 40-40, 43-43

core/src/types.ts (1)

Line range hint 70-70:
LGTM! Type definition changes align with the PR objective.

The IDataFeedListenerWorker interface has been removed and replaced with IDataFeedListenerWorkerL2.

cli/package.json Outdated Show resolved Hide resolved
@nick-bisonai nick-bisonai merged commit 9e8c382 into master Jul 17, 2024
1 check passed
@nick-bisonai nick-bisonai deleted the feat/remove-core-and-cli branch July 17, 2024 01:25
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.

2 participants