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

chore: cleanup core/app #21368

Merged
merged 16 commits into from
Aug 27, 2024
Merged

chore: cleanup core/app #21368

merged 16 commits into from
Aug 27, 2024

Conversation

tac0turtle
Copy link
Member

@tac0turtle tac0turtle commented Aug 20, 2024

Description

ref #21176

remove query and initchain structs as they are not needed
move interfaces to where they are used

rewrite stf to not use testify

rename app to server


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title, you can find examples of the prefixes below:
  • confirmed ! in the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • reviewed "Files changed" and left comments if necessary
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • updated the relevant documentation or specification, including comments for documenting Go code
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic, API design and naming, documentation is accurate, tests and test coverage

Summary by CodeRabbit

  • New Features

    • Introduced new structures for block transaction requests and responses, enhancing clarity in handling block data.
    • Added interfaces to facilitate dynamic interaction with various interface types, improving modularity.
  • Bug Fixes

    • Improved error handling and logging for better clarity during transaction processing.
  • Refactor

    • Reorganized code to transition from appmanager types to server types throughout the application, streamlining functionality.
  • Chores

    • Updated dependency requirements and removed unused packages to enhance maintainability and security.

Copy link
Contributor

coderabbitai bot commented Aug 20, 2024

Walkthrough

Walkthrough

The recent changes involve a significant restructuring of the codebase, primarily transitioning from an app package to a server package. Key data structures related to block processing, such as BlockRequest and BlockResponse, have been introduced, while older structures like QueryRequest and QueryResponse have been removed. This refactor aims to streamline interactions within the application and enhance modularity.

Changes

