Skip to content

Sgov feed#5

Open
Siddharth2207 wants to merge 3 commits into2025-09-26-stox-price-pusherfrom
sgov-feed
Open

Sgov feed#5
Siddharth2207 wants to merge 3 commits into2025-09-26-stox-price-pusherfrom
sgov-feed

Conversation

@Siddharth2207
Copy link
Copy Markdown
Collaborator

@Siddharth2207 Siddharth2207 commented Apr 19, 2026

Summary

Sgov feed

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded price configuration to support 30+ additional asset pairs including equities and commodities with standardized update thresholds
    • Added 15-second startup timeout mechanism with improved initialization logging to diagnose price feed connectivity
    • Enhanced price update logging with age diagnostics for better monitoring
  • Chores

    • Updated platform-specific build dependencies for improved cross-platform compatibility
    • Added test fixtures

@Siddharth2207 Siddharth2207 changed the base branch from main to 2025-09-26-stox-price-pusher April 19, 2026 14:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 69318744-3565-4ac8-8996-9b568fe08e14

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

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Walkthrough

The PR introduces Docker containerization infrastructure via a GitHub Actions workflow and Dockerfile, expands the sample price configuration with additional ticker aliases, enhances the PythPriceListener with async/await corrections and first-update polling, adds debug logging to EVM modules for gas handling, updates flake.nix for platform-specific dependency management, and includes a new test fixture file.

Changes

Cohort / File(s) Summary
Docker & CI Infrastructure
.github/workflows/rainix-docker.yml, Dockerfile
Added GitHub Actions workflow to build and publish Docker images on push (with optional manual tag input), and created Dockerfile that runs the price-pusher service with Node.js 22.14 configured via environment variables for contract addresses, endpoints, and optional parameters.
Price Configuration
apps/price_pusher/price-config.stable.sample.yaml
Replaced prior cryptocurrency tickers (BTC/USD, BNB/USD, PYTH/USD) with expanded equity/asset set (GOOG, AMZN, AAPL, MSFT, TSLA, NVDA, META, GME, MSTR, BRKB, SPLG, IAU, COIN, SIVR, CRCL, BMNR, PPLT, RKLB, SGOV with PRE/POST variants where applicable). Standardized all entries to time_difference: 300, price_deviation: 0.05, confidence_ratio: 200, and added uniform early_update configuration.
Price Listener Improvements
apps/price_pusher/src/pyth-price-listener.ts, apps/price_pusher/src/evm/command.ts
Updated PythPriceListener to await startListening() (fixing control flow), extended price freshness threshold from 60 seconds to 24 hours, added per-message diagnostics logging, improved stream error handling, and introduced public waitForFirstPriceUpdate() method. EVM command handler now blocks up to 15 seconds waiting for first price update before initializing client/controller.
EVM Module Enhancements
apps/price_pusher/src/evm/evm.ts
Added debug logging for gas price initialization and computed final gas price/nonce/update fee. Modified simulation to explicitly construct gasLimitToUse with configured value or default 1,000,000 gas, ensuring gas parameter is always passed to simulation (vs. previously undefined when unconfigured).
Development Environment
flake.nix
Updated devShells.default buildInputs from static unconditional list to platform-aware configuration using with pkgs; [...] and conditional additions for Linux (udev, libusb1) and macOS (libusb1, framework dependencies IOKit, CoreFoundation). Replaced python3Packages.distutils with python3Packages.setuptools.
Test Fixtures
test.json
Added new test fixture file with two JSON objects containing hex-encoded binary payloads and parsed records including price, EMA price, and metadata fields.

Sequence Diagram

sequenceDiagram
    participant Handler as EVM Command Handler
    participant Listener as PythPriceListener
    participant EVMClient as EVM Client/Controller
    
    Handler->>Listener: start()
    Listener->>Listener: startListening() [awaited]
    Listener->>Listener: Create stream & subscribe
    
    Handler->>Handler: waitForFirstPriceUpdate(15000)
    loop Poll latestPriceInfo
        Handler->>Listener: Check for price updates
        Listener-->>Handler: No prices yet
        Handler->>Handler: Wait & retry
    end
    
    Listener->>Listener: Receive first price update
    Listener->>Handler: Return true (update received)
    
    Handler->>Handler: Log success / timeout
    Handler->>EVMClient: Create & initialize
    Handler->>EVMClient: Start controller flow
    EVMClient-->>Handler: Running
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is severely incomplete, containing only the title repeated as a summary with no rationale, testing information, or details about the extensive changes. Complete all required sections: provide a detailed summary of changes (Docker workflow, Dockerfile, price feeds expansion), explain the rationale, and document how the changes were tested.
Title check ❓ Inconclusive The title is vague and overly generic, providing minimal information about the substantial changes in the changeset beyond a single asset name. Replace with a more descriptive title that summarizes the main changes, e.g., 'Add Docker workflow and expand price feed configuration' or 'Add Sgov feed with Docker deployment infrastructure'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch sgov-feed

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant