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(runtime/v2): remove dependency on sdk #20389

Merged
merged 8 commits into from
May 16, 2024
Merged

Conversation

kocubinski
Copy link
Member

@kocubinski kocubinski commented May 14, 2024

Description

A follow up to #20369, removes the dependency on the SDK from runtime/v2.


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

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

  • Refactor

    • Enhanced module imports and initialization functions for improved performance and maintainability.
    • Updated functions to support new interfaces for increased compatibility.
  • Chores

    • Streamlined codebase by removing outdated codec dependencies.

Copy link
Contributor

coderabbitai bot commented May 14, 2024

Walkthrough

Walkthrough

The update brings significant refactoring and modularization to the codebase. It includes adding new interfaces and methods for genesis operations, adjusting codec interfaces, and restructuring application modules for improved modularity. Changes involve updating import paths, modifying function signatures, and enhancing the dependency injection framework.

Changes

Files/Groups Change Summary
codec/depinject.go Added imports for various modules and introduced a new struct and function for address codec handling.
core/appmodule/genesis.go, core/appmodule/module.go Added interfaces and imports for legacy codec support and genesis operations.
core/appmodule/v2/genesis.go Introduced interfaces and methods for handling ABCI genesis operations.
crypto/codec/proto.go, crypto/keys/secp256r1/doc.go Updated imports and parameter types in registration functions.
runtime/* Updated imports, removed unused ones, and adjusted function signatures.
std/codec.go, types/codec.go, types/tx/types.go Changes in parameter types and imports for interface registration.
x/genutil/module.go Added imports, implemented a new interface, and added a method for decoding genesis JSON.

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the C:x/genutil genutil module issues label May 14, 2024
@@ -104,3 +110,11 @@ type ValidatorUpdate struct {
type HasRegisterInterfaces interface {
RegisterInterfaces(registry.InterfaceRegistrar)
}

type HasName interface {
Copy link
Member

Choose a reason for hiding this comment

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

this isn't a v2 thing only, so I'd put that on v1 and alias it here.

Name() string
}

type HasAminoCodec interface {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@@ -47,6 +49,10 @@ type HasEndBlocker interface {
EndBlock(context.Context) error
}

type HasABCIEndBlock interface {
Copy link
Member

Choose a reason for hiding this comment

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

do we want that to be a v2 thing that third-party modules can implement?
I would just do the interface check maybe in runtime/v2 for backward compatibility but not add it to core

Copy link
Member Author

Choose a reason for hiding this comment

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

That sounds reasonable to me.

@kocubinski kocubinski marked this pull request as ready for review May 15, 2024 19:47
@kocubinski kocubinski requested a review from a team as a code owner May 15, 2024 19:47
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Out of diff range and nitpick comments (7)
core/appmodule/genesis.go (1)

33-39: Consider adding comments to the methods in the HasGenesisBasics interface to improve code readability and maintainability.

Adding comments to interface methods helps other developers understand the purpose and usage of each method.

core/appmodule/module.go (2)

69-72: Consider adding comments to the Name method in the HasName interface to improve code readability and maintainability.

Adding comments to interface methods helps other developers understand the purpose and usage of each method.


74-78: Consider adding comments to the RegisterLegacyAminoCodec method in the HasAminoCodec interface to improve code readability and maintainability.

Adding comments to interface methods helps other developers understand the purpose and usage of each method.

codec/depinject.go (1)

55-64: Consider adding comments to the fields in the AddressCodecInputs struct to improve code readability and maintainability.

Adding comments to struct fields helps other developers understand the purpose and usage of each field.

x/genutil/module.go (1)

98-104: Consider adding comments to the DecodeGenesisJSON method to improve code readability and maintainability.

Adding comments to methods helps other developers understand the purpose and usage of each method.

runtime/v2/app.go (1)

64-67: Consider adding comments to the fields in the App struct to improve code readability and maintainability.

Adding comments to struct fields helps other developers understand the purpose and usage of each field.

runtime/v2/builder.go (1)

181-187: Consider adding comments to the AppBuilderWithPostTxExec method to improve code readability and maintainability.

Adding comments to methods helps other developers understand the purpose and usage of each method.

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 1643711 and dde3011.
Files ignored due to path filters (3)
  • runtime/v2/go.mod is excluded by !**/*.mod
  • runtime/v2/go.sum is excluded by !**/*.sum
  • x/accounts/defaults/lockup/go.mod is excluded by !**/*.mod
