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

chore: extract improvements from #21497 #21506

Merged
merged 3 commits into from
Sep 4, 2024
Merged

chore: extract improvements from #21497 #21506

merged 3 commits into from
Sep 4, 2024

Conversation

julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Sep 2, 2024

Description

ref #21497 (comment)


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, you can find examples of the prefixes below:
  • 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.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

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

  • Documentation Updates

    • Enhanced clarity on module management and version upgrades in the Cosmos SDK.
    • Removed references to the GRPC-WEB embedded client; users are directed to use the Envoy proxy.
    • Updated migration paths and module requirements for better user guidance.
    • Clarified management of consensus parameters within the BaseApp documentation.
  • New Features

    • Introduced the x/protocolpool module for handling community pool funds.
  • Chores

    • Removed outdated comments and annotations to streamline documentation and code clarity.

@julienrbrt julienrbrt added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Sep 2, 2024
Copy link
Contributor

coderabbitai bot commented Sep 2, 2024

Walkthrough

Walkthrough

The changes introduce significant updates to the Cosmos SDK documentation and codebase, including the removal of the GRPC-WEB embedded client, the introduction of the x/protocolpool module, and modifications to module management with separate go.mod files. Additionally, the Gov module's proposal handler has been updated for compatibility with server/v2, and several comments have been added to indicate future removals of certain parameters and methods.

Changes

Files Change Summary
UPGRADING.md Updated documentation on GRPC, module management, versioning for migrations, and removal of the Crisis module. Emphasized the need for the new x/protocolpool.
docs/learn/advanced/00-baseapp.md Clarified the module managing consensus parameters, updating the reference from x/consensus_params to x/consensus.
server/v2/cometbft/abci.go Modified NewConsensus function signature, annotating consensusAuthority for future removal.
server/v2/types.go Annotated GetConsensusAuthority() method in AppI interface for future removal.
simapp/v2/app_config.go Added entries for accounts module and store key in configuration; noted potential future removal of hardcoded authority string.
x/distribution/keeper/abci.go Removed a TODO comment from the BeginBlocker function regarding context.Context usage.

Possibly related issues


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.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

@github-actions github-actions bot added C:x/distribution distribution module related C:server/v2 Issues related to server/v2 C:server/v2 cometbft labels Sep 2, 2024
@julienrbrt julienrbrt changed the title chore :extract improvements from #21497 chore: extract improvements from #21497 Sep 2, 2024
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

Outside diff range, codebase verification and nitpick comments (2)
simapp/v2/app_config.go (1)

267-267: LGTM!

The code change is approved. The comment serves as a useful TODO to remove the hardcoded Authority value in the future.

Consider creating a GitHub issue to track the removal of the hardcoded Authority value, ensuring that it is not forgotten in future development.

UPGRADING.md (1)

404-404: Consider using "before" instead of "prior to" for conciseness.

The static analysis tool LanguageTool correctly points out that "prior to" can be wordy. Using "before" is a more concise alternative that maintains the same meaning:

- It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any module migrations.
+ It is required to migrate to v0.50 before upgrading to v0.52 to avoid missing any module migrations.
Tools
LanguageTool

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 496cd0d and d72bde6.

Files selected for processing (6)
  • UPGRADING.md (5 hunks)
  • docs/learn/advanced/00-baseapp.md (1 hunks)
  • server/v2/cometbft/abci.go (1 hunks)
  • server/v2/types.go (1 hunks)
  • simapp/v2/app_config.go (2 hunks)
  • x/distribution/keeper/abci.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • docs/learn/advanced/00-baseapp.md
  • x/distribution/keeper/abci.go
Additional context used
Path-based instructions (4)
server/v2/types.go (1)

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

simapp/v2/app_config.go (1)

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

server/v2/cometbft/abci.go (1)

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

UPGRADING.md (1)

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

LanguageTool
UPGRADING.md

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

Additional comments not posted (2)
server/v2/types.go (1)

19-19: Verify the reason and timeline for removing the GetConsensusAuthority method.

The comment indicates a plan to remove this method in the future. Please ensure that:

  • The reason for the removal is clearly documented and communicated to the relevant stakeholders.
  • A timeline for the removal is established, considering the impact on the implementations of the AppI interface.
  • A tracking issue is created to plan and execute the removal.

To verify the reason for the planned removal, run the following script:

simapp/v2/app_config.go (1)

141-144: LGTM!

The code changes are approved. The new entry for the accounts module is correctly added to the OverrideStoreKeys configuration, specifying the ModuleName and KvStoreKey using the constants from the accounts package.

