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

feat(x/mint): Mint issuance using epochs #20044

Closed
wants to merge 55 commits into from
Closed

Conversation

likhita-809
Copy link
Contributor

@likhita-809 likhita-809 commented Apr 15, 2024

Description

Closes: #19952
Note: This work is referenced from osmosis


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Added a new function to retrieve epoch information.
    • Introduced epoch provisions retrieval function and updated minting module parameters.
  • Bug Fixes

    • Updated tests and functions for compatibility with epoch-based minting features.
  • Documentation

    • Enhanced README with new epoch-based minting parameters and endpoints.
  • Refactor

    • Restructured keeper and module functions to support epoch-based minting.
  • Tests

    • Added and updated tests for epoch-based minting functionalities.
  • Chores

    • Updated import paths and removed deprecated mock structures to align with new requirements.

Copy link
Contributor

coderabbitai bot commented Apr 15, 2024

Walkthrough

Walkthrough

The changes migrate the x/mint module from block-based to epoch-based token issuance. This involves modifying the issuance calculation logic to use epochs, defining epoch timers, and adjusting parameters and functions to support this new mechanism. The update ensures consistency and predictability in token issuance by using time-based metrics rather than block numbers.

Changes

File Path Change Summary
x/epochs/keeper/epoch.go Added GetEpochInfo function to retrieve epoch information by identifier.
x/mint/depinject.go Added EpochsKeeper to ModuleInputs struct and included it in the ProvideModule function.
x/mint/keeper/abci.go Updated BeginBlocker function to include mintAtBeginBlock parameter.
x/mint/keeper/genesis_test.go Updated GenesisTestSuite to initialize new parameters and include epochsKeeper.
x/mint/keeper/grpc_query_test.go Added test for equality between epochProvisions.EpochProvisions and minter.EpochProvisions.
x/mint/keeper/keeper.go Added LastReductionEpoch field to Keeper struct and methods to manipulate it.
x/mint/keeper/keeper_test.go Removed stakingKeeper and added epochsKeeper in IntegrationTestSuite SetupTest function.
x/mint/module.go Added migration registration for version 3 to version 4 in RegisterMigrations function.
x/mint/simulation/genesis_test.go Removed functionality related to BlockProvision, NextAnnualProvisions, and NextInflationRate in TestRandomizedGenState.
x/mint/testutil/expected_keepers_mocks.go Removed MockStakingKeeper and updated types to use new package location. Added MockEpochsKeeper.
x/mint/types/expected_keepers.go Removed StakingKeeper interface and added AccountKeeper interface with AddressCodec method.
x/mint/types/genesis.go Updated NewGenesisState and GenesisState struct to include ReductionStartedEpoch.
x/mint/types/minter.go Updated NewMinter function to include epochProvisions and added functions to calculate epoch provisions.
x/mint/README.md Added new parameters and endpoint for querying current minting epoch provisions value.
simapp/app.go Updated NewSimApp function to modify initialization of app.MintKeeper and app.PoolKeeper.
tests/integration/example/example_test.go Modified initialization of mintKeeper and mintModule to remove a nil argument.
x/mint/autocli.go Added new RPC method EpochProvisions to query current minting epoch provisions value.
x/mint/keeper/grpc_query.go Added EpochProvisions function to queryServer struct to retrieve epoch provisions.
x/mint/proto/cosmos/mint/v1beta1/mint.proto Added new fields to Minter and Params messages to include epoch-related parameters.

Assessment against linked issues