Files selected for processing (16)
  • codec/depinject.go (2 hunks)
  • core/appmodule/genesis.go (2 hunks)
  • core/appmodule/module.go (2 hunks)
  • core/appmodule/v2/genesis.go (1 hunks)
  • crypto/codec/proto.go (2 hunks)
  • crypto/keys/secp256r1/doc.go (2 hunks)
  • runtime/module.go (5 hunks)
  • runtime/v2/app.go (2 hunks)
  • runtime/v2/builder.go (3 hunks)
  • runtime/v2/manager.go (17 hunks)
  • runtime/v2/module.go (6 hunks)
  • runtime/v2/types.go (1 hunks)
  • std/codec.go (2 hunks)
  • types/codec.go (2 hunks)
  • types/tx/types.go (2 hunks)
  • x/genutil/module.go (3 hunks)
Additional Context Used
Path-based Instructions (16)
types/codec.go (1)

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

std/codec.go (1)

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

core/appmodule/v2/genesis.go (1)

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

crypto/keys/secp256r1/doc.go (1)

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

crypto/codec/proto.go (1)

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

runtime/v2/types.go (1)

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

core/appmodule/genesis.go (1)

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

core/appmodule/module.go (1)

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

codec/depinject.go (1)

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

x/genutil/module.go (1)

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

runtime/v2/app.go (1)

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

runtime/v2/builder.go (1)

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

types/tx/types.go (1)

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

runtime/v2/module.go (1)

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

runtime/module.go (1)

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

runtime/v2/manager.go (1)

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

Additional comments not posted (26)
types/codec.go (1)

21-23: Update to use registry.InterfaceRegistrar looks good.

std/codec.go (1)

Line range hint 21-27: Update to use registry.InterfaceRegistrar looks good.

core/appmodule/v2/genesis.go (3)

18-18: The HasGenesis interface is well-defined for handling genesis operations.


20-22: The HasABCIGenesis interface is well-defined for handling ABCI genesis operations.


24-26: The GenesisDecoder interface is well-defined for decoding genesis JSON data.

crypto/keys/secp256r1/doc.go (1)

34-36: Update to use registry.InterfaceRegistrar looks good.

crypto/codec/proto.go (1)

Line range hint 14-26: Update to use registry.InterfaceRegistrar looks good.

runtime/v2/types.go (2)

24-47: The validateProtoAnnotations function is well-implemented for validating proto annotations.


51-63: The validateMsgServiceAnnotations function is well-implemented for validating the cosmos.msg.v1.service proto annotation.

runtime/v2/builder.go (1)

41-52: Ensure that all modules implementing appmodule.HasName and appmodulev2.HasRegisterInterfaces are correctly registered.

Verify that all modules implementing these interfaces are correctly registered to avoid runtime errors.

types/tx/types.go (2)

8-8: Import statement for registry added.


Line range hint 230-238: The RegisterInterfaces function has been updated to use registry.InterfaceRegistrar.

runtime/v2/module.go (3)

Line range hint 107-141: The ProvideAppBuilder function has been updated to use registry.InterfaceRegistrar and legacy.Amino.


147-154: The AppInputs struct has been updated to use registry.InterfaceRegistrar and legacy.Amino.


163-165: The SetupAppBuilder function has been updated to register interfaces and legacy amino codec using the new registry and legacy packages.

runtime/module.go (1)

97-97: The ProvideApp function has been updated to include codec.ProvideAddressCodec.

runtime/v2/manager.go (10)

21-21: New imports added.

The new imports for legacy, registry, and transaction are appropriate and align with the changes in the code.


63-63: Ensure the defaultMigrationsOrder function is correctly implemented.

Verify that the defaultMigrationsOrder function correctly orders the modules, especially handling the "auth" module as specified.

Verification successful

The defaultMigrationsOrder function correctly handles the "auth" module by ensuring it is appended at the end of the sorted list of modules. The implementation is as follows:

  • It checks for the presence of the "auth" module.
  • It sorts the other modules.
  • It appends "auth" at the end if it exists.

