-
Notifications
You must be signed in to change notification settings - Fork 258
Add chainstate and account services #4488
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?
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 pull request introduces new state and account service implementations along with associated event handling for on‐chain state updates and account management. Key changes include:
- Adding ChainStateService in vm2/service/state with methods for state lookups, proofs, and time adjustments.
- Adding AccountService and AccountEventService in vm2/service/account to manage account creation, default account repair, and event notifications.
- Updating configuration files, node registration logic, and Cargo manifests to support the new services.
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
vm2/service/state/src/service.rs | Introduces ChainStateService with state lookup and proof APIs |
vm2/service/account/src/service.rs | Implements AccountService for account management features |
vm2/service/account/src/account_events.rs | Adds AccountEventService for handling contract event notifications |
node/src/node.rs | Updates service registrations to include new state/account services |
config/src/account_vault_config.rs | Adds a new method to generate a modified vault directory path |
Other Cargo.toml files | Adjust dependencies, versions, and workspace member lists |
commons/utils/src/mpsc.rs | Refactors mpsc functions to use the .inspect() method |
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 new chain state and account services while updating related modules and configuration files to support the new VM2 architecture. Key changes include:
- Implementation of ChainStateService and associated state management functions.
- Introduction of AccountService and AccountEventService with related account message types.
- Updates to node registration, pubsub handling, and Cargo.toml manifests to include the new services.
Reviewed Changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
vm2/service/state/src/service.rs | Implements the ChainStateService and its internal state management logic. |
vm2/service/state/src/lib.rs | Exposes the ChainStateService. |
vm2/service/state/Cargo.toml | Adds dependencies and package configuration for the chain state service. |
vm2/service/account/src/service.rs | Implements the AccountService with default account handling and basic account operations. |
vm2/service/account/src/message.rs | Introduces message types for account-related events. |
vm2/service/account/src/lib.rs | Exposes the account service-related modules. |
vm2/service/account/src/account_events.rs | Provides an AccountEventService for handling contract events (e.g. accepted tokens). |
vm2/service/account/Cargo.toml | Adds dependencies and package configuration for the account service. |
rpc/server/src/module/pubsub.rs | Updates pubsub subscriptions to include a new ContractEventNotification variant. |
node/src/node.rs | Registers the new chain state and account services (including aliased variants) in the node. |
node/Cargo.toml | Updates dependencies and workspace members to incorporate the new VM2 services. |
config/src/account_vault_config.rs | Adds a new method to derive a secondary directory (“dir2”) for account configuration. |
commons/utils/src/mpsc.rs | Refactors channel send and receive logic using the new .inspect API. |
chain/chain-notify/src/message.rs and src/lib.rs | Updates notification messages and event handling to support new ContractEventNotification variants. |
Cargo.toml | Updates workspace configuration to include new service modules and dependency revisions. |
Comments suppressed due to low confidence (2)
vm2/service/state/src/service.rs:161
- [nitpick] The struct name 'Inner' is ambiguous; consider renaming it to a more descriptive name, such as 'ChainStateInner', to improve code clarity.
pub struct Inner {
node/src/node.rs:54
- [nitpick] The use of numeric suffixes (e.g. AccountEventService2) may lead to ambiguity; consider using more descriptive names (e.g. Vm2AccountEventService) to clarify the service's purpose.
use starcoin_vm2_account_service::{ AccountEventService as AccountEventService2, AccountService as AccountService2, AccountStorage as AccountStorage2,};
7ab5567
to
257273e
Compare
257273e
to
92c6808
Compare
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