Objective Addressed Explanation
Modify issuance calculation logic to use time-based metrics instead of block numbers (#19952)
Implement mechanism to calculate issuance on a per-epoch basis (#19952)
Define epochs on-chain timers and set module hooks for specific epoch identifiers (#19952)
Remove block-based parameters and functions, replacing them with epoch-based equivalents (#19952)
Update documentation to reflect the new epoch-based parameters and endpoints (#19952)

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.

x/mint/keeper/hooks.go Fixed Show fixed Hide fixed
x/mint/keeper/hooks.go Fixed Show fixed Hide fixed
Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall code looks good

x/mint/proto/cosmos/mint/v1beta1/genesis.proto Outdated Show resolved Hide resolved
x/mint/proto/cosmos/mint/v1beta1/mint.proto Outdated Show resolved Hide resolved
x/mint/proto/cosmos/mint/v1beta1/mint.proto Outdated Show resolved Hide resolved
api/cosmos/mint/v1beta1/query.pulsar.go Dismissed Show dismissed Hide dismissed
api/cosmos/mint/v1beta1/query.pulsar.go Dismissed Show dismissed Hide dismissed
api/cosmos/mint/v1beta1/query.pulsar.go Dismissed Show dismissed Hide dismissed
api/cosmos/mint/v1beta1/query.pulsar.go Dismissed Show dismissed Hide dismissed
@likhita-809 likhita-809 marked this pull request as ready for review April 23, 2024 12:51
@likhita-809 likhita-809 requested a review from a team as a code owner April 23, 2024 12:51

This comment has been minimized.

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

Out of diff range and nitpick comments (2)
api/cosmos/mint/v1beta1/genesis.pulsar.go (2)

21-21: Add a comment describing the reduction_started_epoch field.

Adding a descriptive comment for the new field reduction_started_epoch will improve code readability and maintainability, especially for new developers or external contributors who might work with this codebase in the future.


602-606: Document the reduction_started_epoch field in the GenesisState struct.

Add comprehensive documentation for the reduction_started_epoch field in the GenesisState struct to clarify its purpose and usage. This documentation is crucial for developers and users of the SDK to understand the implications of this field.

x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/keeper/abci.go Fixed Show fixed Hide fixed
x/mint/module.go Fixed Show fixed Hide fixed
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

Out of diff range and nitpick comments (1)
x/mint/README.md (1)

Line range hint 10-26: Correct the indentation of the unordered list items for better readability.

-    * [State](#state)
-        * [Minter](#minter)
-        * [Params](#params)
-    * [LastReductionEpoch](#lastreductionepoch)
-    * [Begin Epoch](#begin-epoch)
-        * [NextEpochProvisions](#nextepochprovisions)
-        * [EpochProvision](#epochprovision)
+  * [State](#state)
+    * [Minter](#minter)
+    * [Params](#params)
+  * [LastReductionEpoch](#lastreductionepoch)
+  * [Begin Epoch](#begin-epoch)
+    * [NextEpochProvisions](#nextepochprovisions)
+    * [EpochProvision](#epochprovision)
Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between c6da896 and 5fda275.
Files selected for processing (2)
  • x/mint/README.md (10 hunks)
  • x/mint/keeper/migrator.go (2 hunks)
Additional Context Used
LanguageTool (2)
x/mint/README.md (2)

Near line 128: Possible missing preposition found.
Context: ...e desired ratio (67%). The maximum rate change possible is defined to be 13% per year,...


Near line 129: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...e possible is defined to be 13% per year, however, the annual inflation is capped as betwe...

Path-based Instructions (2)
x/mint/keeper/migrator.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/mint/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (3)
x/mint/keeper/migrator.go (2)

Line range hint 39-48: LGTM! The migration logic for Migrate2to3 correctly initializes and sets the new MaxSupply parameter.


51-66: LGTM! The migration logic for Migrate3to4 correctly handles the LastReductionEpoch parameter, ensuring it is initialized and stored properly.

x/mint/README.md (1)

12-15: LGTM! The documentation updates correctly reflect the new epoch-based minting system.

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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 5fda275 and fcdfa28.
Files selected for processing (1)
  • x/mint/keeper/migrator.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/mint/keeper/migrator.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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between fcdfa28 and 963c1b5.
Files selected for processing (1)
  • x/mint/keeper/hooks.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/mint/keeper/hooks.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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 963c1b5 and 44bdc27.
Files ignored due to path filters (2)
  • x/mint/go.mod is excluded by !**/*.mod
  • x/mint/go.sum is excluded by !**/*.sum
Files selected for processing (1)
  • simapp/app.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • simapp/app.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

Out of diff range and nitpick comments (5)
x/mint/types/expected_keepers.go (1)

37-40: Add documentation for the EpochsKeeper interface and its method.

To maintain consistency and clarity, consider adding comments to describe the EpochsKeeper interface and its GetEpochInfo method.

x/mint/depinject.go (1)

37-37: Add documentation for the EpochsKeeper field in ModuleInputs.

To maintain consistency and clarity, consider adding comments to describe the EpochsKeeper field in the ModuleInputs struct.

x/mint/keeper/keeper_test.go (1)

53-53: Add documentation for the epochsKeeper field in IntegrationTestSuite.

To maintain consistency and clarity, consider adding comments to describe the epochsKeeper field in the IntegrationTestSuite struct.

x/mint/keeper/genesis_test.go (1)

57-57: Add documentation for the epochsKeeper field in GenesisTestSuite.

To maintain consistency and clarity, consider adding comments to describe the epochsKeeper field in the GenesisTestSuite struct.

x/mint/testutil/expected_keepers_mocks.go (1)

227-263: Add documentation for the MockEpochsKeeper struct and its methods.

To maintain consistency and clarity, consider adding comments to describe the MockEpochsKeeper struct and its GetEpochInfo method.

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 44bdc27 and 3a7479b.
Files selected for processing (9)
  • x/epochs/keeper/epoch.go (1 hunks)
  • x/mint/depinject.go (2 hunks)
  • x/mint/keeper/abci.go (1 hunks)
  • x/mint/keeper/genesis_test.go (2 hunks)
  • x/mint/keeper/grpc_query_test.go (3 hunks)
  • x/mint/keeper/keeper.go (4 hunks)
  • x/mint/keeper/keeper_test.go (2 hunks)
  • x/mint/testutil/expected_keepers_mocks.go (9 hunks)
  • x/mint/types/expected_keepers.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • x/mint/keeper/grpc_query_test.go
  • x/mint/keeper/keeper.go
Additional Context Used
Path-based Instructions (7)
x/mint/types/expected_keepers.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/mint/depinject.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/epochs/keeper/epoch.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/mint/keeper/keeper_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/mint/keeper/genesis_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/mint/keeper/abci.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/mint/testutil/expected_keepers_mocks.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (7)
x/mint/depinject.go (1)

71-71: Ensure proper error handling for the EpochsKeeper initialization.

Verify that the EpochsKeeper is correctly initialized and handled in all relevant parts of the codebase.

x/epochs/keeper/epoch.go (1)

10-18: Ensure proper error handling and logging for the GetEpochInfo method.

Consider adding logging for error cases to aid in debugging and monitoring.

x/mint/keeper/keeper_test.go (1)

64-64: Ensure proper error handling for the epochsKeeper initialization.

Verify that the epochsKeeper is correctly initialized and handled in all relevant parts of the test suite.

x/mint/keeper/genesis_test.go (2)

62-62: Ensure proper error handling for the epochsKeeper initialization.

Verify that the epochsKeeper is correctly initialized and handled in all relevant parts of the test suite.


Line range hint 67-82: Ensure comprehensive test coverage for the new genesis parameters.

Verify that the new genesis parameters related to epochs are thoroughly tested, including edge cases and error scenarios.

x/mint/keeper/abci.go (2)

14-18: Ensure proper error handling and logging for the BeginBlocker2 function.

Consider adding logging for error cases to aid in debugging and monitoring.


40-126: Ensure proper error handling and logging for the BeginBlocker function.

Consider adding logging for error cases to aid in debugging and monitoring.

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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 3a7479b and a9fbc33.
Files selected for processing (4)
  • x/mint/keeper/abci.go (1 hunks)
  • x/mint/keeper/genesis_test.go (2 hunks)
  • x/mint/keeper/grpc_query_test.go (1 hunks)
  • x/mint/keeper/keeper.go (3 hunks)
Files skipped from review as they are similar to previous changes (4)
  • x/mint/keeper/abci.go
  • x/mint/keeper/genesis_test.go
  • x/mint/keeper/grpc_query_test.go
  • x/mint/keeper/keeper.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: 2

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between a9fbc33 and 2d68436.
Files selected for processing (12)
  • x/mint/README.md (9 hunks)
  • x/mint/depinject.go (2 hunks)
  • x/mint/keeper/genesis_test.go (2 hunks)
  • x/mint/keeper/grpc_query_test.go (2 hunks)
  • x/mint/keeper/keeper.go (5 hunks)
  • x/mint/keeper/keeper_test.go (3 hunks)
  • x/mint/module.go (5 hunks)
  • x/mint/simulation/genesis_test.go (1 hunks)
  • x/mint/testutil/expected_keepers_mocks.go (1 hunks)
  • x/mint/types/expected_keepers.go (1 hunks)
  • x/mint/types/genesis.go (1 hunks)
  • x/mint/types/minter.go (3 hunks)
Files skipped from review as they are similar to previous changes (8)
  • x/mint/depinject.go
  • x/mint/keeper/genesis_test.go
  • x/mint/keeper/grpc_query_test.go
  • x/mint/keeper/keeper.go
  • x/mint/module.go
  • x/mint/types/expected_keepers.go
  • x/mint/types/genesis.go
  • x/mint/types/minter.go
Additional Context Used
Path-based Instructions (4)
x/mint/keeper/keeper_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/mint/simulation/genesis_test.go (2)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

x/mint/testutil/expected_keepers_mocks.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

x/mint/README.md (1)

Pattern **/*.md: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"

Additional comments not posted (9)
x/mint/keeper/keeper_test.go (2)

30-33: Initialization of mintKeeper, ctx, msgServer, and bankKeeper looks good.


50-61: The TestAliasFunctions function correctly sets up expectations and verifies the behavior of the alias functions.

x/mint/simulation/genesis_test.go (2)

Line range hint 17-37: The TestRandomizedGenState function correctly initializes the simulation state and verifies the genesis state parameters.


Line range hint 40-57: The TestRandomizedGenState1 function correctly sets up scenarios that should panic and verifies the panic messages.

x/mint/testutil/expected_keepers_mocks.go (2)

Line range hint 10-41: The MockAccountKeeper struct and methods correctly simulate the behavior of the AccountKeeper interface.


Line range hint 43-79: The MockBankKeeper struct and methods correctly simulate the behavior of the BankKeeper interface.

x/mint/README.md (3)

74-78: The description of LastReductionEpoch is clear and concise.


80-97: The Begin-Epoch section provides a clear explanation of the epoch-based minting mechanism.


156-174: The descriptions and examples of the new query commands are clear and well-documented.

x/mint/README.md Show resolved Hide resolved
x/mint/README.md Show resolved Hide resolved
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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2d68436 and e1c9be5.
Files selected for processing (2)
  • simapp/app.go (3 hunks)
  • tests/integration/example/example_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • simapp/app.go
Additional Context Used
Path-based Instructions (1)
tests/integration/example/example_test.go (3)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.


Pattern tests/**/*: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"


Pattern **/*_test.go: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"

Additional comments not posted (1)
tests/integration/example/example_test.go (1)

69-70: Ensure mintKeeper initialization includes all necessary dependencies.

The mintKeeper initialization should include all required dependencies, such as the EpochsKeeper, if applicable. Verify that the EpochsKeeper is correctly integrated if it is part of the new epoch-based minting mechanism.

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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between e1c9be5 and 2c97872.
Files selected for processing (5)
  • simapp/app.go (4 hunks)
  • x/mint/autocli.go (1 hunks)
  • x/mint/keeper/grpc_query.go (3 hunks)
  • x/mint/proto/cosmos/mint/v1beta1/mint.proto (2 hunks)
  • x/mint/proto/cosmos/mint/v1beta1/query.proto (3 hunks)
Files skipped from review as they are similar to previous changes (5)
  • simapp/app.go
  • x/mint/autocli.go
  • x/mint/keeper/grpc_query.go
  • x/mint/proto/cosmos/mint/v1beta1/mint.proto
  • x/mint/proto/cosmos/mint/v1beta1/query.proto

@@ -473,7 +477,7 @@ func NewSimApp(
// CanWithdrawInvariant invariant.
// NOTE: staking module is required if HistoricalEntries param > 0
app.ModuleManager.SetOrderBeginBlockers(
minttypes.ModuleName,
// minttypes.ModuleName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// minttypes.ModuleName,

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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 2c97872 and 0efb8b3.
Files ignored due to path filters (3)
  • api/cosmos/mint/v1beta1/query_grpc.pb.go is excluded by !**/*.pb.go
  • x/mint/types/mint.pb.go is excluded by !**/*.pb.go
  • x/mint/types/query.pb.go is excluded by !**/*.pb.go
Files selected for processing (3)
  • api/cosmos/mint/v1beta1/mint.pulsar.go (28 hunks)
  • api/cosmos/mint/v1beta1/query.pulsar.go (45 hunks)
  • x/mint/proto/cosmos/mint/v1beta1/mint.proto (2 hunks)
Files not summarized due to errors (2)
  • api/cosmos/mint/v1beta1/mint.pulsar.go: Error: Message exceeds token limit
  • api/cosmos/mint/v1beta1/query.pulsar.go: Error: Message exceeds token limit
Files skipped from review as they are similar to previous changes (1)
  • x/mint/proto/cosmos/mint/v1beta1/mint.proto
Additional Context Used
Path-based Instructions (2)
api/cosmos/mint/v1beta1/mint.pulsar.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

api/cosmos/mint/v1beta1/query.pulsar.go (1)

Pattern **/*.go: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.

Additional comments not posted (16)
api/cosmos/mint/v1beta1/mint.pulsar.go (6)

22-22: New field descriptor fd_Minter_epoch_provisions added for epoch_provisions in the Minter struct.


30-30: Initialization of the new field descriptor fd_Minter_epoch_provisions is correctly placed.


110-115: Handling of the new epoch_provisions field in the Range method is correctly implemented.


135-136: Handling of the new epoch_provisions field in the Has method is correctly implemented.


157-158: Handling of the new epoch_provisions field in the Clear method is correctly implemented.


181-183: Handling of the new epoch_provisions field in the Get method is correctly implemented.

api/cosmos/mint/v1beta1/query.pulsar.go (10)

1242-1243: LGTM! The Range function correctly iterates over the fields and calls the provided function f.


1264-1264: LGTM! The Has function correctly checks if the field is populated.


1282-1282: LGTM! The Clear function correctly clears the value of the field.


1301-1301: LGTM! The Get function correctly retrieves the value of the field.


1323-1323: LGTM! The Set function correctly sets the value of the field.


1360-1360: LGTM! The NewField function correctly returns a new value assignable to the field.


Line range hint 1523-1574: LGTM! The Unmarshal function correctly unmarshals data into the message.


1599-1601: LGTM! The ProtoReflect function correctly returns the message reflection interface.


1659-1660: LGTM! The Range function correctly iterates over the fields and calls the provided function f.


1674-1681: LGTM! The Has function correctly checks if the field is populated.

}

// mint coins, update supply
mintedCoin := minter.EpochProvision(params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this calculated? it should still be a function of how much is staked no? this change might be too fundamental for chains to adopt. Also it changes an economic design. We should reconsider this change and possibly revert it

Comment on lines 76 to 87
// StakingTokenSupply implements an alias call to the underlying staking keeper's
// StakingTokenSupply to be used in BeginBlocker.
func (k Keeper) StakingTokenSupply(ctx context.Context) (math.Int, error) {
return k.stakingKeeper.StakingTokenSupply(ctx)
}

// BondedRatio implements an alias call to the underlying staking keeper's
// BondedRatio to be used in BeginBlocker.
func (k Keeper) BondedRatio(ctx context.Context) (math.LegacyDec, error) {
return k.stakingKeeper.BondedRatio(ctx)
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this removed? minting should still be a function of some supply

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

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0efb8b3 and 8d1a9a3.
Files selected for processing (8)
  • simapp/app.go (3 hunks)
  • x/mint/depinject.go (2 hunks)
  • x/mint/keeper/genesis_test.go (2 hunks)
  • x/mint/keeper/grpc_query_test.go (1 hunks)
  • x/mint/keeper/hooks.go (1 hunks)
  • x/mint/keeper/keeper.go (5 hunks)
  • x/mint/keeper/keeper_test.go (1 hunks)
  • x/mint/types/minter.go (4 hunks)
Files skipped from review as they are similar to previous changes (8)
  • simapp/app.go
  • x/mint/depinject.go
  • x/mint/keeper/genesis_test.go
  • x/mint/keeper/grpc_query_test.go
  • x/mint/keeper/hooks.go
  • x/mint/keeper/keeper.go
  • x/mint/keeper/keeper_test.go
  • x/mint/types/minter.go

@tac0turtle
Copy link
Member

closing in favour of #20363 for now. We may come back to this if needed

@tac0turtle tac0turtle closed this Jun 6, 2024
@tac0turtle tac0turtle deleted the likhita/mint-issuance branch September 17, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

x/mint: Migrate away from blocks influencing issuance to use epochs
4 participants