Skip to content

Commit

Permalink
[11/n][vm-rewrite] Move the old move-vm-types
Browse files Browse the repository at this point in the history
Moves `move/move-execution/shared/crates/move-vm-types` to
`move/crates/legacy-move-vm-types` and updates paths in other parts of
the codebase based on this change.

No semantic changes.
  • Loading branch information
tzakian committed Feb 11, 2025
1 parent f301cc6 commit 7b669ec
Show file tree
Hide file tree
Showing 174 changed files with 225 additions and 211 deletions.
53 changes: 27 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ move-disassembler = { path = "external-crates/move/crates/move-disassembler" }
move-package = { path = "external-crates/move/crates/move-package" }
move-unit-test = { path = "external-crates/move/crates/move-unit-test" }
move-vm-config = { path = "external-crates/move/crates/move-vm-config" }
legacy-move-vm-types = { path = "external-crates/move/crates/legacy-move-vm-types" }
## TODO(vm-rewrite): we need to have a better execution versioning story here as just relying on the vm-runtime directly is not kosher...
move-vm-runtime = { path = "external-crates/move/crates/move-vm-runtime/", features = [
"tiered-gas",
Expand Down
3 changes: 1 addition & 2 deletions crates/sui-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ lru.workspace = true

sui-sdk-types.workspace = true

## TODO(vm-rewrite): Determine where to place the historical trait implementation of the `GasMeter` trait, and this will determine whether we remove this, or if we want to add it to the workspace officially.
move-vm-types-old = { path = "../../external-crates/move/move-execution/shared/crates/move-vm-types", package = "move-vm-types" }
legacy-move-vm-types.workspace = true

[dev-dependencies]
bincode.workspace = true
Expand Down
9 changes: 4 additions & 5 deletions crates/sui-types/src/gas_model/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,6 @@ pub fn initial_cost_schedule_for_unit_tests() -> TestCostTable {
}
}

// TODO(vm-rewrite): Move this to a better place. Possibly under `sui-execution`?
mod old_versions {
use crate::gas_model::gas_predicates::native_function_threshold_exceeded;
use crate::gas_model::gas_predicates::use_legacy_abstract_size;
Expand All @@ -955,17 +954,17 @@ mod old_versions {
GasStatus, BOOL_SIZE, REFERENCE_SIZE, U128_SIZE, U16_SIZE, U256_SIZE, U32_SIZE, U64_SIZE,
U8_SIZE,
};
use legacy_move_vm_types::gas::GasMeter;
use legacy_move_vm_types::gas::SimpleInstruction;
use legacy_move_vm_types::views::TypeView;
use legacy_move_vm_types::views::ValueView;
use move_binary_format::errors::PartialVMResult;
use move_core_types::gas_algebra::AbstractMemorySize;
use move_core_types::gas_algebra::InternalGas;
use move_core_types::gas_algebra::NumArgs;
use move_core_types::gas_algebra::NumBytes;
use move_core_types::language_storage::ModuleId;
use move_vm_profiler::GasProfiler;
use move_vm_types_old::gas::GasMeter;
use move_vm_types_old::gas::SimpleInstruction;
use move_vm_types_old::views::TypeView;
use move_vm_types_old::views::ValueView;

/// Returns a tuple of (<pops>, <pushes>, <stack_size_decrease>, <stack_size_increase>)
fn get_simple_instruction_stack_change(
Expand Down
13 changes: 13 additions & 0 deletions external-crates/move/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions external-crates/move/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ move-vm-config = { path = "crates/move-vm-config" }
move-vm-profiler = { path = "crates/move-vm-profiler" }
move-vm-runtime = { path = "crates/move-vm-runtime" }
prover_bytecode = { path = "crates/move-stackless-bytecode", package="move-stackless-bytecode" }
legacy-move-vm-types = { path = "crates/legacy-move-vm-types" }

[profile.bench]
debug = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "move-vm-types"
name = "legacy-move-vm-types"
version = "0.1.0"
authors = ["Diem Association <[email protected]>"]
description = "Types for Move VM"
description = "Legacy (pre-rewrite) Types for Move VM"
repository = "https://github.com/diem/diem"
homepage = "https://diem.com"
license = "Apache-2.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ publish = false
[dependencies]
move-binary-format.workspace = true
move-core-types.workspace = true
move-vm-types = { path = "../../../shared/crates/move-vm-types" }
legacy-move-vm-types.workspace = true
move-vm-runtime = { path = "../move-vm-runtime", package = "move-vm-runtime-v0" }
smallvec.workspace = true
sha2.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type,
natives::function::NativeResult,
pop_arg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use move_binary_format::errors::PartialVMResult;
use move_core_types::{account_address::AccountAddress, gas_algebra::InternalGas};
use move_vm_runtime::native_functions::{NativeContext, NativeFunction};
#[allow(unused_imports)]
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type,
natives::function::NativeResult,
pop_arg,
Expand Down Expand Up @@ -197,7 +197,7 @@ mod testing {
vm_status::StatusCode,
};
use move_vm_runtime::native_functions::NativeContext;
use move_vm_types::{loaded_data::runtime_types::Type, values::Value};
use legacy_move_vm_types::{loaded_data::runtime_types::Type, values::Value};
use std::{fmt, fmt::Write};

const VECTOR_BEGIN: &str = "[";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type, natives::function::NativeResult, pop_arg, values::Value,
};
use sha2::{Digest, Sha256};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type,
natives::function::NativeResult,
pop_arg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type,
natives::function::NativeResult,
pop_arg,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type,
natives::function::NativeResult,
values::{Struct, Value},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use move_vm_runtime::{
native_charge_gas_early_exit,
native_functions::{NativeContext, NativeFunction},
};
use move_vm_types::{
use legacy_move_vm_types::{
loaded_data::runtime_types::Type, natives::function::NativeResult, pop_arg, values::Value,
};
use smallvec::smallvec;
Expand Down
Loading

0 comments on commit 7b669ec

Please sign in to comment.