chain icon indicating copy to clipboard operation
chain copied to clipboard

feat: storage-cost per storage-provider

Open shifty11 opened this issue 10 months ago • 1 comments

Summary by CodeRabbit

  • New Features
    • Introduced new functionalities and updates across various modules to enhance parameter retrieval and storage cost calculations based on provider IDs.
    • Updated API documentation to reflect changes in storage cost parameters.
  • Bug Fixes
    • Adjusted storage cost retrieval logic in tests to accommodate new parameter structures.
  • Refactor
    • Enhanced existing functions and structures to support the handling of storage costs as a map, improving flexibility and accuracy in cost management.
  • Documentation
    • Updated OpenAPI specifications to align with the new storage costs structure and additional properties.

shifty11 avatar Apr 23 '24 09:04 shifty11

Walkthrough

The recent updates focus on enhancing the storage cost management and parameter handling in the application. New functions and structures have been introduced to facilitate migrations and parameter updates, especially for the x/bundles module. Changes include method signature updates, new keeper functionalities, and API documentation adjustments to reflect the new storage cost structures.

Changes

File Path Change Summary
app/app.go, app/upgrades/v1_5/upgrade.go Added arguments to New function call and updated function signatures.
docs/static/openapi.yml, proto/.../params.proto Renamed and updated API definitions for new storage cost structures.
x/bundles/keeper/..., x/bundles/types/... Enhanced parameters handling and keeper functionalities.
x/stakers/keeper/... Adjusted storage cost retrieval in stakers keeper tests.

🐰✨ In the land of code where the bits align, A rabbit hopped through, leaving changes behind. Storage costs mapped, parameters anew, In bundles and keepers, our app grew. Hop, hop, hooray! On bytes we dine, For every line of code, let's make it shine! 🌟 🐰💻


Recent Review Details

Configuration used: CodeRabbit UI Review profile: CHILL

Commits Files that changed from the base of the PR and between 9d78b1030e0da3b54146b2075df7df25734138e7 and ab8f4c1c36b30084b787b10925c3cd8f9b6be9f3.
Files selected for processing (2)
  • app/upgrades/v1_5/upgrade.go (2 hunks)
  • x/bundles/spec/08_params.md (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • app/upgrades/v1_5/upgrade.go
Additional Context Used
LanguageTool (22)
x/bundles/spec/08_params.md (22)

Near line 7: An apostrophe may be missing. Context: # Parameters The bundles module contains the following parameter...


Near line 9: Possible typo: you repeated a whitespace Context: ...ontains the following parameters: | Key | Type ...


Near line 9: Possible typo: you repeated a whitespace Context: ...wing parameters: | Key | Type | Example ...


Near line 9: Possible typo: you repeated a whitespace Context: ... | Example | |---------------|---------------------...


Near line 11: Possible spelling mistake found. Context: ...------------------------------------| | UploadTimeout | uint64 (time s) ...


Near line 11: Possible typo: you repeated a whitespace Context: ...-----| | UploadTimeout | uint64 (time s) | 600 ...


Near line 11: Possible typo: you repeated a whitespace Context: ... | 600 | | StorageCosts | []StorageCost (stora...


Near line 12: Possible spelling mistake found. Context: ... | | StorageCosts | []StorageCost (storageProviderId, co...


Near line 12: Possible typo: you repeated a whitespace Context: ... | | StorageCosts | []StorageCost (storageProviderId, cost...


Near line 12: Possible spelling mistake found. Context: ... | | StorageCosts | []StorageCost (storageProviderId, cost in tkyve per b...


Near line 12: Possible spelling mistake found. Context: ... | | StorageCosts | []StorageCost (storageProviderId, cost in tkyve per byte) | ["storage_pr...


Near line 12: Possible spelling mistake found. Context: ...StorageCost (storageProviderId, cost in tkyve per byte) | ["storage_provider_id": 1, ...


Near line 13: Possible spelling mistake found. Context: ...torage_provider_id": 1, "cost": 25] | | NetworkFee | sdk.Dec (%) ...


Near line 13: Possible typo: you repeated a whitespace Context: ...vider_id": 1, "cost": 25] | | NetworkFee | sdk.Dec (%) ...


Near line 13: Possible spelling mistake found. Context: ...id": 1, "cost": 25] | | NetworkFee | sdk.Dec (%) ...


Near line 13: Add a space between sentences. Context: ... 1, "cost": 25] | | NetworkFee | sdk.Dec (%) ...


Near line 13: Possible typo: you repeated a whitespace Context: ...st": 25] | | NetworkFee | sdk.Dec (%) | "0.01" ...


Near line 13: Possible typo: you repeated a whitespace Context: ... | "0.01" | | MaxPoints | uint64 ...


Near line 14: Possible spelling mistake found. Context: ...01" | | MaxPoints | uint64 ...


Near line 14: Possible typo: you repeated a whitespace Context: ... | | MaxPoints | uint64 ...


Near line 14: Possible typo: you repeated a whitespace Context: ... | | MaxPoints | uint64 | 5 ...


Near line 14: Possible typo: you repeated a whitespace Context: ... | 5 |

Additional comments not posted (1)
x/bundles/spec/08_params.md (1)

12-12: Update the StorageCosts parameter to reflect dynamic storage costs per provider.

This change aligns with the PR's objective to handle storage costs dynamically based on the storage provider, enhancing flexibility and scalability.


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.

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

coderabbitai[bot] avatar Apr 23 '24 09:04 coderabbitai[bot]