feat: enable valset update
Overview
Re-enable ABCI update valset.
Summary by CodeRabbit
-
New Features
- Enhanced block management and state update mechanisms to handle validator sets more effectively.
- Improved initialization of state from genesis documents with comprehensive validator configurations.
-
Bug Fixes
- Adjusted state update logic to correctly manage last, current, and next validator sets, ensuring more reliable block validation and execution.
-
Documentation
- Updated comments and documentation for clearer understanding of the changes related to validators in state management.
-
Refactor
- Streamlined handling of validator updates across various components to enhance performance and maintainability.
-
Tests
- Expanded testing to cover new validator initialization and state update scenarios, ensuring robustness and correctness.
[!NOTE]
Reviews paused
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Walkthrough
The updates to block/manager.go focus on enhancing validation logic by renaming variables, removing unneeded structures, and refining functions related to validator handling. Changes in node/full_node_test.go adjust the node creation process to include genesis and genesisValidatorKey parameters for better persistence and initialization.
Changes
| Files | Change Summary |
|---|---|
block/manager.go |
Renamed error variable, modified functions for validator handling, removed validatorSet, updated logic |
node/full_node_test.go |
Added parameters genesis and genesisValidatorKey in createAggregatorWithPersistence |
Sequence Diagrams
Validator Handling Before and After Changes
Before Changes
sequenceDiagram
participant Client
participant Manager
participant ValidatorSet
participant State
Client ->> Manager: Initialize Manager
Manager ->> ValidatorSet: Access validators from validatorSet
ValidatorSet -->> Manager: Return validators
Manager ->> Manager: Check if proposer
Manager ->> State: Publish block with validators
State -->> Manager: Update state with validators
After Changes
sequenceDiagram
participant Client
participant Manager
participant State
Client ->> Manager: Initialize Manager
Manager ->> State: Access validators from state
State -->> Manager: Return validators
Manager ->> Manager: Check if proposer
Manager ->> State: Publish block and handle validators
State -->> Manager: Update state with validators
Poem
In the land of code where structures shift,
Our dearManagergot a nifty lift.
Validators now dance in state’s sweet embrace,
Proposers too find their rightful place.
Genesis keys in tests for all to see,
Block's logic shines, as clear as can be.
Celebrate we shall, with code so bright,
A job well done, from morning to night! 🌟
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?
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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR. -
@coderabbitai resumeto resume the paused reviews. -
@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository. -
@coderabbitai full reviewto do a full review from scratch and review all the files again. -
@coderabbitai summaryto regenerate the summary of the PR. -
@coderabbitai resolveresolve all the CodeRabbit review comments. -
@coderabbitai configurationto show the current CodeRabbit configuration for the repository. -
@coderabbitai helpto get help.
Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
CodeRabbit Configration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
@vuong177 when you are ready to move this out of draft, can you also please link an issue or provide more context for this change?
Codecov Report
Attention: Patch coverage is 48.23529% with 132 lines in your changes missing coverage. Please review.
Project coverage is 42.11%. Comparing base (
c9d8467) to head (bbfaf4d). Report is 135 commits behind head on main.
:exclamation: There is a different number of reports uploaded between BASE (c9d8467) and HEAD (bbfaf4d). Click for more details.
HEAD has 1 upload less than BASE
| Flag | BASE (c9d8467) | HEAD (bbfaf4d) | |------|------|------| ||2|1|
Additional details and impacted files
@@ Coverage Diff @@
## main #1658 +/- ##
==========================================
- Coverage 50.23% 42.11% -8.12%
==========================================
Files 52 76 +24
Lines 6762 10088 +3326
==========================================
+ Hits 3397 4249 +852
- Misses 3024 5120 +2096
- Partials 341 719 +378
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@vuong177 when you are ready to move this out of draft, can you also please link an issue or provide more context for this change?
sure, I'll create a issue for more details.
@Manav-Aggarwal
In general my main question that maybe @gupadhyaya can help with too is how this will work with the current limitation of rollkit only supporting a single sequencer model.
I think we should verify the validator set after applying the update. Similar to the rollkit-sdk, only one validator is allowed at a time.
@MSevey @gupadhyaya I have added TestChangeValSet to test the valset change.
@coderabbitai resolve
@coderabbitai ignore
Actions performed
Comments resolved.
@coderabbitai ignore
Actions performed
Reviews paused.
Please fix the golangci lint error.
You should just need to run make fmt