-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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: remove dependency x/module -> sdk in InterfaceRegistry #19641
Conversation
Important Auto Review SkippedAuto reviews are disabled on base/target branches other than the default branch. Please add the base/target branch pattern to the list of additional branches to be reviewed in the settings. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe overarching change involves transitioning from using Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
@coderabbitai review |
types/module/module.go
Outdated
@@ -86,7 +86,7 @@ type HasAminoCodec interface { | |||
|
|||
// HasRegisterInterfaces is the interface for modules to register their msg types. | |||
type HasRegisterInterfaces interface { |
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.
Can you move that to core/appmodule/v2 and alias it in core/appmodule?
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.yml
Files selected for processing (53)
- core/registry/legacy.go (1 hunks)
- runtime/v2/builder.go (1 hunks)
- runtime/v2/manager.go (3 hunks)
- simapp/v2/go.mod (2 hunks)
- simapp/v2/go.sum (2 hunks)
- testutil/mock/types_mock_appmodule.go (3 hunks)
- testutil/mock/types_module_module.go (5 hunks)
- types/module/core_module.go (3 hunks)
- types/module/module.go (4 hunks)
- types/msgservice/msg_service.go (1 hunks)
- x/accounts/module.go (3 hunks)
- x/auth/module.go (3 hunks)
- x/auth/types/codec.go (2 hunks)
- x/auth/vesting/module.go (2 hunks)
- x/auth/vesting/types/codec.go (2 hunks)
- x/authz/codec.go (2 hunks)
- x/authz/module/module.go (2 hunks)
- x/bank/module.go (3 hunks)
- x/bank/types/codec.go (2 hunks)
- x/circuit/module.go (3 hunks)
- x/circuit/types/codec.go (1 hunks)
- x/consensus/module.go (2 hunks)
- x/consensus/types/codec.go (1 hunks)
- x/counter/module.go (2 hunks)
- x/counter/types/codec.go (1 hunks)
- x/crisis/module.go (2 hunks)
- x/crisis/types/codec.go (2 hunks)
- x/distribution/module.go (3 hunks)
- x/distribution/types/codec.go (2 hunks)
- x/evidence/module.go (3 hunks)
- x/evidence/types/codec.go (2 hunks)
- x/feegrant/codec.go (2 hunks)
- x/feegrant/module/module.go (2 hunks)
- x/genutil/module.go (2 hunks)
- x/gov/module.go (3 hunks)
- x/gov/types/v1/codec.go (2 hunks)
- x/gov/types/v1beta1/codec.go (2 hunks)
- x/group/codec.go (2 hunks)
- x/group/module/module.go (2 hunks)
- x/mint/module.go (3 hunks)
- x/mint/types/codec.go (2 hunks)
- x/nft/codec.go (1 hunks)
- x/nft/module/module.go (2 hunks)
- x/params/module.go (3 hunks)
- x/params/types/proposal/codec.go (1 hunks)
- x/protocolpool/module.go (3 hunks)
- x/protocolpool/types/codec.go (1 hunks)
- x/slashing/module.go (2 hunks)
- x/slashing/types/codec.go (2 hunks)
- x/staking/module.go (3 hunks)
- x/staking/types/codec.go (2 hunks)
- x/upgrade/module.go (3 hunks)
- x/upgrade/types/codec.go (2 hunks)
Files skipped from review due to trivial changes (1)
- runtime/v2/builder.go
Additional comments: 108
x/counter/types/codec.go (2)
- 4-5: The import path has been updated to use
cosmossdk.io/core/registry
instead of the previousSDK/types/codec
. This change aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface.- 10-10: The
RegisterInterfaces
function now accepts aregistry.LegacyRegistry
type instead oftypes.InterfaceRegistry
. This modification is crucial for achieving the PR's goal of reducing direct dependencies on the Cosmos SDK. Ensure that all implementations ofsdk.Msg
that are registered here are compatible with the newLegacyRegistry
interface.x/nft/codec.go (2)
- 4-5: The import path update to
cosmossdk.io/core/registry
is consistent with the PR's objective to streamline interactions with theInterfaceRegistry
by using theLegacyRegistry
interface. This change is appropriate and aligns with the overall goal of the PR.- 11-11: Changing the parameter type in the
RegisterInterfaces
function toregistry.LegacyRegistry
is a key step towards decoupling the NFT module from direct SDK dependencies. It's important to verify that all registered implementations are fully compatible with the new interface.core/registry/legacy.go (1)
- 1-14: The introduction of the
LegacyRegistry
interface incore/registry/legacy.go
is a significant addition that supports the PR's goal of decoupling modules from direct SDK dependencies. The methodsRegisterInterface
andRegisterImplementations
are well-defined, allowing for the registration of interfaces and their implementations usinggogoproto.Message
. This design promotes modularity and flexibility in the Cosmos SDK architecture.x/circuit/types/codec.go (2)
- 4-5: Updating the import path to
cosmossdk.io/core/registry
is consistent with the PR's objective of reducing direct dependencies on the Cosmos SDK. This change facilitates the use of theLegacyRegistry
interface, which is central to the PR's goals.- 11-11: The modification of the
RegisterInterfaces
function to useregistry.LegacyRegistry
is a crucial step in decoupling the circuit module from the SDK. It's important to ensure that all registered implementations are compatible with the new interface.x/protocolpool/types/codec.go (2)
- 4-5: The change in the import path to
cosmossdk.io/core/registry
aligns with the PR's goal of simplifying and decoupling modules from direct SDK dependencies. This is a positive step towards a more modular architecture.- 10-10: Modifying the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
is consistent with the PR's objectives. It's crucial to verify the compatibility of all registered implementations with the new interface to ensure smooth integration.x/params/types/proposal/codec.go (2)
- 4-4: The update to the import path, introducing
cosmossdk.io/core/registry
, is in line with the PR's aim to streamline interactions with theInterfaceRegistry
. This change supports the goal of enhancing modularity within the SDK.- 15-15: Changing the parameter type in the
RegisterInterfaces
function toregistry.LegacyRegistry
is a key step in reducing direct dependencies on the SDK. This change, particularly in the context of proposals, is crucial for ensuring that the module is compatible with the new interface.x/consensus/types/codec.go (2)
- 4-5: The update to the import path for
cosmossdk.io/core/registry
is consistent with the PR's objectives of decoupling modules from direct SDK dependencies. This change is crucial for the consensus module to utilize theLegacyRegistry
interface.- 12-12: Modifying the
RegisterInterfaces
function to useregistry.LegacyRegistry
aligns with the PR's goal of simplifying module dependencies on the SDK. It's important to ensure that all registered implementations are fully compatible with the new interface.x/mint/types/codec.go (2)
- 4-5: The change in the import path to
cosmossdk.io/core/registry
is in line with the PR's objectives of reducing direct SDK dependencies. This modification is essential for the mint module to leverage theLegacyRegistry
interface.- 19-19: The adjustment of the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
is a crucial step towards decoupling the mint module from the SDK. Verifying the compatibility of all registered implementations with the new interface is essential for ensuring seamless integration.x/slashing/types/codec.go (2)
- 4-5: Updating the import path to
cosmossdk.io/core/registry
aligns with the PR's goal of simplifying interactions with theInterfaceRegistry
. This change is appropriate for the slashing module and supports the objective of enhancing modularity.- 20-20: Changing the parameter type in the
RegisterInterfaces
function toregistry.LegacyRegistry
is a key step in decoupling the slashing module from direct SDK dependencies. It's important to ensure that all registered implementations are compatible with the new interface.x/crisis/types/codec.go (2)
- 4-5: The update to the import path for
cosmossdk.io/core/registry
is consistent with the PR's objectives of reducing direct dependencies on the SDK. This change is crucial for the crisis module to utilize theLegacyRegistry
interface effectively.- 20-20: Modifying the
RegisterInterfaces
function to useregistry.LegacyRegistry
aligns with the PR's goal of simplifying module dependencies on the SDK. It's important to verify the compatibility of all registered implementations with the new interface to ensure smooth integration.x/evidence/types/codec.go (2)
- 4-4: The import of
"cosmossdk.io/core/registry"
is correctly added to replace the previous dependency ontypes.InterfaceRegistry
. This aligns with the PR's objective to decouple modules from direct SDK dependencies.- 22-22: The modification of the
RegisterInterfaces
function's parameter type fromtypes.InterfaceRegistry
toregistry.LegacyRegistry
is consistent with the PR's goal of simplifying and decoupling the modules from direct SDK dependencies. This change should ensure that the evidence module can register its interfaces and concrete types without relying directly on the Cosmos SDK'stypes
package.x/upgrade/types/codec.go (2)
- 4-4: The addition of
"cosmossdk.io/core/registry"
to the imports is appropriate and supports the PR's objective of reducing direct dependencies on the Cosmos SDK. This change facilitates the use of a more streamlined interface for interface registration.- 22-22: Changing the parameter type of the
RegisterInterfaces
function toregistry.LegacyRegistry
is a positive step towards decoupling the upgrade module from the Cosmos SDK'stypes
package. This change aligns with the PR's goals and should be beneficial for modularity.x/bank/types/codec.go (2)
- 4-4: The import of
"cosmossdk.io/core/registry"
is correctly added, which is essential for the transition to usingregistry.LegacyRegistry
for interface registration. This change is in line with the PR's objective to minimize direct dependencies on the Cosmos SDK.- 24-24: Modifying the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
as its parameter type is a key step in decoupling the bank module from the Cosmos SDK'stypes
package. This approach enhances modularity and aligns with the PR's goals.x/gov/types/v1beta1/codec.go (2)
- 4-4: Adding
"cosmossdk.io/core/registry"
to the imports supports the PR's goal of reducing the governance module's direct dependencies on the Cosmos SDK. This change is crucial for using theregistry.LegacyRegistry
for interface registration.- 24-24: The update to the
RegisterInterfaces
function's parameter type toregistry.LegacyRegistry
is consistent with the PR's objective of enhancing modularity by decoupling modules from the Cosmos SDK'stypes
package. This change should facilitate a more flexible and modular approach to interface registration within the governance module.x/auth/vesting/module.go (2)
- 5-5: The inclusion of
"cosmossdk.io/core/registry"
in the imports is a necessary adjustment for utilizing theregistry.LegacyRegistry
in the vesting module. This change aligns with the PR's aim to minimize direct SDK dependencies, promoting a more modular architecture.- 48-48: Changing the
RegisterInterfaces
function to useregistry.LegacyRegistry
as its parameter type is a strategic move towards decoupling the vesting module from the Cosmos SDK'stypes
package. This modification supports the PR's goals of enhancing modularity and reducing direct dependencies.x/counter/module.go (2)
- 4-4: The addition of
"cosmossdk.io/core/registry"
to the imports is appropriate for the counter module, facilitating the use ofregistry.LegacyRegistry
for interface registration. This change is in line with the PR's objective to reduce direct dependencies on the Cosmos SDK, promoting a more modular design.- 50-50: Modifying the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is a positive step towards decoupling the counter module from the Cosmos SDK'stypes
package. This change aligns with the PR's goals of enhancing modularity and simplifying dependencies.x/distribution/types/codec.go (2)
- 4-4: The inclusion of
"cosmossdk.io/core/registry"
in the imports is a necessary adjustment for the distribution module, enabling the use ofregistry.LegacyRegistry
for interface registration. This change supports the PR's aim of reducing direct SDK dependencies and promoting a modular architecture.- 25-25: Changing the
RegisterInterfaces
function to useregistry.LegacyRegistry
as its parameter type is a strategic move towards decoupling the distribution module from the Cosmos SDK'stypes
package. This modification aligns with the PR's goals of enhancing modularity and simplifying dependencies.x/feegrant/codec.go (2)
- 4-4: Adding
"cosmossdk.io/core/registry"
to the imports is appropriate for the feegrant module, facilitating the use ofregistry.LegacyRegistry
for interface registration. This change aligns with the PR's objective to minimize direct dependencies on the Cosmos SDK, promoting a more modular design.- 25-25: Modifying the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is a positive step towards decoupling the feegrant module from the Cosmos SDK'stypes
package. This change supports the PR's goals of enhancing modularity and simplifying dependencies.x/gov/types/v1/codec.go (2)
- 4-4: The inclusion of
"cosmossdk.io/core/registry"
in the imports is a necessary adjustment for the governance module, enabling the use ofregistry.LegacyRegistry
for interface registration. This change supports the PR's aim of reducing direct SDK dependencies and promoting a modular architecture.- 27-27: Changing the
RegisterInterfaces
function to useregistry.LegacyRegistry
as its parameter type is a strategic move towards decoupling the governance module from the Cosmos SDK'stypes
package. This modification aligns with the PR's goals of enhancing modularity and simplifying dependencies.x/authz/codec.go (2)
- 4-4: The addition of
"cosmossdk.io/core/registry"
to the imports is appropriate for the authz module, facilitating the use ofregistry.LegacyRegistry
for interface registration. This change is in line with the PR's objective to reduce direct dependencies on the Cosmos SDK, promoting a more modular design.- 26-26: Modifying the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is a positive step towards decoupling the authz module from the Cosmos SDK'stypes
package. This change supports the PR's goals of enhancing modularity and simplifying dependencies.x/auth/types/codec.go (2)
- 4-4: The import path change from
"github.com/cosmos/cosmos-sdk/codec/types"
to"cosmossdk.io/core/registry"
aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface defined incore
. This change is consistent with the goal of enhancing modularity within the SDK.- 31-31: The update of the
RegisterInterfaces
function signature to useregistry.LegacyRegistry
instead oftypes.InterfaceRegistry
is a key part of the refactor aimed at reducing direct dependencies on the Cosmos SDK. This change is crucial for achieving the PR's objective of simplifying interactions with theInterfaceRegistry
and promoting a more decoupled architecture. Ensure that all calls toRegisterInterfaces
across the codebase are updated to reflect this new signature.types/msgservice/msg_service.go (2)
- 10-10: The import path change to
"cosmossdk.io/core/registry"
is consistent with the overarching goal of the PR to streamline interactions with theInterfaceRegistry
by utilizing a more generalized interface. This modification supports the initiative to reduce direct SDK dependencies.- 24-24: Updating the
RegisterMsgServiceDesc
function signature to acceptregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is in line with the PR's objective to decouple modules from the Cosmos SDK's direct dependencies. This change is essential for promoting a more modular architecture. Ensure compatibility and correct usage across all instances where this function is invoked.x/staking/types/codec.go (2)
- 4-4: The import path adjustment to
"cosmossdk.io/core/registry"
aligns with the PR's goal of reducing direct dependencies on the Cosmos SDK by utilizing a more generalized interface. This change supports the initiative to enhance modularity within the SDK.- 32-32: Modifying the
RegisterInterfaces
function to useregistry.LegacyRegistry
instead oftypes.InterfaceRegistry
is a crucial step towards decoupling thex/staking
module from direct SDK dependencies. This change is consistent with the PR's objective of simplifying interactions with theInterfaceRegistry
and promoting a more decoupled architecture.x/auth/vesting/types/codec.go (2)
- 4-4: The addition of the import
"cosmossdk.io/core/registry"
and the removal of the direct dependency on the Cosmos SDK'scodec/types
is in line with the PR's objective to streamline module interactions with theInterfaceRegistry
. This change enhances the modularity and decouples thex/auth/vesting
module from the SDK.- 30-30: Changing the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
instead oftypes.InterfaceRegistry
is a significant step towards achieving the PR's goal of reducing direct dependencies on the Cosmos SDK. This modification is crucial for promoting a more modular architecture within the SDK.x/consensus/module.go (2)
- 6-6: The import of
"cosmossdk.io/core/registry"
supports the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface. This change is consistent with the goal of enhancing modularity within the SDK.- 64-64: Updating the
RegisterInterfaces
function to useregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
aligns with the PR's goal of simplifying interactions with theInterfaceRegistry
. This change is essential for promoting a more decoupled and modular architecture within the SDK.x/accounts/module.go (2)
- 7-7: The import of
"cosmossdk.io/core/registry"
is in line with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more generalized interface. This change supports the initiative to enhance modularity within the SDK.- 55-55: Changing the
RegisterInterfaces
function to acceptregistry.LegacyRegistry
instead oftypes.InterfaceRegistry
is a crucial step towards decoupling thex/accounts
module from direct SDK dependencies. This modification is consistent with the PR's goal of promoting a more modular architecture.x/group/codec.go (2)
- 4-4: The addition of the import
"cosmossdk.io/core/registry"
aligns with the PR's objective to streamline interactions with theInterfaceRegistry
by utilizing a more generalized interface. This change supports the initiative to reduce direct SDK dependencies.- 37-37: Modifying the
RegisterInterfaces
function to useregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is a key part of the refactor aimed at reducing direct dependencies on the Cosmos SDK. This change is crucial for achieving the PR's objective of simplifying interactions with theInterfaceRegistry
and promoting a more decoupled architecture.x/params/module.go (2)
- 6-6: The import of
"cosmossdk.io/core/registry"
is consistent with the PR's goal of decoupling modules from direct SDK dependencies by utilizing a more streamlined interface. This change supports the initiative to enhance modularity within the SDK.- 67-67: Updating the
RegisterInterfaces
function to useregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
aligns with the PR's objective of simplifying interactions with theInterfaceRegistry
. This change is essential for promoting a more decoupled and modular architecture within the SDK.x/genutil/module.go (2)
- 8-8: The import path update to
"cosmossdk.io/core/registry"
is in line with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more generalized interface. This change supports the initiative to enhance modularity within the SDK.- 101-101: The
RegisterInterfaces
function in this file has been updated to acceptregistry.LegacyRegistry
, but it's left empty. This might be intentional, given the nature of thegenutil
module, which may not need to register specific interfaces. However, it's important to ensure that this aligns with the overall architecture and future plans for the module.x/circuit/module.go (2)
- 9-9: The addition of the import
"cosmossdk.io/core/registry"
aligns with the PR's objective to streamline interactions with theInterfaceRegistry
by utilizing a more generalized interface. This change supports the initiative to reduce direct SDK dependencies and enhance modularity within the SDK.- 57-57: Modifying the
RegisterInterfaces
function to useregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is a key part of the refactor aimed at reducing direct dependencies on the Cosmos SDK. This change is crucial for achieving the PR's objective of simplifying interactions with theInterfaceRegistry
and promoting a more decoupled architecture.x/protocolpool/module.go (2)
- 8-8: The addition of
"cosmossdk.io/core/registry"
import aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface defined incore
. This change is necessary for the subsequent modification of theRegisterInterfaces
function signature.- 75-75: The change in the
RegisterInterfaces
function signature fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
is consistent with the PR's goal to eliminate the dependency onSDK/types/codec
through the interface registry. This modification simplifies interactions with theInterfaceRegistry
and enhances modularity within the SDK.x/nft/module/module.go (2)
- 7-7: The addition of
"cosmossdk.io/core/registry"
import is appropriate for the changes made in theRegisterInterfaces
function. This import is necessary for utilizing theLegacyRegistry
interface, which is part of the effort to streamline module interactions with the interface registry.- 74-74: Modifying the
RegisterInterfaces
function signature to useregistry.LegacyRegistry
instead ofcdctypes.InterfaceRegistry
is in line with the PR's objectives. This change facilitates a more decoupled architecture by reducing direct dependencies on the SDK'stypes/codec
.x/crisis/module.go (2)
- 9-9: Adding
"cosmossdk.io/core/registry"
to the imports is necessary for the subsequent modification in theRegisterInterfaces
function. This change supports the PR's goal of decoupling modules from the SDK by using a more generalized interface registry.- 77-77: The update of the
RegisterInterfaces
function signature to acceptregistry.LegacyRegistry
aligns with the overarching goal of the PR to simplify and decouple the modules from direct SDK dependencies. This change is consistent and necessary for achieving a more modular architecture.x/upgrade/module.go (2)
- 8-8: The addition of
"cosmossdk.io/core/registry"
to the imports is appropriate and necessary for the changes made in theRegisterInterfaces
function. This import facilitates the use of theLegacyRegistry
interface, which is crucial for the PR's objective to streamline interactions with the interface registry.- 82-82: Changing the
RegisterInterfaces
function signature to utilizeregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is consistent with the PR's aim to reduce direct dependencies on the SDK'stypes/codec
. This modification supports a more decoupled and modular architecture within the SDK.x/feegrant/module/module.go (2)
- 8-8: The import of
"cosmossdk.io/core/registry"
is correctly added to support the changes in theRegisterInterfaces
function. This import is essential for utilizing theLegacyRegistry
interface, aligning with the PR's goal to simplify module interactions with the interface registry.- 76-76: Updating the
RegisterInterfaces
function signature to useregistry.LegacyRegistry
is in line with the PR's objectives to decouple modules from direct SDK dependencies. This change enhances modularity by reducing reliance on the SDK'stypes/codec
.types/module/core_module.go (1)
- 174-178: The modification of the
RegisterInterfaces
function signature within thecoreAppModuleAdaptor
struct to acceptregistry.LegacyRegistry
instead ofcodectypes.InterfaceRegistry
is consistent with the PR's aim to streamline and decouple module interactions with the interface registry. This change supports a more modular and flexible architecture by reducing direct dependencies on the SDK'stypes/codec
.x/evidence/module.go (2)
- 8-8: The addition of
cosmossdk.io/core/registry
and removal ofcodectypes
align with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more streamlined interface. This change is a positive step towards decoupling and modularization.- 85-85: Changing the parameter type in the
RegisterInterfaces
function fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
is in line with the PR's objectives to streamline interactions and reduce direct SDK dependencies. This modification enhances modularity and simplifies the module's interface with the SDK.x/authz/module/module.go (2)
- 8-8: The addition of
cosmossdk.io/core/registry
aligns with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more streamlined interface. This change is a positive step towards decoupling and modularization.- 95-95: Changing the parameter type in the
RegisterInterfaces
function fromcdctypes.InterfaceRegistry
toregistry.LegacyRegistry
is in line with the PR's objectives to streamline interactions and reduce direct SDK dependencies. This modification enhances modularity and simplifies the module's interface with the SDK.x/group/module/module.go (2)
- 8-8: The addition of
cosmossdk.io/core/registry
aligns with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more streamlined interface. This change is a positive step towards decoupling and modularization.- 86-86: Changing the parameter type in the
RegisterInterfaces
function toregistry.LegacyRegistry
is in line with the PR's objectives to streamline interactions and reduce direct SDK dependencies. This modification enhances modularity and simplifies the module's interface with the SDK.x/mint/module.go (2)
- 8-8: The addition of
cosmossdk.io/core/registry
aligns with the PR's objective to reduce direct dependencies on the Cosmos SDK by utilizing a more streamlined interface. This change is a positive step towards decoupling and modularization.- 86-86: Changing the parameter type in the
RegisterInterfaces
function toregistry.LegacyRegistry
is in line with the PR's objectives to streamline interactions and reduce direct SDK dependencies. This modification enhances modularity and simplifies the module's interface with the SDK.x/slashing/module.go (2)
- 8-8: The addition of the
cosmossdk.io/core/registry
import aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface defined incore
. This change is necessary for the subsequent modification in theRegisterInterfaces
function.- 85-85: Changing the parameter type in the
RegisterInterfaces
function fromcdctypes.InterfaceRegistry
toregistry.LegacyRegistry
is a key part of the PR's goal to eliminate the dependency onSDK/types/codec
through the interface registry. This modification ensures that the slashing module interacts with theInterfaceRegistry
through the newLegacyRegistry
interface, promoting a more decoupled architecture.x/bank/module.go (2)
- 9-9: The addition of the
cosmossdk.io/core/registry
import is consistent with the PR's objective to reduce direct SDK dependencies by leveraging a more streamlined interface defined incore
. This change is necessary for the subsequent modification in theRegisterInterfaces
function and aligns with the broader goal of enhancing modularity within the SDK.- 86-86: Changing the parameter type in the
RegisterInterfaces
function fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
is crucial for achieving the PR's goal of decoupling the bank module from direct SDK dependencies. This modification ensures that the bank module interacts with theInterfaceRegistry
through the newLegacyRegistry
interface, promoting a more decoupled and modular architecture.x/staking/module.go (2)
- 8-8: The addition of the
cosmossdk.io/core/registry
import supports the PR's objective to facilitate a more streamlined and decoupled interaction with theInterfaceRegistry
through theLegacyRegistry
interface. This change is essential for the subsequent modification in theRegisterInterfaces
function and aligns with the broader goal of reducing direct SDK dependencies.- 86-86: Modifying the parameter type in the
RegisterInterfaces
function fromcdctypes.InterfaceRegistry
toregistry.LegacyRegistry
is a critical step towards decoupling the staking module from direct SDK dependencies. This change ensures that the staking module interacts with theInterfaceRegistry
through the newLegacyRegistry
interface, promoting a more modular and loosely coupled architecture within the SDK.x/auth/module.go (2)
- 8-8: The addition of the
cosmossdk.io/core/registry
import aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface defined incore
. This change is necessary for the subsequent modification in theRegisterInterfaces
function and supports the broader goal of enhancing modularity within the SDK.- 80-80: Changing the parameter type in the
RegisterInterfaces
function fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
is crucial for achieving the PR's goal of decoupling the auth module from direct SDK dependencies. This modification ensures that the auth module interacts with theInterfaceRegistry
through the newLegacyRegistry
interface, promoting a more decoupled and modular architecture.x/distribution/module.go (3)
- 8-8: The addition of
"cosmossdk.io/core/registry"
aligns with the PR's objective to decouple modules from direct SDK dependencies. This change is appropriate and supports the goal of using a more streamlined interface.- 8-8: The removal of
"github.com/cosmos/cosmos-sdk/codec/types"
is consistent with the PR's goal to eliminate the dependency onSDK/types/codec
. This change supports the objective of reducing direct SDK dependencies.- 96-96: Changing the parameter type in
RegisterInterfaces
fromcdctypes.InterfaceRegistry
toregistry.LegacyRegistry
is a key part of the refactor to decouple the module from the Cosmos SDK and enhance modularity. This change is consistent with the PR's objectives.x/gov/module.go (3)
- 8-8: The addition of
"cosmossdk.io/core/registry"
aligns with the PR's objective to decouple modules from direct SDK dependencies. This change is appropriate and supports the goal of using a more streamlined interface.- 8-8: The removal of
"github.com/cosmos/cosmos-sdk/codec/types"
is consistent with the PR's goal to eliminate the dependency onSDK/types/codec
. This change supports the objective of reducing direct SDK dependencies.- 114-114: Changing the parameter type in
RegisterInterfaces
fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
is a key part of the refactor to decouple the module from the Cosmos SDK and enhance modularity. This change is consistent with the PR's objectives.simapp/v2/go.mod (3)
- 44-44: The update to
cosmossdk.io/x/distribution
aligns with the PR's objectives. Ensure compatibility and test thoroughly to avoid potential breaking changes.- 179-179: The update to
github.com/prometheus/client_golang
is noted. Verify compatibility and assess any performance impact due to this update.- 181-181: The update to
github.com/prometheus/common
is acknowledged. Ensure that this update does not affect the application's monitoring and metrics collection capabilities adversely.runtime/v2/manager.go (2)
- 10-10: The import changes align with the PR's objective to minimize direct dependencies on the Cosmos SDK by introducing
cosmossdk.io/core/registry
and removinggithub.com/cosmos/cosmos-sdk/codec/types
. Ensure that the removal of the SDK codec types import does not lead to unresolved references elsewhere in the file or project.- 103-103: The change in the
RegisterInterfaces
function signature fromcodectypes.InterfaceRegistry
toregistry.LegacyRegistry
supports the PR's goal of reducing SDK dependencies. Ensure that all modules implementingsdkmodule.HasRegisterInterfaces
are compatible with this change.testutil/mock/types_module_module.go (4)
- 73-73: The change from
types0.InterfaceRegistry
toregistry.LegacyRegistry
in theRegisterInterfaces
method ofMockAppModuleBasic
aligns with the PR's objective to decouple modules from direct SDK dependencies. This modification simplifies the interaction with the interface registry by utilizing a more streamlined interface defined incore
.- 158-158: The update in
MockAppModule
to useregistry.LegacyRegistry
instead oftypes0.InterfaceRegistry
for theRegisterInterfaces
method is consistent with the overarching goal of reducing direct dependencies on the Cosmos SDK. This change contributes to a more modular architecture by leveraging the newly definedLegacyRegistry
interface.- 330-330: Replacing
types0.InterfaceRegistry
withregistry.LegacyRegistry
in theRegisterInterfaces
method ofMockHasRegisterInterfaces
is another step towards achieving the PR's goal of minimizing SDK dependencies. This adjustment ensures that mock types are in line with the new decoupled architecture, promoting better modularity and maintainability.- 707-707: The modification in
MockHasABCIEndBlock
to useregistry.LegacyRegistry
for theRegisterInterfaces
method is in harmony with the PR's objectives. This change further exemplifies the effort to streamline interactions with the interface registry and enhance the modularity of the Cosmos SDK by reducing direct dependencies.testutil/mock/types_mock_appmodule.go (2)
- 140-140: The change from
types0.InterfaceRegistry
toregistry.LegacyRegistry
in theRegisterInterfaces
method forMockAppModuleWithAllExtensions
aligns with the PR's objective to decouple modules from direct SDK dependencies. This modification ensures that the mock implementation is consistent with the new interface defined incore/registry
. It's crucial to verify that all references and usages ofMockAppModuleWithAllExtensions
throughout the test suite have been updated accordingly to avoid any integration issues.- 308-308: Similar to the previous comment, the update in the
RegisterInterfaces
method forMockAppModuleWithAllExtensionsABCI
to useregistry.LegacyRegistry
is in line with the overarching goal of reducing direct dependencies on the Cosmos SDK. This change is essential for maintaining consistency across the codebase and ensuring that the mock implementations reflect the new architectural decisions. As with the previous change, it's important to ensure that all instances whereMockAppModuleWithAllExtensionsABCI
is used are checked and updated if necessary.types/module/module.go (3)
- 29-29: The import statement for
cosmossdk.io/core/registry
has been added, which aligns with the PR's objective to decouple modules from direct SDK dependencies by utilizing a more streamlined interface defined incore
. This change is necessary for the subsequent modifications in the file that replacetypes.InterfaceRegistry
withregistry.LegacyRegistry
.- 89-89: The
RegisterInterfaces
method signature in theHasRegisterInterfaces
interface has been updated to acceptregistry.LegacyRegistry
instead of the previouscodectypes.InterfaceRegistry
. This change is a direct implementation of the PR's objective to reduce direct dependencies on the Cosmos SDK'stypes/codec
by utilizing a new interface defined within thecore/registry
package. It's a crucial step towards achieving better modularity and reduced coupling with the SDK.- 316-316: The implementation of the
RegisterInterfaces
method in theManager
struct has been updated to acceptregistry.LegacyRegistry
as its parameter. This modification is consistent with the changes made in theHasRegisterInterfaces
interface and supports the PR's goal of decoupling modules from the Cosmos SDK'stypes/codec
. By doing so, it contributes to a more modular architecture where modules interact with theInterfaceRegistry
through a more streamlined and decoupled interface.simapp/v2/go.sum (2)
- 899-900: The update to
github.com/prometheus/client_golang
v1.19.0 is noted. It's important to ensure compatibility with this new version through thorough testing, especially given Prometheus's role in monitoring and metrics.- 915-916: The update to
github.com/prometheus/common
v0.48.0 is observed. Similar to the previous update, verifying compatibility and conducting thorough testing are essential steps to ensure the update does not adversely affect the project.
core/registry/legacy.go
Outdated
import gogoproto "github.com/cosmos/gogoproto/proto" | ||
|
||
type LegacyRegistry interface { | ||
RegisterInterface(protoName string, iface interface{}, impls ...gogoproto.Message) |
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.
RegisterInterface(protoName string, iface interface{}, impls ...gogoproto.Message) | |
RegisterInterface(protoName string, iface interface{}, impls ... protoiface.MessageV1) |
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.
This will take a bigger refactor though right? The concrete implementation we're passing around expects gogoproto.Message
cosmos-sdk/codec/types/interface_registry.go
Lines 191 to 196 in aa9ff3d
func (registry *interfaceRegistry) RegisterImplementations(iface interface{}, impls ...proto.Message) { | |
for _, impl := range impls { | |
typeURL := MsgTypeURL(impl) | |
registry.registerImpl(iface, typeURL, impl) | |
} | |
} |
core/registry/legacy.go
Outdated
// | ||
// Ex: | ||
// registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSend{}, &MsgMultiSend{}) | ||
RegisterImplementations(iface interface{}, impls ...gogoproto.Message) |
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.
RegisterImplementations(iface interface{}, impls ...gogoproto.Message) | |
RegisterImplementations(iface interface{}, impls ... protoiface.MessageV1) |
do you want to do this straight to main instead of server branch. dont think its contingent on anything in server |
Yea I can try to rebase onto main and see how it turns out |
Close in favor of #19652 |
High level Goal: Remove dependency of x/module -> SDK.
This PR's goal: Remove dependency on
SDK/types/codec
through interface registry.Methodology: Interact with
InterfaceRegistry
through a thinner interface defined incore
.Status: Ready for review, building, a couple test failures I think related to mock generation.
Questions:
core/registry/LegacyRegistry
manually, a mock gen script somewhere should be modified to generate an implementation of the core type, is that right?I can explore questions 1) and 2) a bit here or in a separate PR.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit
New Features
LegacyRegistry
interface to improve registration of interfaces and their implementations, enhancing the system's compatibility and flexibility.Refactor
LegacyRegistry
interface, streamlining interface registration processes.Chores
go.mod
andgo.sum
files, ensuring the latest versions for improved security and performance.Bug Fixes