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

Metadata os param store addition #1932

Merged
merged 9 commits into from
Apr 16, 2024

Conversation

nullpointer0x00
Copy link
Contributor

@nullpointer0x00 nullpointer0x00 commented Apr 15, 2024

Description

Removes the use of param store in the metadata module and uses module's store for params. Currently, metadata module only has a set of os locator params that needed migrated.

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 a new metadata parameter migration system, enhancing the handling of module parameters during application upgrades.
  • Refactor
    • Streamlined initialization processes in the application, removing unnecessary parameter handling.
    • Updated the metadata keeper with simplified logic for OS locator parameters, improving system efficiency.
  • Documentation
    • Updated internal documentation to reflect changes in handling metadata parameters and OS locator configurations.

Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough

The changes in this update focus on migrating module parameters from the param space to a new module store in the software project. These modifications streamline parameter handling, initialization processes, and querying mechanisms, enhancing system efficiency and organization by centralizing parameter storage.

Changes

Files Change Summary
app/app.go, app/upgrades.go Modified MetadataKeeper initialization, rearranged paramsKeeper.Subspace calls, added migrateMetadataOSLocatorParams function for OS locator params migration.
x/metadata/keeper/... Restructured parameter handling by removing paramSpace and simplifying logic across various files.
x/metadata/types/... Added a new constant for OS locator params and updated related types for parameter handling.

Possibly related issues

🐇✨🎉
Changes are here, oh what a sight,
From param space to module store, alright!
Code hops along, cleaner than before,
With every commit, it's less of a chore.
Celebrate we do, with a hop and a cheer, 🥕🎈
For cleaner code, the goal is near!
🐇✨🎉


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 2a77b63 and b8f2c57.
Files selected for processing (1)
  • x/metadata/keeper/oslocatorparams_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/metadata/keeper/oslocatorparams_test.go

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.

@nullpointer0x00 nullpointer0x00 marked this pull request as ready for review April 16, 2024 15:59
@nullpointer0x00 nullpointer0x00 requested a review from a team as a code owner April 16, 2024 15:59
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: 1

Actionable comments outside the diff hunks (11)
CHANGELOG.md (11)

Line range hint 64-69: Ensure consistency in list item markers.

- * Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
- * Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
- * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
+ * Bump cosmos-SDK to `v0.50.2` (from `v0.46.13-pio-2`) [#1772](https://github.com/provenance-io/provenance/issues/1772).
+ * Add store for crisis module for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
+ * Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).

Line range hint 140-171: Ensure consistency in list item markers.

