diff --git a/Cargo.lock b/Cargo.lock index 180cbdb8cc..f1312fa136 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6275,7 +6275,7 @@ dependencies = [ "starcoin-cmd", "starcoin-config", "starcoin-crypto", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-gas-schedule", "starcoin-logger", "starcoin-move-compiler", @@ -10199,7 +10199,7 @@ dependencies = [ "once_cell", "proptest", "proptest-derive 0.3.0", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-package-builder", "starcoin-vm-types", ] @@ -10779,19 +10779,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "starcoin-framework" -version = "13.0.0" -source = "git+https://github.com/starcoinorg/starcoin-framework?rev=94bcd77e80232b169cf95754ef4e87775645afcd#94bcd77e80232b169cf95754ef4e87775645afcd" -dependencies = [ - "anyhow", - "include_dir", - "log 0.4.22", - "once_cell", - "tempfile", - "walkdir", -] - [[package]] name = "starcoin-gas-algebra" version = "2.0.1" @@ -11101,7 +11088,7 @@ dependencies = [ "petgraph 0.5.1", "regex", "starcoin-crypto", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-logger", "starcoin-vm-types", "stest", @@ -11423,7 +11410,7 @@ dependencies = [ "itertools 0.10.5", "move-command-line-common", "move-package", - "starcoin-framework 0.1.0", + "starcoin-framework", "tempfile", ] @@ -11711,7 +11698,7 @@ dependencies = [ "serde-reflection 0.3.2", "serde_yaml", "starcoin-cached-packages", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-vm-types", "tempfile", "textwrap 0.14.2", @@ -12074,7 +12061,7 @@ dependencies = [ "starcoin-crypto", "starcoin-dag", "starcoin-dev", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-gas-meter", "starcoin-gas-schedule", "starcoin-genesis", @@ -12257,7 +12244,7 @@ dependencies = [ "starcoin-cached-packages", "starcoin-config", "starcoin-crypto", - "starcoin-framework 0.1.0", + "starcoin-framework", "starcoin-gas-algebra", "starcoin-gas-meter", "starcoin-gas-schedule", @@ -12362,16 +12349,13 @@ dependencies = [ "move-compiler", "move-prover", "once_cell", - "serde", "sha2 0.9.9", "simplelog", + "starcoin-cached-packages", "starcoin-crypto", - "starcoin-framework 0.1.0", - "starcoin-framework 13.0.0", + "starcoin-framework", "starcoin-move-compiler", "starcoin-vm-types", - "tempfile", - "walkdir", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d0ecfe6ff0..7b22e373e4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -527,7 +527,6 @@ starcoin-crypto = { git = "https://github.com/starcoinorg/starcoin-crypto", rev starcoin-decrypt = { path = "commons/decrypt" } starcoin-dev = { path = "vm/dev" } starcoin-executor = { path = "executor" } -starcoin-framework-legacy = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "94bcd77e80232b169cf95754ef4e87775645afcd", package = "starcoin-framework" } starcoin-framework = { path = "vm/framework" } starcoin-sdk-builder = { path = "vm/starcoin-sdk-builder" } starcoin-genesis = { path = "genesis" } diff --git a/vm/stdlib/Cargo.toml b/vm/stdlib/Cargo.toml index 551200cbd0..7670eb8780 100644 --- a/vm/stdlib/Cargo.toml +++ b/vm/stdlib/Cargo.toml @@ -10,16 +10,13 @@ move-bytecode-verifier = { workspace = true } move-compiler = { workspace = true } move-prover = { workspace = true } once_cell = { workspace = true } -serde = { features = ["derive"], workspace = true } sha2 = { workspace = true } simplelog = { workspace = true } starcoin-crypto = { workspace = true } starcoin-framework = { workspace = true } starcoin-move-compiler = { workspace = true } starcoin-vm-types = { workspace = true } -tempfile = { workspace = true } -walkdir = { workspace = true } -starcoin-framework-legacy = { workspace = true } +starcoin-cached-packages = { workspace = true } [dev-dependencies] datatest-stable = { workspace = true } diff --git a/vm/stdlib/src/lib.rs b/vm/stdlib/src/lib.rs index 510e539fef..4838fb32c9 100644 --- a/vm/stdlib/src/lib.rs +++ b/vm/stdlib/src/lib.rs @@ -30,7 +30,6 @@ use std::{ mod compat; pub use compat::*; -pub use starcoin_framework_legacy::SourceFiles; pub use starcoin_move_compiler::utils::iterate_directory; pub const NO_USE_COMPILED: &str = "MOVE_NO_USE_COMPILED"; @@ -57,20 +56,22 @@ pub const ERROR_DESC_EXTENSION: &str = "errmap"; pub const ERROR_DESCRIPTIONS: &[u8] = std::include_bytes!("../compiled/latest/error_descriptions/error_descriptions.errmap"); -// XXX FIXME YSG need to remove -pub const STDLIB_DIR: Dir = starcoin_framework_legacy::SOURCES_DIR; - // The current stdlib that is freshly built. This will never be used in deployment so we don't need // to pull the same trick here in order to include this in the Rust binary. static G_FRESH_MOVE_LANG_STDLIB: Lazy>> = Lazy::new(|| { - build_stdlib(STARCOIN_FRAMEWORK_SOURCES.files.as_slice()) - .values() - .map(|m| { - let mut blob = vec![]; - m.serialize(&mut blob).unwrap(); - blob - }) - .collect() + build_stdlib( + starcoin_cached_packages::head_release_bundle() + .files() + .unwrap() + .as_slice(), + ) + .values() + .map(|m| { + let mut blob = vec![]; + m.serialize(&mut blob).unwrap(); + blob + }) + .collect() }); // This needs to be a string literal due to restrictions imposed by include_bytes. @@ -104,8 +105,6 @@ pub static G_COMPILED_STDLIB: Lazy>>> = Lazy: pub const SCRIPT_HASH_LENGTH: usize = HashValue::LENGTH; -pub use starcoin_framework_legacy::STARCOIN_FRAMEWORK_SOURCES; - /// Return all versions of stdlib, include latest. pub fn stdlib_versions() -> Vec { G_STDLIB_VERSIONS.clone() @@ -163,7 +162,10 @@ pub fn module_to_package( } pub fn stdlib_files() -> Vec { - STARCOIN_FRAMEWORK_SOURCES.files.clone() + starcoin_cached_packages::head_release_bundle() + .files() + .unwrap() + .clone() } pub fn build_stdlib(targets: &[String]) -> BTreeMap { diff --git a/vm/stdlib/src/main.rs b/vm/stdlib/src/main.rs index 2f8ecc1eff..2fe4268837 100644 --- a/vm/stdlib/src/main.rs +++ b/vm/stdlib/src/main.rs @@ -8,7 +8,6 @@ use itertools::Itertools; use log::LevelFilter; use simplelog::{Config, SimpleLogger}; use starcoin_crypto::hash::PlainCryptoHash; -use starcoin_framework_legacy::STARCOIN_FRAMEWORK_SOURCES; use starcoin_move_compiler::check_compiled_module_compat; use starcoin_vm_types::account_config::core_code_address; use starcoin_vm_types::file_format::CompiledModule; @@ -140,11 +139,7 @@ fn full_update_with_version(version_number: u64) -> PathBuf { dest } -fn replace_stdlib_by_path( - _source_dir: &Path, - module_path: &Path, - new_modules: BTreeMap, -) { +fn replace_stdlib_by_path(module_path: &Path, new_modules: BTreeMap) { if module_path.exists() { std::fs::remove_dir_all(module_path).unwrap(); } @@ -317,8 +312,12 @@ fn main() { .join("../../vm/stdlib"); std::env::set_current_dir(base_path).expect("failed to change directory"); - let sources = &STARCOIN_FRAMEWORK_SOURCES; - let new_modules = build_stdlib(&sources.files); + let new_modules = build_stdlib( + &starcoin_cached_packages::head_release_bundle() + .files() + .unwrap() + .as_slice(), + ); if !no_check_compatibility { if let Some((pre_stable_version, pre_stable_modules)) = pre_version @@ -367,11 +366,7 @@ fn main() { // Write the stdlib blob let module_path = PathBuf::from(LATEST_COMPILED_OUTPUT_PATH).join(STDLIB_DIR_NAME); - replace_stdlib_by_path( - sources.tempdir.path(), - module_path.as_path(), - new_modules.clone(), - ); + replace_stdlib_by_path(module_path.as_path(), new_modules.clone()); let stdlib_versions = &stdlib::G_STDLIB_VERSIONS; for version in stdlib_versions.iter() { let modules = stdlib::load_compiled_modules(*version);