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

Add upgrade handler to add default navs for testnet markers #1881

Merged
merged 6 commits into from
Mar 19, 2024

Conversation

nullpointer0x00
Copy link
Contributor

@nullpointer0x00 nullpointer0x00 commented Mar 19, 2024

Description

Add an upgrade handler to set the navs of Figure markers values in testnet.

This is the query used to populate the prices: https://test.figure.tech/service-pricing-engine/external/api/v1/pricing/marker/new?time=2024-03-19T00:00:00.000-05:00

closes: #XXXX


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

Summary by CodeRabbit

  • New Features
    • Introduced an upgrade handler for setting net asset values to markers in the testnet environment.
  • Tests
    • Enhanced testing suite to include logging for the process of adding marker net asset values during upgrades.

Copy link
Contributor

coderabbitai bot commented Mar 19, 2024

Walkthrough

This update introduces a new feature that automatically sets the net asset values (NAVs) for markers in the pio-testnet-1. This is achieved through the addition of an upgrade handler within the codebase, specifically designed to handle the "tourmaline-rc3" upgrade. The implementation involves calling a function to assign NAVs to markers, enhancing the system's capability to manage and represent asset values efficiently.

Changes

File(s) Summary
CHANGELOG.md Added an upgrade handler to set net asset values to markers in pio-testnet-1.
app/upgrades.go Introduced a call to addMarkerNavs within the "tourmaline-rc3" upgrade handler.
app/.../upgrades_test.go Enhanced testing to include logging the process of adding marker NAVs in upgrade tests.

🐇✨
In the land of code and net,
A tiny rabbit set to bet.
With markers bright and NAVs set right,
"Tourmaline's glow, oh what a sight!"
Through tests and trials, we leap and bound,
In pio-testnet-1, our treasures found.
🌟🐾

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

@nullpointer0x00 nullpointer0x00 marked this pull request as ready for review March 19, 2024 16:11
@nullpointer0x00 nullpointer0x00 requested a review from a team as a code owner March 19, 2024 16:11
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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between f14cb35 and 0e2feee.
Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • app/upgrades.go (1 hunks)
  • app/upgrades_test.go (1 hunks)
Additional comments: 8
app/upgrades.go (1)
  • 139-139: The addition of addMarkerNavs(ctx, app, GetPioTestnet1DenomToNav()) within the "tourmaline-rc3" upgrade handler is a critical update for setting default NAVs for markers in the testnet environment. This change aligns with the PR objectives and ensures that the blockchain reflects real-world economic values accurately.
  • The change is logically sound and aligns with the PR's objectives.
  • It's important to ensure that GetPioTestnet1DenomToNav() fetches the latest and accurate NAVs from the Figure Technologies pricing engine. Manual verification or automated tests should confirm that the fetched NAVs are as expected on the date specified (March 19, 2024).
app/upgrades_test.go (6)
  • 449-450: The test asserts log messages for adding marker net asset values during the tourmaline-rc3 upgrade. Ensure the actual upgrade handler's implementation aligns with these expectations.
  • 449-450: Ensure the addMarkerNavs function, which is tested here, robustly handles edge cases and errors, especially for markers without supply or existing NAVs.
  • 449-450: Confirm that the setExchangeParams function preserves existing configurations where appropriate, especially when parameters are already set.
  • 449-450: Verify the accuracy of NAV unit conversions by the convertNavUnits function, particularly for markers with the USD denomination in their NAVs.
  • 449-450: Ensure the updateMsgFeesNhashPerMil function precisely updates the NhashPerUsdMil parameter to the intended value without unintended side effects.
  • 449-450: Confirm that the setExchangePaymentParamsToDefaults function preserves existing configurations where appropriate, especially when payment parameters are already set.
CHANGELOG.md (1)
  • 44-44: The changelog entry is clear and concise, accurately summarizing the addition of an upgrade handler for setting net asset values to markers in pio-testnet-1. Good job on maintaining the clarity and brevity expected in a changelog.

@nullpointer0x00 nullpointer0x00 enabled auto-merge (squash) March 19, 2024 16:37
@nullpointer0x00 nullpointer0x00 merged commit 2d21a84 into main Mar 19, 2024
36 checks passed
@nullpointer0x00 nullpointer0x00 deleted the nullpointer0x00/testnet-pricing-data-to-navs branch March 19, 2024 16:47
SpicyLemon pushed a commit that referenced this pull request Mar 19, 2024
* add denom to nav pricing data method

* add testnet navs to upgrade handler rc3

* comment out negative price, keep as reference

* add upgrade handler

* remove negative value marker

* add change log
SpicyLemon added a commit that referenced this pull request Mar 19, 2024
…1882)

* add denom to nav pricing data method

* add testnet navs to upgrade handler rc3

* comment out negative price, keep as reference

* add upgrade handler

* remove negative value marker

* add change log

Co-authored-by: Carlton Hanna <nullpointer0x00@gmail.com>
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