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

Reinstate usage of some SDK functionality unique to our fork. #1930

Merged
merged 26 commits into from
Apr 16, 2024

Conversation

SpicyLemon
Copy link
Contributor

@SpicyLemon SpicyLemon commented Apr 15, 2024

Description

Note: The hold cli tests will fail to build until #1926 has been merged. I'll keep this PR in draft until then.

This PR bumps the SDK to v0.50.5-pio-3 (from v0.50.5-pio-2).

This PR also takes care of a handful of TODOs in the v0.50 epic:

  • TODO[1760]: cli: ReadPageRequestWithPageKeyDecoded
  • TODO[1760]: Copy needed stuff out of simapp and remove this require. (Removes import of cosmossdk.io/simapp.)
  • TODO[1760]: count-authz (Reinstate several tests that use the CountAuthorization.)
  • TODO[1760]: gov-cli (Restores several commands that submit gov props.)
  • TODO[1760]: locked-coins (Restore the x/hold module functionality.)
  • TODO[1760]: exchange (Switch back to InputOutputCoinsProv for exchange transfers.)
  • Remove the stuff specific to make test-unit-amino.

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

    • Restored the hold module functionality.
    • Added new governance proposal CLI commands.
    • Enhanced pagination handling across various modules by updating function calls to handle decoded page keys.
  • Bug Fixes

    • Fixed an issue with key decoding in governance proposals.
    • Corrected a variable name typo from addr1Esrow to addr1Escrow.
  • Refactor

    • Updated banking operations to use BaseKeeper instead of Keeper.
    • Changed the InputOutputCoins method to InputOutputCoinsProv in the BankKeeper interface for better exchange transfers.
    • Migrated bank parameters handling to a new function for better upgrade compatibility.
    • Refactored message wrapping in governance proposal generation for direct setting.
  • Documentation

    • Removed outdated TODO comments related to locked coins and governance CLI.
  • Tests

    • Enhanced test configurations and targets in the Makefile.
    • Updated test cases to reflect new functionalities and refactored codebases.

…the grant command, so there's a couple things that are still needed in the SDK.
…it. Remove the check-test stuff since we've also got build-tests which is easier for me to remember.
… it's actually a comment rather than a command that's printed.
…ame flow as make test, and also give it the same tags.
…terface since that interface doesn't have InputOutputCoinsProv.
…nce to one because there's some deep down-stream wiring stuff that assumes it's concrete.
…al test is commented out right now until the quarantine PR merges that has the needed query helper.
Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough

This update harmonizes various adjustments across the codebase to enhance testing, build processes, and vital functionalities like pagination, governance proposals, and bank parameters. Notable changes involve restoring the hold module, refining CLI commands, and enhancing coin transfer mechanisms within the exchange module to align with the ongoing Cosmos SDK v0.50.x upgrade efforts.

Changes

Files Change Summary
Makefile, app/app.go, .../app_test.go, .../params/proto.go Refinements in build configurations, import statements, and deprecations for improved dependency management.
CHANGELOG.md, x/hold/client/cli/cli_test.go, x/hold/.../query.go, x/hold/.../expected_keepers.go, ... Restoration and enhancement of the hold module, including test case updates and management of locked coins.
x/exchange/..., x/attribute/.../query.go, x/marker/.../query.go, x/metadata/.../query.go, x/name/.../query.go, x/trigger/.../query.go Updates in pagination handling across various modules by transitioning to ReadPageRequestWithPageKeyDecoded from ReadPageRequest.
x/exchange/expected_keepers.go, x/exchange/keeper/..., internal/provcli/cli_helpers.go Enhancements in coin transfer functions and governance proposal generation for improved functionality and streamlined processes.

Possibly related issues

  • Epic: SDK v0.50 #1760: The changes in this PR, such as updating dependencies and addressing TODO comments, align well with the objectives of upgrading to Cosmos SDK v0.50.x.
  • Upgrade ibc-go to v8.0.0 #1707: While not directly linked, the overarching theme of upgrading dependencies and improving module functionalities could indirectly support the ibc-go upgrade to v8.0.0.

🐰 Poem by CodeRabbit

In the warren of code, changes hop around,
From cli to keeper, improvements abound.
With modules updated, and tests refined,
A better version, we're destined to find.
Let's celebrate the leaps, with a carrot or two, 🥕
For every line of code, feels almost brand new!


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 89fd284 and aacf489.
Files selected for processing (4)
  • CHANGELOG.md (1 hunks)
  • app/app.go (4 hunks)
  • app/upgrades.go (7 hunks)
  • app/upgrades_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (3)
  • app/app.go
  • app/upgrades.go
  • app/upgrades_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.

@SpicyLemon SpicyLemon marked this pull request as ready for review April 15, 2024 20:10
@SpicyLemon SpicyLemon requested a review from a team as a code owner April 15, 2024 20:10
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: 4

Actionable comments outside the diff hunks (6)
app/app.go (4)

Line range hint 994-994: Check the error return value of app.mm.RegisterServices.

- app.mm.RegisterServices(app.configurator)
+ if err := app.mm.RegisterServices(app.configurator); err != nil {
+     panic(fmt.Errorf("failed to register services: %w", err))
+ }

It's important to handle errors returned by RegisterServices to avoid runtime panics due to unhandled issues during the service registration process.


Line range hint 1205-1205: Check the error return value of app.UpgradeKeeper.SetModuleVersionMap.

- app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap())
+ if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.mm.GetVersionMap()); err != nil {
+     panic(fmt.Errorf("failed to set module version map: %w", err))
+ }