Files Change Summary
core/server/app.go, core/server/codec.go, core/server/doc.go Transitioned from app to server package, introducing new data structures for block processing and removing obsolete structures. New interfaces for modularity and extensibility were added.
server/v2/stf/stf.go, server/v2/cometbft/* Updated methods to utilize server types, improving integration with the new architecture for handling transactions and state management.
simapp/v2/app_di.go, simapp/v2/app_test.go Adjusted import paths and updated the usage of types from server, reinforcing the overall transition.
x/upgrade/depinject.go, x/upgrade/keeper/keeper.go Modified dependencies and types in the Keeper structure and related methods to align with the new server package structure.

Sequence Diagram(s)

sequenceDiagram
    participant A as App
    participant S as Server
    participant T as Tests

    A->>S: Send BlockRequest
    S->>S: Process Block
    S-->>A: Return BlockResponse
    A->>T: Validate response
    T-->>A: Log results
Loading

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

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 C:Cosmovisor Issues and PR related to Cosmovisor C:server/v2 Issues related to server/v2 C:server/v2 stf C:server/v2 api labels Aug 20, 2024
@tac0turtle tac0turtle marked this pull request as ready for review August 20, 2024 07:44
@tac0turtle tac0turtle requested a review from a team as a code owner August 20, 2024 07:44
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (22)
server/v2/stf/go.mod (1)

Testify is still in use across test files. The removal of github.com/stretchr/testify from go.mod will affect numerous test files that currently depend on it for assertions and other functionalities. Please ensure these test files are updated to remove or replace the testify dependency.

  • Test files still importing testify:
    • x/protocolpool/types/types_test.go
    • x/upgrade/types/storeloader_test.go
    • x/upgrade/types/plan_test.go
    • ... (and many more as listed in the output)
Analysis chain

Line range hint 5-5: Verify the impact of removing testify.

The removal of github.com/stretchr/testify may affect test assertions and mocking. Ensure that the tests have been updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the test files for any usage of `testify`.

# Test: Search for any remaining usage of `testify`. Expect: No occurrences.
rg --type go 'testify' --glob '!go.mod'

Length of output: 51043

server/v2/types.go (1)

7-7: Inconsistent Transition from coreapp to server

The transition from coreapp.InterfaceRegistry to server.InterfaceRegistry is incomplete. While server.InterfaceRegistry is used in several files, coreapp.InterfaceRegistry is still present in simapp/v2/app_di.go. Please review and update the code to ensure a consistent transition across the codebase.

  • simapp/v2/app_di.go: Contains coreapp.InterfaceRegistry
  • server/v2/types.go, server/v2/server_test.go, server/v2/api/grpc/codec.go: Use server.InterfaceRegistry
Analysis chain

Verify the transition from coreapp to server.

The import of InterfaceRegistry has shifted from coreapp to server. Ensure that this change is reflected throughout the codebase and does not introduce inconsistencies.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the transition from `coreapp` to `server`.

# Test: Search for any remaining usage of `coreapp.InterfaceRegistry`. Expect: No occurrences.
rg --type go 'coreapp.InterfaceRegistry'

Length of output: 130


Script:

#!/bin/bash
# Search for occurrences of `server.InterfaceRegistry` to verify if the transition is partially implemented.
rg --type go 'server.InterfaceRegistry'

Length of output: 376

server/v2/appmanager/types.go (1)

6-6: Incomplete Refactoring from appmanager to server.

The refactoring is incomplete as there are still references to appmanager.BlockResponse and appmanager.TxResult in the codebase. Please review and update these references to ensure consistency with the new server package.

  • server/v2/cometbft/utils.go: References to appmanager.BlockResponse and appmanager.TxResult.
  • server/v2/cometbft/handlers/defaults.go: Reference to appmanager.TxResult.
Analysis chain

Verify the refactoring from appmanager to server.

The types used in StateTransitionFunction methods have been updated. Ensure that all related code reflects this change and functions correctly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the refactoring from `appmanager` to `server`.

# Test: Search for any remaining usage of `appmanager.BlockRequest`, `appmanager.BlockResponse`, and `appmanager.TxResult`. Expect: No occurrences.
rg --type go 'appmanager\.(BlockRequest|BlockResponse|TxResult)'

Length of output: 503

server/v2/stf/stf_router_test.go (10)

23-24: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging. Consider including the test case name or scenario in the error message.

- t.Errorf("expected message: %v, got: %v", expectedMsg, gotMsg)
+ t.Errorf("TestRouter: expected message: %v, got: %v", expectedMsg, gotMsg)

32-33: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("unexpected error: %v", err)
+ t.Errorf("TestRouter: unexpected error: %v", err)

46-47: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Error("expected error, got nil")
+ t.Error("TestRouter: expected error, got nil")

53-54: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("unexpected error: %v", err)
+ t.Errorf("TestRouter: unexpected error: %v", err)

56-57: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("expected response: %v, got: %v", expectedResp, gotResp)
+ t.Errorf("TestRouter: expected response: %v, got: %v", expectedResp, gotResp)

64-65: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("unexpected error: %v", err)
+ t.Errorf("TestRouter: unexpected error: %v", err)

67-68: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("expected response: %v, got: %v", expectedResp, gotResp)
+ t.Errorf("TestRouter: expected response: %v, got: %v", expectedResp, gotResp)

116-117: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Error("expected error, got nil")
+ t.Error("TestMerge: expected error, got nil")

120-121: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("unexpected error: %v", err)
+ t.Errorf("TestMerge: unexpected error: %v", err)

123-124: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("expected merged message: %v, got: %v", tt.expected, tt.dst)
+ t.Errorf("TestMerge: expected merged message: %v, got: %v", tt.expected, tt.dst)
server/v2/stf/branch/branch_test.go (9)

13-15: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Error setting value: %v", err)
+ t.Errorf("TestBranch: Error setting value: %v", err)

20-21: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Error getting value: %v", err)
+ t.Errorf("TestBranch: Error getting value: %v", err)

24-25: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Expected nil value, got: %v", value)
+ t.Errorf("TestBranch: Expected nil value, got: %v", value)

28-29: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Expected value: %s, got: %s", wantValue, value)
+ t.Errorf("TestBranch: Expected value: %s, got: %s", wantValue, value)

36-37: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Error deleting value: %v", err)
+ t.Errorf("TestBranch: Error deleting value: %v", err)

54-55: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Error creating iterator: %v", err)
+ t.Errorf("TestBranch: Error creating iterator: %v", err)

60-61: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Expected iterator to be valid")
+ t.Errorf("TestBranch: Expected iterator to be valid")

65-66: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Expected key: %s, got: %s", wantKey, gotKey)
+ t.Errorf("TestBranch: Expected key: %s, got: %s", wantKey, gotKey)

68-69: Use consistent error messages.

Ensure that error messages are consistent and provide enough context for debugging.

- t.Errorf("Expected value: %s, got: %s", wantValue, gotValue)
+ t.Errorf("TestBranch: Expected value: %s, got: %s", wantValue, gotValue)
Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aeb0f27 and ba90a76.

Files ignored due to path filters (1)
  • server/v2/stf/go.sum is excluded by !**/*.sum
Files selected for processing (17)
  • core/server/app.go (4 hunks)
  • core/server/codec.go (1 hunks)
  • core/server/doc.go (1 hunks)
  • runtime/module.go (2 hunks)
  • server/v2/api/grpc/codec.go (2 hunks)
  • server/v2/appmanager/appmanager.go (4 hunks)
  • server/v2/appmanager/types.go (2 hunks)
  • server/v2/server_test.go (2 hunks)
  • server/v2/stf/branch/branch_test.go (3 hunks)
  • server/v2/stf/core_branch_service_test.go (4 hunks)
  • server/v2/stf/go.mod (1 hunks)
  • server/v2/stf/identity.go (1 hunks)
  • server/v2/stf/stf.go (14 hunks)
  • server/v2/stf/stf_router_test.go (3 hunks)
  • server/v2/stf/stf_test.go (10 hunks)
  • server/v2/types.go (2 hunks)
  • tools/cosmovisor/cmd/cosmovisor/version_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
  • core/server/doc.go
  • server/v2/stf/identity.go
  • tools/cosmovisor/cmd/cosmovisor/version_test.go
Additional context used
Path-based instructions (13)
core/server/codec.go (1)

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

server/v2/types.go (1)

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

server/v2/appmanager/types.go (1)

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

core/server/app.go (1)

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

server/v2/server_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"