- * Support commitments in the exchange module [#1789](https://github.com/provenance-io/provenance/issues/1789), [PR 1830](https://github.com/provenance-io/provenance/pull/1830).
- * Add [Payments](x/exchange/spec/01_concepts.md#payments) to the exchange module [#1703](https://github.com/provenance-io/provenance/issues/1703).
- * Add the ibcratelimit module [#1498](https://github.com/provenance-io/provenance/issues/1498).
- * Add NAV support for metadata scopes [#1749](https://github.com/provenance-io/provenance/issues/1749).
- * Add fix for NAV units to tourmaline upgrade handler [#1815](https://github.com/provenance-io/provenance/issues/1815).
- * In the marker module's `SendRestrictionFn`, allow a transfer agent to be identified through the context [#1834](https://github.com/provenance-io/provenance/issues/1834).
- * In the exchange module, provide the admin as the transfer agent when attempting to move funds [#1834](https://github.com/provenance-io/provenance/issues/1834).
- * Add upgrade handler to set net asset values to markers in pio-testnet-1 [PR 1881](https://github.com/provenance-io/provenance/pull/1881).
- * Add upgrade handler to set net asset values and update block height for pio-mainnet-1 [PR 1888](https://github.com/provenance-io/provenance/pull/1888).
+ * Support commitments in the exchange module [#1789](https://github.com/provenance-io/provenance/issues/1789), [PR 1830](https://github.com/provenance-io/provenance/pull/1830).
+ * Add [Payments](x/exchange/spec/01_concepts.md#payments) to the exchange module [#1703](https://github.com/provenance-io/provenance/issues/1703).
+ * Add the ibcratelimit module [#1498](https://github.com/provenance-io/provenance/issues/1498).
+ * Add NAV support for metadata scopes [#1749](https://github.com/provenance-io/provenance/issues/1749).
+ * Add fix for NAV units to tourmaline upgrade handler [#1815](https://github.com/provenance-io/provenance/issues/1815).
+ * In the marker module's `SendRestrictionFn`, allow a transfer agent to be identified through the context [#1834](https://github.com/provenance-io/provenance/issues/1834).
+ * In the exchange module, provide the admin as the transfer agent when attempting to move funds [#1834](https://github.com/provenance-io/provenance/issues/1834).
+ * Add upgrade handler to set net asset values to markers in pio-testnet-1 [PR 1881](https://github.com/provenance-io/provenance/pull/1881).
+ * Add upgrade handler to set net asset values and update block height for pio-mainnet-1 [PR 1888](https://github.com/provenance-io/provenance/pull/1888).

Line range hint 200-202: Ensure consistency in list item markers.

- * Add CLI commands for the exchange module endpoints and queries [#1701](https://github.com/provenance-io/provenance/issues/1701).
- * Create CLI commands for adding a market to a genesis file [#1757](https://github.com/provenance-io/provenance/issues/1757).
- * Add CLI command to generate autocomplete shell scripts [#1762](https://github.com/provenance-io/provenance/pull/1762).
+ * Add CLI commands for the exchange module endpoints and queries [#1701](https://github.com/provenance-io/provenance/issues/1701).
+ * Create CLI commands for adding a market to a genesis file [#1757](https://github.com/provenance-io/provenance/issues/1757).
+ * Add CLI command to generate autocomplete shell scripts [#1762](https://github.com/provenance-io/provenance/pull/1762).

Line range hint 279-301: Ensure consistency in list item markers.

- * Create the `x/exchange` module which facilitates the buying and selling of assets [#1658](https://github.com/provenance-io/provenance/issues/1658), [#1699](https://github.com/provenance-io/provenance/issues/1699), [#1700](https://github.com/provenance-io/provenance/issues/1700).
- * Allow marker's transfer authority to prevent transfer of restricted coin with deny list on send [#1518](https://github.com/provenance-io/provenance/issues/1518).
- * Add net asset value to markers [#1328](https://github.com/provenance-io/provenance/issues/1328).
- * Add ICQHost and Oracle module to allow cross chain oracle queries [#1497](https://github.com/provenance-io/provenance/issues/1497).
- * New `GetByAddr` metadata query [#1443](https://github.com/provenance-io/provenance/issues/1443).
- * Add Trigger module queries to stargate whitelist for smart contracts [#1636](https://github.com/provenance-io/provenance/issues/1636).
- * Added the saffron upgrade handlers [PR 1648](https://github.com/provenance-io/provenance/pull/1648).
+ * Create the `x/exchange` module which facilitates the buying and selling of assets [#1658](https://github.com/provenance-io/provenance/issues/1658), [#1699](https://github.com/provenance-io/provenance/issues/1699), [#1700](https://github.com/provenance-io/provenance/issues/1700).
+ * Allow marker's transfer authority to prevent transfer of restricted coin with deny list on send [#1518](https://github.com/provenance-io/provenance/issues/1518).
+ * Add net asset value to markers [#1328](https://github.com/provenance-io/provenance/issues/1328).
+ * Add ICQHost and Oracle module to allow cross chain oracle queries [#1497](https://github.com/provenance-io/provenance/issues/1497).
+ * New `GetByAddr` metadata query [#1443](https://github.com/provenance-io/provenance/issues/1443).
+ * Add Trigger module queries to stargate whitelist for smart contracts [#1636](https://github.com/provenance-io/provenance/issues/1636).
+ * Added the saffron upgrade handlers [PR 1648](https://github.com/provenance-io/provenance/pull/1648).

Line range hint 657-665: Ensure consistency in list item markers.

- * Add support to add/remove required attributes for a restricted marker. [#1512](https://github.com/provenance-io/provenance/issues/1512)
- * Add trigger module for delayed execution. [#1462](https://github.com/provenance-io/provenance/issues/1462)
- * Add support to update the `allow_forced_transfer` field of a restricted marker [#1546](https://github.com/provenance-io/provenance/issues/1546).
- * Add expiration date value to `attribute` [#1435](https://github.com/provenance-io/provenance/issues/1435).
- * Add endpoints to update the value owner address of scopes [#1329](https://github.com/provenance-io/provenance/issues/1329).
- * Add pre-upgrade command that updates config files to newest format and sets `consensus.timeout_commit` to `1500ms` [PR 1594](https://github.com/provenance-io/provenance/pull/1594), [PR 1600](https://github.com/provenance-io/provenance/pull/1600).
+ * Add support to add/remove required attributes for a restricted marker. [#1512](https://github.com/provenance-io/provenance/issues/1512)
+ * Add trigger module for delayed execution. [#1462](https://github.com/provenance-io/provenance/issues/1462)
+ * Add support to update the `allow_forced_transfer` field of a restricted marker [#1546](https://github.com/provenance-io/provenance/issues/1546).
+ * Add expiration date value to `attribute` [#1435](https://github.com/provenance-io/provenance/issues/1435).
+ * Add endpoints to update the value owner address of scopes [#1329](https://github.com/provenance-io/provenance/issues/1329).
+ * Add pre-upgrade command that updates config files to newest format and sets `consensus.timeout_commit` to `1500ms` [PR 1594](https://github.com/provenance-io/provenance/pull/1594), [PR 1600](https://github.com/provenance-io/provenance/pull/1600).

Line range hint 710-718: Ensure consistency in list item markers.

- * Address the [Barberry security advisory](https://forum.cosmos.network/t/cosmos-sdk-security-advisory-barberry/10825) [PR 1576](https://github.com/provenance-io/provenance/pull/1576)
+ * Address the [Barberry security advisory](https://forum.cosmos.network/t/cosmos-sdk-security-advisory-barberry/10825) [PR 1576](https://github.com/provenance-io/provenance/pull/1576)

Line range hint 764-764: Ensure there are no multiple consecutive blank lines.

- 

Line range hint 1165-1165: Ensure there are no multiple consecutive blank lines.

- 

Line range hint 1182-1182: Ensure there are no multiple consecutive blank lines.

- 

Line range hint 1234-1234: Ensure there are no multiple consecutive blank lines.

- 

Line range hint 1338-1338: Ensure there are no multiple consecutive blank lines.

- 

app/app.go Show resolved Hide resolved
@nullpointer0x00 nullpointer0x00 merged commit 55a96da into main Apr 16, 2024
19 of 36 checks passed
@nullpointer0x00 nullpointer0x00 deleted the nullpointer0x00/metadata-param-store-migration branch April 16, 2024 18:31
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