Proper error handling is crucial when setting the module version map to ensure that the application state is correctly initialized.


Line range hint 1428-1428: Check the error return value of app.UpgradeKeeper.ClearUpgradePlan.

- app.UpgradeKeeper.ClearUpgradePlan(ctx)
+ if err := app.UpgradeKeeper.ClearUpgradePlan(ctx); err != nil {
+     panic(fmt.Errorf("failed to clear upgrade plan: %w", err))
+ }

It's important to handle errors when clearing the upgrade plan to ensure that the application does not enter an inconsistent state.


Line range hint 454-454: Correct the misuse of the append function.

- enabledSignModes := append(tx.DefaultSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)
+ enabledSignModes := append([]sigtypes.SignMode{}, tx.DefaultSignModes...)
+ enabledSignModes = append(enabledSignModes, sigtypes.SignMode_SIGN_MODE_TEXTUAL)

Ensure that the append does not modify the original DefaultSignModes slice. This change avoids potential side effects across different parts of the application where DefaultSignModes might be used.

CHANGELOG.md (2)

Line range hint 64-300: Consistent list marker style needed.

- - Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.0 ([#1910](https://github.com/provenance-io/provenance/pull/1910))
+ * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.0 ([#1910](https://github.com/provenance-io/provenance/pull/1910))

Please replace all dashes (-) with asterisks (*) for list items to maintain a consistent style throughout the document.


Line range hint 175-596: Convert bare URLs to Markdown links.

- https://github.com/provenance-io/provenance/issues/1760
+ [https://github.com/provenance-io/provenance/issues/1760](https://github.com/provenance-io/provenance/issues/1760)

Please update all bare URLs throughout the document to use Markdown link syntax for better readability and consistency.

x/metadata/client/cli/cli_test.go Show resolved Hide resolved
x/metadata/client/cli/cli_test.go Show resolved Hide resolved
x/hold/keeper/locked_coins.go Show resolved Hide resolved
x/hold/keeper/invariants.go Show resolved Hide resolved
@SpicyLemon SpicyLemon enabled auto-merge (squash) April 15, 2024 20:47
Taztingo
Taztingo previously approved these changes Apr 16, 2024
# Conflicts:
#	CHANGELOG.md
#	app/upgrades.go
#	app/upgrades_test.go
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

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

Line range hint 66-303: Consider using a consistent list marker style in markdown.

- - Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.0 ([#1910](https://github.com/provenance-io/provenance/pull/1910))
+ * Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.0 ([#1910](https://github.com/provenance-io/provenance/pull/1910))

Change all list markers from dashes (-) to asterisks (*) for consistency throughout the document.


Line range hint 177-598: Ensure all URLs are properly formatted with markdown links.

- https://github.com/provenance-io/provenance/issues/1772
+ [https://github.com/provenance-io/provenance/issues/1772](https://github.com/provenance-io/provenance/issues/1772)

Apply this change to all bare URLs throughout the document to improve readability and accessibility.

# Conflicts:
#	CHANGELOG.md
#	app/upgrades.go
#	app/upgrades_test.go
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

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

Line range hint 69-306: Consider using a consistent list marker style in Markdown.

- -
+ *

Line range hint 769-769: Remove consecutive blank lines to maintain a clean and consistent format.

-

Line range hint 180-180: Convert bare URLs to Markdown links for better readability and to provide clickable links in Markdown viewers.

- https://github.com/provenance-io/provenance/issues/1760
+ [v0.50 epic](https://github.com/provenance-io/provenance/issues/1760)

Line range hint 897-897: Remove spaces inside emphasis markers to fix Markdown formatting.

- * message PR <pull-request-number> *
+ *message PR <pull-request-number>*

Line range hint 293-293: Remove spaces inside code span elements to ensure correct rendering.

- ` MsgAddMarkerRequest `
+ `MsgAddMarkerRequest`

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 (2)
CHANGELOG.md (2)

Line range hint 146-148: Ensure consistency in list item markers, prefer using asterisks (*) over dashes (-) for unordered lists.

- * Remove unsupported database types [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Update ibc and migrate params [#1760](https://github.com/provenance-io/provenance/issues/1760).
- * Replace ModuleBasics with BasicModuleManager [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Remove unsupported database types [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Update ibc and migrate params [#1760](https://github.com/provenance-io/provenance/issues/1760).
+ * Replace ModuleBasics with BasicModuleManager [#1760](https://github.com/provenance-io/provenance/issues/1760).

Line range hint 206-208: Ensure consistency in list item markers, prefer using asterisks (*) over dashes (-) for unordered lists.

- * Remove deleted marker send deny entries [#1666](https://github.com/provenance-io/provenance/issues/1666).
- * Update protos, naming, and documentation to use mills for NAVs [#1813](https://github.com/provenance-io/provenance/issues/1813).
- * Update marker transfer to work with groups [#1818](https://github.com/provenance-io/provenance/issues/1818).
+ * Remove deleted marker send deny entries [#1666](https://github.com/provenance-io/provenance/issues/1666).
+ * Update protos, naming, and documentation to use mills for NAVs [#1813](https://github.com/provenance-io/provenance/issues/1813).
+ * Update marker transfer to work with groups [#1818](https://github.com/provenance-io/provenance/issues/1818).

CHANGELOG.md Show resolved Hide resolved
@SpicyLemon SpicyLemon merged commit 06e9b05 into main Apr 16, 2024
19 of 37 checks passed
@SpicyLemon SpicyLemon deleted the dwedul/1760-sdk-customizations branch April 16, 2024 21:04
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