This confirms that the function is correctly implemented.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify the implementation of the `defaultMigrationsOrder` function.

# Test: Search for the function implementation. Expect: Correct handling of the "auth" module.
rg --type go 'func defaultMigrationsOrder'

Length of output: 123



Script:

#!/bin/bash
# Extract the implementation of the `defaultMigrationsOrder` function from `runtime/v2/manager.go`
ast-grep --lang go --pattern $'func defaultMigrationsOrder(modules []string) []string {
  $$$
}' runtime/v2/manager.go

Length of output: 891


86-90: Ensure proper registration of legacy Amino codecs.

The RegisterLegacyAminoCodec function correctly registers the legacy Amino codecs for all modules implementing the HasAminoCodec interface.


Line range hint 107-115: Ensure proper handling of default genesis data.

The DefaultGenesis function correctly handles the default genesis data for all modules, including those implementing the HasGenesisBasics and HasGenesis interfaces.


Line range hint 122-130: Ensure proper validation of genesis data.

The ValidateGenesis function correctly validates the genesis data for all modules, including those implementing the HasGenesisBasics and HasGenesis interfaces.


Line range hint 137-193: Ensure proper initialization of genesis data from JSON.

The InitGenesisJSON function correctly initializes the genesis data from JSON for all modules, including handling special cases like the "genutil" module and modules implementing the GenesisDecoder, HasGenesis, and HasABCIGenesis interfaces.


Line range hint 199-234: Ensure proper export of genesis data for modules.

The ExportGenesisForModules function correctly exports the genesis data for the specified modules, including handling modules implementing the HasGenesis and HasABCIGenesis interfaces.


Line range hint 288-318: Ensure proper handling of end-block logic.

The EndBlock function correctly handles the end-block logic for all modules, including those implementing the HasEndBlocker and hasABCIEndBlock interfaces.


Line range hint 403-413: Ensure proper handling of module migrations.

The RunMigrations function correctly handles the migrations for all modules, including those implementing the HasConsensusVersion and HasABCIGenesis interfaces.


666-685: Ensure proper ordering of module migrations.

The defaultMigrationsOrder function correctly orders the modules for migrations, ensuring the "auth" module runs last as specified.

Comment on lines +66 to +92
// ProvideAddressCodec provides an address.Codec to the container for any
// modules that want to do address string <> bytes conversion.
func ProvideAddressCodec(in AddressCodecInputs) (address.Codec, address.ValidatorAddressCodec, address.ConsensusAddressCodec) {
if in.AddressCodecFactory != nil && in.ValidatorAddressCodecFactory != nil && in.ConsensusAddressCodecFactory != nil {
return in.AddressCodecFactory(), in.ValidatorAddressCodecFactory(), in.ConsensusAddressCodecFactory()
}

if in.AuthConfig == nil || in.AuthConfig.Bech32Prefix == "" {
panic("auth config bech32 prefix cannot be empty if no custom address codec is provided")
}

if in.StakingConfig == nil {
in.StakingConfig = &stakingmodulev1.Module{}
}

if in.StakingConfig.Bech32PrefixValidator == "" {
in.StakingConfig.Bech32PrefixValidator = fmt.Sprintf("%svaloper", in.AuthConfig.Bech32Prefix)
}

if in.StakingConfig.Bech32PrefixConsensus == "" {
in.StakingConfig.Bech32PrefixConsensus = fmt.Sprintf("%svalcons", in.AuthConfig.Bech32Prefix)
}

return addresscodec.NewBech32Codec(in.AuthConfig.Bech32Prefix),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixValidator),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixConsensus)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Ensure proper error handling in the ProvideAddressCodec function to avoid potential runtime panics.

- panic("auth config bech32 prefix cannot be empty if no custom address codec is provided")
+ return nil, nil, fmt.Errorf("auth config bech32 prefix cannot be empty if no custom address codec is provided")

Using panic for error handling is not recommended as it can cause the program to terminate unexpectedly. Returning an error allows the caller to handle it gracefully.


Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.

Suggested change
// ProvideAddressCodec provides an address.Codec to the container for any
// modules that want to do address string <> bytes conversion.
func ProvideAddressCodec(in AddressCodecInputs) (address.Codec, address.ValidatorAddressCodec, address.ConsensusAddressCodec) {
if in.AddressCodecFactory != nil && in.ValidatorAddressCodecFactory != nil && in.ConsensusAddressCodecFactory != nil {
return in.AddressCodecFactory(), in.ValidatorAddressCodecFactory(), in.ConsensusAddressCodecFactory()
}
if in.AuthConfig == nil || in.AuthConfig.Bech32Prefix == "" {
panic("auth config bech32 prefix cannot be empty if no custom address codec is provided")
}
if in.StakingConfig == nil {
in.StakingConfig = &stakingmodulev1.Module{}
}
if in.StakingConfig.Bech32PrefixValidator == "" {
in.StakingConfig.Bech32PrefixValidator = fmt.Sprintf("%svaloper", in.AuthConfig.Bech32Prefix)
}
if in.StakingConfig.Bech32PrefixConsensus == "" {
in.StakingConfig.Bech32PrefixConsensus = fmt.Sprintf("%svalcons", in.AuthConfig.Bech32Prefix)
}
return addresscodec.NewBech32Codec(in.AuthConfig.Bech32Prefix),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixValidator),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixConsensus)
}
// ProvideAddressCodec provides an address.Codec to the container for any
// modules that want to do address string <> bytes conversion.
func ProvideAddressCodec(in AddressCodecInputs) (address.Codec, address.ValidatorAddressCodec, address.ConsensusAddressCodec, error) {
if in.AddressCodecFactory != nil && in.ValidatorAddressCodecFactory != nil && in.ConsensusAddressCodecFactory != nil {
return in.AddressCodecFactory(), in.ValidatorAddressCodecFactory(), in.ConsensusAddressCodecFactory(), nil
}
if in.AuthConfig == nil || in.AuthConfig.Bech32Prefix == "" {
return nil, nil, nil, fmt.Errorf("auth config bech32 prefix cannot be empty if no custom address codec is provided")
}
if in.StakingConfig == nil {
in.StakingConfig = &stakingmodulev1.Module{}
}
if in.StakingConfig.Bech32PrefixValidator == "" {
in.StakingConfig.Bech32PrefixValidator = fmt.Sprintf("%svaloper", in.AuthConfig.Bech32Prefix)
}
if in.StakingConfig.Bech32PrefixConsensus == "" {
in.StakingConfig.Bech32PrefixConsensus = fmt.Sprintf("%svalcons", in.AuthConfig.Bech32Prefix)
}
return addresscodec.NewBech32Codec(in.AuthConfig.Bech32Prefix),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixValidator),
addresscodec.NewBech32Codec(in.StakingConfig.Bech32PrefixConsensus),
nil
}

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between dde3011 and 0485f2f.
Files selected for processing (1)
  • runtime/v2/manager.go (17 hunks)
Additional Context Used
Path-based Instructions (1)
runtime/v2/manager.go (1)

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

Additional comments not posted (7)
runtime/v2/manager.go (7)

21-21: New imports added for legacy, registry, transaction, log, and stf are appropriate and necessary for the refactored code.


63-63: Setting OrderMigrations to a default value if not provided is a good practice to avoid potential issues during migrations.


86-88: The RegisterLegacyAminoCodec function correctly iterates over the modules and registers the legacy amino codec if the module implements the HasAminoCodec interface.


107-107: The DefaultGenesis function now checks for the HasGenesisBasics interface, ensuring compatibility with modules implementing this interface.


122-122: The ValidateGenesis function now checks for the HasGenesisBasics interface, ensuring compatibility with modules implementing this interface.


Line range hint 137-193: The InitGenesisJSON function includes additional checks and handles different module types (HasGenesisAuto, GenesisDecoder, HasGenesis, HasABCIGenesis). This ensures proper initialization of genesis data for various module types.


199-202: The ExportGenesisForModules function includes a check to verify that the modules exist in the app before exporting genesis data, preventing potential panics during the export process.

Copy link
Member

@julienrbrt julienrbrt left a comment

Choose a reason for hiding this comment

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

lgtm!

@@ -64,3 +65,14 @@ type HasPrecommit interface {
appmodule.AppModule
Precommit(context.Context) error
}

// HasName is an extension interface that must return the appmodule.AppModule's Name.
type HasName interface {
Copy link
Member

Choose a reason for hiding this comment

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

Should we add an alias for this in appmodulev2? I remember it was considered as a legacy thing as we can get the module name as a depinject.ModuleKey, but the module manager doesn't really cares and is still very dependent on Name().

Cc @aaronc

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should make in a follow up the runtime/v2 module manager a bit less dependent on this to fulfill this abstraction.

Copy link
Member Author

Choose a reason for hiding this comment

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

I like it, created #20408

Copy link
Member

@tac0turtle tac0turtle left a comment

Choose a reason for hiding this comment

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

left one question otherwise LGTM

Comment on lines +8 to +9
authmodulev1 "cosmossdk.io/api/cosmos/auth/module/v1"
stakingmodulev1 "cosmossdk.io/api/cosmos/staking/module/v1"
Copy link
Member

Choose a reason for hiding this comment

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

are we fine with this for now? I guess there isn't a choice in the current design? maybe we open an issue to close before we release?

Copy link
Member

Choose a reason for hiding this comment

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

It is the modules config. When depinject supports gogo proto, we should make sure it is able to provide both types (if existing), so that the provider can resolve this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I cringed but also don't have an alternative at the moment.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits Files that changed from the base of the PR and between 0485f2f and 7f8d973.
Files selected for processing (3)
  • runtime/module.go (5 hunks)
  • runtime/v2/module.go (6 hunks)
  • types/tx/types.go (2 hunks)
Files skipped from review as they are similar to previous changes (1)
  • types/tx/types.go
Additional Context Used
Path-based Instructions (2)
runtime/v2/module.go (1)

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

runtime/module.go (1)

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

Additional comments not posted (9)
runtime/v2/module.go (8)

20-21: Necessary imports for legacy and registry.


107-110: Function signature includes new parameters interfaceRegistrar and amino.


121-123: Proto annotations validation ensures correctness at startup.


141-141: Return values are consistent with the function's purpose.


147-154: AppInputs struct includes new fields InterfaceRegistrar and LegacyAmino.


163-163: Function body initializes the app with the provided inputs.


165-165: TODO comment suggests a potential improvement for store key registration.


179-179: Function initializes a new module manager with the provided logger, config, and modules.

runtime/module.go (1)

97-97: Addition of ProvideAddressCodec to appconfig.Provide is necessary for the new address codec functionality.

@kocubinski kocubinski added this pull request to the merge queue May 16, 2024
Merged via the queue into main with commit e034766 May 16, 2024
67 checks passed
@kocubinski kocubinski deleted the kocu/runtime-v2-deps branch May 16, 2024 11:44
alpe added a commit that referenced this pull request May 23, 2024
* main: (95 commits)
  fix(x/accounts): check for overflows in multisig weights and votes (#20384)
  docs(x/account/auth): Improve error handling and comments in fee.go (#20426)
  docs: fix some markdown syntax (#20432)
  revert: bank change module to account change (#20427)
  fix: nil pointer panic when store don't exists in historical version (#20425)
  fix(store/v2): Remove should not error on miss (#20423)
  chore: upstream more changes from v2 (#20387)
  docs(x/auth/ante): fixed typo  in TxWithTimeoutHeight interface name (#20418)
  fix: avoid default sendenabled for module accounts (#20419)
  docs(x/auth): fixed typo in command example for multisign transaction (#20417)
  build(deps): Bump bufbuild/buf-setup-action from 1.31.0 to 1.32.0 (#20413)
  build(deps): Bump github.com/hashicorp/go-plugin from 1.6.0 to 1.6.1 in /store (#20414)
  feat(x/accounts): Add schema caching feature and corresponding test case (#20055)
  refactor(runtime/v2): remove dependency on sdk (#20389)
  refactor!: turn MsgsV2 into ReflectMessages to make it less confusing (#19839)
  docs: Enhanced the ParsePagination method documentation (#20385)
  refactor(runtime,core): split router service (#20401)
  chore: fix spelling errors (#20400)
  docs: Documented error handling in OfferSnapshot method (#20380)
  build(deps): Bump google.golang.org/grpc from 1.63.2 to 1.64.0 (#20390)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:x/accounts C:x/genutil genutil module issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants