-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat: add vote extension support #1641
Conversation
WalkthroughThe recent updates focus on integrating vote extensions within the blockchain management system. These changes include the addition of new methods and functionalities across various components to handle extended commit information and support ABCI methods related to vote extensions. This comprehensive update ensures the system's compatibility with new voting protocols, enhancing its efficiency and security in processing votes. Changes
Assessment against linked issues
Poem
Enjoy the celebration of these integral changes to our system, as narrated by our very own CodeRabbit! 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 (
|
dff81d9
to
71626f1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (1)
node/full_node_test.go (1)
266-322
: The implementation ofTestVoteExtension
looks solid and correctly tests the vote extension functionality. However, consider using a context with a longer timeout or a context without a timeout for integration tests to avoid flakiness due to time constraints.
2a3469a
to
6fa57b8
Compare
ef2839f
to
72b7a36
Compare
72b7a36
to
1295dd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Out of diff range and nitpick comments (1)
block/manager.go (1)
Line range hint
816-986
: Refactor the handling of extended commits for clarity and error handling.The logic for handling extended commits within the
publishBlock
method and related functions is complex and could benefit from refactoring for better clarity and error handling. Consider breaking down the operations into smaller, more manageable functions, especially the error handling and conditional checks around the vote extension feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- block/manager.go (5 hunks)
- node/full_node_test.go (3 hunks)
- state/executor.go (3 hunks)
- state/executor_test.go (6 hunks)
- store/store.go (3 hunks)
- store/store_test.go (1 hunks)
- store/types.go (1 hunks)
- test/mocks/Store.go (3 hunks)
- types/state.go (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- state/executor.go
- state/executor_test.go
- store/store.go
- store/store_test.go
- store/types.go
- test/mocks/Store.go
- types/state.go
Additional comments not posted (1)
node/full_node_test.go (1)
363-401
: Consider refactoringcreateAggregatorWithApp
to reduce duplication.As previously discussed in comments by MSevey, gupadhyaya, and tzdybal, there is a significant overlap with
createAggregatorWithPersistence
and potential for refactoring to reduce duplication. A follow-up issue has already been created (#1648). It's important to ensure this refactoring task is prioritized to maintain code cleanliness and prevent technical debt from accumulating.
Implemented the ability to get and save extended commit information. This allows new blocks to be created with extended vote information if the feature is enabled.
Manager creates initial state from genesis in constructor, so VoteExtensionEnableHeight has to be set early.
The commit updates the expected vote extension in full_node_test.go. Previously, it was a hardcoded string, now it's a dynamic string based on the block height.
A new functionality to sign vote extensions has been introduced in the block manager. This allows to attach a signature to a vote extension and ensures its verification in the full node tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (9)
- block/manager.go (5 hunks)
- node/full_node_test.go (3 hunks)
- state/executor.go (3 hunks)
- state/executor_test.go (6 hunks)
- store/store.go (3 hunks)
- store/store_test.go (1 hunks)
- store/types.go (1 hunks)
- test/mocks/Store.go (3 hunks)
- types/state.go (1 hunks)
Files skipped from review as they are similar to previous changes (7)
- state/executor.go
- state/executor_test.go
- store/store.go
- store/store_test.go
- store/types.go
- test/mocks/Store.go
- types/state.go
Additional Context Used
Learnings (1)
node/full_node_test.go (1)
User: tzdybal PR: rollkit/rollkit#1641 File: node/full_node_test.go:266-321 Timestamp: 2024-05-07T07:23:53.788Z Learning: Issue #1663 was created to address adding comprehensive tests for error scenarios in `TestVoteExtension` in the rollkit repository.
Additional comments not posted (2)
node/full_node_test.go (2)
266-321
: The implementation ofTestVoteExtension
effectively tests the happy path for the vote extension feature. The mock setups and assertions are well-constructed to ensure the correct behavior is validated.
363-401
: The functioncreateAggregatorWithApp
is correctly implemented to set up a node with specific configurations for testing. The use of helper methods and comprehensive error checks enhances the robustness of the test setup.
Overview
Resolves #1593
Summary by CodeRabbit
New Features
Enhancements
SetHeight
method in the store for better performance and simplicity.Bug Fixes
Documentation