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 price-feeder to v0.2.4 #315

Merged
merged 1 commit into from
Feb 21, 2025

Conversation

leonz789
Copy link
Contributor

@leonz789 leonz789 commented Feb 21, 2025

Description

supersede #265

update price-feeder dependency to v0.2.4
integrate logger from imuad into price-feeder


Closes #XXX

Copy link
Contributor

coderabbitai bot commented Feb 21, 2025

Walkthrough

The pull request updates the initialization and configuration of the price feeder and related components. In the command implementation, it removes a temporary disablement comment and modifies the logging context by introducing a new server context variable. Dependency versions in the module file are updated, with one dependency removed and another added, reflecting shifts in external library usage. The local node configuration files are restructured to use more detailed token definitions and updated sender and endpoint formats.

Changes

File Change Summary
cmd/imuad/root.go Modified NewRootCmd: removed the temporary disablement comment for the price feeder, adjusted handling of mnemonic and clientCtx, introduced serverCtx, and updated the call to pricefeeder.StartPriceFeeder with enhanced logging.
go.mod Updated dependency versions: upgraded github.com/imua-xyz/price-feeder to v0.2.4; removed go.uber.org/atomic; added go.uber.org/zap v1.27.0.
local_node.sh (oracle config files) Restructured configuration files: in oracle_feeder.yaml, replaced a flat token list with structured tokens specifying token and sources (including new NSTETH from beaconchain), reformatted sender, rpc, and ws entries; added nstid in oracle_env_beaconchain.yaml.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as "CLI Command"
    participant Root as "RootCmd"
    participant PreRun as "PreRunE Handler"
    participant Logger as "ServerCtx.Logger"
    participant PF as "Price Feeder"

    CLI->>Root: Execute command
    Root->>PreRun: Call PreRunE procedure
    PreRun->>Logger: Retrieve logging context (module: price-feeder)
    PreRun->>PF: Invoke StartPriceFeeder with logging context
Loading

Poem

I'm a rabbit in the code burrow deep,
Hopping through logs while the services leap.
Dependencies change like carrots in a row,
Structured configs and updates ready to go.
With a skip and a hop, our code sings anew,
Celebrating these changes with a joyful "whee!"
🐇🌟

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

@leonz789 leonz789 mentioned this pull request Feb 21, 2025
3 tasks
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)
cmd/imuad/root.go (1)

162-163: Remove unused variable assignments.

The variables mnemonic and clientCtx are assigned but never used. This creates unnecessary assignments in the code.

-  _ = mnemonic
-  _ = clientCtx
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f51483 and 2d86f92.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • cmd/imuad/root.go (1 hunks)
  • go.mod (2 hunks)
  • local_node.sh (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: test-unit-e2e
  • GitHub Check: test-unit-cover
  • GitHub Check: Analyze (go)
  • GitHub Check: goreleaser
🔇 Additional comments (6)
cmd/imuad/root.go (1)

164-165: LGTM! Enhanced logging context for price feeder.

The addition of server context with module-specific logging will improve observability of the price feeder component.

go.mod (1)

26-26: LGTM! Dependency updates align with objectives.

The update to price-feeder v0.2.4 and the transition to zap for logging are consistent with the PR objectives.

Also applies to: 61-61

local_node.sh (4)

233-238: LGTM! Improved token configuration structure.

The new token configuration format with explicit source mappings improves clarity and maintainability.


244-246: LGTM! Enhanced endpoint configuration.

The explicit type declarations for endpoints using !!str prevent potential YAML parsing issues.


260-261: LGTM! Added nstid configuration.

The addition of nstid with proper type declaration enhances the beaconchain configuration.


247-249:

❓ Verification inconclusive

Verify debugger port availability.

Ensure that port 50051 is available and doesn't conflict with other services in the development environment.


🏁 Script executed:

#!/bin/bash
# Check if port 50051 is in use
nc -z localhost 50051
if [ $? -eq 0 ]; then
    echo "Warning: Port 50051 is already in use"
fi

Length of output: 136


Action Required: Verify Debugger Port Availability Using an Alternate Method

The original verification script failed because the nc command is not available in the environment. Please confirm that port 50051 is free by using an alternative tool (e.g., lsof or netstat). For example, you might run:

#!/bin/bash
# Check if port 50051 is in use using lsof if available, otherwise fallback to netstat.
if command -v lsof >/dev/null 2>&1; then
    lsof -i :50051 || echo "Port 50051 not in use (lsof)"
else
    echo "lsof not available, trying netstat..."
    netstat -tuln | grep 50051 || echo "Port 50051 not in use (netstat)"
fi

Please manually verify the port status using one of these commands or update your environment to include nc if that’s your preferred tool.

Copy link
Contributor

@bwhour bwhour left a comment

Choose a reason for hiding this comment

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

it looks good.

@leonz789 leonz789 added this pull request to the merge queue Feb 21, 2025
Merged via the queue into imua-xyz:develop with commit ebf14f6 Feb 21, 2025
24 checks passed
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