server/v2/api/grpc/codec.go (1)

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

server/v2/stf/core_branch_service_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"

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"

server/v2/stf/branch/branch_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"

server/v2/appmanager/appmanager.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.

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"

server/v2/stf/stf.go (1)

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

Additional comments not posted (35)
server/v2/stf/go.mod (1)

Line range hint 6-6: Ensure compatibility with the new gogoproto version.

The replace directive for github.com/cosmos/gogoproto has been updated. Verify that this version is compatible with the rest of the codebase.

core/server/codec.go (2)

14-18: Consider the implications of type aliasing for AnyResolver.

The type aliasing of AnyResolver might simplify imports but could also obscure the origin of the interface. Ensure this does not lead to confusion in the codebase.

Verification successful

Type aliasing for AnyResolver is consistent and clear.

The aliasing of AnyResolver is used consistently across the codebase, primarily in conjunction with jsonpb. This does not obscure the origin of the interface, as its usage is clear and well-documented. The alias simplifies imports without causing confusion.

  • Usage is consistent in files such as server/v2/api/grpcgateway/server.go and codec/unknownproto/unknown_fields.go.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify usage of `AnyResolver`.

# Test: Search for usage of `AnyResolver`. Expect: Clear and consistent usage.
rg --type go 'AnyResolver'

Length of output: 3229


7-12: Ensure comprehensive implementation of InterfaceRegistry.

The InterfaceRegistry interface is defined with methods for listing implementations and interfaces. Ensure that implementations of this interface are thorough and consistent.

Verification successful

Comprehensive Implementation Verified for InterfaceRegistry.

The interfaceRegistry struct implements both ListImplementations and ListAllInterfaces methods, ensuring a thorough and consistent implementation of the InterfaceRegistry interface.

  • ListImplementations method is implemented at codec/types/interface_registry.go:214.
  • ListAllInterfaces method is implemented at codec/types/interface_registry.go:205.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify implementations of `InterfaceRegistry`.

# Test: Search for implementations of `InterfaceRegistry`. Expect: Consistent method implementations.
ast-grep --lang go --pattern 'type $_ struct { $$$ }' --pattern 'func ($_ *$_) ListImplementations($_) []string { $$$ }'

Length of output: 289


Script:

#!/bin/bash
# Find structs that implement the InterfaceRegistry interface
ast-grep --lang go --pattern 'type $_ struct { $$$ }' --pattern '$_ InterfaceRegistry'

# Find ListImplementations method implementations
ast-grep --lang go --pattern 'func ($_ *$_) ListImplementations($_) []string { $$$ }'

Length of output: 1348


Script:

#!/bin/bash
# Find ListAllInterfaces method implementations
ast-grep --lang go --pattern 'func ($_ *$_) ListAllInterfaces() []string { $$$ }'

Length of output: 624

server/v2/types.go (1)

17-17: Check for seamless integration of server.InterfaceRegistry.

The return type of InterfaceRegistry has been updated. Verify that this change is compatible with existing implementations.

Verification successful

Compatibility of server.InterfaceRegistry Change Verified

The return type change for InterfaceRegistry in server.InterfaceRegistry appears to be compatible with existing implementations and usages in the codebase. No issues were found in the following locations:

  • Mock implementation in server/v2/server_test.go.
  • Usage in server/v2/api/grpc/codec.go.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify compatibility with `server.InterfaceRegistry`.

# Test: Search for implementations of `AppI` and check for compatibility. Expect: No issues.
ast-grep --lang go --pattern 'type $_ struct { $$$ }' --pattern 'func ($_ *$_) InterfaceRegistry() server.InterfaceRegistry { $$$ }'

Length of output: 301


Script:

#!/bin/bash
# Search for implementations of the InterfaceRegistry method returning server.InterfaceRegistry
ast-grep --lang go --pattern 'func ($_ *$_) InterfaceRegistry() server.InterfaceRegistry { $$$ }'

# Search for all usages of server.InterfaceRegistry in the codebase
rg 'server.InterfaceRegistry' -A 3

Length of output: 1078

server/v2/appmanager/types.go (3)

16-18: Ensure consistency in DeliverBlock method changes.

The DeliverBlock method now uses server.BlockRequest and server.BlockResponse. Verify that these changes are consistent with the rest of the codebase.

Verification successful

Consistency in DeliverBlock Method Changes Verified

The changes to the DeliverBlock method, involving server.BlockRequest and server.BlockResponse, are consistently integrated across the codebase. These types are used in both implementation and test files, confirming their proper adoption.

  • Files with Consistent Usage:
    • server/v2/stf/stf.go
    • server/v2/stf/stf_test.go
    • server/v2/appmanager/appmanager.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify consistency in `DeliverBlock` method changes.

# Test: Search for implementations of `DeliverBlock` and check for consistency. Expect: Consistent usage of `server` types.
ast-grep --lang go --pattern 'func ($_ *$_) DeliverBlock(ctx context.Context, block *server.BlockRequest[$_], state store.ReaderMap) (blockResult *server.BlockResponse, newState store.WriterMap, err error) { $$$ }'

Length of output: 216


Script:

#!/bin/bash
# Description: Search for all usages of `server.BlockRequest` and `server.BlockResponse` in the codebase.

# Search for usage of `server.BlockRequest`
rg 'server\.BlockRequest' -A 3

# Search for usage of `server.BlockResponse`
rg 'server\.BlockResponse' -A 3

Length of output: 4798


34-34: Confirm Simulate method changes.

The Simulate method now returns server.TxResult. Verify that this change is consistent across all implementations.


26-26: Validate ValidateTx method changes.

The ValidateTx method now returns server.TxResult. Ensure that this change is reflected in all implementations.

core/server/app.go (4)

Line range hint 12-23: Review of BlockRequest struct.

The BlockRequest struct is well-defined and uses a generic type T for transactions, which enhances flexibility. Ensure that the use of generics is consistent with the rest of the codebase.


Line range hint 25-33: Review of BlockResponse struct.

The BlockResponse struct is clear and concise, capturing essential elements of a block response. The use of appmodulev2.ValidatorUpdate and event.Event is appropriate. Ensure these dependencies are correctly imported and utilized.


Line range hint 35-48: Review of TxResult struct.

The TxResult struct provides a comprehensive representation of a transaction's execution result. The inclusion of fields like Events, Error, and GasUsed is beneficial for detailed transaction analysis.


1-1: Package name change to server.

The package name has been changed from app to server. This reflects the restructuring of the codebase to align with the new architecture. Ensure that all references to this package are updated accordingly.

Verification successful

Package name change verified successfully.

The package name change from app to server has been correctly applied throughout the codebase. No occurrences of package app were found, confirming that all references have been updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to the package name have been updated.

# Test: Search for the old package name usage. Expect: No occurrences of the old package name.
rg --type go -A 5 $'package app'

Length of output: 11155

server/v2/server_test.go (2)

14-14: Import statement update to coreserver.

The import statement has been updated from coreapp to coreserver. This aligns with the architectural changes. Ensure that all references to InterfaceRegistry are consistent with this change.


45-47: Method signature update in mockApp.

The InterfaceRegistry method now returns coreserver.InterfaceRegistry, reflecting the updated architecture. This change is consistent with the import updates and maintains the intended functionality.

server/v2/api/grpc/codec.go (3)

16-21: Introduction of protocdc interface.

The protocdc interface is well-defined, providing methods for marshaling, unmarshaling, and retrieving the codec name. This enhances flexibility and clarity in codec operations.


24-29: Update to protoCodec struct.

The protoCodec struct now uses server.InterfaceRegistry, aligning with the new architecture. This change supports better modularity and integration with server functionalities.


73-75: Update to grpcProtoCodec struct.

The grpcProtoCodec struct now uses the protocdc interface, standardizing the codec behavior across different message types. This change is consistent with the architectural updates.

server/v2/stf/core_branch_service_test.go (3)

63-67: Improved error handling in test cases.

The test now uses conditional statements for error checking instead of require assertions. This change improves clarity in error reporting and maintains the same logical checks.


78-83: Consistent error handling in test cases.

The test case consistently uses conditional statements to check for expected errors and gas usage, enhancing readability and error reporting.


95-104: Precision check for gas limit.

The test now includes a conditional check for gas limit precision, ensuring correctness in gas usage validation.

server/v2/appmanager/appmanager.go (4)

119-120: Verify consistency with new server types.

Ensure that all usages of BlockRequest and BlockResponse align with their new definitions in the server package.


150-153: Verify consistency with new server types.

Ensure that all usages of TxResult align with their new definitions in the server package.


141-144: Verify consistency with new server types.

Ensure that all usages of TxResult align with their new definitions in the server package.


42-45: Verify consistency with new server types.

Ensure that all usages of BlockRequest and BlockResponse align with their new definitions in the server package.

Verification successful

Verification Successful: Consistent Usage of server Types

The transition to using server.BlockRequest[T] and server.BlockResponse is consistent across the codebase. No inconsistencies were found in their usage.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all usages of `BlockRequest` and `BlockResponse` in the server package.

# Test: Search for `BlockRequest` and `BlockResponse` usages. Expect: Consistent usage with the new definitions.
rg --type go 'BlockRequest|BlockResponse'

Length of output: 123379

runtime/module.go (1)

291-291: Verify consistency with new server types.

Ensure that all usages of VersionModifier align with their new definitions in the server package.

server/v2/stf/stf_test.go (7)

100-108: Improved error handling in test case.

The use of t.Errorf with detailed error messages enhances the clarity of test failures.


114-137: Enhanced transaction result validation.

The test case now includes explicit checks for transaction results, improving test reliability.


153-176: Robust handling of out-of-gas scenario.

The test case effectively checks for state integrity and expected errors when out of gas.


186-198: Accurate error message verification.

The test case effectively verifies that the correct error messages are returned on transaction failure.


211-223: Effective post-transaction failure handling.

The test case accurately detects and reports errors occurring during post-transaction execution.


237-249: Comprehensive failure scenario testing.

The test case effectively checks for errors in both transaction and post-transaction phases.


261-273: Accurate validation failure detection.

The test case effectively verifies that validation errors are correctly reported.

server/v2/stf/stf.go (4)

Line range hint 85-155: Aligned with new architecture.

The DeliverBlock method now uses server types, improving modularity and consistency.


Line range hint 172-203: Improved transaction processing.

The deliverTx method now returns server.TxResult, enhancing error handling and processing.


410-414: Enhanced simulation accuracy.

The Simulate method now returns server.TxResult, improving simulation consistency.


428-431: Improved validation accuracy.

The ValidateTx method now returns server.TxResult, enhancing validation consistency.

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! Nice improvement.

The only point I have is to better define the split between core/server/InterfaceRegistry and core/registry/InterfaceRegistrar could be explained. Especially because the actual implementation in the SDK called InterfaceRegistry is both (

) (types.InterfaceRegistry, registry.InterfaceRegistrar, error) {
/
type InterfaceRegistry interface {
)

@julienrbrt
Copy link
Member

The build is failing because there are still usages of cosmossdk.io/core/app in the code

@julienrbrt julienrbrt mentioned this pull request Aug 20, 2024
15 tasks
core/server/app.go Outdated Show resolved Hide resolved
Copy link
Member

@aaronc aaronc left a comment

Choose a reason for hiding this comment

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

This is an improvement but it would be nice to have docs on fields too. For instance, TxResult has so many things in it and some see duplicated:

  • Resp and Data
  • Log and Info
  • Error, Code and Codespace

This obviously is directly pulled from ABCI. But do we really want to replicate all of this verbatim in core & server/v2? At least we should have docs for clarification

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 ba90a76 and 15005f4.

Files selected for processing (3)
  • core/server/app.go (3 hunks)
  • core/server/codec.go (1 hunks)
  • server/v2/stf/stf.go (14 hunks)
Files skipped from review as they are similar to previous changes (2)
  • core/server/codec.go
  • server/v2/stf/stf.go
Additional context used
Path-based instructions (1)
core/server/app.go (1)

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

Additional comments not posted (5)
core/server/app.go (5)

Line range hint 1-10: Package renaming and imports look good.

The renaming from app to server aligns with the PR objectives. The imports are appropriate and necessary for the defined structures.


Line range hint 12-23: BlockRequest struct is well-defined.

The use of generics enhances flexibility, and the comments clarify its purpose. The struct is appropriately structured for handling block-related requests.


25-31: BlockResponse struct is comprehensive and clear.

The struct effectively captures the necessary components for block responses, with clear comments explaining its role.


34-39: TxResult struct and documentation are appropriate.

The struct is well-documented, and its fields are suitable for capturing the results of transaction execution.


Line range hint 44-51: VersionModifier interface is necessary and well-defined.

The interface aligns with the architectural goals of managing versioning and consensus parameters.

Events []event.Event // Events produced by the transaction.
Resp []transaction.Msg // Response messages produced by the transaction.
Error error // Error produced by the transaction.
Code uint32 // Code produced by the transaction.
Copy link
Member

Choose a reason for hiding this comment

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

Can we have these before the field so that they're doc comments? Also this doesn't really explain what these mean. Copilot can mostly write docs for all fields and then we can expand where needed

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 went through the useage in comets spec and how we use it in baseapp and removed fields that we previously populated with error information. Ill double check with users if thats okay

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 15005f4 and 111b8cc.

Files selected for processing (11)
  • core/server/app.go (3 hunks)
  • core/server/doc.go (1 hunks)
  • runtime/v2/module.go (2 hunks)
  • server/v2/cometbft/abci.go (5 hunks)
  • server/v2/cometbft/handlers/defaults.go (1 hunks)
  • server/v2/cometbft/streaming.go (3 hunks)
  • server/v2/cometbft/utils.go (4 hunks)
  • simapp/v2/app_di.go (2 hunks)
  • simapp/v2/app_test.go (3 hunks)
  • x/upgrade/depinject.go (2 hunks)
  • x/upgrade/keeper/keeper.go (3 hunks)
Files skipped from review due to trivial changes (1)
  • core/server/doc.go
Additional context used
Path-based instructions (10)
core/server/app.go (1)

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

server/v2/cometbft/streaming.go (1)

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

x/upgrade/depinject.go (1)

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

simapp/v2/app_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"

server/v2/cometbft/handlers/defaults.go (1)

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

simapp/v2/app_di.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.

server/v2/cometbft/utils.go (1)

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

x/upgrade/keeper/keeper.go (1)

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

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 (19)
core/server/app.go (3)

Line range hint 12-23: Verify the correctness of AppHash.

The AppHash field was questioned in previous reviews. Ensure its usage and definition are correct.


25-31: LGTM!

The BlockResponse structure is well-defined and aligns with its intended purpose.


34-49: LGTM!

The TxResult structure is well-documented and correctly implemented.

server/v2/cometbft/streaming.go (1)

Line range hint 13-35: Verify the impact of changes on functionality.

The switch to server.TxResult and the simplification of ExecTxResult may affect functionality. Ensure that these changes align with the intended behavior.

x/upgrade/depinject.go (1)

43-43: Verify the correctness of AppVersionModifier type change.

The change to coreserver.VersionModifier should be verified to ensure it aligns with the intended architectural decisions.

simapp/v2/app_test.go (3)

16-16: Import statement update aligns with restructuring.

The import statement for server replaces app2, aligning with the restructuring efforts. Ensure that all dependencies are correctly updated.


126-126: Ensure consistency in MoveNextBlock.

The usage of server.BlockRequest in MoveNextBlock is consistent with the changes in NewTestApp. Ensure that this change does not affect the logic of the test.


83-83: Correct usage of server.BlockRequest.

The change from app2.BlockRequest to server.BlockRequest is consistent with the import update. Verify that the server.BlockRequest provides the same functionality as before.

Run the following script to verify the BlockRequest implementation:

Verification successful

Verification successful for server.BlockRequest.

The BlockRequest type is defined in the server package with fields that are consistent with its likely usage in blockchain-related operations. The change from app2.BlockRequest to server.BlockRequest is valid.

  • Location: core/server/app.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `BlockRequest` in the server package.

ast-grep --lang go --pattern $'package server {
  $$$
  type BlockRequest[$$$] struct {
    $$$
  }
  $$$
}'

Length of output: 608


Script:

#!/bin/bash
# Description: Verify the implementation of `BlockRequest` in the server package.

ast-grep --lang go --pattern $'type BlockRequest[$$$] struct {
  $$$
}'

Length of output: 72


Script:

#!/bin/bash
# Description: Search for the definition of `BlockRequest` across the entire codebase.

rg 'type BlockRequest' -A 5

Length of output: 271

server/v2/cometbft/handlers/defaults.go (2)

12-12: Import statement update aligns with restructuring.

The import statement for server replaces appmanager, aligning with the restructuring efforts. Ensure that all dependencies are correctly updated.


19-19: Updated return type in ValidateTx.

The return type of ValidateTx has been updated to server.TxResult. Ensure that this change is compatible with the existing logic and does not introduce any errors.

Run the following script to verify the TxResult implementation:

Verification successful

Updated return type in ValidateTx is compatible.

The TxResult type is well-defined in core/server/app.go with fields covering necessary transaction details. Ensure that the rest of the codebase handles these fields appropriately to maintain compatibility.

  • core/server/app.go: Lines 35-50
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the implementation of `TxResult` in the server package.

ast-grep --lang go --pattern $'package server {
  $$$
  type TxResult struct {
    $$$
  }
  $$$
}'

Length of output: 590


Script:

#!/bin/bash
# Description: Search for the `TxResult` type definition in the Go files.

ast-grep --lang go --pattern $'type TxResult struct { $$$ }'

Length of output: 1023

simapp/v2/app_di.go (2)

10-10: Import statement update aligns with restructuring.

The import statement for server replaces coreapp, aligning with the restructuring efforts. Ensure that all dependencies are correctly updated.


215-215: Updated return type in InterfaceRegistry.

The return type of InterfaceRegistry has been updated to server.InterfaceRegistry. Ensure that this change is compatible with the existing logic and does not introduce any errors.

Run the following script to verify the InterfaceRegistry implementation:

runtime/v2/module.go (1)

22-22: Verify the usage of ProvideAppVersionModifier.

The function now returns a server.VersionModifier instead of app.VersionModifier. Ensure that all usages of this function are updated accordingly in the codebase.

Run the following script to verify the function usage:

Also applies to: 245-245

Verification successful

Verification Successful: Function Usage Updated

The function ProvideAppVersionModifier has been updated to return server.VersionModifier, and all usages in the codebase are consistent with this change. There are no other occurrences that require updates.

  • runtime/module.go
  • runtime/v2/module.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `ProvideAppVersionModifier` match the new return type.

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

Length of output: 1256


Script:

#!/bin/bash
# Search for all usages of ProvideAppVersionModifier across the codebase to ensure they match the new return type.
rg --type go 'ProvideAppVersionModifier'

Length of output: 515

server/v2/cometbft/utils.go (1)

23-23: Verify the impact of type changes in function signatures.

The functions now use server.BlockResponse and server.TxResult instead of appmanager types. Ensure that all related code is updated to accommodate these changes.

Run the following script to verify the impact of these changes:

Also applies to: 71-71, 102-102, 149-149

Verification successful

Type Changes Successfully Implemented

The transition to using server.BlockResponse and server.TxResult has been completed without any remaining instances of the old appmanager types. All related code appears to be updated accordingly.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all function calls to `finalizeBlockResponse`, `intoABCITxResults`, and `intoABCISimulationResponse` match the new parameter types.

# Test: Search for the function usage. Expect: Only occurrences of the new parameter types.
rg --type go -A 5 $'finalizeBlockResponse|intoABCITxResults|intoABCISimulationResponse'

Length of output: 2584


Script:

#!/bin/bash
# Search for any remaining instances of the old types `appmanager.BlockResponse` and `appmanager.TxResult`
rg --type go 'appmanager.BlockResponse|appmanager.TxResult'

Length of output: 61

x/upgrade/keeper/keeper.go (1)

17-17: Verify the usage of versionModifier in the Keeper struct.

The versionModifier field now uses server.VersionModifier instead of app.VersionModifier. Ensure that all related code is updated to accommodate this change.

Run the following script to verify the usage of versionModifier:

Also applies to: 37-37, 54-54

server/v2/cometbft/abci.go (4)

17-17: Import addition is appropriate.

The addition of the server import aligns with the changes in block request handling.


288-288: Logging adjustment is approved.

The omission of the Log field from the warning message may indicate a refinement in the logging strategy.


440-440: Transition to server.BlockRequest[T] is approved.

The change reflects a shift in the source of the block request structure, likely for better modularity.

Ensure that all instances of BlockRequest[T] are updated throughout the codebase.


267-267: Transition to server.BlockRequest[T] is approved.

The change reflects a shift in the source of the block request structure, likely for better modularity.

Ensure that all instances of BlockRequest[T] are updated throughout the codebase.

Run the following script to verify the usage of BlockRequest[T]:

Verification successful

Transition to server.BlockRequest[T] is consistent across the codebase.

All instances of BlockRequest[T] have been updated to use server.BlockRequest[T]. The change is uniformly applied in the following files:

  • server/v2/stf/stf.go
  • server/v2/cometbft/abci.go
  • server/v2/appmanager/appmanager.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all instances of `BlockRequest[T]` are updated.

# Test: Search for the usage of `BlockRequest[T]`. Expect: Only occurrences of `server.BlockRequest[T]`.
rg --type go 'BlockRequest\[T\]'

Length of output: 415

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (3)
core/server/app.go (2)

Line range hint 12-23: Clarify the purpose of the AppHash field.

The comment for AppHash could be more descriptive to explain its role in the block request.

Consider expanding the comment to clarify what AppHash represents in the context of a block request.


34-49: Consider making the Code field explanation more concise.

The explanation for the Code field is informative but could be simplified for clarity.

Consider rephrasing to make the explanation more concise while retaining the necessary details.

server/v2/cometbft/handlers/defaults.go (1)

19-19: Implementation of ValidateTx not returning server.TxResult.

The ValidateTx method in x/auth/ante/sigverify.go currently returns an error instead of server.TxResult. This needs to be updated to align with the AppManager interface change.

  • File: x/auth/ante/sigverify.go
  • Method: ValidateTx
Analysis chain

Interface change approved.

The ValidateTx method now returning server.TxResult aligns with the refactoring efforts.

Ensure that all implementations of AppManager are updated to return server.TxResult.

Run the following script to verify the implementation of AppManager:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all implementations of `AppManager` return `server.TxResult`.

# Test: Search for the implementation of `AppManager`. Expect: Only occurrences of `server.TxResult`.
ast-grep --lang go --pattern $'type $_ struct {
  $$$
}
func ($_ *$_) ValidateTx(ctx context.Context, tx $_) (server.TxResult, error) {
  $$$
}'

Length of output: 680


Script:

#!/bin/bash
# Description: Verify all implementations of `AppManager` return `server.TxResult`.

# Find all implementations of the `ValidateTx` method and check for the return type.
rg --multiline --multiline-dotall 'func \(\w+ \*?\w+\) ValidateTx\(.+\) \((.+), error\)' -A 5

Length of output: 8471

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 15005f4 and 111b8cc.

Files selected for processing (11)
  • core/server/app.go (3 hunks)
  • core/server/doc.go (1 hunks)
  • runtime/v2/module.go (2 hunks)
  • server/v2/cometbft/abci.go (5 hunks)
  • server/v2/cometbft/handlers/defaults.go (1 hunks)
  • server/v2/cometbft/streaming.go (3 hunks)
  • server/v2/cometbft/utils.go (4 hunks)
  • simapp/v2/app_di.go (2 hunks)
  • simapp/v2/app_test.go (3 hunks)
  • x/upgrade/depinject.go (2 hunks)
  • x/upgrade/keeper/keeper.go (3 hunks)
Files skipped from review due to trivial changes (1)
  • core/server/doc.go
Additional context used
Path-based instructions (10)
core/server/app.go (1)

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

server/v2/cometbft/streaming.go (1)

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

x/upgrade/depinject.go (1)

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

simapp/v2/app_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"

server/v2/cometbft/handlers/defaults.go (1)

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

simapp/v2/app_di.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.

server/v2/cometbft/utils.go (1)

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

x/upgrade/keeper/keeper.go (1)

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

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 (18)
core/server/app.go (2)

25-32: LGTM! The BlockResponse struct is well-defined.

The struct aligns with the intended functionality and enhances clarity in block processing.


Line range hint 51-59: LGTM! The VersionModifier interface is clear and well-defined.

The interface aligns with its intended purpose of managing app versioning.

server/v2/cometbft/streaming.go (1)

17-17: LGTM! The streamDeliverBlockChanges function changes are appropriate.

The switch to server.TxResult aligns with the refactor goals and maintains the function's logic.

x/upgrade/depinject.go (1)

43-43: LGTM! The ModuleInputs struct changes are appropriate.

The shift to coreserver.VersionModifier aligns with the architectural update and enhances dependency management.

simapp/v2/app_test.go (3)

16-16: Import change approved.

The addition of the server package aligns with the refactoring of BlockRequest usage.


Line range hint 126-131: BlockRequest refactoring approved.

The usage of server.BlockRequest is consistent with the refactoring efforts.

Ensure that all references to BlockRequest are updated throughout the codebase.


Line range hint 83-89: BlockRequest refactoring approved.

The usage of server.BlockRequest is consistent with the refactoring efforts.

Ensure that all references to BlockRequest are updated throughout the codebase.

Run the following script to verify the usage of BlockRequest:

Verification successful

BlockRequest references updated successfully.

The BlockRequest type has been updated to server.BlockRequest where applicable. Other references in the codebase are unrelated to this change.

  • The usage of server.BlockRequest is consistent with the refactoring efforts.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify all references to `BlockRequest` are updated.

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

Length of output: 216968

simapp/v2/app_di.go (1)

215-215: Method change approved.

The InterfaceRegistry method now returning server.InterfaceRegistry aligns with the refactoring efforts.

Ensure that all usages of InterfaceRegistry are updated to handle server.InterfaceRegistry.

Run the following script to verify the usage of InterfaceRegistry:

runtime/v2/module.go (2)

22-22: Import change approved.

The addition of the server package is consistent with the shift in functionality from app to server.


245-246: Function signature change approved.

The change in the return type of ProvideAppVersionModifier from app.VersionModifier to server.VersionModifier aligns with the architectural shift.

server/v2/cometbft/utils.go (3)

Line range hint 71-75: Parameter type change approved.

The change in the parameter type of finalizeBlockResponse from appmanager.BlockResponse to server.BlockResponse aligns with the architectural shift.


102-103: Parameter type change approved.

The change in the parameter type of intoABCITxResults from appmanager.TxResult to server.TxResult is consistent with the architectural shift.


149-150: Parameter type change approved.

The change in the parameter type of intoABCISimulationResponse from appmanager.TxResult to server.TxResult aligns with the architectural transition.

x/upgrade/keeper/keeper.go (2)

37-37: Struct field type change approved.

The change in the versionModifier field type from app.VersionModifier to server.VersionModifier reflects the architectural shift in version management.


54-55: Function parameter type change approved.

The change in the parameter type for vs in NewKeeper from app.VersionModifier to server.VersionModifier aligns with the architectural reorganization.

server/v2/cometbft/abci.go (3)

17-17: Import change approved.

The addition of the server package import aligns with the refactoring changes.


267-267: Refactor to server.BlockRequest approved.

The transition to using server.BlockRequest reflects the architectural restructuring and maintains the existing logic.


440-440: Refactor to server.BlockRequest approved.

The transition to using server.BlockRequest is consistent with the architectural restructuring and maintains the existing logic.

@github-actions github-actions bot removed the C:Cosmovisor Issues and PR related to Cosmovisor label Aug 21, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: .coderabbit.yml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 111b8cc and e68f1b8.

Files selected for processing (2)
  • server/v2/stf/stf.go (14 hunks)
  • server/v2/stf/stf_router_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • server/v2/stf/stf.go
  • server/v2/stf/stf_router_test.go

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 e68f1b8 and 93a0188.

Files selected for processing (2)
  • runtime/v2/module.go (2 hunks)
  • server/v2/stf/stf_router_test.go (2 hunks)
Files skipped from review as they are similar to previous changes (2)
  • runtime/v2/module.go
  • server/v2/stf/stf_router_test.go

Copy link
Contributor

@hieuvubk hieuvubk left a comment

Choose a reason for hiding this comment

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

LGTM

@tac0turtle tac0turtle added this pull request to the merge queue Aug 27, 2024
Merged via the queue into main with commit 355f748 Aug 27, 2024
78 checks passed
@tac0turtle tac0turtle deleted the marko/core branch August 27, 2024 09:59
@julienrbrt
Copy link
Member

Due to module changes here we need to partially backport this

@julienrbrt
Copy link
Member

@Mergifyio backport release/v0.52.x

Copy link
Contributor

mergify bot commented Aug 27, 2024

backport release/v0.52.x

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 27, 2024
(cherry picked from commit 355f748)

# Conflicts:
#	core/server/app.go
#	runtime/v2/module.go
#	server/v2/api/grpc/codec.go
#	server/v2/appmanager/appmanager.go
#	server/v2/appmanager/types.go
#	server/v2/server_test.go
#	server/v2/stf/branch/branch_test.go
#	server/v2/stf/core_branch_service_test.go
#	server/v2/stf/go.mod
#	server/v2/stf/go.sum
#	server/v2/stf/stf.go
#	server/v2/stf/stf_router_test.go
#	server/v2/stf/stf_test.go
#	server/v2/types.go
@mergify mergify bot mentioned this pull request Aug 27, 2024
12 tasks
julienrbrt added a commit that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants