-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(staking): add go.mod #18257
Conversation
WalkthroughThe changes primarily revolve around the restructuring of the Cosmos SDK project, with a focus on the Changes
TipsChat with CodeRabbit Bot (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files ignored due to filter (30)
- api/cosmos/store/streaming/abci/grpc_grpc.pb.go
- client/v2/go.mod
- github.com/cosmos/cosmos-sdk/types/tx/amino/amino.pb.go
- github.com/cosmos/cosmos-sdk/x/auth/types/auth.pb.go
- go.mod
- simapp/go.mod
- tests/go.mod
- tests/starship/tests/go.mod
- x/circuit/go.mod
- x/distribution/go.mod
- x/evidence/go.mod
- x/feegrant/go.mod
- x/gov/go.mod
- x/group/go.mod
- x/nft/go.mod
- x/params/go.mod
- x/protocolpool/go.mod
- x/slashing/go.mod
- x/slashing/types/genesis.pb.go
- x/slashing/types/query.pb.go
- x/slashing/types/slashing.pb.go
- x/slashing/types/tx.pb.go
- x/staking/go.mod
- x/staking/go.sum
- x/staking/types/authz.pb.go
- x/staking/types/genesis.pb.go
- x/staking/types/query.pb.go
- x/staking/types/staking.pb.go
- x/staking/types/tx.pb.go
- x/upgrade/go.mod
Files selected for processing (57)
- CHANGELOG.md (1 hunks)
- api/cosmos/distribution/module/v1/module.pulsar.go (1 hunks)
- api/cosmos/slashing/module/v1/module.pulsar.go (1 hunks)
- api/cosmos/staking/module/v1/module.pulsar.go (2 hunks)
- api/cosmos/store/internal/kv/v1beta1/kv.pulsar.go (3 hunks)
- api/cosmos/store/streaming/abci/grpc.pulsar.go (7 hunks)
- api/cosmos/store/v1beta1/commit_info.pulsar.go (5 hunks)
- api/cosmos/store/v1beta1/listening.pulsar.go (3 hunks)
- baseapp/utils_test.go (2 hunks)
- collections/README.md (2 hunks)
- docs/architecture/adr-057-app-wiring.md (1 hunks)
- proto/cosmos/staking/module/v1/module.proto (1 hunks)
- proto/cosmos/staking/v1beta1/authz.proto (1 hunks)
- proto/cosmos/staking/v1beta1/genesis.proto (1 hunks)
- proto/cosmos/staking/v1beta1/query.proto (1 hunks)
- proto/cosmos/staking/v1beta1/staking.proto (1 hunks)
- proto/cosmos/staking/v1beta1/tx.proto (1 hunks)
- proto/cosmos/store/snapshots/v1/snapshot.proto (2 hunks)
- proto/cosmos/store/streaming/abci/grpc.proto (1 hunks)
- proto/cosmos/store/v1beta1/commit_info.proto (1 hunks)
- proto/cosmos/store/v1beta1/listening.proto (2 hunks)
- server/api/server_test.go (2 hunks)
- server/grpc/server_test.go (2 hunks)
- simapp/app.go (2 hunks)
- simapp/app_config.go (2 hunks)
- simapp/app_test.go (2 hunks)
- simapp/app_v2.go (2 hunks)
- simapp/export.go (1 hunks)
- simapp/sim_test.go (2 hunks)
- simapp/simd/cmd/testnet.go (2 hunks)
- simapp/simd/cmd/testnet_test.go (2 hunks)
- tests/e2e/authz/tx.go (2 hunks)
- tests/e2e/distribution/withdraw_all_suite.go (2 hunks)
- tests/e2e/staking/suite.go (1 hunks)
- tests/integration/bank/app_test.go (2 hunks)
- tests/integration/bank/bench_test.go (2 hunks)
- tests/integration/bank/keeper/deterministic_test.go (2 hunks)
- tests/integration/distribution/keeper/grpc_query_test.go (1 hunks)
- tests/integration/distribution/keeper/msg_server_test.go (2 hunks)
- tests/integration/evidence/keeper/infraction_test.go (2 hunks)
- tests/integration/gov/common_test.go (1 hunks)
- tests/integration/gov/genesis_test.go (2 hunks)
- tests/integration/gov/keeper/common_test.go (1 hunks)
- tests/integration/gov/keeper/keeper_test.go (2 hunks)
- tests/integration/gov/keeper/tally_test.go (1 hunks)
- tests/integration/rapidgen/rapidgen.go (2 hunks)
- tests/integration/runtime/query_test.go (2 hunks)
- tests/integration/slashing/keeper/keeper_test.go (2 hunks)
- tests/integration/staking/keeper/common_test.go (2 hunks)
- tests/integration/staking/keeper/delegation_test.go (1 hunks)
- tests/integration/staking/keeper/deterministic_test.go (2 hunks)
- tests/integration/staking/keeper/genesis_test.go (1 hunks)
- tests/integration/staking/keeper/grpc_query_test.go (1 hunks)
- tests/integration/staking/keeper/msg_server_test.go (1 hunks)
- tests/integration/staking/keeper/slash_test.go (1 hunks)
- tests/integration/staking/keeper/unbonding_test.go (1 hunks)
- tests/integration/staking/keeper/validator_bench_test.go (1 hunks)
Files not processed due to max files limit (124)
- tests/integration/staking/keeper/validator_test.go
- tests/integration/staking/keeper/vote_extensions_test.go
- tests/integration/staking/simulation/operations_test.go
- tests/integration/tx/aminojson/aminojson_test.go
- tests/integration/tx/decode_test.go
- testutil/configurator/configurator.go
- testutil/network/network.go
- testutil/sims/app_helpers.go
- testutil/sims/state_helpers.go
- x/auth/testutil/app_config.go
- x/authz/client/cli/tx.go
- x/authz/codec.go
- x/authz/msgs_test.go
- x/authz/testutil/app_config.go
- x/bank/simulation/operations_test.go
- x/distribution/keeper/allocation.go
- x/distribution/keeper/allocation_test.go
- x/distribution/keeper/delegation.go
- x/distribution/keeper/delegation_test.go
- x/distribution/keeper/grpc_query.go
- x/distribution/keeper/grpc_query_test.go
- x/distribution/keeper/hooks.go
- x/distribution/keeper/invariants.go
- x/distribution/keeper/validator.go
- x/distribution/module.go
- x/distribution/simulation/operations_test.go
- x/distribution/testutil/app_config.go
- x/distribution/testutil/expected_keepers_mocks.go
- x/distribution/testutil/staking_helper.go
- x/distribution/types/expected_keepers.go
- x/evidence/testutil/app_config.go
- x/evidence/testutil/expected_keepers_mocks.go
- x/evidence/types/expected_keepers.go
- x/feegrant/simulation/operations_test.go
- x/genutil/client/cli/gentx.go
- x/genutil/client/cli/gentx_test.go
- x/genutil/client/cli/init_test.go
- x/genutil/collect.go
- x/genutil/gentx.go
- x/genutil/gentx_test.go
- x/genutil/types/genesis_state.go
- x/genutil/types/genesis_state_test.go
- x/gov/abci_test.go
- x/gov/client/cli/util_test.go
- x/gov/common_test.go
- x/gov/keeper/tally.go
- x/gov/keeper/tally_test.go
- x/gov/simulation/operations_test.go
- x/gov/testutil/expected_keepers_mocks.go
- x/gov/types/expected_keepers.go
- x/group/module/abci_test.go
- x/group/testutil/app_config.go
- x/mint/testutil/app_config.go
- x/nft/simulation/operations_test.go
- x/nft/testutil/app_config.go
- x/protocolpool/simulation/operations_test.go
- x/protocolpool/testutil/app_config.go
- x/simulation/params.go
- x/slashing/abci_test.go
- x/slashing/app_test.go
- x/slashing/keeper/genesis.go
- x/slashing/keeper/hooks_test.go
- x/slashing/keeper/msg_server_test.go
- x/slashing/module.go
- x/slashing/simulation/operations_test.go
- x/slashing/testutil/app_config.go
- x/slashing/testutil/expected_keepers_mocks.go
- x/slashing/types/expected_keepers.go
- x/staking/app_test.go
- x/staking/bench_test.go
- x/staking/client/cli/flags.go
- x/staking/client/cli/tx.go
- x/staking/client/cli/tx_test.go
- x/staking/client/cli/utils.go
- x/staking/genesis.go
- x/staking/genesis_test.go
- x/staking/keeper/abci.go
- x/staking/keeper/alias_functions.go
- x/staking/keeper/delegation.go
- x/staking/keeper/delegation_test.go
- x/staking/keeper/genesis.go
- x/staking/keeper/grpc_query.go
- x/staking/keeper/grpc_query_test.go
- x/staking/keeper/historical_info.go
- x/staking/keeper/historical_info_test.go
- x/staking/keeper/invariants.go
- x/staking/keeper/keeper.go
- x/staking/keeper/keeper_test.go
- x/staking/keeper/migrations.go
- x/staking/keeper/msg_server.go
- x/staking/keeper/msg_server_test.go
- x/staking/keeper/pool.go
- x/staking/keeper/query_utils.go
- x/staking/keeper/slash.go
- x/staking/keeper/slash_test.go
- x/staking/keeper/test_common.go
- x/staking/keeper/unbonding.go
- x/staking/keeper/unbonding_test.go
- x/staking/keeper/val_state_change.go
- x/staking/keeper/validator.go
- x/staking/keeper/validator_test.go
- x/staking/migrations/v5/migrations_test.go
- x/staking/module.go
- x/staking/module_test.go
- x/staking/simulation/decoder.go
- x/staking/simulation/decoder_test.go
- x/staking/simulation/genesis.go
- x/staking/simulation/genesis_test.go
- x/staking/simulation/operations.go
- x/staking/simulation/proposals.go
- x/staking/simulation/proposals_test.go
- x/staking/testutil/app_config.go
- x/staking/testutil/cmt.go
- x/staking/testutil/expected_keepers_mocks.go
- x/staking/testutil/helpers.go
- x/staking/testutil/validator.go
- x/staking/types/authz_test.go
- x/staking/types/commission_test.go
- x/staking/types/delegation_test.go
- x/staking/types/historical_info_test.go
- x/staking/types/keys_test.go
- x/staking/types/msg_test.go
- x/staking/types/params_test.go
- x/staking/types/validator_test.go
Files skipped from review due to trivial changes (45)
- api/cosmos/store/internal/kv/v1beta1/kv.pulsar.go
- api/cosmos/store/streaming/abci/grpc.pulsar.go
- api/cosmos/store/v1beta1/commit_info.pulsar.go
- api/cosmos/store/v1beta1/listening.pulsar.go
- baseapp/utils_test.go
- collections/README.md
- proto/cosmos/staking/v1beta1/authz.proto
- proto/cosmos/staking/v1beta1/genesis.proto
- proto/cosmos/staking/v1beta1/query.proto
- proto/cosmos/staking/v1beta1/staking.proto
- proto/cosmos/staking/v1beta1/tx.proto
- proto/cosmos/store/snapshots/v1/snapshot.proto
- proto/cosmos/store/streaming/abci/grpc.proto
- proto/cosmos/store/v1beta1/commit_info.proto
- proto/cosmos/store/v1beta1/listening.proto
- server/grpc/server_test.go
- simapp/app.go
- simapp/app_config.go
- simapp/app_test.go
- simapp/sim_test.go
- simapp/simd/cmd/testnet.go
- simapp/simd/cmd/testnet_test.go
- tests/e2e/authz/tx.go
- tests/e2e/distribution/withdraw_all_suite.go
- tests/e2e/staking/suite.go
- tests/integration/bank/app_test.go
- tests/integration/distribution/keeper/grpc_query_test.go
- tests/integration/distribution/keeper/msg_server_test.go
- tests/integration/evidence/keeper/infraction_test.go
- tests/integration/gov/common_test.go
- tests/integration/gov/keeper/common_test.go
- tests/integration/gov/keeper/keeper_test.go
- tests/integration/gov/keeper/tally_test.go
- tests/integration/rapidgen/rapidgen.go
- tests/integration/runtime/query_test.go
- tests/integration/slashing/keeper/keeper_test.go
- tests/integration/staking/keeper/common_test.go
- tests/integration/staking/keeper/delegation_test.go
- tests/integration/staking/keeper/deterministic_test.go
- tests/integration/staking/keeper/genesis_test.go
- tests/integration/staking/keeper/grpc_query_test.go
- tests/integration/staking/keeper/msg_server_test.go
- tests/integration/staking/keeper/slash_test.go
- tests/integration/staking/keeper/unbonding_test.go
- tests/integration/staking/keeper/validator_bench_test.go
Additional comments: 16
proto/cosmos/staking/module/v1/module.proto (1)
- 10-10: The import path for the staking module has been updated from
"github.com/cosmos/cosmos-sdk/x/staking"
to"cosmossdk.io/x/staking"
. Ensure that the new import path is correct and that the module is accessible at this location. Also, verify that all references to this module in the codebase have been updated to reflect this change.api/cosmos/distribution/module/v1/module.pulsar.go (1)
- 567-592: The changes in this hunk are related to the binary representation of the protobuf message and do not affect the logic or functionality of the code. The changes are likely due to the recompilation of the protobuf message after changes in other parts of the codebase. No issues or improvements are identified in this hunk.
api/cosmos/staking/module/v1/module.pulsar.go (1)
- 784-792: > Note: This review was outside of the patch, so it was mapped to the patch with the greatest overlap. Original lines [776-789]
The changes in these lines are part of a protobuf file, which is typically auto-generated from a
.proto
file. The changes seem to be related to the renaming of the import paths, as mentioned in the PR summary. However, it's important to ensure that the corresponding.proto
file has been updated with the new import paths and that the protobuf files are regenerated. If not, these changes might be overwritten the next time the protobuf files are regenerated.docs/architecture/adr-057-app-wiring.md (1)
- 233-233: The import path for the
staking
module has been updated from"github.com/cosmos/cosmos-sdk/x/staking/module"
to"cosmossdk.io/x/staking/module"
. Ensure that the new import path is correct and the module is accessible at this location. Also, verify that all references to thestaking
module in the codebase have been updated to reflect this change.simapp/export.go (1)
- 13-14: The import paths for the
staking
module and related types have been updated from"github.com/cosmos/cosmos-sdk/x/staking"
and"github.com/cosmos/cosmos-sdk/x/staking/types"
to"cosmossdk.io/x/staking"
and"cosmossdk.io/x/staking/types"
respectively. Ensure that the new paths are correct and the packages are available at these locations. Also, verify that all references to these packages in the code have been updated to use the new paths.tests/integration/gov/genesis_test.go (2)
18-20: The import paths for the
staking
module have been updated from"github.com/cosmos/cosmos-sdk/x/staking"
to"cosmossdk.io/x/staking"
. Ensure that the new import paths are correct and that thestaking
module is available at the new location. Also, verify that all references to thestaking
module in the code have been updated to use the new import paths.31-34: The import paths for the
staking
module have been removed from this section. This change is consistent with the addition of the new import paths for thestaking
module in lines 18-20. No action is required here as long as the new import paths are correct.tests/integration/bank/bench_test.go (2)
12-13: The import path for
stakingtypes
has been changed from"github.com/cosmos/cosmos-sdk/x/staking/types"
to"cosmossdk.io/x/staking/types"
. Ensure that the new import path is correct and the package is available at the new location. Also, verify that all references tostakingtypes
in the code are still valid with the new import path.24-24: The variable
moduleAccAddr
is created usingstakingtypes.BondedPoolName
from thestakingtypes
package. Given the change in the import path forstakingtypes
, ensure thatBondedPoolName
is still available and correctly defined in the new package location.api/cosmos/slashing/module/v1/module.pulsar.go (1)
- 498-498: The import path for the slashing module has been updated from
"github.com/cosmos/cosmos-sdk/x/slashing"
to"cosmossdk.io/x/slashing"
. Ensure that the new import path is correct and that thecosmossdk.io
domain is properly configured to serve Go modules. This change should not affect the functionality of the code, but it is important to verify that the new import path works as expected.There are no other significant changes in this hunk. The protobuf message definition for
Module
remains the same, and the generated methods for working with theModule
message are not shown in this hunk. The changes are primarily related to the import path update.server/api/server_test.go (2)
21-21: The import path for the
staking
module has been updated from"github.com/cosmos/cosmos-sdk/x/staking"
to"cosmossdk.io/x/staking"
. Ensure that the new import path is correct and that thestaking
module is available at the new location. Also, verify that all references to thestaking
module in the code have been updated to use the new import path.29-29: The import statement for the
staking
module has been removed. If thestaking
module is no longer used in this file, this change is fine. However, if there are still references to thestaking
module in the code, this will cause a compilation error. Please verify.simapp/app_v2.go (2)
25-25: The import path for
stakingkeeper
has been updated from"github.com/cosmos/cosmos-sdk/x/staking/keeper"
to"cosmossdk.io/x/staking/keeper"
. Ensure that the new package at"cosmossdk.io/x/staking/keeper"
has the same functionality and API as the old package. Also, verify that all references tostakingkeeper
in the codebase have been updated to use the new import path.45-48: The import for
stakingkeeper
has been removed. Ensure that this does not break any code that depends onstakingkeeper
. Ifstakingkeeper
is no longer needed, make sure to remove any unused code or references to it.tests/integration/bank/keeper/deterministic_test.go (2)
13-13: The import path for the
staking
module has been updated from"github.com/cosmos/cosmos-sdk/x/staking"
to"cosmossdk.io/x/staking"
. Please ensure that the new import path is correct and the package at the new location provides the same functionality as the old one. Also, make sure that thestaking
package is actually used in the code, as it's imported with the blank identifier_
, which means its exported identifiers are not accessible and it's only imported for its side-effects.29-32: The import paths for the
bank
andmint
modules remain unchanged. However, the import for theconsensus
module has been moved from the old hunk to the new hunk, and the import for thestaking
module has been removed. If theconsensus
andstaking
modules are not used in this file, these changes are appropriate. Otherwise, please ensure that the removal of thestaking
import and the relocation of theconsensus
import do not affect the functionality of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (5)
- .github/workflows/test.yml (1 hunks)
- CHANGELOG.md (2 hunks)
- UPGRADING.md (1 hunks)
- x/staking/CHANGELOG.md (1 hunks)
- x/staking/sonar-project.properties (1 hunks)
Files skipped from review due to trivial changes (4)
- .github/workflows/test.yml
- UPGRADING.md
- x/staking/CHANGELOG.md
- x/staking/sonar-project.properties
Additional comments: 2
CHANGELOG.md (2)
163-163: The change in the import path for
Infraction_*
from"cosmossdk.io/x/staking/types"
to"cosmossdk.io/api/cosmos/staking/v1beta1"
is correctly reflected in the changelog. This change is part of the effort to remove dependencies between modules on staking.180-180: The change in the location of the Staking module to its own
go.mod
atcosmossdk.io/x/staking
is correctly reflected in the changelog. This change is part of the effort to modularize the Cosmos SDK project.
[Cosmos SDK - x/slashing] Kudos, SonarCloud Quality Gate passed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Sonar needs to be configured
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- contrib/images/simd-env/Dockerfile (1} hunks)
Additional comments: 1
contrib/images/simd-env/Dockerfile (1)
- 20-20: The new hunk adds the
go.mod
andgo.sum
files for thex/staking
module to the Docker image. This is in line with the PR's goal of modularizing thestaking
module. Ensure that these files exist and contain the correct module information and dependencies for thex/staking
module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something was wrong in the UPGRADING.md merging, we usually put Module > **all**
first, which I fixed in a previous PR (https://github.com/cosmos/cosmos-sdk/pull/18242/files). However it seems this PR or a previous re-added them before again and they are now duplicated.
See upgrading.md on main.
Description
this pr adds a go.mod to the staking module
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...
!
to the type prefix if API or client breaking changeCHANGELOG.md
make lint
andmake test
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking changeSummary by CodeRabbit
x/staking
module now separated into its owngo.mod
file. This change enhances the modularity of the codebase, making it easier to manage and update individual components.x/staking
module, providing a dedicated space to track changes and updates specific to this module.cosmos/store
have been marked as deprecated, with users advised to use Store v2 types instead. This change is part of an ongoing effort to transition to a newer, more efficient storage system.Please note that these changes are primarily technical and may not directly impact end-users.