@@ -67,7 +67,7 @@ type Consensus[T transaction.Tx] struct {
func NewConsensus[T transaction.Tx](
logger log.Logger,
appName string,
consensusAuthority string,
consensusAuthority string, // TODO remove
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure all references to consensusAuthority are removed when removing the parameter.

The TODO comment indicates the intention to remove the consensusAuthority parameter in the future. When doing so, please make sure to:

  • Update the NewConsensus function body to remove any references to consensusAuthority.
  • Update any code that invokes NewConsensus to remove the consensusAuthority argument.

Consider creating a GitHub issue to track the removal of the consensusAuthority parameter and link it to the TODO comment.

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

Outside diff range, codebase verification and nitpick comments (4)
server/v2/cometbft/abci.go (1)

70-70: TODO comment indicates future removal of consensusAuthority parameter.

The comment serves as a proactive flag for potential refactoring or removal of the consensusAuthority parameter in subsequent updates. The current implementation remains unaffected.

Consider creating a GitHub issue to track the removal of the consensusAuthority parameter, ensuring it is addressed in a future update. This will help maintain a cleaner function signature and improve code clarity.

UPGRADING.md (3)

404-404: LGTM with a minor suggestion

The migration instructions are clear and accurate. Just a minor suggestion - consider replacing "prior to" with "before" for more concise phrasing. For example:

"It is required to migrate to v0.50 before upgrading to v0.52 to avoid missing any module migrations."

But this is just a minor refinement suggestion, feel free to ignore it if you prefer the current phrasing.

Tools
LanguageTool

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)


447-447: More details needed

The migration instruction to add the new x/protocolpool module for chains using x/distribution is important. However, it would be helpful to include more details or a code example showing how to add this new module to the existing app.

Could you please expand this section with the necessary steps or code changes required to properly add the x/protocolpool module?


458-458: Code example needed

The introduction of the new x/protocolpool module to handle community pool funds is clearly explained. However, a code example demonstrating how to add the x/protocolpool store during the upgrade to v0.52.x would be very helpful.

Could you please include a code snippet showing the necessary store upgrades to add the x/protocolpool store?

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 496cd0d and d72bde6.

Files selected for processing (6)
  • UPGRADING.md (5 hunks)
  • docs/learn/advanced/00-baseapp.md (1 hunks)
  • server/v2/cometbft/abci.go (1 hunks)
  • server/v2/types.go (1 hunks)
  • simapp/v2/app_config.go (2 hunks)
  • x/distribution/keeper/abci.go (1 hunks)
Files skipped from review due to trivial changes (2)
  • docs/learn/advanced/00-baseapp.md
  • x/distribution/keeper/abci.go
Additional context used
Path-based instructions (4)
server/v2/types.go (1)

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

simapp/v2/app_config.go (1)

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

server/v2/cometbft/abci.go (1)

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

UPGRADING.md (1)

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

LanguageTool
UPGRADING.md

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

Additional comments not posted (6)
simapp/v2/app_config.go (2)

141-144: LGTM!

The code changes are approved. The accounts module is correctly added to the application's configuration with the appropriate module name and store key.


267-267: Acknowledged the TODO comment.

The comment indicates a plan to remove the hardcoded Authority string for the consensus module configuration in the future. This doesn't introduce any immediate issues but serves as a reminder for a future cleanup.

UPGRADING.md (4)

109-109: LGTM!

The migration instructions for updating Tendermint imports to CometBFT look good.


350-351: LGTM!

The migration instructions for updating module import paths look good.


443-443: LGTM!

The removal of the unsupported x/crisis module is clearly documented.


Line range hint 475-481: Excellent!

Thank you for adding the code example demonstrating how to include the x/protocolpool store during the upgrade to v0.52.x. This is exactly what was needed to provide clarity on the upgrade process.

@@ -16,7 +16,7 @@ type AppI[T transaction.Tx] interface {
Name() string
InterfaceRegistry() server.InterfaceRegistry
GetAppManager() *appmanager.AppManager[T]
GetConsensusAuthority() string
GetConsensusAuthority() string // TODO remove
Copy link
Contributor

Choose a reason for hiding this comment

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

Acknowledge the TODO comment for removing the GetConsensusAuthority method.

The comment // TODO remove indicates a future intention to remove the GetConsensusAuthority method from the AppI interface. This change suggests a potential shift in the design or functionality of the interface, indicating that the method may no longer be necessary or relevant in future iterations of the codebase.

Consider creating a GitHub issue to track the removal of the GetConsensusAuthority method. This will help ensure that the removal is properly planned and executed in a future update. Do you want me to open a GitHub issue for this?

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: 3

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d72bde6 and 4022ac6.

Files selected for processing (1)
  • UPGRADING.md (5 hunks)
Additional context used
Path-based instructions (1)
UPGRADING.md (1)

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

LanguageTool
UPGRADING.md

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

Additional comments not posted (3)
UPGRADING.md (3)

109-109: LGTM!

The change from github.com/tendermint/tendermint to github.com/cometbft/cometbft is approved as part of the CometBFT migration.


350-351: Important: Update module imports!

All modules (except auth) now have their own go.mod file. Make sure to replace their imports with cosmossdk.io/x/{moduleName} across your codebase.


Line range hint 475-480: Looks good!

The provided code example for adding the x/protocolpool store during an upgrade to v0.52.x is correct and helpful.

### `x/crsis`

The Crisis module was removed due to it not being supported or functional any longer.
The `x/crisis` module was removed due to it not being supported or functional any longer.
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 3, 2024

Choose a reason for hiding this comment

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

Action Required: Remove x/crisis module usage

The x/crisis module has been removed as it is no longer supported. If your application is using this module, make sure to remove it before upgrading to this version.

Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `x/crisis` module was removed due to it not being supported or functional any longer.
The `x/crisis` module was removed due to it's not being supported or functional any longer.

Copy link
Contributor

Choose a reason for hiding this comment

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

@akhilkumarpilli, the original sentence is grammatically correct. The phrase "it's" is a contraction of "it is" or "it has," which doesn't fit the context here. The correct possessive form is "its," so the original sentence should remain as is.

#### `x/group`

Group was spun out into its own `go.mod`. To import it use `cosmossdk.io/x/group`
Existing chains using `x/distribution` module must add the new `x/protocolpool` module.
Copy link
Contributor

Choose a reason for hiding this comment

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

Required: Add x/protocolpool module

If your chain is using the x/distribution module, you must add the new x/protocolpool module when upgrading to this version.

#### `x/protocolpool`

Introducing a new `x/protocolpool` module to handle community pool funds. Its store must be added while upgrading to v0.51.x.
Introducing a new `x/protocolpool` module to handle community pool funds. Its store must be added while upgrading to v0.52.x.
Copy link
Contributor

Choose a reason for hiding this comment

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

Required: Add x/protocolpool store during upgrade

When upgrading to v0.52.x, make sure to add the x/protocolpool store as part of the upgrade process.

Copy link
Contributor

@akhilkumarpilli akhilkumarpilli left a comment

Choose a reason for hiding this comment

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

lgtm, small nits

UPGRADING.md Outdated Show resolved Hide resolved
### `x/crsis`

The Crisis module was removed due to it not being supported or functional any longer.
The `x/crisis` module was removed due to it not being supported or functional any longer.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
The `x/crisis` module was removed due to it not being supported or functional any longer.
The `x/crisis` module was removed due to it's not being supported or functional any longer.

Co-authored-by: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com>
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 4022ac6 and b246ea0.

Files selected for processing (1)
  • UPGRADING.md (5 hunks)
Additional context used
Path-based instructions (1)
UPGRADING.md (1)

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

LanguageTool
UPGRADING.md

[style] ~404-~404: ‘prior to’ might be wordy. Consider a shorter alternative.
Context: ...ved. It is required to migrate to v0.50 prior to upgrading to v0.52 for not missing any ...

(EN_WORDINESS_PREMIUM_PRIOR_TO)

Additional comments not posted (4)
UPGRADING.md (4)

109-109: LGTM!

The code changes are approved.


350-351: LGTM!

The code changes are approved.


441-443: LGTM!

The code changes are approved.


Line range hint 475-483: LGTM!

The example for adding the x/protocolpool store while upgrading to v0.52.x looks good.

@julienrbrt julienrbrt added this pull request to the merge queue Sep 4, 2024
Merged via the queue into main with commit 6ffa71a Sep 4, 2024
75 of 76 checks passed
@julienrbrt julienrbrt deleted the julien/chores branch September 4, 2024 11:03
mergify bot pushed a commit that referenced this pull request Sep 4, 2024
Co-authored-by: Akhil Kumar P <36399231+akhilkumarpilli@users.noreply.github.com>
(cherry picked from commit 6ffa71a)

# Conflicts:
#	server/v2/types.go
julienrbrt added a commit that referenced this pull request Sep 4, 2024
Co-authored-by: Julien Robert <julien@rbrt.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release C:server/v2 cometbft C:server/v2 Issues related to server/v2 C:x/distribution distribution module related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants