-
Notifications
You must be signed in to change notification settings - Fork 258
Add vm state accumulator #4485
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
base: multi-move-vm
Are you sure you want to change the base?
Add vm state accumulator #4485
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration 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.
Pull Request Overview
This PR introduces the VM state accumulator to enhance state management and block validation across several modules. Key changes include:
- Updating accessor methods to support the new VM state accumulator (e.g., converting field accesses to method calls).
- Adding new storage definitions, column families, and accumulator types to persist VM state.
- Modifying tests, genesis construction, and chain service logic to integrate VM state accumulator functionality.
Reviewed Changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
sync/src/sync.rs | Updated call to access block information using the new accessor method. |
sync/src/block_connector/write_block_chain.rs | Updated return type and usage of block info along with newly added VM state, with a typo. |
storage/src/upgrade.rs | Extended DB upgrade paths to support the new storage version and VM state accumulator. |
storage/src/lib.rs | Added new column family and updated storage configuration to include VM state accumulator. |
storage/src/accumulator/mod.rs | Defined new storage for VM state accumulator with associated helper functions. |
state/statedb/src/multi_chain_state_db.rs, state/service/src/service.rs | Integrated VM state retrieval and handling in state-related services. |
genesis/src/lib.rs | Updated genesis blocks generation to incorporate VM state accumulator operations. |
Other files (rpc, network, miner, chain, block-relayer, etc.) | Updated block accessors and method calls to accommodate the VM state accumulator integration. |
Files not reviewed (1)
- rpc/api/generated_rpc_schema/sync_manager.json: Language not supported
Comments suppressed due to low confidence (1)
sync/src/block_connector/write_block_chain.rs:449
- It appears that 'multi_sate' is a typo. Please rename it to 'multi_state' to maintain consistency with the rest of the code.
connect(ExecutedBlock::new(block.clone(), block_info, multi_sate))?
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.
Pull Request Overview
This PR adds support for a new VM state accumulator and integrates it throughout the storage, state, genesis, and network modules. Key changes include:
- Introducing a new VMStateAccumulatorStorage with proper storage versioning and prefix.
- Updating various modules (storage, state service, open-block, genesis, etc.) to incorporate the VM state accumulator.
- Adjusting tests and configuration to support the new accumulator feature.
Reviewed Changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
storage/src/tests/test_storage.rs | Added a new test accumulator info entry to support VM state accumulation. |
storage/src/lib.rs | Integrated VMStateAccumulatorStorage and updated storage versioning. |
storage/src/accumulator/mod.rs | Defined VMStateAccumulatorStorage via the define_storage! macro. |
state/statedb/src/multi_chain_state_db.rs | Updated state root comparisons following accumulator changes. |
state/service/src/service.rs | Integrated get_vm_multi_state to retrieve VM multi state. |
rpc/api/src/types.rs | Updated BlockInfoView to include a placeholder for the VM state accumulator. |
network/tests/network_service_test.rs | Updated node configuration for tests using the new test config without vm2. |
network-rpc/src/tests.rs | Changed NodeConfig usage to random_for_test_without_vm2. |
miner/src/create_block_template/mod.rs | Fixed block header access for uncle insertion. |
genesis/src/lib.rs | Revised genesis block generation to incorporate VM state accumulation. |
config/src/lib.rs | Added a new function random_for_test_without_vm2 for specific test scenarios. |
commons/accumulator/src/node.rs | Added the VMState variant to AccumulatorStoreType. |
chain/tests/test_block_chain.rs | Updated block access patterns for uncle verification. |
chain/tests/block_test_utils.rs | Adjusted node configuration usage to leverage the new test config. |
chain/src/lib.rs | Introduced a new module (fixed_blocks) to support upcoming changes. |
chain/service/src/chain_service.rs | Updated block retrieval to use the revised accessor methods. |
chain/open-block/src/lib.rs | Integrated VM state accumulator usage in block template finalization. |
block-relayer/src/block_relayer.rs | Updated block info access for compact block message creation. |
Files not reviewed (1)
- rpc/api/generated_rpc_schema/sync_manager.json: Language not supported
Comments suppressed due to low confidence (1)
chain/open-block/src/lib.rs:102
- The assert may lead to a panic when exactly one VM state leaf is present. Consider adding error handling to manage this situation gracefully instead of asserting.
assert!(num_leaves > 1, "vm_state_accumulator num_leaves should be greater than 1");
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Other information