-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
chore: reduce default inflation #20606
Conversation
Warning Rate limit exceeded@tac0turtle has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 34 minutes and 39 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. WalkthroughThe changes primarily involve refining encoding processes and updating inflation rate calculations. Specifically, encoding clarifications for Changes
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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
Files selected for processing (5)
- orm/encoding/ormfield/duration.go (1 hunks)
- orm/encoding/ormfield/timestamp.go (1 hunks)
- x/mint/README.md (1 hunks)
- x/mint/types/minter_test.go (1 hunks)
- x/mint/types/params.go (1 hunks)
Files skipped from review due to trivial changes (2)
- orm/encoding/ormfield/duration.go
- orm/encoding/ormfield/timestamp.go
Additional context used
Path-based instructions (3)
x/mint/types/minter_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/types/params.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"
LanguageTool
x/mint/README.md
[typographical] ~98-~98: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (HOWEVER_SENTENCE)
Context: ...e possible is defined to be 13% per year, however, the annual inflation is capped as betwe...
Markdownlint
x/mint/README.md
10-10: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
11-11: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
13-13: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
14-14: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
15-15: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
18-18: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
20-20: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
21-21: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
22-22: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
66-66: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
103-103: Column: 1 (MD010, no-hard-tabs)
Hard tabs
104-104: Column: 1 (MD010, no-hard-tabs)
Hard tabs
106-106: Column: 1 (MD010, no-hard-tabs)
Hard tabs
107-107: Column: 1 (MD010, no-hard-tabs)
Hard tabs
108-108: Column: 1 (MD010, no-hard-tabs)
Hard tabs
109-109: Column: 1 (MD010, no-hard-tabs)
Hard tabs
110-110: Column: 1 (MD010, no-hard-tabs)
Hard tabs
111-111: Column: 1 (MD010, no-hard-tabs)
Hard tabs
112-112: Column: 1 (MD010, no-hard-tabs)
Hard tabs
113-113: Column: 1 (MD010, no-hard-tabs)
Hard tabs
115-115: Column: 1 (MD010, no-hard-tabs)
Hard tabs
126-126: Column: 1 (MD010, no-hard-tabs)
Hard tabs
135-135: Column: 1 (MD010, no-hard-tabs)
Hard tabs
136-136: Column: 1 (MD010, no-hard-tabs)
Hard tabs
49-49: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
139-139: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
155-155: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
169-169: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
Additional comments not posted (3)
x/mint/types/minter_test.go (1)
26-26
: Ensure the test cases accurately reflect the new inflation parameters.The updated test cases correctly reflect the changes in inflation parameters from 7%-20% to 0%-5%. This is crucial for ensuring the system behaves as expected under the new settings.
Also applies to: 31-31, 37-37, 42-43, 46-47, 50-50
x/mint/types/params.go (1)
31-32
: Updated inflation parameters align with PR objectives.The changes to
InflationMax
andInflationMin
in theDefaultParams
function correctly implement the new desired range of 0%-5% for inflation, supporting the PR's goal of encouraging lower inflation rates.x/mint/README.md (1)
99-99
: Documentation accurately reflects the new inflation cap.The documentation update correctly states the new inflation cap of 0%-5%, aligning with the changes made in the codebase.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
There was a problem hiding this 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
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/mint/README.md (1 hunks)
Additional context used
Path-based instructions (1)
x/mint/README.md (1)
Pattern
**/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
LanguageTool
x/mint/README.md
[uncategorized] ~97-~97: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_OF)
Context: ...e desired ratio (67%). The maximum rate change possible is defined to be 5% per year, ...
[typographical] ~98-~98: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (HOWEVER_SENTENCE)
Context: ...ge possible is defined to be 5% per year, however, the annual inflation is capped between ...
Markdownlint
x/mint/README.md
10-10: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
11-11: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
13-13: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
14-14: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
15-15: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
18-18: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
20-20: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
21-21: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
22-22: Expected: 2; Actual: 4 (MD007, ul-indent)
Unordered list indentation
66-66: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
102-102: Column: 1 (MD010, no-hard-tabs)
Hard tabs
103-103: Column: 1 (MD010, no-hard-tabs)
Hard tabs
105-105: Column: 1 (MD010, no-hard-tabs)
Hard tabs
106-106: Column: 1 (MD010, no-hard-tabs)
Hard tabs
107-107: Column: 1 (MD010, no-hard-tabs)
Hard tabs
108-108: Column: 1 (MD010, no-hard-tabs)
Hard tabs
109-109: Column: 1 (MD010, no-hard-tabs)
Hard tabs
110-110: Column: 1 (MD010, no-hard-tabs)
Hard tabs
111-111: Column: 1 (MD010, no-hard-tabs)
Hard tabs
112-112: Column: 1 (MD010, no-hard-tabs)
Hard tabs
114-114: Column: 1 (MD010, no-hard-tabs)
Hard tabs
125-125: Column: 1 (MD010, no-hard-tabs)
Hard tabs
134-134: Column: 1 (MD010, no-hard-tabs)
Hard tabs
135-135: Column: 1 (MD010, no-hard-tabs)
Hard tabs
49-49: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
138-138: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
154-154: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
168-168: Expected: 1; Actual: 2 (MD012, no-multiple-blanks)
Multiple consecutive blank lines
@@ -95,8 +95,7 @@ type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, | |||
The target annual inflation rate is recalculated each block. | |||
The inflation is also subject to a rate change (positive or negative) | |||
depending on the distance from the desired ratio (67%). The maximum rate change | |||
possible is defined to be 13% per year, however, the annual inflation is capped | |||
as between 7% and 20%. | |||
possible is defined to be 5% per year, however, the annual inflation is capped between 0% and 5%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct the grammatical structure around "however".
- possible is defined to be 5% per year, however, the annual inflation is capped between 0% and 5%.
+ possible is defined to be 5% per year; however, the annual inflation is capped between 0% and 5%.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
possible is defined to be 5% per year, however, the annual inflation is capped between 0% and 5%. | |
possible is defined to be 5% per year; however, the annual inflation is capped between 0% and 5%. |
Tools
LanguageTool
[typographical] ~98-~98: The word “however” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence. (HOWEVER_SENTENCE)
Context: ...ge possible is defined to be 5% per year, however, the annual inflation is capped between ...
There was a problem hiding this 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
Outside diff range and nitpick comments (1)
x/mint/types/minter_test.go (1)
26-26
: Update the comment to reflect the new inflation parameters.The comment mentions "0% bonded atom supply the inflation should increase by InflationRateChange," but it should explicitly reflect the new inflation parameters for clarity.
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (1)
- x/mint/types/minter_test.go (1 hunks)
Additional context used
Path-based instructions (1)
x/mint/types/minter_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"
Additional comments not posted (3)
x/mint/types/minter_test.go (3)
31-31
: Ensure test cases align with new inflation parameters.The test cases have been updated to reflect the new inflation parameters accurately. This includes the expected changes in inflation based on different bonded ratios. Good job on updating these to maintain test relevance with the new business logic.
Also applies to: 37-37, 42-42, 46-46, 50-50
43-43
: Check for potential edge cases in inflation calculations.#!/bin/bash # Description: Verify edge cases for inflation calculations. # Test: Search for additional test cases handling edge values. rg --type go 'NextInflationRate' x/mint/types/minter_test.goConsider adding more test cases to cover potential edge cases, especially where inflation might hit the exact boundary values of 0% and 5%.
47-47
: Verify the handling of large decimal values in inflation calculations.#!/bin/bash # Description: Verify handling of large decimal values. # Test: Search for handling of large decimals in inflation calculations. rg --type go 'math.LegacyNewDecWithPrec(499999999, 10)' x/mint/types/minter_test.goEnsure that the handling of large decimal values in inflation calculations is robust and does not introduce precision errors.
* main: refactor(x/auth): Fix system test (#20531) feat(crypto): add blst (#20296) docs: Update high level overview and introduction (#20535) refactor(x/core): remove test (#20624) feat(x/mint)!: Replace InflationCalculationFn with MintFn + simple epoch minting (#20363) docs: remove duplicate words (#20622) feat: prep for errors v2 (#20539) chore: reduce default inflation (#20606) refactor(store): add miss defer (#20602) chore: use comet api pkg instead of comet alias (#20614) chore: write gentx info to cmd.ErrOrStderr (#20616) docs: ADR 073: update to accepted and add to README.md (#20619) chore(proto): change future extracted modules version from v1.0.0 to v0.2.0 (#20600) fix: remove some duplicate words (#20605) feat(stf): port simappv2 changes (#20587) chore: bring patch changelogs to main (#20599)
Description
This pr is more of a nit. It reduces default mint parameters to 0-5%. chains should figure out what to set but they should aim for below 5% and seeing 5% may make them think that way
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...
!
in the type prefix if API or client breaking changeCHANGELOG.md
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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
Documentation
README.md
forx/mint
module to reflect new inflation range of 0%-5% and maximum annual rate change of 5%.Bug Fixes
google.protobuf.Duration
andgoogle.protobuf.Timestamp
values to ensure proper lexicographical order.Tests
x/mint/types/minter_test.go
for inflation calculations to align with new inflation ranges and bonded ratios.Refactor
x/mint/types/params.go
to new values:InflationMax
set to 5% andInflationMin
set to 0%.