-
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: zerodep core #21239
refactor: zerodep core #21239
Conversation
WalkthroughWalkthroughThe recent changes primarily focus on updating the Changes
Sequence Diagram(s)sequenceDiagram
participant A as Client
participant B as Server
participant C as Transaction Handler
participant D as Event Manager
A->>B: Send transaction message (transaction.Msg)
B->>C: Process transaction
C->>D: Emit event related to transaction
D-->>B: Event emitted successfully
B-->>A: Acknowledge transaction
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? 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 Configuration File (
|
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (4)
core/app/codec.go (1)
11-12
: Inconsistent usage ofgogoproto.Msg
andgogoproto.Message
.The change from
gogoproto.Message
togogoproto.Msg
in theProtoCodec
interface is not consistently applied across the codebase. Notably,gogoproto.Message
is still used in thegogoProtoCodec
interface and other parts of the code. Review and update the following areas to ensure consistency:
x/tx/decode/decode.go
: ThegogoProtoCodec
interface usesgogoproto.Message
.- Other instances where
gogoproto.Message
appears should be reviewed for consistency with the newgogoproto.Msg
type.Analysis chain
Verify the type change to
gogoproto.Msg
.The change from
gogoproto.Message
togogoproto.Msg
should be consistent throughout the codebase. Ensure that all implementations and usages ofProtoCodec
are updated accordingly.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of `ProtoCodec` interface to ensure consistency with the new `gogoproto.Msg` type. # Test: Search for `ProtoCodec` implementations and usages. Expect: Consistent use of `gogoproto.Msg`. rg --type go -A 5 'ProtoCodec'Length of output: 87360
core/testing/context.go (1)
6-6
: Inconsistent Import Path Usage DetectedThe import path "cosmossdk.io/core/transaction" is not consistently updated across the codebase. The alias "gogoproto" is still used in several files. Please ensure the following files are updated to reflect the new import path consistently:
core/testing/event.go
core/testing/context.go
core/registry/legacy.go
core/router/service.go
core/event/service.go
core/app/codec.go
Additionally, verify that the new package provides the necessary functionality expected from the previous import.
Analysis chain
Update the import statement.
The import path for
gogoproto
has been updated to"cosmossdk.io/core/transaction"
. Ensure that this change is consistent across the codebase and that the new package provides the necessary functionality.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of the new import path across the codebase. # Test: Search for the new import path. Expect: Consistent usage of the new path. rg --type go 'cosmossdk.io/core/transaction'Length of output: 5914
core/event/service.go (1)
22-22
: InconsistentEmit
Method Signature DetectedThe
Emit
method in theeventManager
struct withinserver/v2/stf/core_event_service.go
usestransaction.Msg
instead ofgogoproto.Msg
. This inconsistency may lead to compatibility issues with the updatedManager
interface. Please review and update the implementation to ensure compatibility.
- File:
server/v2/stf/core_event_service.go
- Current Signature:
func (em *eventManager) Emit(tev transaction.Msg) error
Analysis chain
Ensure compatibility of method signature change.
The
Emit
method signature in theManager
interface has been updated to usegogoproto.Msg
. Verify that all implementations of this interface have been updated accordingly and that this change does not introduce any breaking changes.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementations of the `Manager` interface. # Test: Search for implementations of `Manager`. Expect: Consistent usage of `gogoproto.Msg`. ast-grep --lang go --pattern $'type $_ struct {\n $$$\n}\n\nfunc ($_ *$_) Emit($_ gogoproto.Msg) error {\n $$$\n}'Length of output: 612
Script:
#!/bin/bash # Find all structs that implement the Manager interface rg 'type (\w+) struct' -A 10 | rg 'Emit\(' # Verify the Emit method signature in these implementations ast-grep --lang go --pattern $'func ($_ *$_) Emit($_ gogoproto.Msg) error {\n $$$\n}'Length of output: 400
server/v2/cometbft/abci.go (1)
73-73
: Type mismatch inNewConsensus
call forgRPCMethodsMap
.The method
GetGPRCMethodsToMessageMap
returns amap[string]func() gogoproto.Message
, which does not match the expected typemap[string]func() transaction.Msg
for theNewConsensus
function.
- Location of type mismatch:
server/v2/cometbft/server.go
: Call toNewConsensus
withappI.GetGPRCMethodsToMessageMap()
Please ensure the return type of
GetGPRCMethodsToMessageMap
aligns with the expected type inNewConsensus
.Analysis chain
Verify calls to
NewConsensus
with the updated parameter type.Ensure that all instances where
NewConsensus
is called pass amap[string]func() transaction.Msg
for thegRPCMethodsMap
parameter.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all calls to `NewConsensus` pass the correct `transaction.Msg` type for `gRPCMethodsMap`. # Test: Search for all calls to `NewConsensus`. Expect: Correct type for `gRPCMethodsMap`. rg --type go -A 5 'NewConsensus'Length of output: 2102
Script:
#!/bin/bash # Extract more lines around the call to `NewConsensus` in `server/v2/cometbft/server.go` to verify the type of `gRPCMethodsMap`. rg --type go -A 10 -B 5 'NewConsensus' server/v2/cometbft/server.goLength of output: 906
Script:
#!/bin/bash # Find the definition of `GetGPRCMethodsToMessageMap` to verify its return type. rg --type go 'func GetGPRCMethodsToMessageMap' -A 5Length of output: 53
Script:
#!/bin/bash # Search for `GetGPRCMethodsToMessageMap` within method definitions or interface declarations. rg --type go 'GetGPRCMethodsToMessageMap'Length of output: 483
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (34)
client/v2/go.sum
is excluded by!**/*.sum
collections/go.sum
is excluded by!**/*.sum
core/go.sum
is excluded by!**/*.sum
core/testing/go.sum
is excluded by!**/*.sum
go.sum
is excluded by!**/*.sum
server/v2/appmanager/go.sum
is excluded by!**/*.sum
server/v2/cometbft/go.sum
is excluded by!**/*.sum
server/v2/go.sum
is excluded by!**/*.sum
server/v2/stf/go.sum
is excluded by!**/*.sum
simapp/go.sum
is excluded by!**/*.sum
simapp/v2/go.sum
is excluded by!**/*.sum
store/v2/go.sum
is excluded by!**/*.sum
tests/go.sum
is excluded by!**/*.sum
x/accounts/defaults/lockup/go.sum
is excluded by!**/*.sum
x/accounts/defaults/multisig/go.sum
is excluded by!**/*.sum
x/accounts/go.sum
is excluded by!**/*.sum
x/auth/go.sum
is excluded by!**/*.sum
x/authz/go.sum
is excluded by!**/*.sum
x/bank/go.sum
is excluded by!**/*.sum
x/circuit/go.sum
is excluded by!**/*.sum
x/consensus/go.sum
is excluded by!**/*.sum
x/distribution/go.sum
is excluded by!**/*.sum
x/epochs/go.sum
is excluded by!**/*.sum
x/evidence/go.sum
is excluded by!**/*.sum
x/feegrant/go.sum
is excluded by!**/*.sum
x/gov/go.sum
is excluded by!**/*.sum
x/group/go.sum
is excluded by!**/*.sum
x/mint/go.sum
is excluded by!**/*.sum
x/nft/go.sum
is excluded by!**/*.sum
x/params/go.sum
is excluded by!**/*.sum
x/protocolpool/go.sum
is excluded by!**/*.sum
x/slashing/go.sum
is excluded by!**/*.sum
x/staking/go.sum
is excluded by!**/*.sum
x/upgrade/go.sum
is excluded by!**/*.sum
Files selected for processing (48)
- client/v2/go.mod (1 hunks)
- collections/go.mod (1 hunks)
- core/app/codec.go (1 hunks)
- core/appmodule/v2/handlers.go (1 hunks)
- core/event/service.go (2 hunks)
- core/go.mod (1 hunks)
- core/registry/legacy.go (2 hunks)
- core/router/service.go (2 hunks)
- core/testing/context.go (3 hunks)
- core/testing/event.go (3 hunks)
- core/testing/go.mod (1 hunks)
- core/transaction/transaction.go (1 hunks)
- go.mod (1 hunks)
- server/v2/appmanager/go.mod (1 hunks)
- server/v2/cometbft/abci.go (2 hunks)
- server/v2/cometbft/go.mod (1 hunks)
- server/v2/go.mod (1 hunks)
- server/v2/stf/core_event_service.go (3 hunks)
- server/v2/stf/core_router_service.go (3 hunks)
- server/v2/stf/go.mod (1 hunks)
- server/v2/stf/mock/tx.go (1 hunks)
- server/v2/stf/stf_router.go (4 hunks)
- server/v2/stf/stf_router_test.go (3 hunks)
- server/v2/stf/stf_test.go (3 hunks)
- simapp/go.mod (1 hunks)
- simapp/v2/go.mod (1 hunks)
- tests/go.mod (1 hunks)
- x/accounts/defaults/lockup/go.mod (1 hunks)
- x/accounts/defaults/multisig/go.mod (1 hunks)
- x/accounts/go.mod (1 hunks)
- x/auth/go.mod (1 hunks)
- x/authz/go.mod (1 hunks)
- x/bank/go.mod (1 hunks)
- x/circuit/go.mod (1 hunks)
- x/consensus/go.mod (1 hunks)
- x/distribution/go.mod (1 hunks)
- x/epochs/go.mod (1 hunks)
- x/evidence/go.mod (1 hunks)
- x/feegrant/go.mod (1 hunks)
- x/gov/go.mod (1 hunks)
- x/group/go.mod (1 hunks)
- x/mint/go.mod (1 hunks)
- x/nft/go.mod (1 hunks)
- x/params/go.mod (1 hunks)
- x/protocolpool/go.mod (1 hunks)
- x/slashing/go.mod (1 hunks)
- x/staking/go.mod (1 hunks)
- x/upgrade/go.mod (1 hunks)
Files skipped from review due to trivial changes (11)
- client/v2/go.mod
- collections/go.mod
- core/go.mod
- core/testing/go.mod
- server/v2/appmanager/go.mod
- x/accounts/defaults/lockup/go.mod
- x/epochs/go.mod
- x/feegrant/go.mod
- x/group/go.mod
- x/mint/go.mod
- x/protocolpool/go.mod
Additional context used
Path-based instructions (16)
core/app/codec.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/router/service.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/testing/context.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/registry/legacy.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/event/service.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/transaction/transaction.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.core/testing/event.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/core_event_service.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/mock/tx.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/core_router_service.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/stf_router_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"core/appmodule/v2/handlers.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/stf_router.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.server/v2/stf/stf_test.go (2)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Pattern
**/*_test.go
: "Assess the unit test code assessing sufficient code coverage for the changes associated in the pull request"tests/go.mod (1)
Pattern
tests/**/*
: "Assess the integration and e2e test code assessing sufficient code coverage for the changes associated in the pull request"server/v2/cometbft/abci.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (47)
core/app/codec.go (2)
4-4
: Import statement update looks good.The change to use
cosmossdk.io/core/transaction
aligns with the refactoring objectives to streamline dependencies.
22-24
: TheAnyResolver
interface update looks good.The new
AnyResolver
interface with theResolve
method aligns with the refactoring goals to streamline message handling.server/v2/stf/go.mod (1)
23-23
: Thereplace
directive update is justified.Updating
gogoproto
to a specific pseudo-version ensures compatibility and aligns with the refactoring goals. Ensure that this version resolves any existing issues or dependencies.core/router/service.go (2)
15-15
: TheInvokeTyped
method update looks good.The change to use
gogoproto.Msg
aligns with the refactoring goals and should be consistent with other parts of the codebase.
16-17
: TheInvokeUntyped
method update looks good.The change to use
gogoproto.Msg
and the updated comment enhance clarity and align with the refactoring goals.core/testing/context.go (1)
18-18
: Evaluate type change fromgogoproto.Message
togogoproto.Msg
.The type of
protoEvents
has been changed to usegogoproto.Msg
. Ensure that this change aligns with the intended usage of theMsg
type and that it doesn't introduce any type compatibility issues.Also applies to: 31-31
core/registry/legacy.go (2)
4-4
: Update the import statement.The import path for
gogoproto
has been updated to"cosmossdk.io/core/transaction"
. Ensure that this change is consistent across the codebase and that the new package provides the necessary functionality.
17-17
: Ensure compatibility of method signature changes.The method signatures in the
InterfaceRegistrar
interface have been updated to usegogoproto.Msg
. Verify that all implementations of this interface have been updated accordingly and that this change does not introduce any breaking changes.Also applies to: 24-24
core/event/service.go (1)
7-7
: Update the import statement.The import path for
gogoproto
has been updated to"cosmossdk.io/core/transaction"
. Ensure that this change is consistent across the codebase and that the new package provides the necessary functionality.core/transaction/transaction.go (1)
4-8
: LGTM! Verify the usage of theMsg
interface across the codebase.The new interface definition for
Msg
enhances flexibility by allowing different implementations. Ensure all types implementingMsg
define the required methods and check for any impact on existing code.core/testing/event.go (2)
6-6
: Update the import path to reflect the newMsg
type.The import path has been updated to use
cosmossdk.io/core/transaction
, aligning with the newMsg
interface. Ensure all references togogoproto
are updated accordingly.
33-33
: Ensure consistency inMsg
type usage.The
GetProtoEvents
andEmit
methods now usegogoproto.Msg
, aligning with the new interface. Verify that all message handling logic is consistent with this change.Also applies to: 42-42
Verification successful
Consistent Usage of
gogoproto.Msg
VerifiedThe usage of
gogoproto.Msg
is consistent across the codebase, including in theGetProtoEvents
andEmit
methods. The type is used uniformly in function parameters, return types, and data structures. No inconsistencies were found.
core/registry/legacy.go
: Used inRegisterInterface
andRegisterImplementations
.core/router/service.go
: Used inInvokeTyped
andInvokeUntyped
.core/testing/context.go
: Used inprotoEvents
.core/testing/event.go
: Used inGetProtoEvents
andEmit
.core/event/service.go
: Used inEmit
.core/app/codec.go
: Used inMarshal
,Unmarshal
, andResolve
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify consistency in the usage of `Msg` type across the codebase. # Test: Search for functions using `gogoproto.Msg`. Expect: Consistent usage in all relevant functions. ast-grep --lang go --pattern $'func $_($_ ...gogoproto.Msg) { $$$ }'Length of output: 71
Script:
#!/bin/bash # Description: Search for any usage of `gogoproto.Msg` in the codebase to verify consistency. # Search for all occurrences of `gogoproto.Msg` in the codebase. rg 'gogoproto\.Msg' -A 3Length of output: 2137
server/v2/stf/core_event_service.go (2)
14-14
: Add import fortransaction
package.The import statement for the
transaction
package has been added to use theMsg
type, reflecting its new role in event handling.
36-36
: Ensure proper handling oftransaction.Msg
in event methods.The methods
Emit
,EmitNonConsensus
, andTypedEventToEvent
now usetransaction.Msg
, aligning with the new interface. Verify that all related logic is updated to handletransaction.Msg
correctly.Also applies to: 54-54, 59-59
Verification successful
Handling of
transaction.Msg
is correctly implemented in event methods.The methods
Emit
,EmitNonConsensus
, andTypedEventToEvent
appropriately handletransaction.Msg
according to their intended functionality. The conversion and processing logic align with the expectations set by the review comment. No further action is needed.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the handling of `transaction.Msg` in event-related methods. # Test: Search for methods using `transaction.Msg`. Expect: Proper handling in all relevant methods. ast-grep --lang go --pattern $'func $_($_ transaction.Msg) { $$$ }'Length of output: 70
Script:
#!/bin/bash # Search for the implementation of the Emit method using transaction.Msg ast-grep --lang go --pattern $'func Emit($_ transaction.Msg) error { $$$ }' # Search for the implementation of the EmitNonConsensus method using transaction.Msg ast-grep --lang go --pattern $'func EmitNonConsensus($_ transaction.Msg) error { $$$ }' # Search for the implementation of the TypedEventToEvent method using transaction.Msg ast-grep --lang go --pattern $'func TypedEventToEvent($_ transaction.Msg) error { $$$ }'Length of output: 261
Script:
#!/bin/bash # Search for the Emit method that uses transaction.Msg ast-grep --lang go --pattern $'func Emit($_ transaction.Msg) { $$$ }' # Search for the EmitNonConsensus method that uses transaction.Msg ast-grep --lang go --pattern $'func EmitNonConsensus($_ transaction.Msg) { $$$ }' # Search for the TypedEventToEvent method that uses transaction.Msg ast-grep --lang go --pattern $'func TypedEventToEvent($_ transaction.Msg) { $$$ }'Length of output: 243
Script:
#!/bin/bash # Search for any usage of transaction.Msg in the core_event_service.go file rg 'transaction\.Msg' server/v2/stf/core_event_service.go -A 5 -B 5Length of output: 957
server/v2/stf/mock/tx.go (1)
99-99
: LGTM! But verify the impact of the type change.The change from
proto.Message
totransaction.Msg
enhances type safety. Ensure that all usages ofDecodeJSON
are compatible with this new type.server/v2/stf/core_router_service.go (1)
32-32
: LGTM! But verify the impact of the type changes.The changes from
gogoproto.Message
totransaction.Msg
improve type safety and specificity. Ensure that all method calls are compatible with these new types.Also applies to: 37-37, 60-60, 68-69
server/v2/stf/stf_router_test.go (1)
23-23
: LGTM! But verify test coverage and impact of type changes.The changes to use
transaction.Msg
improve type safety and consistency in tests. Ensure that all test cases cover the new types and functionalities.Also applies to: 61-63
Verification successful
Test coverage for
transaction.Msg
changes is sufficient. TheTestRouter
andTestMerge
functions inserver/v2/stf/stf_router_test.go
thoroughly cover the new types and functionalities, ensuring the changes are well-tested.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify test coverage for changes in `TestRouter` and `TestMerge`. # Test: Ensure all test cases cover the new types and functionalities. rg --type go -A 5 $'TestRouter|TestMerge'Length of output: 3101
Script:
#!/bin/bash # Description: Check the implementation details of `TestRouter` and `TestMerge` to verify coverage of `transaction.Msg`. # Extract the implementation of `TestRouter` and `TestMerge` functions. ast-grep --lang go --pattern 'func TestRouter($_) { $$$ }' ast-grep --lang go --pattern 'func TestMerge($_) { $$$ }'Length of output: 6396
server/v2/go.mod (1)
14-14
: Replace directive approved.The addition of the replace directive for
github.com/cosmos/gogoproto
to a specific version is appropriate for ensuring compatibility with new features or fixes.core/appmodule/v2/handlers.go (4)
11-16
: Function signature updates approved.The updates to the function signatures from
Message
totransaction.Msg
enhance type safety and clarity. Ensure that all usages of these handlers are updated accordingly.
86-102
: RegisterPostHandler function signature update approved.The update to use
transaction.Msg
in theRegisterPostHandler
function ensures consistency and type safety. Verify that all usages of this function are updated to match the new signature.
59-71
: RegisterPreHandler function signature update approved.The update to use
transaction.Msg
in theRegisterPreHandler
function enhances type safety. Verify that all usages of this function are updated to match the new signature.Verification successful
No usages of
RegisterPreHandler
found in the codebase.The
RegisterPreHandler
function is not currently used anywhere in the codebase, so there are no usages that need updating to match the new signature. The verification is complete.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of the RegisterPreHandler function to ensure they match the updated signature. # Test: Search for the RegisterPreHandler function. Expect: Only occurrences of the new signature. rg --type go -A 3 $'RegisterPreHandler'Length of output: 1091
Script:
#!/bin/bash # Description: Search for any usage of the RegisterPreHandler function across the codebase to ensure all usages match the new signature. # Test: Search for the RegisterPreHandler function calls. Expect: Identify any usage of the function. rg --type go 'RegisterPreHandler\('Length of output: 260
32-44
: RegisterHandler function signature update approved.The update to use
transaction.Msg
in theRegisterHandler
function ensures type safety. Verify that all usages of this function are updated to match the new signature.server/v2/stf/stf_router.go (3)
Line range hint
69-74
:
Global pre-handler function signature update approved.The update to use
transaction.Msg
in theglobalPreHandler
function aligns with the transaction-specific type, enhancing compatibility. Verify that all usages of this function are updated to match the new signature.Verification successful
Verification Successful: Global pre-handler function signature update is consistent.
All usages of the
globalPreHandler
function have been verified to match the updated signature usingtransaction.Msg
. No discrepancies found.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of the globalPreHandler function to ensure they match the updated signature. # Test: Search for the globalPreHandler function. Expect: Only occurrences of the new signature. rg --type go -A 3 $'globalPreHandler'Length of output: 1675
Line range hint
79-84
:
Global post-handler function signature update approved.The update to use
transaction.Msg
in theglobalPostHandler
function ensures consistency with the transaction-specific type. Verify that all usages of this function are updated to match the new signature.Verification successful
All usages of
globalPostHandler
are consistent with the updated signature. The function is only referenced withinserver/v2/stf/stf_router.go
, and all instances align with the new signature usingtransaction.Msg
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all usages of the globalPostHandler function to ensure they match the updated signature. # Test: Search for the globalPostHandler function. Expect: Only occurrences of the new signature. rg --type go -A 3 $'globalPostHandler'Length of output: 1625
Script:
#!/bin/bash # Search the entire repository for references to globalPostHandler to verify consistent usage. rg --type go 'globalPostHandler'Length of output: 668
Line range hint
110-126
:
Handler function in buildHandler signature update approved.The update to use
transaction.Msg
in the handler function returned bybuildHandler
aligns with the transaction-specific type, improving type safety. Verify that all usages of this function are updated to match the new signature.server/v2/cometbft/go.mod (1)
36-36
: Verify compatibility with the updatedgogoproto
version.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the rest of the codebase and that any new features or changes are properly integrated.x/auth/go.mod (1)
20-20
: Verify compatibility with the updatedgogoproto
version.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the rest of the codebase and that any new features or changes are properly integrated.x/consensus/go.mod (1)
16-16
: Verify compatibility with the updatedgogoproto
version.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the rest of the codebase and that any new features or changes are properly integrated.x/staking/go.mod (1)
18-18
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated to a newer version. Ensure that this does not introduce any breaking changes and is compatible with the current codebase.x/bank/go.mod (1)
18-18
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated. Ensure that this update is compatible with the current codebase and does not introduce any breaking changes.x/nft/go.mod (1)
15-15
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated. Ensure that this update is compatible with the current codebase and does not introduce any breaking changes.x/evidence/go.mod (1)
17-17
: Verify compatibility and impacts of thegogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update is compatible with other dependencies and does not introduce any breaking changes.x/slashing/go.mod (1)
19-19
: Verify compatibility and impacts of thegogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update is compatible with other dependencies and does not introduce any breaking changes.x/authz/go.mod (1)
19-19
: Verify compatibility and impacts of thegogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update is compatible with other dependencies and does not introduce any breaking changes.x/circuit/go.mod (1)
15-15
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update does not introduce any breaking changes or unexpected behavior in the codebase.x/distribution/go.mod (1)
20-20
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update does not introduce any breaking changes or unexpected behavior in the codebase.x/gov/go.mod (1)
23-23
: Verify the impact of thegogoproto
version update.The
gogoproto
dependency has been updated to a newer version. Ensure that this update does not introduce any breaking changes or unexpected behavior in the codebase.x/params/go.mod (1)
18-18
: Dependency Update Acknowledged.The
gogoproto
dependency has been updated to a more recent version. Ensure compatibility with any other components that rely on this library.server/v2/stf/stf_test.go (1)
25-29
: Refactoring totransaction.Msg
.The function now uses
transaction.Msg
instead ofproto.Message
, aligning with a more specific message protocol. Verify that all related components and tests are updated accordingly.Also applies to: 39-39
Verification successful
Refactoring to
transaction.Msg
verified.The transition from
proto.Message
totransaction.Msg
has been consistently applied across various components and test files in the codebase. This refactoring aligns with the updated message handling protocol. No further issues detected.
- Verified usage in
types/codec.go
,x/upgrade/types/codec.go
,types/tx_msg.go
, and many other files.- Tests in
types/mempool/signer_extraction_adapater_test.go
,types/mempool/mempool_test.go
, and others reflect the update.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls and related components are updated to use `transaction.Msg`. # Test: Search for the function usage. Expect: Only occurrences of the new type `transaction.Msg`. rg --type go -A 5 $'transaction.Msg'Length of output: 27197
x/accounts/go.mod (1)
15-15
: Dependency Update Acknowledged.The
gogoproto
dependency has been updated to a more recent version. Ensure compatibility with any other components that rely on this library.x/accounts/defaults/multisig/go.mod (1)
13-13
: Verify consistency ofgogoproto
version across the codebase.Ensure that the
gogoproto
version update is consistently applied across all modules to prevent version conflicts or unexpected behavior.go.mod (1)
31-31
: Verify consistency ofgogoproto
version across the codebase.Ensure that the
gogoproto
version update is consistently applied across all modules to prevent version conflicts or unexpected behavior.x/upgrade/go.mod (1)
21-21
: Verify consistency ofgogoproto
version across the codebase.Ensure that the
gogoproto
version update is consistently applied across all modules to prevent version conflicts or unexpected behavior.tests/go.mod (1)
26-26
: Verify compatibility ofgogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the existing codebase and does not introduce breaking changes.simapp/go.mod (1)
41-41
: Verify compatibility ofgogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the existing codebase and does not introduce breaking changes.simapp/v2/go.mod (1)
95-95
: Verify compatibility ofgogoproto
update.The
gogoproto
dependency has been updated to a newer version. Ensure that this version is compatible with the existing codebase and does not introduce breaking changes.server/v2/cometbft/abci.go (1)
63-63
: Verify usage ofgrpcMethodsMap
with the new type.The change in type for
grpcMethodsMap
fromgogoproto.Message
totransaction.Msg
should be reflected in all usages of this map. Ensure that all functions interacting withgrpcMethodsMap
correctly handle the new type.
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.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
server/v2/stf/stf_router.go (1)
163-169
: Inconsistent usage ofInvokeTyped
withtransaction.Msg
.The
InvokeTyped
function has been updated to usetransaction.Msg
as parameters, but there are still several invocations using different types such asconsensusv1.QueryParamsRequest
andgogoproto.Message
. Please ensure all invocations are updated to usetransaction.Msg
.
- Files with inconsistent usage:
x/upgrade/keeper/abci.go
x/auth/ante/setup.go
x/staking/keeper/msg_server.go
x/evidence/keeper/infraction.go
simapp/mint_fn.go
runtime/router.go
Analysis chain
Verify the correctness of the type change for
InvokeTyped
.Ensure that all invocations and implementations of
InvokeTyped
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all invocations of `InvokeTyped` use the correct type. # Test: Search for `InvokeTyped` usage. Expect: Only occurrences with `transaction.Msg`. rg --type go -A 5 $'InvokeTyped'Length of output: 11149
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- runtime/v2/manager.go (1 hunks)
- server/v2/stf/stf_router.go (5 hunks)
Additional context used
Path-based instructions (2)
server/v2/stf/stf_router.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 (5)
server/v2/stf/stf_router.go (3)
Line range hint
79-86
: Verify the correctness of the type change forglobalPostHandler
.Ensure that all invocations and implementations of
globalPostHandler
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.Verification successful
Type change for
globalPostHandler
verified successfully.The
globalPostHandler
is consistently used withtransaction.Msg
throughout the codebase, confirming the correctness of the type change. No further action is required.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all invocations of `globalPostHandler` use the correct type. # Test: Search for `globalPostHandler` usage. Expect: Only occurrences with `transaction.Msg`. rg --type go -A 5 $'globalPostHandler'Length of output: 2250
Line range hint
110-136
: Verify the correctness of the type change forbuildHandler
.Ensure that all invocations and implementations of
buildHandler
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.
Line range hint
69-76
: Verify the correctness of the type change forglobalPreHandler
.Ensure that all invocations and implementations of
globalPreHandler
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.Verification successful
Verification Successful: Type Change for
globalPreHandler
is CorrectThe
PreMsgHandler
is defined to accepttransaction.Msg
, confirming compatibility with the updatedglobalPreHandler
function. No further issues were found with this type change.
core/appmodule/v2/handlers.go
:PreMsgHandler
is defined asfunc(ctx context.Context, msg transaction.Msg) error
.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all invocations of `globalPreHandler` use the correct type. # Test: Search for `globalPreHandler` usage. Expect: Only occurrences with `transaction.Msg`. rg --type go -A 5 $'globalPreHandler'Length of output: 2297
Script:
#!/bin/bash # Description: Check the definition of `appmodulev2.PreMsgHandler` to verify compatibility with `transaction.Msg`. # Test: Search for the definition of `appmodulev2.PreMsgHandler`. rg --type go 'type PreMsgHandler'Length of output: 35
Script:
#!/bin/bash # Description: Locate the definition of `appmodulev2.PreMsgHandler` to verify its compatibility with `transaction.Msg`. # Test: Use `ast-grep` to search for `PreMsgHandler` type definition. ast-grep --lang go --pattern 'type PreMsgHandler $_'Length of output: 54
Script:
#!/bin/bash # Description: Search for any alias or related definition of `PreMsgHandler` to verify its compatibility with `transaction.Msg`. # Test: Use `rg` to search for `PreMsgHandler` across the repository. rg 'PreMsgHandler'Length of output: 2240
runtime/v2/manager.go (2)
Line range hint
682-690
: Verify the correctness of the type change formessagePassingInterceptor
.Ensure that all invocations and implementations of
messagePassingInterceptor
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.Verification successful
Type Change Verification Successful
The
messagePassingInterceptor
function is correctly updated to usetransaction.Msg
in its implementation and invocation. The type change is consistently applied in the codebase.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all invocations of `messagePassingInterceptor` use the correct type. # Test: Search for `messagePassingInterceptor` usage. Expect: Only occurrences with `transaction.Msg`. rg --type go -A 5 $'messagePassingInterceptor'Length of output: 666
670-676
: Verify the correctness of the type change forregisterMethod
.Ensure that all invocations and implementations of
registerMethod
are updated to usetransaction.Msg
instead ofappmodulev2.Message
.Verification successful
Type Change Verification for
registerMethod
: ConfirmedThe change from
appmodulev2.Message
totransaction.Msg
inregisterMethod
is consistent and appropriate across the codebase. Thetransaction.Msg
type is extensively used in relevant contexts, ensuring compatibility and correctness.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all invocations of `registerMethod` use the correct type. # Test: Search for `registerMethod` usage. Expect: Only occurrences with `transaction.Msg`. rg --type go -A 5 $'registerMethod'Length of output: 957
Script:
#!/bin/bash # Description: Extract the lines where `registerMethod` is called to check the argument types. # Extract lines around `registerMethod` calls to examine the arguments. rg --type go -C 3 'registerMethod' runtime/v2/manager.goLength of output: 844
Script:
#!/bin/bash # Description: Search for the definition and usage of `grpc.MethodDesc` to verify compatibility with `transaction.Msg`. # Find where `grpc.MethodDesc` is defined and used. rg --type go 'grpc.MethodDesc' -A 5Length of output: 45326
Script:
#!/bin/bash # Description: Search for the definition and usage of `transaction.Msg`. # Find where `transaction.Msg` is defined and used. rg --type go 'transaction.Msg' -A 5Length of output: 28877
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (2)
- core/testing/context.go (3 hunks)
- core/testing/event.go (3 hunks)
Files skipped from review as they are similar to previous changes (2)
- core/testing/context.go
- core/testing/event.go
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files selected for processing (4)
- core/app/codec.go (1 hunks)
- core/event/service.go (2 hunks)
- core/registry/legacy.go (2 hunks)
- core/router/service.go (2 hunks)
Files skipped from review as they are similar to previous changes (3)
- core/event/service.go
- core/registry/legacy.go
- core/router/service.go
Additional context used
Path-based instructions (1)
core/app/codec.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (4)
core/app/codec.go (4)
4-4
: Import change aligns with zero-dependency goal.The import statement now references
cosmossdk.io/core/transaction
, which is consistent with the PR's objective of achieving a zero-dependency architecture.
17-17
: Improved modularity withAnyResolver
integration.The
InterfaceRegistry
now embeds theAnyResolver
interface, enhancing modularity and flexibility in type resolution.
22-24
: Introduction ofAnyResolver
interface enhances clarity.The
AnyResolver
interface provides a clear contract for resolving types, aligning with the refactored architecture.
11-12
: UpdatedProtoCodec
interface for type specificity.The
Marshal
andUnmarshal
methods now usetransaction.Msg
, enhancing type specificity. Ensure all implementations ofProtoCodec
are updated to match this change.
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (2)
runtime/v2/go.sum
is excluded by!**/*.sum
x/tx/go.sum
is excluded by!**/*.sum
Files selected for processing (6)
- core/app/codec.go (1 hunks)
- core/event/service.go (2 hunks)
- core/registry/legacy.go (2 hunks)
- core/router/service.go (2 hunks)
- runtime/v2/go.mod (1 hunks)
- x/tx/go.mod (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- core/app/codec.go
- core/event/service.go
- core/router/service.go
Additional context used
Path-based instructions (1)
core/registry/legacy.go (1)
Pattern
**/*.go
: Review the Golang code for conformity with the Uber Golang style guide, highlighting any deviations.
Additional comments not posted (4)
core/registry/legacy.go (2)
4-4
: Update import totransaction
package.The import change from
gogoproto
totransaction
indicates a shift to a new package for handling transaction messages. Ensure that all dependencies on the old package are resolved.
17-17
: Update method signatures to usetransaction.Msg
.The method signatures in the
InterfaceRegistrar
interface now usetransaction.Msg
instead ofgogoproto.Message
. This enhances type specificity and aligns with the new transaction handling framework. Ensure all implementations of this interface are updated accordingly.Also applies to: 24-24
Verification successful
All Implementations of InterfaceRegistrar are Updated
The method signatures in the
InterfaceRegistrar
interface have been successfully updated to usetransaction.Msg
, and all relevant implementations reflect this change. Instances ofgogoproto.Message
found in the codebase are unrelated to this interface.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all implementations of the InterfaceRegistrar interface are updated to use transaction.Msg. # Test: Search for implementations of InterfaceRegistrar. Expect: All implementations use transaction.Msg. rg --type go -A 5 'InterfaceRegistrar'Length of output: 20548
Script:
#!/bin/bash # Description: Check for any remaining usage of gogoproto.Message with InterfaceRegistrar implementations. # Search for any usage of gogoproto.Message in the context of InterfaceRegistrar implementations. rg --type go 'gogoproto\.Message' -A 5Length of output: 44764
x/tx/go.mod (1)
11-11
: Upgradegogoproto
dependency version.The update to
gogoproto
versionv1.6.1-0.20240809124342-d6a57064ada0
may introduce improvements or bug fixes. Verify compatibility and ensure that all dependent code is tested against this version.runtime/v2/go.mod (1)
25-25
: Upgradegogoproto
dependency version.The update to
gogoproto
versionv1.6.1-0.20240809124342-d6a57064ada0
may introduce improvements or bug fixes. Verify compatibility and ensure that all dependent code is tested against this version.
That go.sum from serverv2 is suspiciously big, where does it come from? |
fixed, not sure where it came from |
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.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Files ignored due to path filters (1)
server/v2/go.sum
is excluded by!**/*.sum
Files selected for processing (1)
- server/v2/go.mod (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- server/v2/go.mod
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.
🚀
core/appmodule/v2/handlers.go
Outdated
} | ||
router.Register(messageName[Req](), untypedHandler) | ||
} | ||
// // RegisterHandler is a helper function that modules can use to not lose type safety when registering handlers to the |
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.
cc @testinginprod (#21176)
Description
this is a pr after discussion how to get core to zerodep
needs: cosmos/gogoproto#144
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.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit
New Features
gogoproto
package across multiple modules to enhance overall stability and performance.gogoproto.Message
totransaction.Msg
in various event and message handling functions, facilitating better clarity and type safety.Bug Fixes
Chores
go.mod
files across multiple modules, ensuring dependencies are current and properly maintained for improved project structure.