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(node-core): remove chain service from middleware + cleanup #1842

Merged
merged 3 commits into from
Aug 3, 2024

Conversation

ocnc2
Copy link
Contributor

@ocnc2 ocnc2 commented Aug 2, 2024

Summary by CodeRabbit

  • New Features

    • Added several new functions to enhance API usability, including DefaultNodeAPIComponents, DefaultNodeAPIHandlers, and DefaultBrokerProviders.
    • Introduced a new reporting service, integrating logging and telemetry functionalities.
  • Improvements

    • Updated mock generation tool version to ensure improved performance and potential bug fixes across multiple mock files.
    • Restructured several component input types for better readability and maintainability.
  • Refactor

    • Removed redundant fields from structures such as ABCIMiddlewareInput and adjusted field ordering for improved clarity.

@ocnc2 ocnc2 enabled auto-merge (squash) August 2, 2024 19:59
Copy link
Contributor

coderabbitai bot commented Aug 2, 2024

Walkthrough

The recent changes involve updating the Mockery tool version from v2.43.2 to v2.44.1 across multiple mock files. Furthermore, significant modifications were made to structures and functions within core components such as api.go, api_handlers.go, and others, enhancing organization and readability. New functions and fields were introduced, improving integration and overall functionality within the codebase.

Changes

Files Change Summary
mod/engine-primitives/pkg/...mocks/*.mock.go, mod/node-api/backend/mocks/*.mock.go, mod/runtime/pkg/...mocks/*.mock.go, mod/storage/pkg/...mocks/*.mock.go Updated mock generation tool version from v2.43.2 to v2.44.1 across all listed files.
mod/node-core/pkg/components/api.go, api_handlers.go, attributes_factory.go, backend.go, block_store.go, block_store_service.go, brokers.go Structural reorganizations; new functions and fields added, enhancing functionality and maintainability.
mod/node-core/pkg/components/chain_service.go, db_manager.go, defaults.go, middleware.go Minor adjustments, primarily focused on field ordering or blank line additions for improved readability.
mod/node-core/pkg/components/reporting_service.go, service_registry.go, types.go Introduced new structures and functions, enhancing the overall functionality and integration of the services.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant API
    participant Service
    participant Logger

    User->>API: Request data
    API->>Logger: Log request
    API->>Service: Fetch data
    Service-->>API: Return data
    API-->>User: Respond with data
Loading

🐰 In the fields where I hop and play,
New tools bring joy to my day!
With mocks updated, neat and bright,
Our code now shines, a lovely sight!
So let’s all cheer, with a joyful cheer,
For changes that bring us all good cheer! 🌟


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.

CodeRabbit Configuration File (.coderabbit.yaml)

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

Documentation and Community

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

Copy link

codecov bot commented Aug 2, 2024

Codecov Report

Attention: Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.

Project coverage is 24.03%. Comparing base (2a8aaf9) to head (964f807).

Files Patch % Lines
mod/node-core/pkg/components/api_handlers.go 0.00% 11 Missing ⚠️
mod/node-core/pkg/components/brokers.go 0.00% 11 Missing ⚠️
mod/node-core/pkg/components/defaults.go 0.00% 10 Missing ⚠️
mod/node-core/pkg/components/api.go 0.00% 6 Missing ⚠️
mod/node-core/pkg/components/reporting_service.go 0.00% 6 Missing ⚠️
mod/node-core/pkg/components/attributes_factory.go 0.00% 3 Missing ⚠️
mod/node-core/pkg/components/service_registry.go 0.00% 1 Missing ⚠️
mod/runtime/pkg/middleware/middleware.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1842      +/-   ##
==========================================
- Coverage   24.06%   24.03%   -0.03%     
==========================================
  Files         325      326       +1     
  Lines       14027    14041      +14     
  Branches       18       18              
==========================================
  Hits         3375     3375              
- Misses      10537    10551      +14     
  Partials      115      115              
Files Coverage Δ
mod/node-core/pkg/components/backend.go 0.00% <ø> (ø)
mod/node-core/pkg/components/block_store.go 0.00% <ø> (ø)
...od/node-core/pkg/components/block_store_service.go 0.00% <ø> (ø)
mod/node-core/pkg/components/chain_service.go 0.00% <ø> (ø)
mod/node-core/pkg/components/db_manager.go 0.00% <ø> (ø)
mod/node-core/pkg/components/middleware.go 0.00% <ø> (ø)
mod/node-core/pkg/components/service_registry.go 0.00% <0.00%> (ø)
mod/runtime/pkg/middleware/middleware.go 0.00% <0.00%> (ø)
mod/node-core/pkg/components/attributes_factory.go 0.00% <0.00%> (ø)
mod/node-core/pkg/components/api.go 0.00% <0.00%> (ø)
... and 4 more

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 UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between d69eba7 and 9d4ed70.

Files selected for processing (37)
  • mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go (1 hunks)
  • mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go (1 hunks)
  • mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (1 hunks)
  • mod/node-api/backend/mocks/availability_store.mock.go (1 hunks)
  • mod/node-api/backend/mocks/beacon_block_header.mock.go (1 hunks)
  • mod/node-api/backend/mocks/beacon_state.mock.go (1 hunks)
  • mod/node-api/backend/mocks/block_store.mock.go (1 hunks)
  • mod/node-api/backend/mocks/deposit_store.mock.go (1 hunks)
  • mod/node-api/backend/mocks/node.mock.go (1 hunks)
  • mod/node-api/backend/mocks/state_processor.mock.go (1 hunks)
  • mod/node-api/backend/mocks/storage_backend.mock.go (1 hunks)
  • mod/node-api/backend/mocks/validator.mock.go (1 hunks)
  • mod/node-api/backend/mocks/withdrawal.mock.go (1 hunks)
  • mod/node-api/backend/mocks/withdrawal_credentials.mock.go (1 hunks)
  • mod/node-core/pkg/components/api.go (3 hunks)
  • mod/node-core/pkg/components/api_handlers.go (1 hunks)
  • mod/node-core/pkg/components/attributes_factory.go (1 hunks)
  • mod/node-core/pkg/components/backend.go (1 hunks)
  • mod/node-core/pkg/components/block_store.go (1 hunks)
  • mod/node-core/pkg/components/block_store_service.go (1 hunks)
  • mod/node-core/pkg/components/brokers.go (2 hunks)
  • mod/node-core/pkg/components/chain_service.go (1 hunks)
  • mod/node-core/pkg/components/db_manager.go (1 hunks)
  • mod/node-core/pkg/components/defaults.go (2 hunks)
  • mod/node-core/pkg/components/middleware.go (2 hunks)
  • mod/node-core/pkg/components/reporting_service.go (1 hunks)
  • mod/node-core/pkg/components/service_registry.go (3 hunks)
  • mod/node-core/pkg/components/types.go (2 hunks)
  • mod/primitives/pkg/crypto/mocks/bls_signer.mock.go (1 hunks)
  • mod/runtime/pkg/middleware/middleware.go (3 hunks)
  • mod/runtime/pkg/service/mocks/basic.mock.go (1 hunks)
  • mod/runtime/pkg/service/mocks/registry_option.mock.go (1 hunks)
  • mod/storage/pkg/interfaces/mocks/db.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/beacon_block.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/block_event.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/prunable.mock.go (1 hunks)
  • mod/storage/pkg/pruner/mocks/pruner.mock.go (1 hunks)
Additional comments not posted (51)
mod/node-core/pkg/components/db_manager.go (1)

34-34: LGTM! Field reordering is fine.

The reordering of the DepositPruner field does not affect functionality and may improve readability.

mod/node-core/pkg/components/block_store_service.go (1)

36-37: LGTM! Field reordering is fine.

The reordering of the Config and Logger fields does not affect functionality and may improve readability.

mod/node-core/pkg/components/reporting_service.go (3)

1-19: LGTM! Standard licensing information.

The file header contains standard licensing information and does not require changes.


32-36: LGTM! Well-defined struct.

The ReportingServiceInput struct is well-defined and follows standard practices.


38-43: LGTM! Well-defined function.

The ProvideReportingService function follows standard practices and correctly initializes the reporting service.

mod/node-core/pkg/components/attributes_factory.go (4)

24-24: Import approved.

The addition of the depinject import is appropriate for the updated function signature that uses dependency injection.


31-38: New struct approved.

The AttributesFactoryInput struct consolidates related parameters, enhancing readability and maintainability.


42-43: Function signature change approved.

The ProvideAttributesFactory function now takes a single parameter of type AttributesFactoryInput, simplifying the function signature and aligning with best practices in dependency injection.


50-53: Internal logic change approved.

The internal logic of ProvideAttributesFactory has been updated to reference the fields of the AttributesFactoryInput struct, clarifying the source of each argument and reducing cognitive load.

mod/storage/pkg/pruner/mocks/beacon_block.mock.go (1)

1-1: Version number update approved.

The version number in the comment header has been updated to v2.44.1, indicating the use of a newer version of the mock generation tool.

mod/storage/pkg/pruner/mocks/prunable.mock.go (1)

1-1: Version number update approved.

The version number in the comment header has been updated to v2.44.1, indicating the use of a newer version of the mock generation tool.

mod/node-core/pkg/components/backend.go (2)

33-33: LGTM! The reordering of fields improves logical grouping.

The BlockStore field has been moved to follow the AvailabilityStore field, which enhances the readability and logical grouping of the struct.


Line range hint 24-29:
LGTM! The inclusion of BlockStore in the depinject.In section is consistent with the struct changes.

The BlockStore field is now included in the depinject.In section, which aligns with the updated struct definition.

mod/node-core/pkg/components/defaults.go (1)

Line range hint 24-62:
LGTM! The restructuring enhances modularity and maintainability.

The function now initializes a components variable and populates it with several component providers dynamically, which improves the modularity and maintainability of the code.

mod/runtime/pkg/service/mocks/registry_option.mock.go (1)

1-1: LGTM! The version update of the mock generation tool is consistent.

The version of the mock generation tool has been updated from v2.43.2 to v2.44.1, which may suggest improvements or bug fixes in the tool itself.

mod/node-core/pkg/components/middleware.go (2)

Line range hint 14-23:
LGTM! Verify the usage of ChainService in the codebase.

The removal of ChainService from ABCIMiddlewareInput is a good step towards reducing dependencies and improving modularity.

Ensure that any previous usage of ChainService in the codebase has been updated or refactored accordingly.

Verification successful

LGTM! The removal of ChainService from ABCIMiddlewareInput has been properly handled.

The ABCIMiddlewareInput struct is only used within mod/node-core/pkg/components/middleware.go, and there are no other references to it in the codebase. The change does not impact other parts of the code.

  • mod/node-core/pkg/components/middleware.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `ChainService` in the codebase.

# Test: Search for the usage of `ChainService`. Expect: No occurrences of `ChainService` in the context of `ABCIMiddlewareInput`.
rg --type go -A 5 'ChainService'

Length of output: 3139


Script:

#!/bin/bash
# Description: Verify the usage of `ABCIMiddlewareInput` in the codebase.

# Test: Search for the usage of `ABCIMiddlewareInput`. Expect: Ensure that the removal of `ChainService` has been properly handled.
rg --type go -A 5 'ABCIMiddlewareInput'

Length of output: 1035


Line range hint 26-43:
LGTM! Verify the function calls to ProvideABCIMiddleware.

The removal of ChainService from the ProvideABCIMiddleware function signature is a good step towards reducing dependencies and improving modularity.

Ensure that all calls to ProvideABCIMiddleware have been updated to match the new signature.

mod/node-core/pkg/components/brokers.go (3)

69-79: LGTM!

The addition of DefaultBrokerProviders improves the organization and accessibility of broker provider instances.


27-30: LGTM! Verify the function calls to ProvideBlobBroker.

The renaming of ProvideBlobFeed to ProvideBlobBroker enhances clarity by aligning the function name with its purpose.

Ensure that all calls to ProvideBlobFeed have been updated to ProvideBlobBroker.

Verification successful

Renaming verified successfully!

All references to ProvideBlobFeed have been updated to ProvideBlobBroker. No occurrences of the old function name were found in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function calls to `ProvideBlobBroker`.

# Test: Search for the function calls to `ProvideBlobBroker`. Expect: Only occurrences of the new function name.
rg --type go -A 5 'ProvideBlobBroker'

Length of output: 875


Script:

#!/bin/bash
# Description: Verify that there are no remaining calls to the old function name `ProvideBlobFeed`.

# Test: Search for the function calls to `ProvideBlobFeed`. Expect: No occurrences of the old function name.
rg --type go -A 5 'ProvideBlobFeed'

Length of output: 35


34-37: LGTM! Verify the function calls to ProvideBlockBroker.

The renaming of ProvideBlockFeed to ProvideBlockBroker enhances clarity by aligning the function name with its purpose.

Ensure that all calls to ProvideBlockFeed have been updated to ProvideBlockBroker.

Verification successful

Renaming successfully verified!

All calls to ProvideBlockFeed have been updated to ProvideBlockBroker, and there are no remaining references to the old function name in the codebase.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the function calls to `ProvideBlockBroker`.

# Test: Search for the function calls to `ProvideBlockBroker`. Expect: Only occurrences of the new function name.
rg --type go -A 5 'ProvideBlockBroker'

Length of output: 855


Script:

#!/bin/bash
# Description: Verify if any calls to the old function name `ProvideBlockFeed` still exist.

# Test: Search for the function calls to `ProvideBlockFeed`. Expect: No occurrences of the old function name.
rg --type go 'ProvideBlockFeed'

Length of output: 31

mod/node-api/backend/mocks/withdrawal.mock.go (1)

1-1: LGTM!

The update of the mockery tool version in the comment header accurately reflects the version used to generate the mock files.

mod/node-api/backend/mocks/node.mock.go (1)

1-1: Version update in comment header.

The version number in the comment header has been updated from mockery v2.43.2 to mockery v2.44.1. This change indicates the file has been regenerated using the newer version of the mockery tool.

mod/node-api/backend/mocks/withdrawal_credentials.mock.go (1)

1-1: Version update in comment header.

The version number in the comment header has been updated from mockery v2.43.2 to mockery v2.44.1. This change indicates the file has been regenerated using the newer version of the mockery tool.

mod/node-core/pkg/components/service_registry.go (2)

38-44: New field added and reordering of fields in ServiceRegistryInput.

The ReportingService field has been added to the ServiceRegistryInput structure, enhancing the service registry's capabilities. The DBManager field has been reordered, which may improve readability.


65-65: Simplified service provision logic in ProvideServiceRegistry.

The ProvideServiceRegistry function now directly utilizes the ReportingService field from the ServiceRegistryInput, simplifying the service provision logic and potentially improving maintainability and reducing complexity.

mod/runtime/pkg/service/mocks/basic.mock.go (1)

1-1: LGTM! Verify the usage of the new mockery version.

The version update to mockery v2.44.1 is approved.

However, ensure that the new version does not introduce any issues in the generated mocks.

Verification successful

The new mockery version v2.44.1 is consistently used across all generated mocks. No other versions were found, indicating a uniform update.

  • All mock files are generated using mockery v2.44.1.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new mockery version.

# Test: Check for the new version in the generated mocks. Expect: Only occurrences of the new version.
rg --type go -A 1 $'Code generated by mockery v2.44.1'

Length of output: 3582


Script:

#!/bin/bash
# Description: Verify if there are any other versions of mockery used in the codebase.

# Test: Check for any other versions of mockery in the generated mocks. Expect: No occurrences of other versions.
rg --type go -A 1 $'Code generated by mockery v'

Length of output: 3576

mod/node-core/pkg/components/chain_service.go (1)

37-37: LGTM!

The addition of a blank line in the ChainServiceInput struct definition for improved readability is approved.

mod/node-core/pkg/components/block_store.go (1)

65-65: LGTM! Verify the usage of the BlockPrunerInput struct.

The repositioning of the Config field within the BlockPrunerInput struct for logical grouping is approved.

However, ensure that the change does not affect the initialization or usage of the struct.

Verification successful

No issues found with the BlockPrunerInput struct initialization or usage.

The search did not reveal any explicit initializations of the BlockPrunerInput struct that could be affected by the field order change. It is likely that the struct is being used in a context where its fields are automatically injected or assigned, which should not be impacted by the reordering.

  • The BlockPrunerInput struct is defined and used as expected.
  • No explicit initializations were found that could be affected by the field order change.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the `BlockPrunerInput` struct.

# Test: Search for the `BlockPrunerInput` struct usage. Expect: No issues due to the field order change.
rg --type go -A 5 $'BlockPrunerInput'

Length of output: 982


Script:

#!/bin/bash
# Description: Verify the initialization of the `BlockPrunerInput` struct.

# Test: Search for the initialization of the `BlockPrunerInput` struct. Expect: No issues due to the field order change.
rg --type go 'BlockPrunerInput{'

Length of output: 132


Script:

#!/bin/bash
# Description: Verify the initialization of the `BlockPrunerInput` struct.

# Test: Search for the initialization of the `BlockPrunerInput` struct. Expect: No issues due to the field order change.
rg --type go 'BlockPrunerInput\{'

Length of output: 35


Script:

#!/bin/bash
# Description: Verify all references to the `BlockPrunerInput` struct.

# Test: Search for all references to `BlockPrunerInput` in the codebase. Expect: No issues due to the field order change.
rg --type go 'BlockPrunerInput'

Length of output: 271

mod/node-core/pkg/components/api.go (3)

47-47: Approved: Addition of StorageBackend field.

The addition of the StorageBackend field to NodeAPIBackendInput is a positive change, improving the struct's functionality and integration with storage systems.


86-86: Approved: Reordering of fields in NodeAPIServerInput.

The reordering of the Logger field in NodeAPIServerInput enhances the clarity and maintainability of the struct.


103-109: Approved: Addition of DefaultNodeAPIComponents function.

The new DefaultNodeAPIComponents function enhances modularity and reusability, making it easier to initialize and configure Node API components.

mod/storage/pkg/pruner/mocks/pruner.mock.go (1)

1-1: Acknowledged: Update of mockery tool version.

The version update to mockery v2.44.1 is noted. This change does not affect the functionality or logic of the code.

mod/node-api/backend/mocks/state_processor.mock.go (1)

1-1: Acknowledged: Update of mockery tool version.

The version update to mockery v2.44.1 is noted. This change does not affect the functionality or logic of the code.

mod/node-core/pkg/components/api_handlers.go (1)

94-105: LGTM! The new function enhances modularity and usability.

The DefaultNodeAPIHandlers function correctly aggregates and returns a slice of handler functions, improving the structure of the API.

mod/storage/pkg/pruner/mocks/block_event.mock.go (1)

1-1: Acknowledgement: Version update in the code generation tool.

The version update from v2.43.2 to v2.44.1 in the code generation tool mockery is noted. The functionality and logic of the code remain unchanged.

mod/engine-primitives/pkg/engine-primitives/mocks/blobs_bundle.mock.go (1)

1-1: Acknowledgement: Version update in the code generation tool.

The version update from v2.43.2 to v2.44.1 in the code generation tool mockery is noted. The functionality and logic of the code remain unchanged.

mod/engine-primitives/pkg/engine-primitives/mocks/payload_attributer.mock.go (1)

1-1: Version update for mockery tool.

The mockery tool version has been updated from v2.43.2 to v2.44.1. Ensure that the new version does not introduce any inconsistencies or issues.

mod/node-api/backend/mocks/block_store.mock.go (1)

1-1: Version update for mockery tool.

The mockery tool version has been updated from v2.43.2 to v2.44.1. Ensure that the new version does not introduce any inconsistencies or issues.

mod/primitives/pkg/crypto/mocks/bls_signer.mock.go (1)

1-1: Version update for mockery tool.

The mockery tool version has been updated from v2.43.2 to v2.44.1. Ensure that the new version does not introduce any inconsistencies or issues.

mod/node-api/backend/mocks/availability_store.mock.go (1)

1-1: Metadata update: Mockery version incremented.

The version of the mockery tool used for code generation has been updated from v2.43.2 to v2.44.1. This change is purely metadata and does not affect the functionality or structure of the code.

mod/storage/pkg/interfaces/mocks/db.mock.go (1)

1-1: Metadata update: Mockery version incremented.

The version of the mockery tool used for code generation has been updated from v2.43.2 to v2.44.1. This change is purely metadata and does not affect the functionality or structure of the code.

mod/node-api/backend/mocks/deposit_store.mock.go (1)

1-1: Metadata update: Mockery version incremented.

The version of the mockery tool used for code generation has been updated from v2.43.2 to v2.44.1. This change is purely metadata and does not affect the functionality or structure of the code.

mod/runtime/pkg/middleware/middleware.go (2)

129-129: LGTM! But verify the impact of removing chainService parameter.

The removal of the chainService parameter from the NewABCIMiddleware constructor function streamlines the instantiation process.

However, ensure that all parts of the codebase that call this constructor are updated accordingly.

Verification successful

Verify the impact of removing chainService parameter.

The NewABCIMiddleware function is used in mod/node-core/pkg/components/middleware.go. Ensure that this usage conforms to the new signature without the chainService parameter.


LGTM! But verify the impact of removing chainService parameter.

The removal of the chainService parameter from the NewABCIMiddleware constructor function streamlines the instantiation process. The usage in mod/node-core/pkg/components/middleware.go confirms that the new signature is correctly used without the chainService parameter.

  • mod/node-core/pkg/components/middleware.go: Verified correct usage of NewABCIMiddleware without chainService.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `chainService` parameter from `NewABCIMiddleware`.

# Test: Search for the usage of `NewABCIMiddleware` in the codebase. Expect: Only occurrences of the new signature.
rg --type go -A 5 $'NewABCIMiddleware'

Length of output: 997


Script:

#!/bin/bash
# Description: Verify the complete function call of `NewABCIMiddleware` in `mod/node-core/pkg/components/middleware.go`.

# Print the lines around the function call to see the full context.
rg --type go -A 10 -B 10 $'NewABCIMiddleware' mod/node-core/pkg/components/middleware.go

Length of output: 628


Line range hint 41-41:
LGTM! But verify the impact of removing chainService.

The removal of the chainService field simplifies the ABCIMiddleware struct, improving maintainability and modularity.

However, ensure that all parts of the codebase that relied on this field are updated accordingly.

Verification successful

LGTM! But verify the impact of removing chainService.

The removal of the chainService field simplifies the ABCIMiddleware struct, improving maintainability and modularity.

However, ensure that all parts of the codebase that relied on this field are updated accordingly.

  • There are no direct references to chainService within the context of ABCIMiddleware.
  • The chainService field is defined but not actively used elsewhere in the codebase.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing `chainService` from `ABCIMiddleware`.

# Test: Search for the usage of `chainService` in the codebase. Expect: No occurrences.
rg --type go -A 5 $'chainService'

Length of output: 575


Script:

#!/bin/bash
# Description: Verify the impact of removing `chainService` from `ABCIMiddleware` by searching for references to `BlockchainService` in the codebase.

# Test: Search for the usage of `BlockchainService` in the codebase. Expect: Occurrences showing how it's used.
rg --type go -A 5 $'BlockchainService'

Length of output: 580


Script:

#!/bin/bash
# Description: Verify the impact of removing `chainService` from `ABCIMiddleware` by searching for references to `ABCIMiddleware` in the codebase.

# Test: Search for the usage of `ABCIMiddleware` in the codebase. Expect: Occurrences showing how it's used.
rg --type go -A 5 $'ABCIMiddleware'

Length of output: 17675


Script:

#!/bin/bash
# Description: Verify the impact of removing `chainService` from `ABCIMiddleware` by searching for references to `chainService` within the context of `ABCIMiddleware`.

# Test: Search for the usage of `chainService` within the context of `ABCIMiddleware` in the codebase. Expect: Occurrences showing how it's used.
rg --type go -A 5 -B 5 'ABCIMiddleware.*chainService'

Length of output: 55

mod/node-api/backend/mocks/validator.mock.go (1)

1-1: Version update approved.

The version of the mockery tool has been updated from v2.43.2 to v2.44.1. This change does not affect the functionality or structure of the code.

mod/engine-primitives/pkg/engine-primitives/mocks/built_execution_payload_env.mock.go (1)

1-1: Version update approved.

The version of the mockery tool has been updated from v2.43.2 to v2.44.1. This change does not affect the functionality or structure of the code.

mod/node-api/backend/mocks/storage_backend.mock.go (1)

1-1: Version update approved.

The version of the mock generation tool, Mockery, has been updated from v2.43.2 to v2.44.1. This change does not affect the functionality of the code.

mod/node-core/pkg/components/types.go (2)

53-53: New import statement approved.

The import statement for the version package has been added to support the new ReportingService type alias.


326-327: New type alias approved.

The ReportingService type alias has been added to improve modularity and readability.

Verify the usage of the new type alias in the codebase.

Verification successful

New type alias usage verified.

The ReportingService type alias is consistently and correctly used across the codebase.

  • mod/node-core/pkg/components/service_registry.go
  • mod/node-core/pkg/components/defaults.go
  • mod/node-core/pkg/components/reporting_service.go
  • mod/node-core/pkg/services/version/version.go
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of the new `ReportingService` type alias in the codebase.

# Test: Search for the usage of `ReportingService`. Expect: Occurrences of the new type alias.
rg --type go 'ReportingService'

Length of output: 1477


Script:

#!/bin/bash
# Fetch context around the identified lines in the files where `ReportingService` is used.

# Get context for mod/node-core/pkg/components/service_registry.go
rg --type go --context 5 'ReportingService' mod/node-core/pkg/components/service_registry.go

# Get context for mod/node-core/pkg/components/defaults.go
rg --type go --context 5 'ReportingService' mod/node-core/pkg/components/defaults.go

# Get context for mod/node-core/pkg/components/reporting_service.go
rg --type go --context 5 'ReportingService' mod/node-core/pkg/components/reporting_service.go

# Get context for mod/node-core/pkg/services/version/version.go
rg --type go --context 5 'ReportingService' mod/node-core/pkg/services/version/version.go

Length of output: 3396

mod/node-api/backend/mocks/beacon_block_header.mock.go (1)

1-1: Version update approved.

The version of the mock generation tool, Mockery, has been updated from v2.43.2 to v2.44.1. This change does not affect the functionality of the code.

mod/node-api/backend/mocks/beacon_state.mock.go (1)

1-1: Mockery tool version update.

The mockery tool version has been updated from v2.43.2 to v2.44.1. Ensure that this version update does not introduce any breaking changes or issues.

Verification successful

Mockery tool version update verified.

The update from v2.43.2 to v2.44.1 does not introduce any breaking changes or issues. The changes are primarily related to workflow improvements and additional support for certain types.

  • No breaking changes identified in the changelog for v2.44.1.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the new mockery version introduces any issues.

# Test: Check for any breaking changes or issues introduced by the new version.
# Expect: No issues or breaking changes.

# Run go mod tidy to ensure dependencies are correctly managed.
go mod tidy

# Run go test to ensure all tests pass.
go test ./...

Length of output: 170


Script:

#!/bin/bash
# Description: Check the changelog or release notes for mockery tool versions v2.43.2 and v2.44.1 to identify any breaking changes.

# Fetch the changelog for mockery tool v2.43.2
curl -s https://api.github.com/repos/vektra/mockery/releases/tags/v2.43.2 | jq '.body'

# Fetch the changelog for mockery tool v2.44.1
curl -s https://api.github.com/repos/vektra/mockery/releases/tags/v2.44.1 | jq '.body'

Length of output: 734

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 UI
Review profile: ASSERTIVE

Commits

Files that changed from the base of the PR and between 9d4ed70 and 964f807.

Files selected for processing (3)
  • mod/node-core/pkg/components/attributes_factory.go (1 hunks)
  • mod/node-core/pkg/components/block_store.go (1 hunks)
  • mod/node-core/pkg/components/types.go (2 hunks)
Additional comments not posted (4)
mod/node-core/pkg/components/attributes_factory.go (2)

31-37: Good use of struct for dependency injection.

The introduction of AttributesFactoryInput enhances code clarity and maintainability by grouping related parameters.


41-50: Improved function signature and readability.

The use of AttributesFactoryInput in ProvideAttributesFactory streamlines the function's interface and makes dependencies more explicit.

mod/node-core/pkg/components/block_store.go (1)

69-69: Field reorganization in BlockPrunerInput.

The Config field has been moved after BlockStore, which may impact how instances are instantiated and utilized.

mod/node-core/pkg/components/types.go (1)

326-326: Enhanced modularity with type alias ReportingService.

The introduction of ReportingService as a type alias for version.ReportingService enhances modularity and readability.

@ocnc2 ocnc2 merged commit 6657880 into main Aug 3, 2024
18 checks passed
@ocnc2 ocnc2 deleted the service-cleanup branch August 3, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants