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

Eliminates dependency from Controller on BesuComponent #6

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

garyschulte
Copy link
Owner

test greptile pr bot

@garyschulte garyschulte changed the base branch from isolateMetricsOptions to main August 14, 2024 20:46
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This pull request eliminates the dependency of BesuController on BesuComponent, focusing on restructuring the BesuCommand and related classes to improve modularity and reduce coupling.

  • Removed BesuComponent parameter from BesuCommand constructor in BesuCommand.java
  • Updated BesuCommandModule to directly use BesuPluginContextImpl instead of BesuComponent
  • Changed method name from getControllerBuilder() to setupControllerBuilder() in BlocksSubCommand and TrieLogSubCommand
  • Modified BesuPluginContextModule to introduce a new method for providing BesuConfigurationImpl
  • Removed @nAmed("besuPluginContext") annotation from getBesuPluginContext() method in BesuComponent interface

8 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings

import org.hyperledger.besu.services.BesuPluginContextImpl;

import javax.inject.Named;
import javax.inject.Singleton;
Copy link

Choose a reason for hiding this comment

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

logic: The @nAmed annotation has been removed. This might affect dependency injection in other parts of the codebase.

public BesuPluginContextImpl provideBesuPluginContext() {
return new BesuPluginContextImpl();
public BesuPluginContextImpl provideBesuPluginContext(final BesuConfigurationImpl pluginConfig) {
BesuPluginContextImpl retval = new BesuPluginContextImpl();
Copy link

Choose a reason for hiding this comment

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

style: 'retval' doesn't follow Java naming conventions. Rename to 'pluginContext'.

@garyschulte garyschulte reopened this Aug 14, 2024
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

(updates since last review)

This pull request continues to eliminate the dependency of BesuController on BesuComponent, focusing on restructuring the BesuControllerBuilder class to improve modularity and reduce coupling.

  • Removed BesuComponent parameter from BesuControllerBuilder in BesuControllerBuilder.java
  • Updated BesuControllerBuilder to directly use BonsaiCachedMerkleTrieLoader and BlobCache instead of obtaining them from BesuComponent
  • Simplified the build() method in BesuControllerBuilder by removing references to BesuComponent
  • Removed the besuComponent() method from BesuControllerBuilder, as it's no longer needed

No file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

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