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

refactor(sims)!: Remove Baseapp from sims #21039

Merged
merged 5 commits into from
Jul 24, 2024
Merged

refactor(sims)!: Remove Baseapp from sims #21039

merged 5 commits into from
Jul 24, 2024

Conversation

alpe
Copy link
Contributor

@alpe alpe commented Jul 23, 2024

Description

Breaking change to existing Sims in modules

  • Replace *baseapp.BaseApp with simtypes.AppEntrypoint interface:
	return func(
		r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string,
	) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {

with

	return func(
		r *rand.Rand, app simtypes.AppEntrypoint, ctx sdk.Context, accs []simtypes.Account, chainID string,
	) (simtypes.OperationMsg, []simtypes.FutureOperation, error) {
// import simtypes "github.com/cosmos/cosmos-sdk/types/simulation"
  • Deprecates MsgSimulatorFn in favour of MsgSimulatorFnX in types/simulation
  • Minor fix to staking params proposal sims

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

  • New Features

    • Enhanced simulation framework with a new application entry point interface.
    • Introduction of context-aware message simulator functions for improved flexibility.
  • Bug Fixes

    • Simplified command initialization by removing redundant parameters for better usability.
  • Chores

    • Updated repository structure by excluding unnecessary test files from version control.

Copy link
Contributor

coderabbitai bot commented Jul 23, 2024

Walkthrough

Walkthrough

This update introduces significant enhancements to the Cosmos SDK, primarily focusing on the simulation framework. Key changes include the introduction of the AppEntrypoint interface to replace Baseapp, simplification of command initialization by removing redundant parameters, and updates to function signatures across multiple modules to incorporate context.Context. These modifications aim to improve usability, maintainability, and flexibility within the SDK’s API.

Changes

Files Grouped Change Summary
.gitignore Added entry to ignore simapp/simapp.test files.
CHANGELOG.md Removed Baseapp from sims module; refined command initialization, simplifying several command structures.
types/simulation/types.go Introduced AppEntrypoint interface; updated WeightedProposalMsg and MsgSimulatorFn types.
x/auth/simulation/proposals.go Modified ProposalMsgs and SimulateMsgUpdateParams to include context.Context.
x/bank/simulation/proposals.go Updated function signatures to include context.Context; changed message simulator invocation.
x/distribution/simulation/proposals.go Renamed NewWeightedProposalMsg to NewWeightedProposalMsgX; added context.Context to SimulateMsgUpdateParams.
x/gov/simulation/proposals.go Changed SimulateTextProposal and ProposalMsgs to utilize context.Context.
x/mint/simulation/proposals.go Updated SimulateMsgUpdateParams to accept context.Context; modified ProposalMsgs.
x/protocolpool/simulation/proposals.go Altered SimulateMsgCommunityPoolSpend and ProposalMsgs to incorporate context.Context.
x/slashing/simulation/proposals.go Updated SimulateMsgUpdateParams to accept context.Context; changed proposal message handling.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Simulation
    participant AppEntrypoint

    User->>Simulation: Request simulation
    Simulation->>AppEntrypoint: Deliver simulation transaction
    AppEntrypoint-->>Simulation: Return simulation result
    Simulation-->>User: Provide simulation outcome
Loading

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

@alpe alpe changed the title Remove Baseapp from sims refactor (sims): Remove Baseapp from sims Jul 23, 2024
@alpe alpe changed the title refactor (sims): Remove Baseapp from sims refactor (sims)!: Remove Baseapp from sims Jul 23, 2024
@cosmos cosmos deleted a comment from github-actions bot Jul 23, 2024
@alpe alpe changed the title refactor (sims)!: Remove Baseapp from sims refactor(sims)!: Remove Baseapp from sims Jul 23, 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: 0

Outside diff range, codebase verification and nitpick comments (21)
x/staking/simulation/proposals.go (1)

44-44: Comment on MinCommissionRate or BondDenom changes.

The comment about MinCommissionRate or BondDenom creating issues for in-flight messages or state operations is crucial. Ensure this consideration is documented and communicated to developers.

x/feegrant/simulation/operations.go (1)

145-145: Update the function call to SimulateMsgRevokeAllowance in tests/sims/feegrant/operations_test.go.

The function call to SimulateMsgRevokeAllowance in tests/sims/feegrant/operations_test.go still uses app.BaseApp instead of the updated simtypes.AppEntrypoint. Please update the function call to match the new signature.

  • tests/sims/feegrant/operations_test.go line 10: operationMsg, futureOperations, err := op(r, app.BaseApp, ctx, accounts, "")
Analysis chain

Verify the function usage in the codebase.

Ensure that all function calls to SimulateMsgRevokeAllowance match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgRevokeAllowance` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgRevokeAllowance'

Length of output: 1893

x/authz/simulation/operations.go (2)

267-267: Mismatch in function signature usage

The function SimulateMsgExec has been updated to use simtypes.AppEntrypoint, but the following instances do not match the new signature:

  • x/group/simulation/operations_test.go
  • x/group/simulation/operations.go
  • x/authz/simulation/operations.go
  • tests/sims/authz/operations_test.go

Please update these instances to match the new function signature.

Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgExec match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgExec` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgExec'

Length of output: 3366


186-186: Function calls to SimulateMsgRevoke do not match the new signature.

The function calls to SimulateMsgRevoke still use the old signature. Please update the following locations to match the new signature with simtypes.AppEntrypoint:

  • x/authz/simulation/operations.go
  • tests/sims/authz/operations_test.go
Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgRevoke match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgRevoke` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgRevoke'

Length of output: 3205

x/bank/simulation/operations.go (2)

65-65: Ensure all calls to SimulateMsgSend match the new signature.

The code changes are approved, but there are still calls to SimulateMsgSend with the old signature in the following files:

  • x/bank/simulation/operations.go
  • tests/sims/bank/operations_test.go

Please update these calls to match the new function signature.

Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgSend match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgSend` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgSend'

Length of output: 4987


112-112: The function call to SimulateMsgSendToModuleAccount in the test file does not match the new signature.

Please update the function call in tests/sims/bank/operations_test.go to include the simtypes.AppEntrypoint parameter.

  • tests/sims/bank/operations_test.go: Line 10
Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgSendToModuleAccount match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgSendToModuleAccount` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgSendToModuleAccount'

Length of output: 1023


Script:

#!/bin/bash
# Description: Extract the relevant lines from the test file to verify the function call matches the new signature.

# Extract lines around the function call in the test file.
rg -A 10 -B 10 'SimulateMsgSendToModuleAccount' tests/sims/bank/operations_test.go

Length of output: 664

x/gov/simulation/operations.go (2)

503-503: Function signature mismatch detected!

The usage of operationSimulateMsgVoteWeighted does not match the new function signature. Ensure that all calls to this function are updated to match the new signature.

  • File: x/gov/simulation/operations.go
  • Line: 503
Analysis chain

LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to operationSimulateMsgVoteWeighted match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `operationSimulateMsgVoteWeighted` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'operationSimulateMsgVoteWeighted'

Length of output: 579


355-355: Update function calls to match the new signature.

The function calls to SimulateMsgDeposit need to be updated to match the new signature with simtypes.AppEntrypoint.

  • x/gov/simulation/operations.go: Update the function call at line 355.
  • tests/sims/gov/operations_test.go: Update the function call at line 355.
Analysis chain

LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgDeposit match the new signature.


Verify function usage matches the new signature.

The function signature change is approved. Ensure that all function calls to SimulateMsgDeposit match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgDeposit` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgDeposit'

Length of output: 1926


Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgDeposit` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 'SimulateMsgDeposit' | grep -E 'SimulateMsgDeposit\('

Length of output: 456

x/staking/simulation/operations.go (1)

126-126: Ensure that all function calls to SimulateMsgCreateValidator match the new signature.

The function calls in the following files need to be updated to match the new signature:

  • x/staking/simulation/operations.go
  • tests/integration/staking/simulation/operations_test.go
Analysis chain

LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgCreateValidator match the new signature.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCreateValidator` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgCreateValidator'

Length of output: 2382


Script:

#!/bin/bash
# Description: Verify the function calls to `SimulateMsgCreateValidator` match the new signature.

# Extract the lines where `SimulateMsgCreateValidator` is called in the identified files.
rg --type go -A 5 'SimulateMsgCreateValidator' x/staking/simulation/operations.go tests/integration/staking/simulation/operations_test.go

Length of output: 2473

x/group/simulation/operations.go (11)

252-252: Update test file to match new function signature

The test file x/group/simulation/operations_test.go still references suite.app.BaseApp instead of simtypes.AppEntrypoint. Please update the test cases to use the new interface.

  • File: x/group/simulation/operations_test.go
  • Lines:
    • operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "") (multiple occurrences)
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCreateGroup` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgCreateGroup'

Length of output: 4587


536-536: Inconsistent function signature for SimulateMsgUpdateGroupAdmin.

The function signature for SimulateMsgUpdateGroupAdmin in operations.go still uses *baseapp.BaseApp, whereas the test file operations_test.go uses the new simtypes.AppEntrypoint. Please update the function signature in operations.go to ensure consistency and compatibility.

  • operations.go: Update the function signature to use simtypes.AppEntrypoint.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupAdmin` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupAdmin'

Length of output: 1542


762-762: Inconsistent usage of the new interface in test file

The test file x/group/simulation/operations_test.go still uses suite.app.BaseApp instead of the updated simtypes.AppEntrypoint. Please update the test cases to ensure consistency with the new interface.

  • x/group/simulation/operations_test.go: Update suite.app.BaseApp to simtypes.AppEntrypoint.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupPolicyAdmin` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupPolicyAdmin'

Length of output: 1610


610-610: Update function call to match new signature.

The function call to SimulateMsgUpdateGroupMetadata in x/group/simulation/operations_test.go still uses suite.app.BaseApp. Please update it to use the new interface simtypes.AppEntrypoint.

  • x/group/simulation/operations_test.go: Replace suite.app.BaseApp with the appropriate implementation of simtypes.AppEntrypoint.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupMetadata` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupMetadata'

Length of output: 1559


971-971: Potential mismatch in function call signature in test file

The function SimulateMsgWithdrawProposal has been updated to use simtypes.AppEntrypoint, but the test file x/group/simulation/operations_test.go still uses suite.app.BaseApp. Please update the test file to match the new function signature.

  • x/group/simulation/operations_test.go: Update suite.app.BaseApp to use simtypes.AppEntrypoint.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgWithdrawProposal` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgWithdrawProposal'

Length of output: 1514


910-910: Update the test file to match the new function signature.

The function SimulateMsgUpdateGroupPolicyMetadata in operations_test.go still uses the old signature with suite.app.BaseApp. Please update the test file to ensure it matches the new function signature with simtypes.AppEntrypoint.

  • x/group/simulation/operations_test.go: Update the function call to use simtypes.AppEntrypoint instead of suite.app.BaseApp.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupPolicyMetadata` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupPolicyMetadata'

Length of output: 1592


377-377: Update function call to use the new interface.

The function call to SimulateMsgCreateGroupPolicy in x/group/simulation/operations_test.go still uses suite.app.BaseApp. Update this to use the new simtypes.AppEntrypoint interface to ensure consistency and compatibility.

  • File: x/group/simulation/operations_test.go
  • Lines:
    operationMsg, futureOperations, err := op(r, suite.app.BaseApp, suite.ctx, accounts, "")
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCreateGroupPolicy` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgCreateGroupPolicy'

Length of output: 1548


1200-1200: Update function calls to match the new signature.

The function calls to SimulateMsgExec still use the old signature with suite.app.BaseApp. Ensure all calls are updated to use simtypes.AppEntrypoint.

  • x/group/simulation/operations_test.go
  • tests/sims/authz/operations_test.go
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgExec` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgExec'

Length of output: 3366


1285-1285: Inconsistent function signature usage in test file.

The function SimulateMsgLeaveGroup has been updated to replace *baseapp.BaseApp with simtypes.AppEntrypoint. However, the test file x/group/simulation/operations_test.go still references suite.app.BaseApp. Please update the test file to match the new function signature.

  • x/group/simulation/operations_test.go
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgLeaveGroup` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgLeaveGroup'

Length of output: 1464


671-671: Update test cases to use the new interface simtypes.AppEntrypoint.

The test cases in operations_test.go still use suite.app.BaseApp instead of the new interface simtypes.AppEntrypoint. Ensure that all test cases are updated to match the new function signature.

  • x/group/simulation/operations_test.go: Multiple instances where suite.app.BaseApp is used.
Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.


Verify the usage of the new interface simtypes.AppEntrypoint in SimulateMsgUpdateGroupMembers and its test cases.

Ensure that simtypes.AppEntrypoint is correctly implemented and used in both the function and the test cases.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupMembers` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupMembers'

Length of output: 1564


Script:

#!/bin/bash
# Description: Verify the implementation and usage of `simtypes.AppEntrypoint`.

# Search for the definition of `simtypes.AppEntrypoint`.
rg --type go 'type AppEntrypoint' -A 5

# Verify if the test file `operations_test.go` has been updated to use `simtypes.AppEntrypoint`.
rg --type go 'suite.app.BaseApp' -A 5

Length of output: 18564


305-305: Verify the usage of the new interface.

The transition from *baseapp.BaseApp to simtypes.AppEntrypoint is incomplete. The following files still contain references to *baseapp.BaseApp:

  • x/group/simulation/operations_test.go
  • x/upgrade/types/storeloader_test.go
  • x/upgrade/keeper/keeper_test.go
  • x/upgrade/keeper/abci_test.go
  • x/staking/keeper/keeper_test.go
  • x/simulation/simulate.go
  • x/consensus/depinject.go
  • x/circuit/depinject.go
  • x/authz/keeper/genesis_test.go
  • x/authz/keeper/keeper_test.go
  • x/auth/tx/config/depinject.go
  • testutil/sims/tx_helpers.go
  • testutil/integration/router.go
  • tests/integration/bank/app_test.go
  • testutils/sims/runner.go
  • simapp/abci.go
  • server/util.go
  • simapp/sim_test.go
  • simapp/app_di.go
  • simapp/app.go
  • runtime/module.go
  • runtime/builder.go
  • runtime/app.go
  • baseapp/utils_test.go
  • baseapp/baseapp_test.go
  • baseapp/streaming_test.go
  • baseapp/abci_test.go

Please ensure that all instances of *baseapp.BaseApp are replaced with simtypes.AppEntrypoint to maintain consistency across the codebase.

Analysis chain

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.


Verify the usage of the new interface.

Ensure that all instances of *baseapp.BaseApp have been replaced with simtypes.AppEntrypoint in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCreateGroupWithPolicy` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgCreateGroupWithPolicy'

Length of output: 1484


Script:

#!/bin/bash
# Description: Verify all instances of `*baseapp.BaseApp` have been replaced with `simtypes.AppEntrypoint`.

# Test: Search for occurrences of `*baseapp.BaseApp`. Expect: No occurrences.
rg --type go '\*baseapp.BaseApp'

Length of output: 7821

CHANGELOG.md (1)

123-123: Surround lists with blank lines.

To improve readability and comply with markdown linting rules, ensure that lists are surrounded by blank lines.

-### API Breaking Changes
* (sims) [#21039](https://github.com/cosmos/cosmos-sdk/pull/21039): Remove Baseapp from sims by a new interface `simtypes.AppEntrypoint`
* (client) [#20976](https://github.com/cosmos/cosmos-sdk/pull/20976) Simplified command initialization by removing unnecessary parameters such as `txConfig` and `addressCodec`.
  * Remove parameter `txConfig` from `genutilcli.Commands`,`genutilcli.CommandsWithCustomMigrationMap`,`genutilcli.GenTxCmd`.
  * Remove parameter `addressCodec` from `genutilcli.GenTxCmd`,`genutilcli.AddGenesisAccountCmd`,`stakingcli.BuildCreateValidatorMsg`.
+  
Tools
Markdownlint

123-123: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2c236af and f2b03d6.

Files selected for processing (17)
  • .gitignore (1 hunks)
  • CHANGELOG.md (1 hunks)
  • types/simulation/types.go (4 hunks)
  • x/auth/simulation/proposals_test.go (1 hunks)
  • x/authz/simulation/operations.go (4 hunks)
  • x/bank/simulation/operations.go (7 hunks)
  • x/distribution/simulation/operations.go (4 hunks)
  • x/feegrant/simulation/operations.go (3 hunks)
  • x/gov/simulation/operations.go (9 hunks)
  • x/group/simulation/operations.go (15 hunks)
  • x/nft/simulation/operations.go (2 hunks)
  • x/protocolpool/simulation/operations.go (2 hunks)
  • x/simulation/params.go (3 hunks)
  • x/simulation/util.go (2 hunks)
  • x/slashing/simulation/operations.go (2 hunks)
  • x/staking/simulation/operations.go (8 hunks)
  • x/staking/simulation/proposals.go (2 hunks)
Files skipped from review due to trivial changes (1)
  • .gitignore
Additional context used
Path-based instructions (16)
x/auth/simulation/proposals_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/staking/simulation/proposals.go (1)

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

x/protocolpool/simulation/operations.go (1)

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

x/simulation/util.go (1)

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

x/nft/simulation/operations.go (1)

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

x/slashing/simulation/operations.go (1)

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

x/feegrant/simulation/operations.go (1)

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

types/simulation/types.go (1)

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

x/simulation/params.go (1)

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

x/distribution/simulation/operations.go (1)

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

x/authz/simulation/operations.go (1)

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

x/bank/simulation/operations.go (1)

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

x/gov/simulation/operations.go (1)

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

x/staking/simulation/operations.go (1)

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

x/group/simulation/operations.go (1)

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

CHANGELOG.md (1)

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

golangci-lint
types/simulation/types.go

50-50: File is not gofumpt-ed with -extra

(gofumpt)

Markdownlint
CHANGELOG.md

123-123: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Additional comments not posted (36)
x/auth/simulation/proposals_test.go (1)

35-35: Ensure the context is correctly initialized.

The addition of sdk.Context{} is crucial for the simulation. Verify that this context is correctly initialized and contains the necessary state for the simulation.

x/staking/simulation/proposals.go (1)

44-44: Verify the impact of removing random BondDenom generation.

The removal of the random generation for params.BondDenom might affect the variability in simulations. Ensure this change is intentional and does not negatively impact the simulation's effectiveness.

x/protocolpool/simulation/operations.go (1)

49-49: Ensure the correct usage of simtypes.AppEntrypoint.

The change from *baseapp.BaseApp to simtypes.AppEntrypoint needs to be verified for correct usage. Ensure that all necessary methods and properties are accessible through the new interface.

x/simulation/util.go (1)

67-67: Ensure correct usage of simtypes.AppEntrypoint.

The App field in the OperationInput struct has been changed from *baseapp.BaseApp to simtypes.AppEntrypoint. Ensure that all interactions with this field are compatible with the new type.

Verification successful

The usage of simtypes.AppEntrypoint is correct.

The App field in the OperationInput struct is correctly used with the simtypes.AppEntrypoint type, and the SimDeliver method is appropriately called.

  • x/simulation/util.go: Verified the usage of txCtx.App.SimDeliver.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `App` field in the `OperationInput` struct.

# Test: Search for the `App` field usage. Expect: Only occurances of the new type `simtypes.AppEntrypoint`.
rg --type go -A 5 $'OperationInput'

Length of output: 7745


Script:

#!/bin/bash
# Description: Verify the usage of the `App` field in the `OperationInput` struct with the new type `simtypes.AppEntrypoint`.

# Test: Search for the usage of the `App` field in the `OperationInput` struct.
rg --type go 'txCtx.App' -A 5

Length of output: 408


Script:

#!/bin/bash
# Description: Verify the definition and methods of `simtypes.AppEntrypoint`, specifically looking for the `SimDeliver` method.

# Test: Search for the definition of `simtypes.AppEntrypoint` and its methods.
rg --type go 'type AppEntrypoint' -A 10
rg --type go 'func (a AppEntrypoint)' -A 10

Length of output: 840

x/nft/simulation/operations.go (1)

63-63: Ensure correct usage of simtypes.AppEntrypoint.

The app parameter in the SimulateMsgSend function has been changed from *baseapp.BaseApp to simtypes.AppEntrypoint. Ensure that all interactions with this parameter are compatible with the new type.

x/slashing/simulation/operations.go (1)

61-61: Ensure correct usage of simtypes.AppEntrypoint.

The app parameter in the SimulateMsgUnjail function has been changed from *baseapp.BaseApp to simtypes.AppEntrypoint. Ensure that all interactions with this parameter are compatible with the new type.

x/feegrant/simulation/operations.go (1)

81-81: Verify the function usage in the codebase.

Ensure that all function calls to SimulateMsgGrantAllowance match the new signature.

Verification successful

Verify all function calls to SimulateMsgGrantAllowance match the new signature.

Ensure that all occurrences of SimulateMsgGrantAllowance in the codebase use the new signature.


Verification successful.

All occurrences of SimulateMsgGrantAllowance in the codebase match the new signature.

  • x/feegrant/simulation/operations.go
  • tests/sims/feegrant/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgGrantAllowance` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgGrantAllowance'

Length of output: 1973


Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgGrantAllowance` match the new signature.

# Test: Search for all occurrences of the function usage. Expect: Only occurrences of the new signature.
rg --type go 'SimulateMsgGrantAllowance' -A 5

Length of output: 1973

types/simulation/types.go (4)

18-21: LGTM!

The new AppEntrypoint interface is well-defined and aligns with the goal of decoupling the simulation framework from the BaseApp implementation.


44-46: LGTM!

The updates to the WeightedProposalMsg interface enhance the flexibility of the message simulation process by allowing for a context-aware simulator function.


49-51: LGTM!

The update to the MsgSimulatorFn type allows for better management of request contexts during message simulation.

Tools
golangci-lint

50-50: File is not gofumpt-ed with -extra

(gofumpt)


76-76: LGTM!

The update to the Operation type aligns with the goal of decoupling the simulation framework from the BaseApp implementation and allows for greater flexibility in how operations interact with the application entry point.

x/simulation/params.go (3)

4-4: LGTM!

The addition of the context package is necessary for the new function's signature and aligns with best practices for context management.


131-133: LGTM!

The changes to the WeightedProposalMsg struct enhance the flexibility of the message simulation process by allowing for a context-aware simulator function.


143-144: LGTM!

The new NewWeightedProposalMsgX function ensures backward compatibility while encouraging the use of the updated functionality.

x/distribution/simulation/operations.go (3)

76-76: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgSetWithdrawAddress match the new signature.

Verification successful

Verified: All function calls to SimulateMsgSetWithdrawAddress match the new signature.

  • x/distribution/simulation/operations.go
  • tests/sims/distribution/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgSetWithdrawAddress` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgSetWithdrawAddress'

Length of output: 2578


125-125: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgWithdrawDelegatorReward match the new signature.

Verification successful

Function usage matches the new signature.

The function SimulateMsgWithdrawDelegatorReward has been updated and all instances in the codebase reflect the new signature.

  • x/distribution/simulation/operations.go
  • tests/sims/distribution/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgWithdrawDelegatorReward` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgWithdrawDelegatorReward'

Length of output: 2774


193-193: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgWithdrawValidatorCommission match the new signature.

Verification successful

Verified: Function usage matches the new signature.

The function SimulateMsgWithdrawValidatorCommission has been correctly updated, and all usages align with the new signature.

  • x/distribution/simulation/operations.go
  • tests/sims/distribution/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgWithdrawValidatorCommission` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgWithdrawValidatorCommission'

Length of output: 3267

x/authz/simulation/operations.go (1)

105-105: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgGrant match the new signature.

x/bank/simulation/operations.go (4)

148-148: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to sendMsgSend match the new signature.

Verification successful

Verified: All function calls to sendMsgSend match the new signature.

The function sendMsgSend has been correctly updated in all instances found in the codebase.

  • x/bank/simulation/operations.go: Lines 148 and other instances in the same file.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `sendMsgSend` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'sendMsgSend'

Length of output: 1514


200-200: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgMultiSend match the new signature.


372-372: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to sendMsgMultiSend match the new signature.


304-304: LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to SimulateMsgMultiSendToModuleAccount match the new signature.

Verification successful

The function usage matches the new signature.

The function SimulateMsgMultiSendToModuleAccount is used correctly in the test file tests/sims/bank/operations_test.go with the updated signature.

  • tests/sims/bank/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgMultiSendToModuleAccount` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgMultiSendToModuleAccount'

Length of output: 1373

x/gov/simulation/operations.go (5)

173-173: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgSubmitProposal match the new signature.

Verification successful

Ensure all instances of SimulateMsgSubmitProposal match the new signature.

The function signature change is approved. Verify that all instances of SimulateMsgSubmitProposal across the codebase match the new signature.

  • x/group/simulation/operations_test.go
  • x/group/simulation/operations.go
  • x/gov/simulation/operations.go
  • tests/sims/gov/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgSubmitProposal` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgSubmitProposal'

Length of output: 3585


251-251: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to simulateMsgSubmitProposal match the new signature.


434-434: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to operationSimulateMsgVote match the new signature.


200-200: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgSubmitLegacyProposal match the new signature.

Verification successful

LGTM! The function usage matches the new signature.

The function signature change is correctly reflected in both the main code and the test cases.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgSubmitLegacyProposal` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgSubmitLegacyProposal'

Length of output: 2252


Script:

#!/bin/bash
# Verify the usage of SimulateMsgSubmitLegacyProposal in x/gov/simulation/operations.go and tests/sims/gov/operations_test.go

# Check the usage in x/gov/simulation/operations.go
rg --type go -A 5 'SimulateMsgSubmitLegacyProposal' x/gov/simulation/operations.go

# Check the usage in tests/sims/gov/operations_test.go
rg --type go -A 5 'SimulateMsgSubmitLegacyProposal' tests/sims/gov/operations_test.go

Length of output: 1425


329-339: Verify the impact of deactivating future operations.

The future operations have been deactivated, which may affect the simulation process.

x/staking/simulation/operations.go (6)

310-310: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgDelegate match the new signature.

Verification successful

Verified: All function calls to SimulateMsgDelegate match the new signature.

The function signature change is correctly reflected in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgDelegate` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgDelegate'

Length of output: 2299


615-615: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgBeginRedelegate match the new signature.


392-392: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgUndelegate match the new signature.


759-759: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgRotateConsPubKey match the new signature.

Verification successful

Verified: All function calls to SimulateMsgRotateConsPubKey match the new signature.

  • x/staking/simulation/operations.go
  • tests/integration/staking/simulation/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgRotateConsPubKey` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgRotateConsPubKey'

Length of output: 1624


235-235: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgEditValidator match the new signature.

Verification successful

Verify the function usage in the codebase.

The function signature change is approved. Ensure that all function calls to SimulateMsgEditValidator match the new signature.

  • x/staking/simulation/operations.go
  • tests/integration/staking/simulation/operations_test.go

All function calls to SimulateMsgEditValidator match the new signature.

  • x/staking/simulation/operations.go
  • tests/integration/staking/simulation/operations_test.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgEditValidator` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgEditValidator'

Length of output: 2357


Script:

#!/bin/bash
# Verify function calls in `x/staking/simulation/operations.go`
rg --type go -A 5 'SimulateMsgEditValidator' x/staking/simulation/operations.go

# Verify function calls in `tests/integration/staking/simulation/operations_test.go`
rg --type go -A 5 'SimulateMsgEditValidator' tests/integration/staking/simulation/operations_test.go

Length of output: 1251


511-511: LGTM! But verify the function usage in the codebase.

The function signature change is approved.

Ensure that all function calls to SimulateMsgCancelUnbondingDelegate match the new signature.

x/group/simulation/operations.go (3)

836-836: Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

Verification successful

Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

  • The function SimulateMsgUpdateGroupPolicyDecisionPolicy has been updated to use simtypes.AppEntrypoint.
  • The search results show that the function is invoked with the new parameter in x/group/simulation/operations_test.go.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgUpdateGroupPolicyDecisionPolicy` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgUpdateGroupPolicyDecisionPolicy'

Length of output: 1667


1087-1087: Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.


449-449: Verify the usage of the new interface.

Ensure that simtypes.AppEntrypoint is correctly implemented and compatible with the existing logic.

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

123-123: Fix formatting: Surround lists by blank lines.

To comply with Markdown best practices, lists should be surrounded by blank lines.

### API Breaking Changes

* (sims) [#21039](https://github.com/cosmos/cosmos-sdk/pull/21039): Remove Baseapp from sims by a new interface `simtypes.AppEntrypoint`
* (client) [#20976](https://github.com/cosmos/cosmos-sdk/pull/20976) Simplified command initialization by removing unnecessary parameters such as `txConfig` and `addressCodec`.
  * Remove parameter `txConfig` from `genutilcli.Commands`,`genutilcli.CommandsWithCustomMigrationMap`,`genutilcli.GenTxCmd`.
  * Remove parameter `addressCodec` from `genutilcli.GenTxCmd`,`genutilcli.AddGenesisAccountCmd`,`stakingcli.BuildCreateValidatorMsg`.
Tools
Markdownlint

123-123: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2c236af and 4ad93e8.

Files selected for processing (18)
  • .gitignore (1 hunks)
  • CHANGELOG.md (1 hunks)
  • types/simulation/types.go (4 hunks)
  • x/auth/simulation/proposals_test.go (1 hunks)
  • x/authz/simulation/operations.go (4 hunks)
  • x/bank/simulation/operations.go (7 hunks)
  • x/distribution/simulation/operations.go (4 hunks)
  • x/feegrant/simulation/operations.go (3 hunks)
  • x/gov/simulation/operations.go (9 hunks)
  • x/gov/simulation/proposals.go (1 hunks)
  • x/group/simulation/operations.go (15 hunks)
  • x/nft/simulation/operations.go (2 hunks)
  • x/protocolpool/simulation/operations.go (2 hunks)
  • x/simulation/params.go (3 hunks)
  • x/simulation/util.go (2 hunks)
  • x/slashing/simulation/operations.go (2 hunks)
  • x/staking/simulation/operations.go (8 hunks)
  • x/staking/simulation/proposals.go (2 hunks)
Files skipped from review due to trivial changes (3)
  • x/authz/simulation/operations.go
  • x/bank/simulation/operations.go
  • x/gov/simulation/proposals.go
Files skipped from review as they are similar to previous changes (12)
  • .gitignore
  • x/auth/simulation/proposals_test.go
  • x/distribution/simulation/operations.go
  • x/feegrant/simulation/operations.go
  • x/gov/simulation/operations.go
  • x/group/simulation/operations.go
  • x/nft/simulation/operations.go
  • x/protocolpool/simulation/operations.go
  • x/simulation/params.go
  • x/slashing/simulation/operations.go
  • x/staking/simulation/operations.go
  • x/staking/simulation/proposals.go
Additional context used
Path-based instructions (3)
x/simulation/util.go (1)

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

types/simulation/types.go (1)

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

CHANGELOG.md (1)

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

golangci-lint
types/simulation/types.go

50-50: File is not gofumpt-ed with -extra

(gofumpt)

Markdownlint
CHANGELOG.md

123-123: null
Lists should be surrounded by blank lines

(MD032, blanks-around-lists)

Additional comments not posted (5)
x/simulation/util.go (1)

67-67: Change in App field type in OperationInput struct.

The type of the App field has been changed from *baseapp.BaseApp to simtypes.AppEntrypoint. This change decouples the simulation framework from the specific implementation of BaseApp, enhancing modularity and flexibility.

types/simulation/types.go (4)

18-21: Introduction of AppEntrypoint interface.

The AppEntrypoint interface defines a method for delivering simulation transactions to the app. This abstraction allows for greater flexibility in how operations interact with the application, enhancing modularity and maintainability.


44-46: Update to WeightedProposalMsg interface.

The WeightedProposalMsg interface has been updated to change the type of the MsgSimulatorFn method from MsgSimulatorFn to MsgSimulatorFnX. This change reflects a shift towards a more structured approach for message simulation, incorporating context management.


51-51: Introduction of MsgSimulatorFnX type.

The MsgSimulatorFnX type includes a context.Context parameter, allowing for better management of request contexts during message simulation. This aligns with best practices for context management.


76-76: Change in Operation type.

The Operation type has been modified to accept an AppEntrypoint instead of the baseapp.BaseApp. This change reinforces the new structure, allowing for greater flexibility in how operations interact with the application entry point.

@tac0turtle tac0turtle added the backport/v0.52.x PR scheduled for inclusion in the v0.52's next stable release label Jul 24, 2024
@testinginprod testinginprod self-requested a review July 24, 2024 07:51
Copy link
Contributor

@testinginprod testinginprod left a comment

Choose a reason for hiding this comment

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

lgtm

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 (2)
x/gov/simulation/proposals_test.go (1)

34-34: Inconsistent usage of context.Background() in TestProposalMsgs functions.

The TestProposalMsgs function in x/gov/simulation/proposals_test.go has been updated to include a context.Background() argument. However, this update is not reflected in other packages where TestProposalMsgs is defined. To ensure consistency and proper context management, please update the following instances:

  • x/slashing/simulation/proposals_test.go
  • x/staking/simulation/proposals_test.go
  • x/protocolpool/simulation/proposals_test.go
  • x/mint/simulation/proposals_test.go
  • x/distribution/simulation/proposals_test.go
  • x/bank/simulation/proposals_test.go
  • x/auth/simulation/proposals_test.go
Analysis chain

Context parameter added to TestProposalMsgs.

The function TestProposalMsgs now includes a context.Background() argument, enhancing context management.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `TestProposalMsgs` in the codebase.

# Test: Search for the usage of `TestProposalMsgs`. Expect: Only occurrences of the updated function.
rg --type go -A 5 $'TestProposalMsgs'

Length of output: 3276

tests/sims/gov/operations_test.go (1)

60-61: Update all occurrences of MsgSimulatorFn to MsgSimulatorFnX.

The following locations still use the old function signature MsgSimulatorFn and need to be updated to MsgSimulatorFnX:

  • x/simulation/params.go: func NewWeightedProposalMsg(appParamsKey string, defaultWeight int, msgSimulatorFn simulation.MsgSimulatorFn) simulation.WeightedProposalMsg
  • types/simulation/types.go: MsgSimulatorFn() MsgSimulatorFnX // msg simulator function
  • types/simulation/types.go: MsgSimulatorFn func(r *rand.Rand, accs []Account, cdc address.Codec) (sdk.Msg, error)

Please update these references to use MsgSimulatorFnX instead.

Analysis chain

LGTM! But verify the function usage in the codebase.

The code changes are approved.

However, ensure that all function calls to MsgSimulatorFn and MsgSimulatorFnX are updated and used correctly in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `MsgSimulatorFn` and `MsgSimulatorFnX` in the codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'MsgSimulatorFn'
rg --type go -A 5 $'MsgSimulatorFnX'

Length of output: 11351

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 4ad93e8 and 860b768.

Files selected for processing (17)
  • tests/sims/gov/operations_test.go (2 hunks)
  • types/simulation/types.go (4 hunks)
  • x/auth/simulation/proposals.go (3 hunks)
  • x/bank/simulation/proposals.go (3 hunks)
  • x/bank/simulation/proposals_test.go (2 hunks)
  • x/distribution/simulation/proposals.go (3 hunks)
  • x/distribution/simulation/proposals_test.go (2 hunks)
  • x/gov/simulation/proposals.go (3 hunks)
  • x/gov/simulation/proposals_test.go (2 hunks)
  • x/mint/simulation/proposals.go (3 hunks)
  • x/mint/simulation/proposals_test.go (2 hunks)
  • x/protocolpool/simulation/proposals.go (2 hunks)
  • x/protocolpool/simulation/proposals_test.go (2 hunks)
  • x/slashing/simulation/proposals.go (3 hunks)
  • x/slashing/simulation/proposals_test.go (2 hunks)
  • x/staking/simulation/proposals.go (3 hunks)
  • x/staking/simulation/proposals_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • x/staking/simulation/proposals.go
Additional context used
Path-based instructions (16)
x/bank/simulation/proposals.go (1)

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

x/bank/simulation/proposals_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/distribution/simulation/proposals.go (1)

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

x/protocolpool/simulation/proposals.go (1)

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

x/distribution/simulation/proposals_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/protocolpool/simulation/proposals_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/auth/simulation/proposals.go (1)

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

x/staking/simulation/proposals_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/gov/simulation/proposals.go (1)

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

x/slashing/simulation/proposals_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/proposals_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/slashing/simulation/proposals.go (1)

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

x/mint/simulation/proposals.go (1)

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

types/simulation/types.go (1)

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

x/gov/simulation/proposals_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"

tests/sims/gov/operations_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 (28)
x/bank/simulation/proposals.go (2)

26-29: Change to use NewWeightedProposalMsgX looks good.

The update to use simulation.NewWeightedProposalMsgX instead of simulation.NewWeightedProposalMsg is approved. Ensure that the new function NewWeightedProposalMsgX is well-tested and documented.


Line range hint 35-48:
Change to include context.Context parameter looks good.

The update to include context.Context in the function signature enhances context management.

Ensure that all calls to SimulateMsgUpdateParams are updated to pass the new context.Context parameter.

x/bank/simulation/proposals_test.go (1)

37-37: Change to include context.Background() in test looks good.

The update to include context.Background() in the MsgSimulatorFn invocation aligns with the updated function signature for context management.

x/distribution/simulation/proposals.go (2)

27-30: Change to use NewWeightedProposalMsgX looks good.

The update to use simulation.NewWeightedProposalMsgX instead of simulation.NewWeightedProposalMsg is approved. Ensure that the new function NewWeightedProposalMsgX is well-tested and documented.


Line range hint 36-49:
Change to include context.Context parameter looks good.

The update to include context.Context in the function signature enhances context management.

Ensure that all calls to SimulateMsgUpdateParams are updated to pass the new context.Context parameter.

x/protocolpool/simulation/proposals.go (3)

4-4: Import statement for context is appropriate.

The addition of context is necessary for the updated function signatures.


32-32: Ensure proper error handling and context usage.

The function logic appears correct and includes proper error handling. Ensure that the context is used appropriately in the calling code.


24-27: LGTM! But verify the function usage in the codebase.

The changes to use NewWeightedProposalMsgX and include context.Context are approved.

However, ensure that all function calls to SimulateMsgCommunityPoolSpend match the new signature.

Verification successful

Verified: Function usage is correct.

The function SimulateMsgCommunityPoolSpend is used correctly with the updated signature in the codebase. No other occurrences were found.

  • x/protocolpool/simulation/proposals.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCommunityPoolSpend` match the new signature.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'SimulateMsgCommunityPoolSpend'

Length of output: 848


Script:

#!/bin/bash
# Description: Verify all function calls to `SimulateMsgCommunityPoolSpend` match the new signature across the entire codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new signature.
rg --type go 'SimulateMsgCommunityPoolSpend'

Length of output: 288

x/distribution/simulation/proposals_test.go (2)

4-4: Import statement for context is appropriate.

The addition of context is necessary for the updated test function.


37-37: LGTM! The addition of context.Background() is appropriate.

The change to include context.Background() in the function call is approved.

x/protocolpool/simulation/proposals_test.go (2)

4-4: Import statement for context is appropriate.

The addition of context is necessary for the updated test function.


36-36: LGTM! The addition of context.Background() is appropriate.

The change to include context.Background() in the function call is approved.

x/auth/simulation/proposals.go (2)

26-29: Verify the purpose and impact of using simulation.NewWeightedProposalMsgX.

Ensure that the change to simulation.NewWeightedProposalMsgX is intentional and understand the differences and benefits compared to simulation.NewWeightedProposalMsg.


35-35: LGTM! Ensure proper usage of context.Context.

The addition of context.Context is a good practice for managing cancellations and deadlines.

Verify that the context parameter is used appropriately within the function and its callers.

x/staking/simulation/proposals_test.go (2)

4-4: LGTM! Ensure proper usage of context.Context.

The addition of context.Context is a good practice for managing cancellations and deadlines.

Verify that the context parameter is used appropriately within the function and its callers.


44-48: Verify the correctness of updated staking parameters.

Ensure that the new values for BondDenom, MaxEntries, HistoricalEntries, MaxValidators, and UnbondingTime are correct and align with the expected configuration.

x/gov/simulation/proposals.go (2)

21-24: Verify the purpose and impact of using simulation.NewWeightedProposalMsgX.

Ensure that the change to simulation.NewWeightedProposalMsgX is intentional and understand the differences and benefits compared to simulation.NewWeightedProposalMsg.


31-31: LGTM! Ensure proper usage of context.Context.

The addition of context.Context is a good practice for managing cancellations and deadlines.

Verify that the context parameter is used appropriately within the function and its callers.

x/slashing/simulation/proposals_test.go (1)

4-4: LGTM! The addition of context is appropriate.

The addition of context.Background() to the MsgSimulatorFn call is a good practice for handling context-aware operations.

Also applies to: 38-38

x/mint/simulation/proposals_test.go (1)

4-4: LGTM! The addition of context is appropriate.

The addition of context.Background() to the MsgSimulatorFn call is a good practice for handling context-aware operations.

Also applies to: 37-37

x/slashing/simulation/proposals.go (2)

4-4: LGTM! The use of NewWeightedProposalMsgX is appropriate.

The change to use simulation.NewWeightedProposalMsgX indicates a potential update in how weighted proposal messages are constructed.

Also applies to: 28-31


37-37: LGTM! The addition of context is appropriate.

The addition of context.Context to the function signature is a good practice for handling context-aware operations.

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

36-36: LGTM! Verify the function usage in the codebase.

The function SimulateMsgUpdateParams now includes a context.Context parameter. Ensure that all calls to this function pass the appropriate context.


27-30: LGTM! Verify the function usage in the codebase.

The function NewWeightedProposalMsgX is used correctly. Ensure that this function exists and is used appropriately throughout the codebase.

Verification successful

Verified the function usage in the codebase.

The function NewWeightedProposalMsgX is correctly used and implemented across multiple files in the codebase. The definition in x/simulation/params.go and its usage in other files confirm its proper application.

  • x/simulation/params.go: Function definition and usage.
  • Other files (e.g., x/mint/simulation/proposals.go, x/staking/simulation/proposals.go, etc.): Correct usage.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `NewWeightedProposalMsgX` in the codebase.

# Test: Search for the function usage. Expect: Only occurrences of the new function.
rg --type go -A 5 $'NewWeightedProposalMsgX'

Length of output: 3828

types/simulation/types.go (4)

4-4: Context package imported.

The context package is imported to support the addition of context.Context parameters in function signatures.


18-21: AppEntrypoint interface introduced.

The AppEntrypoint interface defines a method for delivering simulation transactions to the app, replacing *baseapp.BaseApp.


78-80: Operation type updated.

The Operation type now accepts an AppEntrypoint instead of *baseapp.BaseApp, enhancing modularity and flexibility.

Verification successful

Operation type updated.

The Operation type now accepts an AppEntrypoint instead of *baseapp.BaseApp, enhancing modularity and flexibility.

  • Verified that the changes have been correctly applied across the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `Operation` type in the codebase.

# Test: Search for the usage of `Operation` type. Expect: Only occurrences of the updated type.
rg --type go -A 5 $'Operation'

Length of output: 161805


44-46: WeightedProposalMsg interface updated.

The WeightedProposalMsg interface now uses MsgSimulatorFnX, reflecting the updated function signature with context.Context.

Verification successful

WeightedProposalMsg interface updated and used correctly.

The WeightedProposalMsg interface has been updated to use MsgSimulatorFnX, and this change is consistently reflected across the codebase.

  • x/staking/simulation/proposals.go
  • x/slashing/simulation/proposals.go
  • x/mint/simulation/proposals.go
  • x/distribution/simulation/proposals.go
  • x/protocolpool/simulation/proposals.go
  • x/gov/simulation/proposals.go
  • x/bank/simulation/proposals.go
  • x/auth/simulation/proposals.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `WeightedProposalMsg` in the codebase.

# Test: Search for the usage of `WeightedProposalMsg`. Expect: Only occurrences of the updated interface.
rg --type go -A 5 $'WeightedProposalMsg'

Length of output: 13263

@alpe alpe enabled auto-merge July 24, 2024 08:33
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 (7)
server/v2/cometbft/go.mod (7)

The dependency github.com/cosmos/gogogateway is still being used in the codebase.

The following files import github.com/cosmos/gogogateway:

  • server/v2/api/grpcgateway/server.go
  • server/api/server.go

Please ensure that these imports are removed or replaced before deleting the dependency from go.mod.

Analysis chain

Line range hint 1-12:
Verify removal of github.com/cosmos/gogogateway.

Ensure that github.com/cosmos/gogogateway is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/cosmos/gogogateway` is no longer used in the codebase.

# Test: Search for any usage of `github.com/cosmos/gogogateway`. Expect: No matches.
rg --type go 'github.com/cosmos/gogogateway'

Length of output: 183


Dependency github.com/huandu/skiplist is still in use.

The dependency github.com/huandu/skiplist has been removed from go.mod, but it is still being used in the following files:

  • types/mempool/skip_list_test.go
  • types/mempool/sender_nonce.go
  • types/mempool/priority_nonce.go

Please ensure that all usages of this dependency are removed or replaced before removing it from go.mod.

Analysis chain

Line range hint 1-12:
Verify removal of github.com/huandu/skiplist.

Ensure that github.com/huandu/skiplist is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/huandu/skiplist` is no longer used in the codebase.

# Test: Search for any usage of `github.com/huandu/skiplist`. Expect: No matches.
rg --type go 'github.com/huandu/skiplist'

Length of output: 225


The dependency github.com/gorilla/mux v1.8.1 is still being used in the codebase.

Please review the following files and remove or replace the usage of github.com/gorilla/mux if it is no longer necessary:

  • server/v2/api/telemetry/server.go
  • server/swagger.go
  • server/v2/api/grpcgateway/server.go
  • server/api/server.go
Analysis chain

Line range hint 1-12:
Verify removal of github.com/gorilla/mux.

Ensure that github.com/gorilla/mux is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/gorilla/mux` is no longer used in the codebase.

# Test: Search for any usage of `github.com/gorilla/mux`. Expect: No matches.
rg --type go 'github.com/gorilla/mux'

Length of output: 250


Issue Found: Dependency cosmossdk.io/schema v0.1.1 is still in use.

The dependency cosmossdk.io/schema v0.1.1 is still being referenced in multiple files across the codebase. Removing it from the go.mod file is likely to cause build failures or runtime errors. Please ensure that all references to cosmossdk.io/schema are removed or update the go.mod file to include this dependency.

  • Files with references:
    • schema/appdata/data.go
    • schema/indexer/indexer.go
    • schema/indexer/manager.go
    • schema/decoding/sync.go
    • schema/decoding/middleware.go
    • schema/decoding/resolver_test.go
    • schema/decoding/resolver.go
    • schema/decoding/decoding_test.go
    • indexer/postgres/column.go
    • indexer/postgres/object.go
    • indexer/postgres/module.go
    • indexer/postgres/enum.go
    • indexer/postgres/indexer.go
    • indexer/postgres/tests/init_schema_test.go
    • indexer/postgres/create_table_test.go
    • indexer/postgres/internal/testdata/example_schema.go
    • baseapp/streaming.go
Analysis chain

Line range hint 1-12:
Verify removal of cosmossdk.io/schema.

Ensure that cosmossdk.io/schema is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `cosmossdk.io/schema` is no longer used in the codebase.

# Test: Search for any usage of `cosmossdk.io/schema`. Expect: No matches.
rg --type go 'cosmossdk.io/schema'

Length of output: 1484


Dependency github.com/gogo/googleapis v1.4.1 is still present.

The dependency github.com/gogo/googleapis v1.4.1 has not been fully removed from the codebase. It is still referenced in multiple go.mod and go.sum files.

  • x/group/go.mod
  • x/upgrade/go.mod
  • x/slashing/go.mod
  • x/staking/go.mod
  • x/mint/go.mod
  • x/params/go.mod
  • x/nft/go.mod
  • x/protocolpool/go.mod
  • x/epochs/go.mod
  • x/evidence/go.mod
  • x/feegrant/go.mod
  • x/gov/go.mod
  • x/distribution/go.mod
  • x/consensus/go.mod
  • x/authz/go.mod
  • x/bank/go.mod
  • x/circuit/go.mod
  • tools/confix/go.mod
  • tools/cosmovisor/go.mod
  • tools/hubl/go.mod
  • x/accounts/defaults/multisig/go.mod
  • x/accounts/go.mod
  • x/auth/go.mod
  • tests/systemtests/go.mod
  • simapp/v2/go.mod
  • simapp/go.mod
  • server/v2/go.mod
  • server/v2/cometbft/go.sum
  • client/v2/go.mod
  • go.mod

Please ensure that all references to github.com/gogo/googleapis v1.4.1 are removed from the codebase.

Analysis chain

Line range hint 1-12:
Verify removal of github.com/gogo/googleapis.

Ensure that github.com/gogo/googleapis is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/gogo/googleapis` is no longer used in the codebase.

# Test: Search for any usage of `github.com/gogo/googleapis`. Expect: No matches.
rg --type go 'github.com/gogo/googleapis'

Length of output: 41


Script:

#!/bin/bash
# Description: Verify if `github.com/gogo/googleapis` is no longer used in the codebase.

# Test: Search for any usage of `github.com/gogo/googleapis`. Expect: No matches.
rg 'github.com/gogo/googleapis'

Length of output: 13201


Dependency github.com/felixge/httpsnoop is still present.

The dependency github.com/felixge/httpsnoop v1.0.4 is still present in various go.mod and go.sum files across the codebase, indicating that it has not been fully removed.

  • x/upgrade/go.mod
  • x/nft/go.sum
  • x/nft/go.mod
  • x/upgrade/go.sum
  • x/staking/go.mod
  • x/staking/go.sum
  • x/slashing/go.sum
  • x/slashing/go.mod
  • x/params/go.sum
  • x/params/go.mod
  • x/protocolpool/go.mod
  • x/protocolpool/go.sum
  • x/group/go.sum
  • x/group/go.mod
  • x/mint/go.mod
  • x/mint/go.sum
  • x/gov/go.sum
  • x/gov/go.mod
  • x/feegrant/go.sum
  • x/feegrant/go.mod
  • x/evidence/go.mod
  • x/evidence/go.sum
  • x/epochs/go.mod
  • x/distribution/go.mod
  • x/epochs/go.sum
  • x/consensus/go.mod
  • x/consensus/go.sum
  • x/distribution/go.sum
  • x/bank/go.sum
  • x/bank/go.mod
  • x/circuit/go.mod
  • x/circuit/go.sum
  • x/authz/go.sum
  • x/authz/go.mod
  • x/accounts/go.sum
  • x/accounts/go.mod
  • x/auth/go.mod
  • x/auth/go.sum
  • x/accounts/defaults/multisig/go.mod
  • x/accounts/defaults/multisig/go.sum
  • x/accounts/defaults/lockup/go.sum
  • tools/hubl/go.mod
  • tools/hubl/go.sum
  • tools/cosmovisor/go.sum
  • tools/cosmovisor/go.mod
  • tools/confix/go.mod
  • tools/confix/go.sum
  • tests/systemtests/go.mod
  • tests/systemtests/go.sum
  • tests/go.mod
  • tests/go.sum
  • simapp/go.mod
  • simapp/go.sum
  • server/v2/cometbft/go.sum
  • simapp/v2/go.mod
  • simapp/v2/go.sum
  • go.mod
  • go.sum
  • client/v2/go.mod
  • client/v2/go.sum
Analysis chain

Line range hint 1-12:
Verify removal of github.com/felixge/httpsnoop.

Ensure that github.com/felixge/httpsnoop is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/felixge/httpsnoop` is no longer used in the codebase.

# Test: Search for any usage of `github.com/felixge/httpsnoop`. Expect: No matches.
rg --type go 'github.com/felixge/httpsnoop'

Length of output: 43


Script:

#!/bin/bash
# Description: Verify if `github.com/felixge/httpsnoop` is present in any go.mod or go.sum files.

# Search for `github.com/felixge/httpsnoop` in all go.mod and go.sum files.
rg 'github.com/felixge/httpsnoop' --glob '**/go.mod' --glob '**/go.sum'

Length of output: 8674


The dependency github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 is still in use.

The imports and their usage in baseapp/grpcserver.go confirm that grpcmiddleware and grpcrecovery are actively utilized in the code.

  • baseapp/grpcserver.go:
    • grpcmiddleware is used in a method handler.
    • grpcrecovery is used as a unary server interceptor.

Please ensure that the dependency is not removed from go.mod unless these usages are refactored or removed.

Analysis chain

Line range hint 1-12:
Verify removal of github.com/grpc-ecosystem/go-grpc-middleware.

Ensure that github.com/grpc-ecosystem/go-grpc-middleware is no longer used in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/grpc-ecosystem/go-grpc-middleware` is no longer used in the codebase.

# Test: Search for any usage of `github.com/grpc-ecosystem/go-grpc-middleware`. Expect: No matches.
rg --type go 'github.com/grpc-ecosystem/go-grpc-middleware'

Length of output: 236


Script:

#!/bin/bash
# Description: Extract relevant lines around the import statements in baseapp/grpcserver.go to confirm if `github.com/grpc-ecosystem/go-grpc-middleware` is still in use.

# Extract lines around the import statements to understand the context.
rg --type go --context 5 'github.com/grpc-ecosystem/go-grpc-middleware' baseapp/grpcserver.go

Length of output: 428


Script:

#!/bin/bash
# Description: Search for the usage of `grpcmiddleware` and `grpcrecovery` in baseapp/grpcserver.go to confirm if `github.com/grpc-ecosystem/go-grpc-middleware` is still in use.

# Search for `grpcmiddleware` usage.
rg --type go 'grpcmiddleware' baseapp/grpcserver.go

# Search for `grpcrecovery` usage.
rg --type go 'grpcrecovery' baseapp/grpcserver.go

Length of output: 353

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 860b768 and 21abb4a.

Files ignored due to path filters (2)
  • server/v2/cometbft/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.sum is excluded by !**/*.sum
Files selected for processing (2)
  • server/v2/cometbft/go.mod (7 hunks)
  • x/accounts/defaults/lockup/go.mod (6 hunks)
Files skipped from review due to trivial changes (1)
  • x/accounts/defaults/lockup/go.mod
Additional comments not posted (5)
server/v2/cometbft/go.mod (5)

Line range hint 1-12:
Verify removal of github.com/Microsoft/go-winio.

Ensure that github.com/Microsoft/go-winio is no longer used in the codebase.

Verification successful

Verified removal of github.com/Microsoft/go-winio.

The search for github.com/Microsoft/go-winio in the codebase did not produce any matches, indicating that the dependency has been successfully removed.

  • Dependency github.com/Microsoft/go-winio is no longer used in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/Microsoft/go-winio` is no longer used in the codebase.

# Test: Search for any usage of `github.com/Microsoft/go-winio`. Expect: No matches.
rg --type go 'github.com/Microsoft/go-winio'

Length of output: 44


Line range hint 1-12:
Verify removal of github.com/gorilla/handlers.

Ensure that github.com/gorilla/handlers is no longer used in the codebase.


Line range hint 1-12:
Verify removal of golang.org/x/mod.

Ensure that golang.org/x/mod is no longer used in the codebase.

Verification successful

The dependency golang.org/x/mod v0.17.0 has been successfully removed and is no longer used in the codebase.

  • No references to golang.org/x/mod were found in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `golang.org/x/mod` is no longer used in the codebase.

# Test: Search for any usage of `golang.org/x/mod`. Expect: No matches.
rg --type go 'golang.org/x/mod'

Length of output: 31


Script:

#!/bin/bash
# Description: Verify if `golang.org/x/mod` is no longer used in the codebase.

# Test: Search for any usage of `golang.org/x/mod`. Expect: No matches.
rg 'golang.org/x/mod' --type go

# Test: Search for any import statements of `golang.org/x/mod`. Expect: No matches.
rg 'import "golang.org/x/mod' --type go

Length of output: 73


Line range hint 1-12:
Verify removal of github.com/DataDog/datadog-go.

Ensure that github.com/DataDog/datadog-go is no longer used in the codebase.

Verification successful

Verify removal of github.com/DataDog/datadog-go.

The dependency github.com/DataDog/datadog-go has been successfully removed and is no longer used in the codebase.

  • No matches were found for github.com/DataDog/datadog-go in the Go files.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if `github.com/DataDog/datadog-go` is no longer used in the codebase.

# Test: Search for any usage of `github.com/DataDog/datadog-go`. Expect: No matches.
rg --type go 'github.com/DataDog/datadog-go'

Length of output: 44


Script:

#!/bin/bash
# Description: Verify if `github.com/DataDog/datadog-go` is no longer used in the codebase.

# Test: Search for any usage of `github.com/DataDog/datadog-go`. Expect: No matches.
rg --type go 'github.com/DataDog/datadog-go' || echo "Error during search"

Length of output: 93


Script:

#!/bin/bash
# Description: Verify if `github.com/DataDog/datadog-go` is no longer used in the codebase.

# Check if there are any Go files in the repository
if ! fd --type f --extension go; then
  echo "No Go files found in the repository."
  exit 1
fi

# Test: Search for any usage of `github.com/DataDog/datadog-go`. Expect: No matches.
rg --type go 'github.com/DataDog/datadog-go' || echo "Error during search"

Length of output: 85707


Script:

#!/bin/bash
# Description: Verify if `github.com/DataDog/datadog-go` is no longer used in the codebase.

# Test: Search for any usage of `github.com/DataDog/datadog-go`. Expect: No matches.
grep -r 'github.com/DataDog/datadog-go' --include \*.go . || echo "No usage found"

Length of output: 97


Line range hint 1-12:
Verify removal of golang.org/x/tools.

Ensure that golang.org/x/tools is no longer used in the codebase.

@alpe alpe added this pull request to the merge queue Jul 24, 2024
Merged via the queue into main with commit 1f0ce2f Jul 24, 2024
83 checks passed
@alpe alpe deleted the alex/sims2_s0 branch July 24, 2024 12:44
mergify bot pushed a commit that referenced this pull request Jul 24, 2024
tac0turtle pushed a commit that referenced this pull request Jul 24, 2024
Co-authored-by: Alexander Peters <alpe@users.noreply.github.com>
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.

3 participants