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: remove UNFORKINGTODOs #8592

Merged
merged 3 commits into from
Aug 8, 2024
Merged

chore: remove UNFORKINGTODOs #8592

merged 3 commits into from
Aug 8, 2024

Conversation

PaddyMc
Copy link
Collaborator

@PaddyMc PaddyMc commented Aug 5, 2024

What is the purpose of the change

In preparation for the v0.50 upgrade we left some UNFORKINGTODO around the code base to verify some functionality, this PR removes and an answers a few of those questions.

Copy link
Contributor

coderabbitai bot commented Aug 5, 2024

Walkthrough

The recent changes involve a comprehensive refactoring aimed at enhancing clarity, simplifying the codebase, and improving module management within the application. Key modifications include the removal of outdated comments, adjustments to module order during initialization, and streamlining transaction command handling. These adjustments not only refine the application's architecture but also contribute to improved maintainability and efficiency, all while preserving essential functionality.

Changes

Files Change Summary
ante/sendblock.go Removed outdated comments regarding the GetSigners function, simplifying the CheckIfBlocked method.
app/app.go, app/modules.go Updated module management in NewOsmosisApp; removed legacy proposal handler comments; adjusted module order in orderBeginBlockers.
app/encoding.go Eliminated commented-out TODO for legacy Amino codec registration, maintaining the core encoding functionality.
cmd/osmosisd/cmd/root.go Simplified txCommand function by removing the moduleBasics parameter, indicating a shift in command management.

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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration 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.

@github-actions github-actions bot added the C:app-wiring Changes to the app folder label Aug 5, 2024
@@ -221,7 +221,7 @@ func orderBeginBlockers(allModuleNames []string) []string {
// Epochs must come before staking, because txfees epoch hook sends fees to the auth "fee collector"
// module account, which is then distributed to stakers. If staking comes before epochs, then the
// funds will not be distributed to stakers as expected.
ord.FirstElements(upgradetypes.ModuleName, epochstypes.ModuleName, capabilitytypes.ModuleName)
Copy link
Member

Choose a reason for hiding this comment

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

Did it say to do this somewhere?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/cosmos/cosmos-sdk/blob/main/UPGRADING.md#set-preblocker

Yeah it did, but it's failing e2e, I think we may need to keep it the way it is 😕

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

e2e was failing on the cli not this

@@ -924,8 +923,6 @@ func txCommand(moduleBasics module.BasicManager) *cobra.Command {
authcmd.GetDecodeCommand(),
)

// UNFORKING v2 TODO: Auto CLI claims we can remove this, but if we do, then the legacy proposal sub commands will not be available.
Copy link
Member

Choose a reason for hiding this comment

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

Did you confirm the legacy proposal sub commands still show?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

λ ghost osmosis → λ git chore/unforking-todos* → make install
Go version: 1.22
GOWORK=off go install -mod=readonly -tags "netgo ledger" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=osmosis -X github.com/cosmos/cosmos-sdk/version.AppName=osmosisd -X github.com/cosmos/cosmos-sdk/version.Version=adam/sqs-v26-testing-68-g985a6ede8 -X github.com/cosmos/cosmos-sdk/version.Commit=985a6ede848f2cc1048ba92ddf180eee222ed637 -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger" -w -s' -trimpath github.com/osmosis-labs/osmosis/v25/cmd/osmosisd

λ ghost osmosis → λ git chore/unforking-todos* → osmosisd tx gov submit-legacy-proposal --help
Submit a legacy proposal along with an initial deposit.
Proposal title, description, type and deposit can be given directly or through a proposal JSON file.

Example:
$ osmosisd tx gov submit-legacy-proposal --proposal="path/to/proposal.json" --from mykey

Was there another command that you noticed missing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah soz, yeah they're missing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Can you find these commands in the v25.x release line? 😕

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Did you confirm the legacy proposal sub commands still show?

I'm struggling here a little, can you add one that I can copy/pasta?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This also makes e2e fail 😢

Copy link
Member

Choose a reason for hiding this comment

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

Do osmosisd q gov submit-legacy-proposal -h and you will see these Available Commands either missing or present:

Available Commands:
  cancel-software-upgrade                    Cancel the current software upgrade proposal
  create-cl-pool-and-cfmm-link               Submit a create clpool and link to cfmm proposal
  create-concentratedliquidity-pool-proposal Submit a create concentrated liquidity pool proposal
  create-groups-proposal                     Submit a create groups proposal
  denom-pair-taker-fee-proposal              Submit a denom pair taker fee proposal
  ibc-upgrade                                Submit an IBC upgrade proposal
  migrate-cw-pool-contracts                  Submit a migrate cw pool contracts proposal
  param-change                               Submit a parameter change proposal
  remove-superfluid-assets-proposal          Submit a superfluid asset remove proposal
  replace-migration-records-proposal         Submit a replace migration record proposal
  replace-pool-incentives                    Submit a full replacement to the records for pool incentives
  set-scaling-factor-controller-proposal     Submit a set scaling factor controller proposal
  set-superfluid-assets-proposal             Submit a superfluid asset set proposal
  software-upgrade                           Submit a software upgrade proposal
  tick-spacing-decrease-proposal             Submit a tick spacing decrease proposal
  update-client                              Submit an update IBC client proposal
  update-fee-token                           Submit a update fee token record proposal
  update-migration-records-proposal          Submit a update migration record proposal
  update-pool-incentives                     Submit an update to the records for pool incentives
  update-unpool-whitelist                    Update unpool whitelist proposal
  upload-code-id-and-whitelist               Submit an upload code id and whitelist proposal

Copy link
Member

Choose a reason for hiding this comment

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

It fails because e2e uses these legacy commands, I have an issue to move away from legacy but alas no time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah ye, they are missing, I've added them back now, the issue we have now is now some commands are doubled, but only the commands with:

λ ghost osmosis → λ git chore/unforking-todos → osmosisd tx | grep - 
  ibc-transfer           IBC fungible token transfer transaction subcommands
  ibc-transfer           IBC fungible token transfer transaction subcommands
  ibc-wasm               IBC wasm manager module transaction subcommands
  ibc-wasm               IBC wasm manager module transaction subcommands
  interchain-accounts    IBC interchain accounts transaction subcommands
  interchain-accounts    IBC interchain accounts transaction subcommands

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

#8599

I created this issue to track, should we merge this and deal with that issue in a vacuum

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

Outside diff range, codebase verification and nitpick comments (1)
cmd/osmosisd/cmd/root.go (1)

Potential issue with legacy proposal subcommands

The submit-legacy-proposal subcommand is not found in the NewRootCmd function. This might indicate that it has been removed or was never implemented. Please verify if this is intentional or if it needs to be re-added.

  • File: cmd/osmosisd/cmd/root.go
  • Function: NewRootCmd
Analysis chain

Line range hint 427-427: Confirm legacy proposal subcommands.

Ensure that the legacy proposal subcommands are still available and functional after the removal of the UNFORKINGTODO comments.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the legacy proposal subcommands are available.

# Test: Check the help output for legacy proposal subcommands.
osmosisd tx gov submit-legacy-proposal --help

Length of output: 123


Script:

#!/bin/bash
# Search for the definition of the NewRootCmd function in the cmd/osmosisd/cmd/root.go file
ast-grep --lang go --pattern 'func NewRootCmd() $_' 

# Search for the registration of legacy proposal subcommands within the NewRootCmd function
ast-grep --lang go --pattern '$_ := &cobra.Command{
  Use:   "tx",
  Short: "Transactions subcommands",
  $$$
}
$_ := &cobra.Command{
  Use:   "gov",
  Short: "Governance subcommands",
  $$$
}
$_ := &cobra.Command{
  Use:   "submit-legacy-proposal",
  Short: "Submit a legacy proposal",
  $$$
}' 

Length of output: 10457


Script:

#!/bin/bash
# Search for the registration of the `tx` subcommand within the NewRootCmd function
ast-grep --lang go --pattern '$_ := &cobra.Command{
  Use:   "tx",
  Short: "Transactions subcommands",
  $$$
}' cmd/osmosisd/cmd/root.go

# Search for the registration of the `gov` subcommand within the NewRootCmd function
ast-grep --lang go --pattern '$_ := &cobra.Command{
  Use:   "gov",
  Short: "Governance subcommands",
  $$$
}' cmd/osmosisd/cmd/root.go

# Search for the registration of the `submit-legacy-proposal` subcommand within the NewRootCmd function
ast-grep --lang go --pattern '$_ := &cobra.Command{
  Use:   "submit-legacy-proposal",
  Short: "Submit a legacy proposal",
  $$$
}' cmd/osmosisd/cmd/root.go

Length of output: 36765

@PaddyMc PaddyMc force-pushed the chore/unforking-todos branch 2 times, most recently from df639c4 to aa936b3 Compare August 6, 2024 11:23
@PaddyMc PaddyMc added A:no-changelog V:state/compatible/no_backport State machine compatible PR, depends on prior breaks labels Aug 6, 2024
@PaddyMc PaddyMc merged commit 977929f into main Aug 8, 2024
1 check passed
@PaddyMc PaddyMc deleted the chore/unforking-todos branch August 8, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:no-changelog C:app-wiring Changes to the app folder V:state/compatible/no_backport State machine compatible PR, depends on prior breaks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants