-
Notifications
You must be signed in to change notification settings - Fork 289
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
Refactor move runtime #4166
Refactor move runtime #4166
Conversation
WalkthroughThe recent updates enhance the Move programming environment by refreshing dependency management and introducing new validation mechanisms for transaction arguments. Key improvements include extended checks for module integrity and a reorganized structure for managing virtual machine interactions. This comprehensive restructuring aims to fortify the reliability and functionalities of the Starcoin framework, ensuring a robust and dynamic development experience. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant VM
participant ExtendedChecker
participant SessionAdapter
User->>VM: Submit Transaction
VM->>ExtendedChecker: Run Extended Checks
ExtendedChecker->>VM: Validate Entries
VM->>SessionAdapter: Check Arguments
SessionAdapter-->>VM: Arguments Validated
VM-->>User: Transaction Processed Successfully
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 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.
Actionable comments posted: 3
Outside diff range, codebase verification and nitpick comments (1)
vm/move-package-manager/src/extended_checks.rs (1)
20-25
: Consider makingerror_category_module
field private.The
error_category_module
field is currently unused and marked with#[allow(unused)]
. If this field is intended to be used internally, consider making it private to encapsulate the implementation details.- #[allow(unused)] - error_category_module: ModuleId, + #[allow(unused)] + error_category_module: ModuleId,
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (17)
- Cargo.toml (2 hunks)
- executor/tests/script_function_test.rs (4 hunks)
- vm/move-package-manager/Cargo.toml (2 hunks)
- vm/move-package-manager/src/extended_checks.rs (1 hunks)
- vm/move-package-manager/src/lib.rs (1 hunks)
- vm/move-package-manager/src/release.rs (2 hunks)
- vm/starcoin-gas/src/gas_meter.rs (2 hunks)
- vm/vm-runtime/Cargo.toml (1 hunks)
- vm/vm-runtime/src/lib.rs (2 hunks)
- vm/vm-runtime/src/parallel_executor/mod.rs (1 hunks)
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs (1 hunks)
- vm/vm-runtime/src/starcoin_vm.rs (6 hunks)
- vm/vm-runtime/src/verifier/mod.rs (1 hunks)
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter_common.rs (2 hunks)
- vm/vm-runtime/src/vm_adapter/mod.rs (1 hunks)
Files skipped from review due to trivial changes (3)
- vm/vm-runtime/Cargo.toml
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs
- vm/vm-runtime/src/vm_adapter/mod.rs
Additional comments not posted (53)
vm/vm-runtime/src/verifier/mod.rs (1)
1-4
: LGTM!The module declaration for
transaction_arg_validation
is correctly added.vm/vm-runtime/src/lib.rs (2)
18-19
: LGTM!The module reorganization by adding
verifier
andvm_adapter
looks good.
18-19
: Verify the implementation of the new modules.Ensure that the new modules
verifier
andvm_adapter
are correctly implemented and integrated.Verification successful
The
verifier
andvm_adapter
modules are correctly implemented and integrated.The
verifier
module, located invm/vm-runtime/src/verifier
, includestransaction_arg_validation.rs
which provides comprehensive validation logic for transaction arguments. Thevm_adapter
module, located invm/vm-runtime/src/vm_adapter
, includesadapter.rs
andadapter_common.rs
, which offer various functionalities for session management and transaction processing.
vm/vm-runtime/src/verifier/mod.rs
vm/vm-runtime/src/verifier/transaction_arg_validation.rs
vm/vm-runtime/src/vm_adapter/mod.rs
vm/vm-runtime/src/vm_adapter/adapter.rs
vm/vm-runtime/src/vm_adapter/adapter_common.rs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the implementation of the new modules `verifier` and `vm_adapter`. # Test: Search for the implementation of the new modules. Expect: Correct implementation and integration. rg --type rust -A 5 $'mod verifier' rg --type rust -A 5 $'mod vm_adapter'Length of output: 1127
Script:
#!/bin/bash # Search for the implementation of the `verifier` module in the `vm/vm-runtime/src` directory. rg --type rust 'verifier' -g 'vm/vm-runtime/src/verifier.rs' -A 10 # Search for the implementation of the `vm_adapter` module in the `vm/vm-runtime/src` directory. rg --type rust 'vm_adapter' -g 'vm/vm-runtime/src/vm_adapter.rs' -A 10Length of output: 431
Script:
#!/bin/bash # List all Rust files in the `vm/vm-runtime/src` directory to locate the correct files for `verifier` and `vm_adapter` modules. fd --type f --extension rs --search-path vm/vm-runtime/src # Search for the implementation of the `verifier` module in the located files. rg --type rust 'verifier' -g 'vm/vm-runtime/src/**/*.rs' -A 10 # Search for the implementation of the `vm_adapter` module in the located files. rg --type rust 'vm_adapter' -g 'vm/vm-runtime/src/**/*.rs' -A 10Length of output: 7991
Script:
#!/bin/bash # Display the contents of the `verifier` module files. cat vm/vm-runtime/src/verifier/mod.rs cat vm/vm-runtime/src/verifier/transaction_arg_validation.rs # Display the contents of the `vm_adapter` module files. cat vm/vm-runtime/src/vm_adapter/mod.rs cat vm/vm-runtime/src/vm_adapter/adapter.rs cat vm/vm-runtime/src/vm_adapter/adapter_common.rsLength of output: 33940
vm/move-package-manager/Cargo.toml (3)
40-40
: LGTM!The addition of the
move-model
dependency looks good.
60-61
: LGTM!The addition of the
codespan-reporting
dependency looks good.
Line range hint
40-61
:
Verify the integration of new dependencies.Ensure that the new dependencies
move-model
andcodespan-reporting
are correctly integrated and used.vm/vm-runtime/src/vm_adapter/adapter_common.rs (2)
4-4
: Verify the new import path forSessionAdapter
.Ensure that
SessionAdapter
is correctly defined in the local modulesuper::SessionAdapter
and that this change does not break any dependencies.Verification successful
The new import path for
SessionAdapter
is correct.The
SessionAdapter
struct is defined invm/vm-runtime/src/vm_adapter/adapter.rs
, making it accessible viasuper::SessionAdapter
inadapter_common.rs
.
vm/vm-runtime/src/vm_adapter/adapter.rs
:pub struct SessionAdapter<'r, 'l, R>
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definition of `SessionAdapter` in the local module. # Test: Search for the definition of `SessionAdapter`. Expect: Definition in the local module. rg --type rust 'struct SessionAdapter' --context 5Length of output: 796
53-53
: Verify the necessity of changing the visibility ofpreprocess_transaction
.Changing the visibility from
pub(crate)
topub
expands the function's accessibility. Ensure that this change is intentional and does not expose any sensitive functionality.Verification successful
Verify the necessity of changing the visibility of
preprocess_transaction
.The function
preprocess_transaction
is used in multiple files, includingvm/vm-runtime/src/parallel_executor/mod.rs
, which is outside its original crate. This justifies the need forpub
visibility. However, ensure that this change does not expose any sensitive functionality or introduce security vulnerabilities.
vm/vm-runtime/src/vm_adapter/mod.rs
vm/vm-runtime/src/parallel_executor/mod.rs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `preprocess_transaction` across the codebase. # Test: Search for the function usage. Expect: Justified use cases for the expanded visibility. rg --type rust 'preprocess_transaction' --context 5Length of output: 3308
vm/vm-runtime/src/parallel_executor/mod.rs (1)
11-11
: Verify the new import paths forpreprocess_transaction
andPreprocessedTransaction
.Ensure that
preprocess_transaction
andPreprocessedTransaction
are correctly defined in thevm_adapter
module and that this change does not break any dependencies.Verification successful
The new import paths for
preprocess_transaction
andPreprocessedTransaction
are correct.
preprocess_transaction
andPreprocessedTransaction
are correctly defined and re-exported in thevm_adapter
module.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the definitions of `preprocess_transaction` and `PreprocessedTransaction` in the `vm_adapter` module. # Test: Search for the definitions of `preprocess_transaction` and `PreprocessedTransaction`. Expect: Definitions in the `vm_adapter` module. rg --type rust 'preprocess_transaction|PreprocessedTransaction' --context 5Length of output: 11763
vm/move-package-manager/src/release.rs (5)
72-77
: Verify the correctness of the graph resolution and package version extraction.Ensure that the resolved graph is correctly used to extract the package version.
Verification successful
The graph resolution and package version extraction are correctly implemented.
The
resolved_graph
is properly used to extract the package version.
vm/move-package-manager/src/release.rs
:let pkg_version = resolved_graph.root_package.package.version;
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `resolved_graph` for extracting the package version. # Test: Search for the usage of `resolved_graph`. Expect: Correct usage for extracting the package version. rg --type rust 'resolved_graph' --context 5Length of output: 3594
4-4
: Verify the import of theextended_checks
module.Ensure that the
extended_checks
module is correctly defined and imported.
78-88
: Verify the correctness of the model creation and usage.Ensure that the model is correctly created using
move_model_for_package
and used for validation.Verification successful
The model is correctly created and used for validation.
The model created by
move_model_for_package
is used for running extended checks and reporting diagnostics, ensuring proper validation.
extended_checks::run_extended_checks(&model)
model.diag_count(Severity::Warning)
model.report_diag
model.has_errors()
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the creation and usage of the model based on the package context. # Test: Search for the usage of `move_model_for_package`. Expect: Correct creation and usage of the model. rg --type rust 'move_model_for_package' --context 5Length of output: 765
Script:
#!/bin/bash # Description: Verify the usage of the `model` variable created by `move_model_for_package`. # Test: Search for the usage of the `model` variable in the `vm/move-package-manager/src/release.rs` file. rg --type rust 'model' -A 10 vm/move-package-manager/src/release.rsLength of output: 989
72-98
: Verify the overall logic flow of thehandle_release
function.Ensure that the overall logic flow of the function is correct and that the new validation steps do not introduce any issues.
Verification successful
Verify the overall logic flow of the
handle_release
function.Ensure that the overall logic flow of the function is correct and that the new validation steps do not introduce any issues.
The overall logic flow of the
handle_release
function is correct and the new validation steps do not introduce any issues.
- The function follows a logical sequence: resolving the package graph, creating a model, running extended checks, and then packaging the modules.
- The new validation steps (extended checks) are correctly integrated into this flow and handle warnings and errors appropriately.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the overall logic flow of the `handle_release` function. # Test: Search for the implementation and usage of the `handle_release` function. Expect: Correct logic flow and validation steps. rg --type rust 'handle_release' --context 10Length of output: 4401
Script:
#!/bin/bash # Extract the full implementation of the `handle_release` function for analysis. ast-grep --lang rust --pattern 'pub fn handle_release($_, $_) -> $_ { $$$ }'Length of output: 6804
89-96
: Verify the correctness of the extended checks and error handling.Ensure that the extended checks are correctly implemented and that any warnings or errors are appropriately handled.
vm/move-package-manager/src/extended_checks.rs (10)
27-36
: Constructor looks good.The constructor initializes the
ExtendedChecker
with the providedGlobalEnv
and sets theerror_category_module
field.
38-45
: Methodrun
looks good.The
run
method iterates over the modules in the environment and performs checks on target modules.
53-55
: Methodhas_attribute
looks good.The
has_attribute
method checks if a function has a specific attribute.
57-69
: Methodhas_attribute_iter
looks good.The
has_attribute_iter
method iterates over attributes to check for a specific attribute name.
71-77
: Methodget_runtime_module_id
looks good.The
get_runtime_module_id
method constructs aModuleId
from the module's name and address.
79-82
: Methodname_string
looks good.The
name_string
method retrieves the string representation of a symbol from the symbol pool.
98-114
: Methodcheck_entry_functions
looks good.The
check_entry_functions
method iterates over functions in a module and performs checks on entry functions.
116-120
: Methodcheck_transaction_args
looks good.The
check_transaction_args
method iterates over function arguments and checks their types.
122-149
: Methodcheck_transaction_input_type
looks good.The
check_transaction_input_type
method checks if a transaction input type is allowed. The TODO comment suggests a potential change to theReference
type.
152-163
: Methodis_allowed_input_struct
looks good.The
is_allowed_input_struct
method checks if a struct type is allowed as an input. The TODO comment suggests finding a way to keep this in sync with allowed structs instarcoin-vm
.vm/move-package-manager/src/lib.rs (1)
26-26
: New moduleextended_checks
looks good.The new module
extended_checks
is added to the project.vm/vm-runtime/src/vm_adapter/adapter.rs (14)
28-32
: StructPublishModuleBundleOption
looks good.The struct
PublishModuleBundleOption
is defined with fields and derives several traits.
34-37
: StructSessionAdapter
looks good.The struct
SessionAdapter
is defined to wrap aSession
.
39-43
: Trait implementationFrom<Session>
looks good.The
From<Session>
trait implementation converts aSession
into aSessionAdapter
.
45-50
: Trait implementationInto<Session>
looks good.The
Into<Session>
trait implementation converts aSessionAdapter
into aSession
.
52-56
: Trait implementationAsRef<Session>
looks good.The
AsRef<Session>
trait implementation provides a reference to the innerSession
.
58-62
: Trait implementationAsMut<Session>
looks good.The
AsMut<Session>
trait implementation provides a mutable reference to the innerSession
.
104-139
: Methodcheck_and_rearrange_args_by_signer_position
looks good.The
check_and_rearrange_args_by_signer_position
method checks the position of the signer argument and rearranges the arguments accordingly.
141-171
: Methodpublish_module_bundle_with_option
looks good.The
publish_module_bundle_with_option
method publishes a module bundle with custom options.
173-256
: Methodverify_module_bundle
looks good.The
verify_module_bundle
method verifies a module bundle with custom options.
258-280
: Methodverify_script_args
looks good.The
verify_script_args
method verifies the arguments of a script.
282-305
: Methodverify_script_function_args
looks good.The
verify_script_function_args
method verifies the arguments of a script function.
307-319
: Methodcheck_script_return
looks good.The
check_script_return
method ensures that a script function does not return a value.
321-332
: Methodcheck_script_signer_and_build_args
looks good.The
check_script_signer_and_build_args
method checks the signer and builds the arguments for a script.
334-339
: Methodempty_loader_cache
looks good.The
empty_loader_cache
method clears the VM runtime loader's cache.executor/tests/script_function_test.rs (4)
42-42
: Approved: Addition ofentry
keyword tofn_script
.The addition of the
entry
keyword allows the function to be called directly from the blockchain, aligning with the refactoring objectives.
45-45
: Approved: Addition ofentry
keyword tofn_script_with_args
.The addition of the
entry
keyword allows the function to be called directly from the blockchain, aligning with the refactoring objectives.
207-207
: Approved: Addition ofentry
keyword toinit
.The addition of the
entry
keyword allows the function to be called directly from the blockchain, aligning with the refactoring objectives.
391-461
: Approved: Addition of new test functiontest_transaction_arg_verify
.The new test function validates the transaction argument verification process, expanding the testing coverage of the transaction handling logic.
Cargo.toml (1)
343-367
: Approved: Transition to branch references for dependencies.The transition to branch references allows for more dynamic updates and improvements from the branch, potentially facilitating easier integration of ongoing developments in the Move ecosystem.
vm/vm-runtime/src/verifier/transaction_arg_validation.rs (7)
24-73
: Approved: Addition of allowed structs for transaction arguments.The
ALLOWED_STRUCTS
static variable defines a set of allowed structs for transaction arguments, ensuring that only specific structs are permitted.
85-161
: Approved: Addition ofvalidate_combine_singer_and_args
function.The function validates and generates arguments for entry functions, including checks for return signature, number of signers, and allowed argument types.
165-185
: Approved: Addition ofis_valid_txn_arg
function.The function checks if a transaction argument is valid and allowed, verifying the argument type against a set of allowed types and structs.
190-216
: Approved: Addition ofconstruct_args
function.The function constructs arguments based on the provided types and arguments, ensuring they are valid and correctly constructed.
222-270
: Approved: Addition ofconstruct_arg
function.The function constructs a single argument based on its type, handling various types and ensuring the argument is correctly constructed.
275-339
: Approved: Addition ofrecursively_construct_arg
function.The function recursively constructs arguments by parsing the serialized data, ensuring the arguments are correctly constructed according to the type signature.
345-442
: Approved: Addition ofvalidate_and_construct
function.The function validates and constructs an argument using a constructor function, generating the BCS serialized representation of the argument.
vm/vm-runtime/src/starcoin_vm.rs (2)
728-757
: LGTM! But verify the function usage in the codebase.The method
validate_execute_entry_function
is well-structured and integrates argument validation within the execution process.However, ensure that all calls to
validate_execute_entry_function
are correct and consistent throughout the codebase.
759-785
: LGTM! But verify the function usage in the codebase.The method
validate_execute_script
is well-structured and integrates argument validation within the execution process.However, ensure that all calls to
validate_execute_script
are correct and consistent throughout the codebase.Verification successful
The function
validate_execute_script
is used correctly and consistently.The function call to
validate_execute_script
in the filevm/vm-runtime/src/starcoin_vm.rs
matches the expected arguments and order.
- File:
vm/vm-runtime/src/starcoin_vm.rs
- Line: 759-785
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify all function calls to `validate_execute_script` are correct and consistent. # Test: Search for the function usage. Expect: Consistent and correct usage. rg --type rust -A 5 $'validate_execute_script'Length of output: 951
// see StandardGasMeter in `aptos-core` | ||
fn charge_dependency( | ||
&mut self, | ||
_is_new: bool, | ||
_addr: &AccountAddress, | ||
_name: &IdentStr, | ||
_size: NumBytes, | ||
) -> PartialVMResult<()> { | ||
Ok(()) | ||
} |
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.
Implement the charge_dependency
method or add a comment explaining its purpose.
The charge_dependency
method currently returns Ok(())
without performing any operations. If this is intentional, consider adding a comment explaining why the method is empty. Otherwise, implement the necessary logic.
impl<'a> ExtendedChecker<'a> { | ||
fn check_init_module(&self, _module: &ModuleEnv) { | ||
// TODO(simon): implement me. | ||
} |
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.
Implement check_init_module
method.
The check_init_module
method is currently not implemented. Consider implementing this method or providing more details on what needs to be done.
Do you need help implementing this method or would you like me to open a GitHub issue to track this task?
impl<'a> ExtendedChecker<'a> { | ||
fn build_error_map(&self, _module: &ModuleEnv) { | ||
// TODO(simon): implement me. | ||
} |
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.
Implement build_error_map
method.
The build_error_map
method is currently not implemented. Consider implementing this method or providing more details on what needs to be done.
Do you need help implementing this method or would you like me to open a GitHub issue to track this task?
Benchmark for 6bf5dd5Click to view benchmark
|
c3e64eb
to
a8a7831
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (17)
- Cargo.toml (2 hunks)
- executor/tests/script_function_test.rs (4 hunks)
- vm/move-package-manager/Cargo.toml (2 hunks)
- vm/move-package-manager/src/extended_checks.rs (1 hunks)
- vm/move-package-manager/src/lib.rs (1 hunks)
- vm/move-package-manager/src/release.rs (2 hunks)
- vm/starcoin-gas/src/gas_meter.rs (2 hunks)
- vm/vm-runtime/Cargo.toml (1 hunks)
- vm/vm-runtime/src/lib.rs (2 hunks)
- vm/vm-runtime/src/parallel_executor/mod.rs (1 hunks)
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs (1 hunks)
- vm/vm-runtime/src/starcoin_vm.rs (6 hunks)
- vm/vm-runtime/src/verifier/mod.rs (1 hunks)
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter_common.rs (2 hunks)
- vm/vm-runtime/src/vm_adapter/mod.rs (1 hunks)
Files skipped from review as they are similar to previous changes (15)
- executor/tests/script_function_test.rs
- vm/move-package-manager/Cargo.toml
- vm/move-package-manager/src/extended_checks.rs
- vm/move-package-manager/src/lib.rs
- vm/starcoin-gas/src/gas_meter.rs
- vm/vm-runtime/Cargo.toml
- vm/vm-runtime/src/lib.rs
- vm/vm-runtime/src/parallel_executor/mod.rs
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs
- vm/vm-runtime/src/starcoin_vm.rs
- vm/vm-runtime/src/verifier/mod.rs
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs
- vm/vm-runtime/src/vm_adapter/adapter.rs
- vm/vm-runtime/src/vm_adapter/adapter_common.rs
- vm/vm-runtime/src/vm_adapter/mod.rs
Additional comments not posted (6)
vm/move-package-manager/src/release.rs (5)
4-6
: LGTM! New imports are necessary for added functionality.The new import statements for
extended_checks
,Severity
,StandardStream
, andModelConfig
are necessary for the added validation mechanisms and error handling.
78-88
: LGTM! Improved model creation.The creation of the model for the package with
ModelConfig
improves the validation process by allowing for a potential filter on the targets.
89-96
: LGTM! Robust error handling.The extended checks and error handling improve the robustness of the package release process by catching issues early.
98-98
: LGTM! Correct package version retrieval.The retrieval of the package version from the resolved graph ensures that the correct version is used in the package release process.
72-97
: LGTM! Enhanced validation process.The changes in the
handle_release
function improve the validation process by resolving the graph, creating a model for the package, and running extended checks. The added error handling ensures that issues are caught early in the package release process.However, ensure that the
extended_checks
module is thoroughly tested to verify the correctness of the new logic.Cargo.toml (1)
346-370
: LGTM! Transition to branch references.The transition to branch references for various Move-related packages allows for more dynamic updates and improvements from the branch, facilitating easier integration of ongoing developments in the Move ecosystem.
However, ensure that the new branch references are correct and point to the intended branches.
Verification successful
Branch references are correct.
The branch "refactor-move-runtime" exists and is accessible in the repository "https://github.com/starcoinorg/move.git". The transition to branch references for the Move-related packages is correctly implemented.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the correctness of the new branch references. # Test: Check if the branches exist in the repository. Expect: Branches should exist and be accessible. for branch in "refactor-move-runtime"; do git ls-remote --heads https://github.com/starcoinorg/move.git $branch doneLength of output: 199
Benchmark for dddebf6Click to view benchmark
|
}, | ||
) | ||
.unwrap(); | ||
extended_checks::run_extended_checks(&model); |
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.
run_extended_checks,只是release检查,运行时候不检查?
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.
这个是离线的检查。新加了一个vm/vm-runtime/src/verifier 做运行时检查。参见transaction_arg_validation.rs
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: 0
Outside diff range, codebase verification and nitpick comments (1)
Cargo.toml (1)
353-353
: Action Required: Invalid Revision Hash formove-coverage
The specified revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
does not exist in the repository. Please update theCargo.toml
file with a valid revision hash.
- File:
Cargo.toml
- Line: 353
Analysis chain
Approved: Dependency update for
move-coverage
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-coverage`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Re-verify the new revision hash for `move-coverage` and list the latest commits. # Check if the new hash exists in the repository. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25 # List the latest commits in the repository to provide more context. git ls-remote https://github.com/starcoinorg/move | head -n 10Length of output: 946
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- Cargo.toml (2 hunks)
Additional comments not posted (12)
Cargo.toml (12)
349-349
: Approved: Dependency update formove-cli
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-cli
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been verified and exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-cli`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List all revision hashes in the repository and check if the specified hash exists. # List all revision hashes git ls-remote https://github.com/starcoinorg/move | awk '{print $1}' > all_hashes.txt # Check if the specified hash exists in the list grep -q "905484b15b2a2218013fdb2c034f1d7898d29a25" all_hashes.txt && echo "Hash exists" || echo "Hash does not exist"Length of output: 169
351-351
: Approved: Dependency update formove-compiler
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-compiler
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
exists and is valid.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-compiler`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Re-verify the new revision hash for `move-compiler`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 168
346-346
: Approved: Dependency update formove-binary-format
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-binary-format
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
exists in the repository and is correct.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-binary-format`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-binary-format`. # Test: List all commits in the repository and check if the new hash exists. git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 168
356-356
: Approved: Dependency update formove-errmapgen
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-errmapgen
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-errmapgen`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List all revision hashes in the repository and check for the specified hash. # List all revision hashes in the repository git ls-remote https://github.com/starcoinorg/move | awk '{print $1}' > all_hashes.txt # Check for the presence of the specified hash if grep -q "905484b15b2a2218013fdb2c034f1d7898d29a25" all_hashes.txt; then echo "Hash exists." else echo "Hash does not exist." fiLength of output: 171
355-355
: Approved: Dependency update formove-docgen
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-docgen
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been successfully verified and exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-docgen`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Re-verify the new revision hash for `move-docgen`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 168
354-354
: Approved: Dependency update formove-disassembler
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-disassembler
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been verified and exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-disassembler`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List all commits in the repository and search for the given hash. # Fetch all commits from the repository. git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 168
348-348
: Approved: Dependency update formove-bytecode-verifier
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-bytecode-verifier
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been verified and is present in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-bytecode-verifier`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List the latest commits from the repository and verify if the hash exists. # Fetch the latest 100 commits from the repository. git ls-remote https://github.com/starcoinorg/move | head -n 100Length of output: 6535
347-347
: Approved: Dependency update formove-bytecode-source-map
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-bytecode-source-map
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been verified and exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-bytecode-source-map`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List the latest commit hashes from the repository to verify the presence of the provided hash. # Fetch the latest 10 commit hashes from the repository. git ls-remote https://github.com/starcoinorg/move | head -n 10Length of output: 853
Script:
#!/bin/bash # Description: Search for the specific hash across all commits in the repository. # Search for the specific hash in the repository. git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 168
352-352
: Approved: Dependency update formove-core-types
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-core-types
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
has been verified and exists in the repository.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-core-types`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-core-types`. # Test: Check if the repository URL is correct and accessible. git ls-remote https://github.com/starcoinorg/move # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 7685
350-350
: Approved: Dependency update formove-command-line-common
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-command-line-common
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
exists in the repository and is valid.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-command-line-common`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: List all available revision hashes in the repository and check for the existence of the specified hash. # List all available revision hashes in the repository git ls-remote https://github.com/starcoinorg/move # Check if the specified hash exists in the list of available hashes git ls-remote https://github.com/starcoinorg/move | grep 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 7761
358-358
: Approved: Dependency update formove-ir-types
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
#!/bin/bash # Description: Verify the new revision hash for `move-ir-types`. # Test: Check if the new hash exists in <details> <summary>Verification successful</summary> --- <!-- [monologue] [task review_file_1/1 dependency_13/25] Review dependency `move-ir-types`. [observations] The output confirms that the new revision hash `905484b15b2a2218013fdb2c034f1d7898d29a25` exists in the repository and is a valid commit. [analysis] Since the hash is valid and exists in the repository, the update to the dependency `move-ir-types` in `Cargo.toml` is correct. [actions] Approve the dependency update and generate the final response. --> **Approved: Dependency update for `move-ir-types`.** The revision hash has been updated to the latest version and has been verified as a valid commit in the repository. </details> <details> <summary>Scripts executed</summary> The following scripts were executed for the analysis: --- Script: ```shell #!/bin/bash # Description: Verify if the new revision hash for `move-ir-types` exists in the repository. # Clone the repository to a temporary directory git clone https://github.com/starcoinorg/move temp_move_repo # Navigate to the repository cd temp_move_repo # Check if the new revision hash exists git cat-file -t 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 243
357-357
: Approved: Dependency update formove-ir-compiler
.The revision hash has been updated to the latest version.
Verify that the new revision hash is correct and consistent with the other dependencies.
Verification successful
Approved: Dependency update for
move-ir-compiler
.The revision hash
905484b15b2a2218013fdb2c034f1d7898d29a25
exists in the repository and is valid.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the new revision hash for `move-ir-compiler`. # Test: Check if the new hash exists in the repository. Expect: The hash should exist. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25Length of output: 92
Script:
#!/bin/bash # Description: Re-verify the new revision hash for `move-ir-compiler`. # Test: Check if the new hash exists in the repository and capture any error messages. git ls-remote https://github.com/starcoinorg/move 905484b15b2a2218013fdb2c034f1d7898d29a25 2>&1Length of output: 92
Script:
#!/bin/bash # Description: List all available hashes in the repository to verify the presence of the specified hash. # Fetch and list all available hashes in the repository. git ls-remote https://github.com/starcoinorg/moveLength of output: 7592
Benchmark for 51533d6Click to view benchmark
|
1. merge adapter_common and vm_adapter to same module 2. remove some unused functions
06134f0
to
45ffb99
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (17)
- Cargo.toml (2 hunks)
- executor/tests/script_function_test.rs (4 hunks)
- vm/move-package-manager/Cargo.toml (2 hunks)
- vm/move-package-manager/src/extended_checks.rs (1 hunks)
- vm/move-package-manager/src/lib.rs (1 hunks)
- vm/move-package-manager/src/release.rs (2 hunks)
- vm/starcoin-gas/src/gas_meter.rs (2 hunks)
- vm/vm-runtime/Cargo.toml (1 hunks)
- vm/vm-runtime/src/lib.rs (2 hunks)
- vm/vm-runtime/src/parallel_executor/mod.rs (1 hunks)
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs (1 hunks)
- vm/vm-runtime/src/starcoin_vm.rs (6 hunks)
- vm/vm-runtime/src/verifier/mod.rs (1 hunks)
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter_common.rs (2 hunks)
- vm/vm-runtime/src/vm_adapter/mod.rs (1 hunks)
Files skipped from review as they are similar to previous changes (16)
- Cargo.toml
- executor/tests/script_function_test.rs
- vm/move-package-manager/Cargo.toml
- vm/move-package-manager/src/extended_checks.rs
- vm/move-package-manager/src/lib.rs
- vm/move-package-manager/src/release.rs
- vm/starcoin-gas/src/gas_meter.rs
- vm/vm-runtime/Cargo.toml
- vm/vm-runtime/src/lib.rs
- vm/vm-runtime/src/parallel_executor/mod.rs
- vm/vm-runtime/src/parallel_executor/vm_wrapper.rs
- vm/vm-runtime/src/starcoin_vm.rs
- vm/vm-runtime/src/verifier/mod.rs
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs
- vm/vm-runtime/src/vm_adapter/adapter.rs
- vm/vm-runtime/src/vm_adapter/mod.rs
Additional comments not posted (2)
vm/vm-runtime/src/vm_adapter/adapter_common.rs (2)
4-4
: Improved module dependency management.Updating the import statement to reference
SessionAdapter
from the local module enhances clarity and reduces coupling.
36-36
: Visibility change forpreprocess_transaction
.Changing the visibility from
pub(crate)
topub
broadens the accessibility of the function, indicating an intention for wider usage across different modules or packages.However, ensure that the function is used correctly across the codebase.
Verification successful
Visibility change for
preprocess_transaction
.The function
preprocess_transaction
is used in multiple modules, and the visibility change frompub(crate)
topub
is consistent with its usage across the codebase. No issues were found with the new visibility.
vm/vm-runtime/src/vm_adapter/mod.rs
vm/vm-runtime/src/parallel_executor/mod.rs
Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the usage of `preprocess_transaction` across the codebase. # Test: Search for the function usage. Expect: No issues with the new visibility. rg --type rust -A 5 $'preprocess_transaction'Length of output: 1855
Benchmark for aa6e231Click to view benchmark
|
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: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (3)
- vm/move-package-manager/src/extended_checks.rs (1 hunks)
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs (1 hunks)
- vm/vm-runtime/src/vm_adapter/adapter_common.rs (1 hunks)
Files skipped from review as they are similar to previous changes (3)
- vm/move-package-manager/src/extended_checks.rs
- vm/vm-runtime/src/verifier/transaction_arg_validation.rs
- vm/vm-runtime/src/vm_adapter/adapter_common.rs
Benchmark for f69fcccClick to view benchmark
|
partly closes #4157 |
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
Summary by CodeRabbit
New Features
SessionAdapter
to improve module and script execution processes.Bug Fixes
Refactor
Documentation