-
Notifications
You must be signed in to change notification settings - Fork 30
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
dedupe commitee listener #2382
dedupe commitee listener #2382
Conversation
WalkthroughThe recent modifications enhance the integration and functionality of the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (2)
- committee/db/base/store.go (3 hunks)
- committee/node/node.go (2 hunks)
Additional comments: 5
committee/db/base/store.go (3)
- 21-21: The embedding of
ChainListenerDB
into theStore
struct is a significant change that integrates listener functionalities directly into the store. This approach simplifies the architecture by reducing the need for separate components to handle listener-related operations. Ensure that all methods fromChainListenerDB
that are now part ofStore
are appropriately used throughout the codebase, and consider any potential naming conflicts or method overrides.- 31-33: Initialization of
ChainListenerDB
within theNewStore
function is correctly done, ensuring that the store is fully equipped with listener functionalities upon creation. This initialization is crucial for the seamless integration of listener capabilities into the store's operations. Verify that thedb
andmetrics
parameters passed toNewChainListenerStore
are correctly handled and that there are no unintended side effects.- 97-98: The expansion of the
GetAllModels
function to includelistenerDB.GetAllModels()
is a clear indication of the broader scope for data retrieval, now encompassing listener-specific models. This change is aligned with the objective of enhancing the store's capabilities. Ensure that the models returned bylistenerDB.GetAllModels()
are correctly handled during migrations or any other operations that utilize theallModels
slice.committee/node/node.go (2)
- 23-23: The modification of import statements to reflect a change in the source package for the
listener
functionality indicates a reorganization of the listener codebase. This change is likely part of the deduplication and optimization efforts. Ensure that the new import path is correct and that all references to thelistener
package throughout the codebase are updated accordingly.- 78-83: The updates in the
NewNode
function to handle the latest block number are part of the optimization efforts. Retrieving the latest block number and passing it toNewChainListener
ensures that the listener starts from the current state of the blockchain, which is crucial for accurate and up-to-date listening. Verify that error handling forchainClient.BlockNumber(ctx)
andlistener.NewChainListener(...)
is robust and that any failures in these operations are correctly managed to prevent partial initializations or inconsistent states.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2382 +/- ##
===================================================
- Coverage 46.88667% 46.84598% -0.04070%
===================================================
Files 383 383
Lines 29181 29185 +4
Branches 83 83
===================================================
- Hits 13682 13672 -10
- Misses 14041 14053 +12
- Partials 1458 1460 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: .coderabbit.yaml
Files selected for processing (2)
- committee/db/base/model.go (1 hunks)
- committee/go.mod (2 hunks)
Additional comments (2)
committee/db/base/model.go (1)
- 4-14: > 📝 NOTE
This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [1-12]
The changes in the
init
function to initializetransactionIDFieldName
andstatusFieldName
usingdbcommon.NewNamer(GetAllModels())
are good for maintaining consistent naming conventions. Ensure that the removal ofchainIDFieldName
andblockNumberFieldName
does not negatively impact any functionality that relied on these fields.committee/go.mod (1)
- 214-214: The addition of
github.com/jpillora/backoff v1.0.0
as an indirect requirement is noted. Ensure that this addition does not introduce any version conflicts or unexpected behavior in the project.
Description
Dedupe listener for commitee
Summary by CodeRabbit
go.mod
file for better package management.