diff --git a/Cargo.lock b/Cargo.lock index d66092c080..305926dac3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2129,9 +2129,11 @@ dependencies = [ "rayon", "serde 1.0.152", "serde_json", + "starcoin-account", "starcoin-account-api", "starcoin-accumulator", "starcoin-chain", + "starcoin-cmd", "starcoin-config", "starcoin-consensus", "starcoin-crypto", @@ -2140,6 +2142,7 @@ dependencies = [ "starcoin-logger", "starcoin-resource-viewer", "starcoin-rpc-api", + "starcoin-state-api", "starcoin-state-tree", "starcoin-statedb", "starcoin-storage", @@ -9271,6 +9274,7 @@ dependencies = [ "starcoin-consensus", "starcoin-crypto", "starcoin-executor", + "starcoin-force-upgrade", "starcoin-genesis", "starcoin-logger", "starcoin-open-block", @@ -9282,6 +9286,7 @@ dependencies = [ "starcoin-time-service", "starcoin-transaction-builder", "starcoin-types", + "starcoin-vm-runtime", "starcoin-vm-types", "stdlib", "stest", @@ -9604,6 +9609,7 @@ dependencies = [ "starcoin-consensus", "starcoin-crypto", "starcoin-dev", + "starcoin-force-upgrade", "starcoin-logger", "starcoin-resource-viewer", "starcoin-state-api", @@ -9671,10 +9677,36 @@ dependencies = [ "tokio-executor 0.2.0-alpha.6", ] +[[package]] +name = "starcoin-force-upgrade" +version = "1.13.10" +dependencies = [ + "anyhow", + "async-trait", + "bcs-ext", + "futures 0.3.26", + "include_dir", + "parking_lot 0.12.1", + "starcoin-accumulator", + "starcoin-chain-api", + "starcoin-crypto", + "starcoin-genesis", + "starcoin-logger", + "starcoin-move-compiler", + "starcoin-state-api", + "starcoin-statedb", + "starcoin-storage", + "starcoin-types", + "starcoin-vm-runtime", + "starcoin-vm-types", + "stdlib", + "stest", +] + [[package]] name = "starcoin-framework" version = "11.0.0" -source = "git+https://github.com/starcoinorg/starcoin-framework?rev=345a3900a0064dc57a9560235bc72c12f03448b1#345a3900a0064dc57a9560235bc72c12f03448b1" +source = "git+https://github.com/starcoinorg/starcoin-framework?rev=1df759371941ab59cb2295542f7eafa85c4ef6fe#1df759371941ab59cb2295542f7eafa85c4ef6fe" dependencies = [ "anyhow", "include_dir", @@ -10254,12 +10286,15 @@ dependencies = [ "starcoin-chain-api", "starcoin-crypto", "starcoin-executor", + "starcoin-force-upgrade", "starcoin-genesis", "starcoin-logger", "starcoin-state-api", "starcoin-statedb", "starcoin-storage", "starcoin-types", + "starcoin-vm-runtime", + "starcoin-vm-types", "stest", ] @@ -11006,6 +11041,7 @@ version = "1.13.11" dependencies = [ "anyhow", "bcs-ext", + "hex", "move-core-types", "move-stdlib", "move-table-extension", diff --git a/Cargo.toml b/Cargo.toml index f78c22b3e9..dabb326153 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ members = [ "chain", "chain/api", "chain/open-block", + "chain/force-upgrade", "chain/mock", "chain/chain-notify", "chain/service", @@ -152,6 +153,7 @@ default-members = [ "chain", "chain/api", "chain/open-block", + "chain/force-upgrade", "chain/mock", "chain/chain-notify", "chain/service", @@ -442,7 +444,7 @@ 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 = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "345a3900a0064dc57a9560235bc72c12f03448b1" } +starcoin-framework = { git = "https://github.com/starcoinorg/starcoin-framework", rev = "1df759371941ab59cb2295542f7eafa85c4ef6fe" } starcoin-genesis = { path = "genesis" } starcoin-logger = { path = "commons/logger" } starcoin-metrics = { path = "commons/metrics" } @@ -460,6 +462,7 @@ starcoin-network-rpc-api = { path = "network-rpc/api" } starcoin-node = { path = "node" } starcoin-node-api = { path = "node/api" } starcoin-open-block = { path = "chain/open-block" } +starcoin-force-upgrade = { path = "chain/force-upgrade" } starcoin-resource-viewer = { path = "vm/resource-viewer" } starcoin-rpc-api = { path = "rpc/api" } starcoin-rpc-client = { path = "rpc/client" } diff --git a/chain/Cargo.toml b/chain/Cargo.toml index 70c841f84e..e9213d3f35 100644 --- a/chain/Cargo.toml +++ b/chain/Cargo.toml @@ -21,6 +21,8 @@ starcoin-statedb = { workspace = true } starcoin-time-service = { workspace = true } starcoin-types = { package = "starcoin-types", workspace = true } starcoin-vm-types = { workspace = true } +starcoin-vm-runtime = { workspace = true } +starcoin-force-upgrade = { workspace = true } starcoin-storage = { workspace = true } thiserror = { workspace = true } once_cell = { workspace = true } @@ -41,6 +43,7 @@ stdlib = { workspace = true } stest = { workspace = true } test-helper = { workspace = true } tokio = { features = ["full"], workspace = true } +starcoin-force-upgrade = { workspace = true } [features] default = [] diff --git a/chain/force-upgrade/Cargo.toml b/chain/force-upgrade/Cargo.toml new file mode 100644 index 0000000000..5f6b1ef073 --- /dev/null +++ b/chain/force-upgrade/Cargo.toml @@ -0,0 +1,35 @@ +[package] +authors = { workspace = true } +edition = { workspace = true } +license = { workspace = true } +name = "starcoin-force-upgrade" +publish = { workspace = true } +version = "1.13.10" +homepage = { workspace = true } +repository = { workspace = true } +rust-version = { workspace = true } + + +[dependencies] +anyhow = { workspace = true } +async-trait = { workspace = true } +bcs-ext = { package = "bcs-ext", workspace = true } +starcoin-crypto = { workspace = true } +futures = { workspace = true } +starcoin-logger = { workspace = true } +parking_lot = { workspace = true } +starcoin-accumulator = { workspace = true } +starcoin-chain-api = { workspace = true } +starcoin-state-api = { workspace = true } +starcoin-statedb = { workspace = true } +starcoin-storage = { workspace = true } +starcoin-types = { workspace = true } +starcoin-vm-types = { workspace = true } +starcoin-vm-runtime = { workspace = true } +starcoin-move-compiler = { workspace = true } +stdlib = { workspace = true } +include_dir = { workspace = true } + +[dev-dependencies] +starcoin-genesis = { workspace = true } +stest = { workspace = true } diff --git a/chain/force-upgrade/src/lib.rs b/chain/force-upgrade/src/lib.rs new file mode 100644 index 0000000000..5157b67297 --- /dev/null +++ b/chain/force-upgrade/src/lib.rs @@ -0,0 +1,63 @@ +// Copyright (c) The Starcoin Core Contributors +// SPDX-License-Identifier: Apache-2 + +use anyhow::format_err; +use starcoin_types::account::DEFAULT_EXPIRATION_TIME; +use starcoin_types::identifier::Identifier; +use starcoin_types::language_storage::ModuleId; +use starcoin_types::{ + account::{Account, DEFAULT_MAX_GAS_AMOUNT}, + transaction::SignedUserTransaction, +}; +use starcoin_vm_types::account_config::core_code_address; +use starcoin_vm_types::transaction::ScriptFunction; +use starcoin_vm_types::{ + account_config::STC_TOKEN_CODE_STR, + genesis_config::ChainId, + transaction::{Package, RawUserTransaction, TransactionPayload}, +}; +use stdlib::COMPILED_MOVE_CODE_DIR; + +pub struct ForceUpgrade; + +impl ForceUpgrade { + // block_timestamp: *NOTE* by seconds, + pub fn force_deploy_txn( + account: Account, + sequence_number: u64, + block_timestamp_in_secs: u64, + chain_id: &ChainId, + ) -> anyhow::Result { + let package_file = "12/11-12/stdlib.blob".to_string(); + let package = COMPILED_MOVE_CODE_DIR + .get_file(package_file.clone()) + .map(|file| { + bcs_ext::from_bytes::(file.contents()) + .expect("Decode package should success") + }) + .ok_or_else(|| format_err!("Can not find upgrade package {}", package_file))?; + + let init_script = ScriptFunction::new( + ModuleId::new( + core_code_address(), + Identifier::new("StdlibUpgradeScripts").unwrap(), + ), + Identifier::new("upgrade_from_v11_to_v12").unwrap(), + vec![], + vec![], + ); + + assert_eq!(package.init_script().unwrap(), &init_script); + + Ok(account.sign_txn(RawUserTransaction::new( + *account.address(), + sequence_number, + TransactionPayload::Package(package), + DEFAULT_MAX_GAS_AMOUNT, + 1, + block_timestamp_in_secs + DEFAULT_EXPIRATION_TIME, + *chain_id, + STC_TOKEN_CODE_STR.to_string(), + ))) + } +} diff --git a/chain/open-block/Cargo.toml b/chain/open-block/Cargo.toml index ece3fc2770..7b211b4bf8 100644 --- a/chain/open-block/Cargo.toml +++ b/chain/open-block/Cargo.toml @@ -13,6 +13,9 @@ starcoin-state-api = { workspace = true } starcoin-statedb = { workspace = true } starcoin-storage = { workspace = true } starcoin-types = { workspace = true } +starcoin-vm-types = { workspace = true } +starcoin-vm-runtime = { workspace = true } +starcoin-force-upgrade = { workspace = true } [dev-dependencies] starcoin-genesis = { workspace = true } diff --git a/chain/open-block/src/lib.rs b/chain/open-block/src/lib.rs index 54104c4440..86d27b11dd 100644 --- a/chain/open-block/src/lib.rs +++ b/chain/open-block/src/lib.rs @@ -6,12 +6,15 @@ use starcoin_accumulator::{node::AccumulatorStoreType, Accumulator, MerkleAccumu use starcoin_chain_api::ExcludedTxns; use starcoin_crypto::HashValue; use starcoin_executor::{execute_block_transactions, execute_transactions, VMMetrics}; +use starcoin_force_upgrade::ForceUpgrade; use starcoin_logger::prelude::*; use starcoin_state_api::{ChainStateReader, ChainStateWriter}; use starcoin_statedb::ChainStateDB; use starcoin_storage::Store; +use starcoin_types::account::DEFAULT_EXPIRATION_TIME; use starcoin_types::block::BlockNumber; use starcoin_types::genesis_config::{ChainId, ConsensusStrategy}; +use starcoin_types::identifier::Identifier; use starcoin_types::vm_error::KeptVMStatus; use starcoin_types::{ account_address::AccountAddress, @@ -23,6 +26,15 @@ use starcoin_types::{ }, U256, }; +use starcoin_vm_runtime::force_upgrade_management::{ + get_force_upgrade_account, get_force_upgrade_block_number, +}; +use starcoin_vm_types::access_path::AccessPath; +use starcoin_vm_types::account_config::{genesis_address, ModuleUpgradeStrategy}; +use starcoin_vm_types::move_resource::MoveResource; +use starcoin_vm_types::on_chain_config; +use starcoin_vm_types::state_store::state_key::StateKey; +use starcoin_vm_types::state_view::{StateReaderExt, StateView}; use std::{convert::TryInto, sync::Arc}; pub struct OpenedBlock { @@ -77,11 +89,11 @@ impl OpenedBlock { chain_id, previous_header.gas_used(), ); + let mut opened_block = Self { previous_block_info: block_info, block_meta, gas_limit: block_gas_limit, - state: chain_state, txn_accumulator, gas_used: 0, @@ -92,6 +104,7 @@ impl OpenedBlock { strategy, vm_metrics, }; + opened_block.initialize()?; Ok(opened_block) } @@ -131,6 +144,10 @@ impl OpenedBlock { &self.state } + pub fn chain_id(&self) -> ChainId { + self.chain_id + } + /// Try to add `user_txns` into this block. /// Return any txns not included, either txn is discarded, or block gas limit is reached. /// If error occurs during the processing, the `open_block` should be dropped, @@ -198,6 +215,10 @@ impl OpenedBlock { } }; } + + self.execute_extra_txn() + .expect("Extra txn must be executed successfully"); + Ok(ExcludedTxns { discarded_txns: discard_txns, untouched_txns: untouched_user_txns, @@ -241,6 +262,15 @@ impl OpenedBlock { &mut self, txn_hash: HashValue, output: TransactionOutput, + ) -> Result<(HashValue, HashValue)> { + self.push_txn_and_state_opt(txn_hash, output, false) + } + + fn push_txn_and_state_opt( + &mut self, + txn_hash: HashValue, + output: TransactionOutput, + is_extra_txn: bool, ) -> Result<(HashValue, HashValue)> { // Ignore the newly created table_infos. // Because they are not needed to calculate state_root, or included to TransactionInfo. @@ -253,6 +283,18 @@ impl OpenedBlock { self.state .apply_write_set(write_set) .map_err(BlockExecutorError::BlockChainStateErr)?; + if is_extra_txn { + // update stdlib version to 12 directly + let version_path = on_chain_config::access_path_for_config( + genesis_address(), + Identifier::new("Version").unwrap(), + Identifier::new("Version").unwrap(), + vec![], + ); + let version = on_chain_config::Version { major: 12 }; + self.state + .set(&version_path, bcs_ext::to_bytes(&version)?)?; + } let txn_state_root = self .state .commit() @@ -262,7 +304,7 @@ impl OpenedBlock { txn_hash, txn_state_root, events.as_slice(), - gas_used, + if is_extra_txn { 0 } else { gas_used }, status, ); let accumulator_root = self.txn_accumulator.append(&[txn_info.id()])?; @@ -294,7 +336,75 @@ impl OpenedBlock { ); Ok(block_template) } + + /// The logic for handling the forced upgrade will be processed. + /// First, set the account policy in `0x1::PackageTxnManager` to 100, + /// Second, after the contract deployment is successful, revert it back. + fn execute_extra_txn(&mut self) -> Result<()> { + let extra_txn = + if self.block_meta.number() == get_force_upgrade_block_number(&self.chain_id) { + let account = get_force_upgrade_account(&self.chain_id)?; + let sequence_number = self.state.get_sequence_number(*account.address())?; + let extra_txn = ForceUpgrade::force_deploy_txn( + account, + sequence_number, + self.block_meta.timestamp() / 1000 + DEFAULT_EXPIRATION_TIME, + &self.chain_id, + )?; + info!("extra txn in opened block ({:?})", extra_txn.id()); + Transaction::UserTransaction(extra_txn) + } else { + return Ok(()); + }; + let extra_txn_hash = extra_txn.id(); + + let strategy_path = AccessPath::resource_access_path( + genesis_address(), + ModuleUpgradeStrategy::struct_tag(), + ); + + // retrieve old strategy value + let old_val = self + .state + .get_state_value(&StateKey::AccessPath(strategy_path.clone()))? + .expect("module upgrade strategy should exist"); + // Set strategy to 100 to execute force-deploy-txn directly + self.state.set(&strategy_path, vec![100])?; + + // execute this special txn without gas limit + let mut results = execute_transactions( + &self.state, + vec![extra_txn.clone()], + self.vm_metrics.clone(), + ) + .map_err(BlockExecutorError::BlockTransactionExecuteErr)?; + + // Restore the old value + self.state.set(&strategy_path, old_val)?; + + let output = results.pop().expect("executed txn should has output"); + match output.status() { + TransactionStatus::Discard(status) => { + bail!( + "extra txn {:?} is discarded, vm status: {:?}", + extra_txn, + status + ); + } + TransactionStatus::Keep(_) => { + // Do not add extra_txn to included_user_txns + // treat it like BlockMeta txn + let _ = self.push_txn_and_state_opt(extra_txn_hash, output, true)?; + } + TransactionStatus::Retry => { + bail!("extra txn {:?} is impossible to retry", extra_txn); + } + }; + + Ok(()) + } } + pub struct AddressFilter; //static BLACKLIST: [&str; 0] = []; impl AddressFilter { diff --git a/chain/src/chain.rs b/chain/src/chain.rs index 255950d219..2d3162ccf6 100644 --- a/chain/src/chain.rs +++ b/chain/src/chain.rs @@ -36,9 +36,10 @@ use starcoin_types::{ transaction::{SignedUserTransaction, Transaction}, U256, }; +use starcoin_vm_runtime::force_upgrade_management::get_force_upgrade_block_number; use starcoin_vm_types::access_path::AccessPath; use starcoin_vm_types::account_config::genesis_address; -use starcoin_vm_types::genesis_config::ConsensusStrategy; +use starcoin_vm_types::genesis_config::{ChainId, ConsensusStrategy}; use starcoin_vm_types::on_chain_resource::Epoch; use std::cmp::min; use std::iter::Extend; @@ -671,6 +672,7 @@ impl BlockChain { let block_accumulator = MerkleAccumulator::new_empty( storage.get_accumulator_store(AccumulatorStoreType::Block), ); + let chain_id = genesis_block.header().chain_id(); let statedb = ChainStateDB::new(storage.clone().into_super_arc(), None); let executed_block = Self::execute_block_and_save( storage.as_ref(), @@ -680,6 +682,7 @@ impl BlockChain { &genesis_epoch, None, genesis_block, + &chain_id, None, )?; Self::new(time_service, executed_block.block.id(), storage, None) @@ -896,6 +899,7 @@ impl BlockChain { epoch: &Epoch, parent_status: Option, block: Block, + chain_id: &ChainId, vm_metrics: Option, ) -> Result { let header = block.header(); @@ -948,7 +952,13 @@ impl BlockChain { verify_block!( VerifyBlockField::State, - vec_transaction_info.len() == transactions.len(), + { + if header.number() == get_force_upgrade_block_number(chain_id) { + vec_transaction_info.len() == transactions.len().checked_add(1).unwrap() + } else { + vec_transaction_info.len() == transactions.len() + } + }, "invalid txn num in the block" ); @@ -1580,6 +1590,7 @@ impl ChainReader for BlockChain { &self.epoch, Some(self.status.status.clone()), verified_block.0, + &self.info().chain_id(), self.vm_metrics.clone(), ) } diff --git a/chain/tests/test_force_upgrade.rs b/chain/tests/test_force_upgrade.rs new file mode 100644 index 0000000000..b34b3052e2 --- /dev/null +++ b/chain/tests/test_force_upgrade.rs @@ -0,0 +1,210 @@ +use anyhow::format_err; +use starcoin_accumulator::Accumulator; +use starcoin_chain_api::{ChainReader, ChainWriter}; +use starcoin_config::NodeConfig; +use starcoin_consensus::Consensus; +use starcoin_statedb::ChainStateDB; +use starcoin_transaction_builder::{build_transfer_from_association, DEFAULT_EXPIRATION_TIME}; +use starcoin_types::account_address::AccountAddress; +use starcoin_vm_runtime::force_upgrade_management::get_force_upgrade_block_number; +use starcoin_vm_types::on_chain_config::Version; +use starcoin_vm_types::{account_config, state_view::StateReaderExt}; +use std::str::FromStr; +use std::sync::Arc; +use test_helper::executor::get_balance; + +#[stest::test] +pub fn test_force_upgrade_1() -> anyhow::Result<()> { + let config = Arc::new(NodeConfig::random_for_test()); + + let force_upgrade_height = get_force_upgrade_block_number(&config.net().chain_id()); + assert!(force_upgrade_height >= 2); + let initial_blocks = force_upgrade_height - 2; + + let mut miner = test_helper::gen_blockchain_with_blocks_for_test(initial_blocks, config.net())?; + let block_gas_limit = 10000000; + let initial_balance = 1000000000000; + let account_reader = miner.chain_state_reader(); + let association_sequence_num = + account_reader.get_sequence_number(account_config::association_address())?; + let miner_db = miner.chain_state(); + + let current_version = get_stdlib_version(miner_db)?; + assert_eq!(current_version, 11); + + // 1 genesis meta + INITIAL_BLOCKS block meta + let mut txns_num = initial_blocks + 1; + assert_eq!(miner.get_txn_accumulator().num_leaves(), txns_num); + + // create two txns to deposit some tokens to two black addresses + // and a third random address which should not in black address list. + let (black1, txn1, black2, txn2, rand3, txn3) = { + let receiver1 = AccountAddress::from_str("0xd0c5a06ae6100ce115cad1600fe59e96").unwrap(); + let txn1 = build_transfer_from_association( + receiver1, + association_sequence_num, + initial_balance + 1, + config.net().time_service().now_secs() + DEFAULT_EXPIRATION_TIME, + config.net(), + ) + .try_into()?; + + let receiver2 = AccountAddress::from_str("0x1af80d10cb642adcd9f7fee1420104ec").unwrap(); + let txn2 = build_transfer_from_association( + receiver2, + association_sequence_num + 1, + initial_balance + 2, + config.net().time_service().now_secs() + DEFAULT_EXPIRATION_TIME, + config.net(), + ) + .try_into()?; + + let rand3 = AccountAddress::random(); + let txn3 = build_transfer_from_association( + rand3, + association_sequence_num + 2, + initial_balance + 3, + config.net().time_service().now_secs() + DEFAULT_EXPIRATION_TIME, + config.net(), + ) + .try_into()?; + + (receiver1, txn1, receiver2, txn2, rand3, txn3) + }; + + // block number 1: deposit some stc tokens to two black addresses + { + let (block_template, _excluded) = miner + .create_block_template( + account_config::association_address(), + None, + vec![txn1, txn2, txn3], + vec![], + Some(block_gas_limit), + ) + .unwrap(); + + let block = miner + .consensus() + .create_block(block_template, miner.time_service().as_ref())?; + + miner.apply(block)?; + + // 1 meta + 3 user = 4 txns + txns_num += 4; + assert_eq!(miner.get_txn_accumulator().num_leaves(), txns_num); + + assert_eq!( + get_balance(black1, miner.chain_state()), + initial_balance + 1 + ); + assert_eq!( + get_balance(black2, miner.chain_state()), + initial_balance + 2 + ); + assert_eq!(get_balance(rand3, miner.chain_state()), initial_balance + 3); + } + + // fork a new chain, to apply block number 2 + let mut chain_to_apply = miner.fork(miner.current_header().id()).unwrap(); + + // create block number 2, then apply it to miner + let block_num_2 = { + let (block_template, _excluded) = miner + .create_block_template( + account_config::association_address(), + None, + vec![], + vec![], + Some(block_gas_limit), + ) + .unwrap(); + + let block2 = miner + .consensus() + .create_block(block_template, miner.time_service().as_ref())?; + + miner.apply(block2.clone())?; + + // 1 meta + 1 extra = 2 txns + let txns_num = txns_num + 2; + assert_eq!(miner.get_txn_accumulator().num_leaves(), txns_num); + + assert_eq!( + get_balance(black1, miner.chain_state()), + 0, + "Upgrade Failed, Balance of black list account not 0" + ); + + assert_eq!( + get_balance(black2, miner.chain_state()), + 0, + "Upgrade Failed, Balance of black list account not 0" + ); + + assert_eq!(get_balance(rand3, miner.chain_state()), initial_balance + 3); + + block2 + }; + + // apply block number 2 to another chain + { + // !!!non-zero balance + assert_ne!(get_balance(black1, chain_to_apply.chain_state()), 0); + assert_ne!(get_balance(black2, chain_to_apply.chain_state()), 0); + assert_ne!(get_balance(rand3, chain_to_apply.chain_state()), 0); + + chain_to_apply.apply(block_num_2)?; + + // 1 meta + 1 extra = 2 txns + let txns_num = txns_num + 2; + assert_eq!(chain_to_apply.get_txn_accumulator().num_leaves(), txns_num); + + assert_eq!(get_balance(black1, chain_to_apply.chain_state()), 0); + assert_eq!(get_balance(black2, chain_to_apply.chain_state()), 0); + assert_eq!( + get_balance(rand3, chain_to_apply.chain_state()), + initial_balance + 3 + ); + } + + // Check on chain config for v12 + let upgraded_version = get_stdlib_version(chain_to_apply.chain_state())?; + assert_eq!(upgraded_version, 12); + + Ok(()) +} + +#[stest::test] +fn test_force_upgrade_2() -> anyhow::Result<()> { + let config = Arc::new(NodeConfig::random_for_test()); + + let force_upgrade_height = get_force_upgrade_block_number(&config.net().chain_id()); + assert!(force_upgrade_height >= 2); + + let chain = + test_helper::gen_blockchain_with_blocks_for_test(force_upgrade_height, config.net())?; + + // genesis 1 + 1meta in each blocks + special block 1meta+1extra.txn + assert_eq!( + chain.get_txn_accumulator().num_leaves(), + force_upgrade_height + 2 + ); + + let chain = + test_helper::gen_blockchain_with_blocks_for_test(force_upgrade_height + 1, config.net())?; + // genesis 1 + 1meta in each blocks + special block 2 + 1 meta in last block + assert_eq!( + chain.get_txn_accumulator().num_leaves(), + force_upgrade_height + 3 + ); + + Ok(()) +} + +fn get_stdlib_version(chain_state_db: &ChainStateDB) -> anyhow::Result { + chain_state_db + .get_on_chain_config::()? + .map(|version| version.major) + .ok_or_else(|| format_err!("on chain config stdlib version can not be empty.")) +} diff --git a/cmd/db-exporter/Cargo.toml b/cmd/db-exporter/Cargo.toml index 18861a2763..2bff6ed903 100644 --- a/cmd/db-exporter/Cargo.toml +++ b/cmd/db-exporter/Cargo.toml @@ -16,26 +16,30 @@ serde_json = { features = ["arbitrary_precision"], workspace = true } tokio = { features = ["full"], workspace = true } move-binary-format = { workspace = true } move-bytecode-verifier = { workspace = true } +starcoin-account = { workspace = true } starcoin-account-api = { workspace = true } starcoin-accumulator = { package = "starcoin-accumulator", workspace = true } starcoin-chain = { workspace = true } +starcoin-cmd = { workspace = true } starcoin-config = { workspace = true } starcoin-consensus = { workspace = true } starcoin-crypto = { workspace = true } starcoin-executor = { workspace = true } starcoin-genesis = { workspace = true } starcoin-resource-viewer = { workspace = true } +starcoin-rpc-api = { workspace = true } starcoin-state-tree = { workspace = true } starcoin-statedb = { workspace = true } starcoin-storage = { workspace = true } +starcoin-state-api = { workspace = true } starcoin-transaction-builder = { workspace = true } starcoin-types = { workspace = true } starcoin-vm-types = { workspace = true } starcoin-vm-runtime = { workspace = true } +# network-p2p-types = { workspace = true } futures = { workspace = true } rayon = { workspace = true } num_cpus = { workspace = true } -starcoin-rpc-api = { workspace = true } [package] authors = { workspace = true } diff --git a/cmd/db-exporter/src/force_deploy_output.rs b/cmd/db-exporter/src/force_deploy_output.rs new file mode 100644 index 0000000000..1c3af409da --- /dev/null +++ b/cmd/db-exporter/src/force_deploy_output.rs @@ -0,0 +1,159 @@ +// Copyright (c) The Starcoin Core Contributors +// SPDX-License-Identifier: Apache-2.0 + +use std::fmt::Debug; +use std::path::PathBuf; +use std::sync::Arc; + +use anyhow::format_err; +use clap::Parser; +use starcoin_chain::{BlockChain, ChainReader, ChainWriter}; +use starcoin_cmd::dev::dev_helper; +use starcoin_config::{BuiltinNetworkID, ChainNetwork}; +use starcoin_genesis::Genesis; +use starcoin_state_api::ChainStateWriter; +use starcoin_statedb::ChainStateDB; +use starcoin_storage::{ + cache_storage::CacheStorage, db_storage::DBStorage, storage::StorageInstance, Storage, + StorageVersion, +}; +use starcoin_transaction_builder::DEFAULT_MAX_GAS_AMOUNT; +use starcoin_types::account::DEFAULT_EXPIRATION_TIME; +use starcoin_types::{account::Account, block::BlockNumber}; +use starcoin_vm_types::{ + access_path::AccessPath, + account_config::{genesis_address, ModuleUpgradeStrategy, STC_TOKEN_CODE_STR}, + genesis_config::ChainId, + move_resource::MoveResource, + state_store::state_key::StateKey, + state_view::StateView, + transaction::{RawUserTransaction, Transaction, TransactionPayload}, +}; + +#[derive(Debug, Parser)] +#[clap( + name = "force-deploy", + about = "Force deploy output with ignore account upgrade strategy" +)] +pub struct ForceDeployOutput { + #[clap(long, short = 'n')] + /// Chain Network, like main, proxima + pub net: BuiltinNetworkID, + + #[clap(long, short = 'i', parse(from_os_str))] + /// starcoin node db path. like ~/.starcoin/barnard/starcoindb/db/starcoindb + pub input_path: PathBuf, + + #[clap(long, short = 'p', parse(from_os_str))] + /// Package path which + pub package_path: PathBuf, + + #[clap(long, short = 's')] + pub block_num: BlockNumber, +} + +pub fn force_deploy_output( + network_path: PathBuf, + package_path: PathBuf, + network: BuiltinNetworkID, + block_number: BlockNumber, +) -> anyhow::Result<()> { + ::starcoin_logger::init(); + let net = ChainNetwork::new_builtin(network); + let db_storage = DBStorage::open_with_cfs( + network_path.join("starcoindb/db/starcoindb"), + StorageVersion::current_version() + .get_column_family_names() + .to_vec(), + true, + Default::default(), + None, + )?; + let storage = Arc::new(Storage::new(StorageInstance::new_cache_and_db_instance( + CacheStorage::new(None), + db_storage, + ))?); + let (chain_info, _) = + Genesis::init_and_check_storage(&net, storage.clone(), network_path.as_ref())?; + let chain = BlockChain::new( + net.time_service(), + chain_info.head().id(), + storage.clone(), + None, + ) + .expect("create block chain should success."); + + let block = chain + .get_block_by_number(block_number)? + .ok_or_else(|| format_err!("{} get block error", block_number))?; + + // BlockChain::set_output_block(); + let mut chain = BlockChain::new( + net.time_service(), + block.header.parent_hash(), + storage, + None, + ) + .expect("create block chain should success."); + + // Write upgrade strategy resource to 0 + let upgrade_strategy_path = + AccessPath::resource_access_path(genesis_address(), ModuleUpgradeStrategy::struct_tag()); + + let statedb = chain.chain_state(); + + let before_ret = statedb + .get_state_value(&StateKey::AccessPath(upgrade_strategy_path.clone()))? + .unwrap(); + assert_eq!(before_ret[0], 1, "Checking the strategy not 1"); + + statedb + .set(&upgrade_strategy_path, vec![0]) + .expect("Add resource failed"); + + // Check state is OK + let after_ret = statedb + .get_state_value(&StateKey::AccessPath(upgrade_strategy_path))? + .unwrap(); + assert_eq!(after_ret[0], 0, "Set to upgrade strategy failed!"); + + let account = Account::new_association(); + deploy_package( + network.chain_id(), + package_path, + chain.chain_state(), + &account, + net.time_service().now_secs(), + )?; + + Ok(()) +} + +fn deploy_package( + chain_id: ChainId, + package_path: PathBuf, + statedb: &ChainStateDB, + account: &Account, + now_time_by_sec: u64, +) -> anyhow::Result<()> { + let package = dev_helper::load_package_from_file(&package_path)?; + let signed_transaction = account.sign_txn(RawUserTransaction::new( + *account.address(), + 0, + TransactionPayload::Package(package), + DEFAULT_MAX_GAS_AMOUNT, + 1, + now_time_by_sec + DEFAULT_EXPIRATION_TIME, + chain_id, + STC_TOKEN_CODE_STR.to_string(), + )); + let ret = starcoin_executor::execute_transactions( + statedb, + vec![Transaction::UserTransaction(signed_transaction)], + None, + ) + .expect("Failed to execute deploy transaction"); + assert_eq!(ret.len(), 1, "There is incorrect execution result"); + + Ok(()) +} diff --git a/cmd/db-exporter/src/lib.rs b/cmd/db-exporter/src/lib.rs index 99e57915f1..4f6c9ea8e4 100644 --- a/cmd/db-exporter/src/lib.rs +++ b/cmd/db-exporter/src/lib.rs @@ -2,5 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 pub mod cmd_batch_execution; +pub mod force_deploy_output; pub mod verify_header; pub mod verify_module; diff --git a/cmd/db-exporter/src/main.rs b/cmd/db-exporter/src/main.rs index 5b0aced7c6..1c4b68c484 100644 --- a/cmd/db-exporter/src/main.rs +++ b/cmd/db-exporter/src/main.rs @@ -5,6 +5,7 @@ use anyhow::{bail, format_err, Result}; use bcs_ext::{BCSCodec, Sample}; use clap::{IntoApp, Parser}; use csv::Writer; +use db_exporter::force_deploy_output::{force_deploy_output, ForceDeployOutput}; use db_exporter::{ verify_header::{verify_header_via_export_file, VerifyHeaderOptions}, verify_module::{verify_modules_via_export_file, VerifyModuleOptions}, @@ -244,6 +245,7 @@ enum Cmd { ApplyBlockOutput(ApplyBlockOutputOptions), SaveStartupInfo(SaveStartupInfoOptions), TokenSupply(TokenSupplyOptions), + ForceDeploy(ForceDeployOutput), } #[derive(Debug, Clone, Parser)] @@ -717,6 +719,14 @@ async fn main() -> anyhow::Result<()> { let result = apply_block_output(option.to_path, option.input_path, option.net); return result; } + Cmd::ForceDeploy(option) => { + return force_deploy_output( + option.input_path, + option.package_path, + option.net, + option.block_num, + ) + } Cmd::SaveStartupInfo(option) => { let result = save_startup_info(option.to_path, option.net, option.hash_value); return result; diff --git a/config/src/genesis_config.rs b/config/src/genesis_config.rs index f553cb5013..4a1d23d3cf 100644 --- a/config/src/genesis_config.rs +++ b/config/src/genesis_config.rs @@ -756,7 +756,7 @@ pub static G_TEST_CONFIG: Lazy = Lazy::new(|| { ), genesis_key_pair: Some((Arc::new(genesis_private_key), genesis_public_key)), time_service_type: TimeServiceType::MockTimeService, - stdlib_version: StdlibVersion::Latest, + stdlib_version: StdlibVersion::Version(11), dao_config: DaoConfig { voting_delay: 60_000, // 1min voting_period: 60 * 60 * 1000, // 1h @@ -774,6 +774,7 @@ pub static G_DEV_CONFIG: Lazy = Lazy::new(|| { let mut gas_constant = G_TEST_GAS_CONSTANTS.clone(); gas_constant.min_price_per_gas_unit = 1; + let stdlib_version = StdlibVersion::Version(11); GenesisConfig { genesis_block_parameter: GenesisBlockParameterConfig::Static(GenesisBlockParameter { parent_hash: HashValue::sha3_256_of(b"starcoin_dev"), @@ -808,7 +809,7 @@ pub static G_DEV_CONFIG: Lazy = Lazy::new(|| { ), genesis_key_pair: Some((Arc::new(genesis_private_key), genesis_public_key)), time_service_type: TimeServiceType::MockTimeService, - stdlib_version: StdlibVersion::Latest, + stdlib_version, dao_config: DaoConfig { voting_delay: 60_000, // 1min voting_period: 60 * 60 * 1000, // 1h @@ -824,16 +825,17 @@ pub static G_HALLEY_BOOT_NODES: Lazy> = Lazy::new(|| { }); pub static G_HALLEY_CONFIG: Lazy = Lazy::new(|| { - let stdlib_version = StdlibVersion::Latest; + // let stdlib_version = StdlibVersion::Latest; + let stdlib_version = StdlibVersion::Version(11); let association_public_key = "068b8493d8c533fd08568429274e49639518a8517f6ab03a0f0cc37edcbdfdd0071855fd941dbcefeb9e4da9f417c7b0f39f73226c9310d39881ae13b45017fa67cc9cb01386e9f5e321b078d4d3a2925b520f955cf7dfd9f6891de366c186ce6ec4a3d5a1c6c795126e5ee1222e23f9a28266c07ecce3e2cd19c6e123b465c091bc45a1fa7f778c66c37af15f3e81ff511e69ff0481bcfaab7b4673f469a3d29760cacf5dd0105a541b5f50720b9577a4c3ff7475554afedbf6a884777f9db4c461fe9aca18df90ed31ee967fe49ed47756311eaa2a6042b7aff1422e48643dc7a0004e0ca3e6b8e548c80d76eeb88e84a82f6b863a1346eabadfe4d5d9be86f98fa72c63f1e1a3f193d4ff71e10dbf364200b221e1a7f71cfab55cc7f7ad2a05"; let mut gas_constant = G_TEST_GAS_CONSTANTS.clone(); - gas_constant.min_price_per_gas_unit = 1; // to keep the same as framework config + gas_constant.min_price_per_gas_unit = 1; GenesisConfig { genesis_block_parameter: GenesisBlockParameterConfig::Static(GenesisBlockParameter { parent_hash: HashValue::sha3_256_of(b"starcoin_halley"), - timestamp: 1693798675000, + timestamp: 1713105562000, difficulty: 100.into(), }), version: Version { major: 1 }, @@ -882,6 +884,7 @@ pub static G_PROXIMA_BOOT_NODES: Lazy> = Lazy::new(|| { }); pub static G_PROXIMA_CONFIG: Lazy = Lazy::new(|| { + // let stdlib_version = StdlibVersion::Latest; let stdlib_version = StdlibVersion::Version(11); let association_public_key = "068b8493d8c533fd08568429274e49639518a8517f6ab03a0f0cc37edcbdfdd0071855fd941dbcefeb9e4da9f417c7b0f39f73226c9310d39881ae13b45017fa67cc9cb01386e9f5e321b078d4d3a2925b520f955cf7dfd9f6891de366c186ce6ec4a3d5a1c6c795126e5ee1222e23f9a28266c07ecce3e2cd19c6e123b465c091bc45a1fa7f778c66c37af15f3e81ff511e69ff0481bcfaab7b4673f469a3d29760cacf5dd0105a541b5f50720b9577a4c3ff7475554afedbf6a884777f9db4c461fe9aca18df90ed31ee967fe49ed47756311eaa2a6042b7aff1422e48643dc7a0004e0ca3e6b8e548c80d76eeb88e84a82f6b863a1346eabadfe4d5d9be86f98fa72c63f1e1a3f193d4ff71e10dbf364200b221e1a7f71cfab55cc7f7ad2a05"; GenesisConfig { diff --git a/executor/Cargo.toml b/executor/Cargo.toml index 7bc8707a48..2fb1c75a67 100644 --- a/executor/Cargo.toml +++ b/executor/Cargo.toml @@ -8,7 +8,9 @@ starcoin-types = { workspace = true } starcoin-vm-types = { workspace = true } starcoin-vm-runtime = { workspace = true } starcoin-statedb = { workspace = true } +starcoin-force-upgrade = { workspace = true } serde = { default-features = false, workspace = true } +bcs-ext = { workspace = true } [dev-dependencies] bcs-ext = { package = "bcs-ext", workspace = true } @@ -26,6 +28,7 @@ starcoin-transaction-builder = { workspace = true } starcoin-state-tree = { workspace = true } starcoin-statedb = { workspace = true } starcoin-vm-runtime = { workspace = true } +starcoin-force-upgrade = { workspace = true } stdlib = { package = "stdlib", workspace = true } stest = { workspace = true } tempfile = { workspace = true } diff --git a/executor/src/block_executor.rs b/executor/src/block_executor.rs index e7b46165d4..782c319af5 100644 --- a/executor/src/block_executor.rs +++ b/executor/src/block_executor.rs @@ -1,16 +1,31 @@ // Copyright (c) The Starcoin Core Contributors // SPDX-License-Identifier: Apache-2.0 +use crate::{execute_block_transactions, execute_transactions}; +use anyhow::bail; +use log::info; use serde::{Deserialize, Serialize}; use starcoin_crypto::HashValue; +use starcoin_force_upgrade::ForceUpgrade; use starcoin_state_api::{ChainStateReader, ChainStateWriter}; +use starcoin_types::account::DEFAULT_EXPIRATION_TIME; use starcoin_types::error::BlockExecutorError; use starcoin_types::error::ExecutorResult; +use starcoin_types::identifier::Identifier; use starcoin_types::transaction::TransactionStatus; use starcoin_types::transaction::{Transaction, TransactionInfo}; +use starcoin_vm_runtime::force_upgrade_management::{ + get_force_upgrade_account, get_force_upgrade_block_number, +}; use starcoin_vm_runtime::metrics::VMMetrics; +use starcoin_vm_types::access_path::AccessPath; +use starcoin_vm_types::account_config::{genesis_address, ModuleUpgradeStrategy}; use starcoin_vm_types::contract_event::ContractEvent; +use starcoin_vm_types::move_resource::MoveResource; +use starcoin_vm_types::on_chain_config; +use starcoin_vm_types::state_store::state_key::StateKey; use starcoin_vm_types::state_store::table::{TableHandle, TableInfo}; +use starcoin_vm_types::state_view::StateReaderExt; use starcoin_vm_types::write_set::WriteSet; use std::collections::BTreeMap; @@ -41,9 +56,13 @@ pub fn block_execute( block_gas_limit: u64, vm_metrics: Option, ) -> ExecutorResult { - let txn_outputs = - crate::execute_block_transactions(chain_state, txns.clone(), block_gas_limit, vm_metrics) - .map_err(BlockExecutorError::BlockTransactionExecuteErr)?; + let txn_outputs = execute_block_transactions( + chain_state, + txns.clone(), + block_gas_limit, + vm_metrics.clone(), + ) + .map_err(BlockExecutorError::BlockTransactionExecuteErr)?; let mut executed_data = BlockExecutedData::default(); for (txn, output) in txns @@ -85,6 +104,108 @@ pub fn block_execute( }; } + if let Some(extra_txn) = create_force_upgrade_extra_txn(chain_state) + .map_err(BlockExecutorError::BlockChainStateErr)? + { + // !!! commit suicide if any error or exception happens !!! + execute_extra_txn(chain_state, extra_txn, vm_metrics, &mut executed_data) + .expect("extra txn must be executed successfully"); + } + executed_data.state_root = chain_state.state_root(); Ok(executed_data) } + +fn create_force_upgrade_extra_txn( + statedb: &S, +) -> anyhow::Result> { + let chain_id = statedb.get_chain_id()?; + let block_timestamp = statedb.get_timestamp()?.seconds(); + let block_number = statedb.get_block_metadata()?.number; + Ok( + if block_number == get_force_upgrade_block_number(&chain_id) { + let account = get_force_upgrade_account(&chain_id)?; + let sequence_number = statedb.get_sequence_number(*account.address())?; + let extra_txn = ForceUpgrade::force_deploy_txn( + account, + sequence_number, + block_timestamp + DEFAULT_EXPIRATION_TIME, + &chain_id, + )?; + info!("extra txn to execute ({:?})", extra_txn.id()); + Some(Transaction::UserTransaction(extra_txn)) + } else { + None + }, + ) +} + +// todo: check the execute_extra_txn in OpenedBlock, and merge with it +fn execute_extra_txn( + chain_state: &S, + txn: Transaction, + vm_metrics: Option, + executed_data: &mut BlockExecutedData, +) -> anyhow::Result<()> { + let txn_hash = txn.id(); + let strategy_path = + AccessPath::resource_access_path(genesis_address(), ModuleUpgradeStrategy::struct_tag()); + + // retrieve the original strategy value + let old_val = chain_state + .get_state_value(&StateKey::AccessPath(strategy_path.clone()))? + .expect("module upgrade strategy should exist"); + // Set strategy to 100 upgrade package directly + chain_state.set(&strategy_path, vec![100])?; + + let output = execute_transactions(&chain_state, vec![txn], vm_metrics)? + .pop() + .expect("extra txn must have output"); + + // restore strategy to old value + chain_state.set(&strategy_path, old_val)?; + + let (mut table_infos, write_set, events, _gas_used, status) = output.into_inner(); + match status { + TransactionStatus::Discard(status) => { + bail!("extra txn {txn_hash:?} is discarded: {status:?}"); + } + TransactionStatus::Keep(status) => { + chain_state + .apply_write_set(write_set.clone()) + .map_err(BlockExecutorError::BlockChainStateErr)?; + { + // update stdlib version to 12 directly + let version_path = on_chain_config::access_path_for_config( + genesis_address(), + Identifier::new("Version").unwrap(), + Identifier::new("Version").unwrap(), + vec![], + ); + let version = on_chain_config::Version { major: 12 }; + chain_state.set(&version_path, bcs_ext::to_bytes(&version)?)?; + } + + let txn_state_root = chain_state + .commit() + .map_err(BlockExecutorError::BlockChainStateErr)?; + executed_data.txn_infos.push(TransactionInfo::new( + txn_hash, + txn_state_root, + events.as_slice(), + // skip the gas_used + 0, + status, + )); + executed_data.txn_events.push(events); + // Merge more table_infos, and keep the latest TableInfo for a same TableHandle + executed_data.txn_table_infos.append(&mut table_infos); + executed_data.write_sets.push(write_set); + } + TransactionStatus::Retry => { + bail!("extra txn {txn_hash:?} must not to retry"); + } + } + + Ok(()) +} diff --git a/executor/tests/module_upgrade_test.rs b/executor/tests/module_upgrade_test.rs index c9d4e949b6..a53c07905f 100644 --- a/executor/tests/module_upgrade_test.rs +++ b/executor/tests/module_upgrade_test.rs @@ -215,7 +215,7 @@ fn test_stdlib_upgrade() -> Result<()> { &alice, &chain_state, &net, - vote_language_version(&net, 4), + vote_language_version(&net, 6), on_chain_config_type_tag(MoveLanguageVersion::type_tag()), execute_script_on_chain_config(&net, MoveLanguageVersion::type_tag(), proposal_id), proposal_id, diff --git a/genesis/generated/halley/genesis b/genesis/generated/halley/genesis index 0b31f956ca..f2366421ba 100644 Binary files a/genesis/generated/halley/genesis and b/genesis/generated/halley/genesis differ diff --git a/genesis/generated/proxima/genesis b/genesis/generated/proxima/genesis index 9fe728663d..e4547c0e13 100644 Binary files a/genesis/generated/proxima/genesis and b/genesis/generated/proxima/genesis differ diff --git a/genesis/src/lib.rs b/genesis/src/lib.rs index f16dc6b0ed..c22090f371 100644 --- a/genesis/src/lib.rs +++ b/genesis/src/lib.rs @@ -576,11 +576,12 @@ mod tests { let epoch = account_state_reader.get_resource::(genesis_address())?; assert!(epoch.is_some(), "Epoch resource should exist."); - test_gas_schedule_in_genesis(net, &state_db)?; + // test_gas_schedule_in_genesis(net, &state_db)?; Ok(()) } + #[allow(dead_code)] fn test_gas_schedule_in_genesis(net: &ChainNetwork, state_db: &ChainStateDB) -> Result<()> { if net.is_custom() { return Ok(()); diff --git a/kube/manifest/starcoin-halley.yaml b/kube/manifest/starcoin-halley.yaml index 8c34ce657c..b2edb16c6d 100644 --- a/kube/manifest/starcoin-halley.yaml +++ b/kube/manifest/starcoin-halley.yaml @@ -23,7 +23,7 @@ spec: starcoin/node-pool: seed-pool containers: - name: starcoin - image: starcoin/starcoin:master + image: starcoin/starcoin:halley24_force_upgrade_v11 imagePullPolicy: Always command: - bash diff --git a/test-helper/src/dao.rs b/test-helper/src/dao.rs index f443106ca3..c050000003 100644 --- a/test-helper/src/dao.rs +++ b/test-helper/src/dao.rs @@ -119,7 +119,7 @@ pub fn txn_publish_config_type_tag() -> TypeTag { })) } -fn execute_create_account( +pub fn execute_create_account( chain_state: &ChainStateDB, net: &ChainNetwork, alice: &Account, diff --git a/test-helper/src/lib.rs b/test-helper/src/lib.rs index 847ae6d8c0..f58193d807 100644 --- a/test-helper/src/lib.rs +++ b/test-helper/src/lib.rs @@ -12,7 +12,7 @@ pub mod starcoin_dao; pub mod txn; pub mod txpool; -pub use chain::gen_blockchain_for_test; +pub use chain::{gen_blockchain_for_test, gen_blockchain_with_blocks_for_test}; pub use dummy_network_service::DummyNetworkService; pub use network::{build_network, build_network_cluster, build_network_pair}; pub use node::{run_node_by_config, run_test_node}; diff --git a/vm/e2e-tests/src/account_universe/bad_transaction.rs b/vm/e2e-tests/src/account_universe/bad_transaction.rs index c8671adabd..ab925bd484 100644 --- a/vm/e2e-tests/src/account_universe/bad_transaction.rs +++ b/vm/e2e-tests/src/account_universe/bad_transaction.rs @@ -124,6 +124,7 @@ pub struct InvalidAuthkeyGen { #[proptest( strategy = "starcoin_crypto::test_utils::uniform_keypair_strategy_with_perturbation(1)" )] + #[allow(unused)] new_keypair: KeyPair, } diff --git a/vm/stdlib/compiled/11/10-11/stdlib.blob b/vm/stdlib/compiled/11/10-11/stdlib.blob index 015be16a83..ff73914bcc 100644 Binary files a/vm/stdlib/compiled/11/10-11/stdlib.blob and b/vm/stdlib/compiled/11/10-11/stdlib.blob differ diff --git a/vm/stdlib/compiled/11/stdlib/62_Genesis.mv b/vm/stdlib/compiled/11/stdlib/62_Genesis.mv index ac1c22e95b..ada24e43ea 100644 Binary files a/vm/stdlib/compiled/11/stdlib/62_Genesis.mv and b/vm/stdlib/compiled/11/stdlib/62_Genesis.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib.blob b/vm/stdlib/compiled/12/11-12/stdlib.blob index e17900e644..3b94cae1b1 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib.blob and b/vm/stdlib/compiled/12/11-12/stdlib.blob differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/003_FromBCS.mv b/vm/stdlib/compiled/12/11-12/stdlib/003_FromBCS.mv deleted file mode 100644 index 6291eb75bc..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/003_FromBCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/004_MintScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/003_MintScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/004_MintScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/003_MintScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/005_SIP_2.mv b/vm/stdlib/compiled/12/11-12/stdlib/004_SIP_2.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/005_SIP_2.mv rename to vm/stdlib/compiled/12/11-12/stdlib/004_SIP_2.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/006_SIP_3.mv b/vm/stdlib/compiled/12/11-12/stdlib/005_SIP_3.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/006_SIP_3.mv rename to vm/stdlib/compiled/12/11-12/stdlib/005_SIP_3.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/006_SignedInteger64.mv b/vm/stdlib/compiled/12/11-12/stdlib/006_SignedInteger64.mv new file mode 100644 index 0000000000..aaf806024f Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/006_SignedInteger64.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/007_SignedInteger64.mv b/vm/stdlib/compiled/12/11-12/stdlib/007_SignedInteger64.mv deleted file mode 100644 index e3b62651c1..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/007_SignedInteger64.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/008_Vector.mv b/vm/stdlib/compiled/12/11-12/stdlib/007_Vector.mv similarity index 51% rename from vm/stdlib/compiled/12/stdlib/008_Vector.mv rename to vm/stdlib/compiled/12/11-12/stdlib/007_Vector.mv index fca0c13f9f..6deae25d48 100644 Binary files a/vm/stdlib/compiled/12/stdlib/008_Vector.mv and b/vm/stdlib/compiled/12/11-12/stdlib/007_Vector.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/009_Errors.mv b/vm/stdlib/compiled/12/11-12/stdlib/008_Errors.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/009_Errors.mv rename to vm/stdlib/compiled/12/11-12/stdlib/008_Errors.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/009_ACL.mv b/vm/stdlib/compiled/12/11-12/stdlib/009_ACL.mv new file mode 100644 index 0000000000..89c46c5234 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/009_ACL.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/010_ACL.mv b/vm/stdlib/compiled/12/11-12/stdlib/010_ACL.mv deleted file mode 100644 index 773134f2ee..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/010_ACL.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/011_Signer.mv b/vm/stdlib/compiled/12/11-12/stdlib/010_Signer.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/011_Signer.mv rename to vm/stdlib/compiled/12/11-12/stdlib/010_Signer.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/012_Math.mv b/vm/stdlib/compiled/12/11-12/stdlib/011_Math.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/012_Math.mv rename to vm/stdlib/compiled/12/11-12/stdlib/011_Math.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/012_BCS.mv b/vm/stdlib/compiled/12/11-12/stdlib/012_BCS.mv new file mode 100644 index 0000000000..6d70b3d7a8 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/012_BCS.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/015_Event.mv b/vm/stdlib/compiled/12/11-12/stdlib/013_Event.mv similarity index 92% rename from vm/stdlib/compiled/12/11-12/stdlib/015_Event.mv rename to vm/stdlib/compiled/12/11-12/stdlib/013_Event.mv index a4b3a1b812..471738d288 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/015_Event.mv and b/vm/stdlib/compiled/12/11-12/stdlib/013_Event.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/014_BCS.mv b/vm/stdlib/compiled/12/11-12/stdlib/014_BCS.mv deleted file mode 100644 index d66fd29767..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/014_BCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/014_Token.mv b/vm/stdlib/compiled/12/11-12/stdlib/014_Token.mv new file mode 100644 index 0000000000..82d9b31f2b Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/014_Token.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/015_CoreAddresses.mv b/vm/stdlib/compiled/12/11-12/stdlib/015_CoreAddresses.mv new file mode 100644 index 0000000000..48361873e4 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/015_CoreAddresses.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/018_Timestamp.mv b/vm/stdlib/compiled/12/11-12/stdlib/016_Timestamp.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/018_Timestamp.mv rename to vm/stdlib/compiled/12/11-12/stdlib/016_Timestamp.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/016_Token.mv b/vm/stdlib/compiled/12/11-12/stdlib/016_Token.mv deleted file mode 100644 index 4217dbb830..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/016_Token.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/017_CoreAddresses.mv b/vm/stdlib/compiled/12/11-12/stdlib/017_CoreAddresses.mv deleted file mode 100644 index 8977cc4410..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/017_CoreAddresses.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/013_Option.mv b/vm/stdlib/compiled/12/11-12/stdlib/017_Option.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/013_Option.mv rename to vm/stdlib/compiled/12/11-12/stdlib/017_Option.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/019_Config.mv b/vm/stdlib/compiled/12/11-12/stdlib/018_Config.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/019_Config.mv rename to vm/stdlib/compiled/12/11-12/stdlib/018_Config.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/020_ChainId.mv b/vm/stdlib/compiled/12/11-12/stdlib/019_ChainId.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/020_ChainId.mv rename to vm/stdlib/compiled/12/11-12/stdlib/019_ChainId.mv diff --git a/vm/stdlib/compiled/12/stdlib/021_VMConfig.mv b/vm/stdlib/compiled/12/11-12/stdlib/020_VMConfig.mv similarity index 87% rename from vm/stdlib/compiled/12/stdlib/021_VMConfig.mv rename to vm/stdlib/compiled/12/11-12/stdlib/020_VMConfig.mv index d4a4038b71..ecd23444b4 100644 Binary files a/vm/stdlib/compiled/12/stdlib/021_VMConfig.mv and b/vm/stdlib/compiled/12/11-12/stdlib/020_VMConfig.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/022_Version.mv b/vm/stdlib/compiled/12/11-12/stdlib/021_Version.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/022_Version.mv rename to vm/stdlib/compiled/12/11-12/stdlib/021_Version.mv diff --git a/vm/stdlib/compiled/12/stdlib/023_PackageTxnManager.mv b/vm/stdlib/compiled/12/11-12/stdlib/022_PackageTxnManager.mv similarity index 91% rename from vm/stdlib/compiled/12/stdlib/023_PackageTxnManager.mv rename to vm/stdlib/compiled/12/11-12/stdlib/022_PackageTxnManager.mv index 75e05951e0..808c7b66c8 100644 Binary files a/vm/stdlib/compiled/12/stdlib/023_PackageTxnManager.mv and b/vm/stdlib/compiled/12/11-12/stdlib/022_PackageTxnManager.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/024_Treasury.mv b/vm/stdlib/compiled/12/11-12/stdlib/023_Treasury.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/024_Treasury.mv rename to vm/stdlib/compiled/12/11-12/stdlib/023_Treasury.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/025_Dao.mv b/vm/stdlib/compiled/12/11-12/stdlib/024_Dao.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/025_Dao.mv rename to vm/stdlib/compiled/12/11-12/stdlib/024_Dao.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/026_UpgradeModuleDaoProposal.mv b/vm/stdlib/compiled/12/11-12/stdlib/025_UpgradeModuleDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/026_UpgradeModuleDaoProposal.mv rename to vm/stdlib/compiled/12/11-12/stdlib/025_UpgradeModuleDaoProposal.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/027_TransactionTimeoutConfig.mv b/vm/stdlib/compiled/12/11-12/stdlib/026_TransactionTimeoutConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/027_TransactionTimeoutConfig.mv rename to vm/stdlib/compiled/12/11-12/stdlib/026_TransactionTimeoutConfig.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/028_TransactionPublishOption.mv b/vm/stdlib/compiled/12/11-12/stdlib/027_TransactionPublishOption.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/028_TransactionPublishOption.mv rename to vm/stdlib/compiled/12/11-12/stdlib/027_TransactionPublishOption.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/029_RewardConfig.mv b/vm/stdlib/compiled/12/11-12/stdlib/028_RewardConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/029_RewardConfig.mv rename to vm/stdlib/compiled/12/11-12/stdlib/028_RewardConfig.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/030_OnChainConfigDao.mv b/vm/stdlib/compiled/12/11-12/stdlib/029_OnChainConfigDao.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/030_OnChainConfigDao.mv rename to vm/stdlib/compiled/12/11-12/stdlib/029_OnChainConfigDao.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/031_ModifyDaoConfigProposal.mv b/vm/stdlib/compiled/12/11-12/stdlib/030_ModifyDaoConfigProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/031_ModifyDaoConfigProposal.mv rename to vm/stdlib/compiled/12/11-12/stdlib/030_ModifyDaoConfigProposal.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/032_ConsensusConfig.mv b/vm/stdlib/compiled/12/11-12/stdlib/031_ConsensusConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/032_ConsensusConfig.mv rename to vm/stdlib/compiled/12/11-12/stdlib/031_ConsensusConfig.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/033_STC.mv b/vm/stdlib/compiled/12/11-12/stdlib/032_STC.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/033_STC.mv rename to vm/stdlib/compiled/12/11-12/stdlib/032_STC.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/034_TransactionFee.mv b/vm/stdlib/compiled/12/11-12/stdlib/033_TransactionFee.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/034_TransactionFee.mv rename to vm/stdlib/compiled/12/11-12/stdlib/033_TransactionFee.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/035_Hash.mv b/vm/stdlib/compiled/12/11-12/stdlib/034_Hash.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/035_Hash.mv rename to vm/stdlib/compiled/12/11-12/stdlib/034_Hash.mv diff --git a/vm/stdlib/compiled/latest/stdlib/036_Authenticator.mv b/vm/stdlib/compiled/12/11-12/stdlib/035_Authenticator.mv similarity index 95% rename from vm/stdlib/compiled/latest/stdlib/036_Authenticator.mv rename to vm/stdlib/compiled/12/11-12/stdlib/035_Authenticator.mv index c5a74c5072..2b6f62520e 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/036_Authenticator.mv and b/vm/stdlib/compiled/12/11-12/stdlib/035_Authenticator.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/036_Account.mv b/vm/stdlib/compiled/12/11-12/stdlib/036_Account.mv new file mode 100644 index 0000000000..aa65760485 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/036_Account.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/037_Account.mv b/vm/stdlib/compiled/12/11-12/stdlib/037_Account.mv deleted file mode 100644 index 1a3465588c..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/037_Account.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/037_AccountScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/037_AccountScripts.mv new file mode 100644 index 0000000000..07ec865a8b Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/037_AccountScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/038_AccountScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/038_AccountScripts.mv deleted file mode 100644 index 3ea86f9cde..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/038_AccountScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/038_Block.mv b/vm/stdlib/compiled/12/11-12/stdlib/038_Block.mv new file mode 100644 index 0000000000..fda9674f72 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/038_Block.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/039_Arith.mv b/vm/stdlib/compiled/12/11-12/stdlib/039_Arith.mv deleted file mode 100644 index 61d6433fab..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/039_Arith.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/042_TreasuryWithdrawDaoProposal.mv b/vm/stdlib/compiled/12/11-12/stdlib/039_TreasuryWithdrawDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/042_TreasuryWithdrawDaoProposal.mv rename to vm/stdlib/compiled/12/11-12/stdlib/039_TreasuryWithdrawDaoProposal.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/043_BlockReward.mv b/vm/stdlib/compiled/12/11-12/stdlib/040_BlockReward.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/043_BlockReward.mv rename to vm/stdlib/compiled/12/11-12/stdlib/040_BlockReward.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/040_Ring.mv b/vm/stdlib/compiled/12/11-12/stdlib/040_Ring.mv deleted file mode 100644 index 870e433ee9..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/040_Ring.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/041_Block.mv b/vm/stdlib/compiled/12/11-12/stdlib/041_Block.mv deleted file mode 100644 index d07b44aeb4..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/041_Block.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/044_Collection.mv b/vm/stdlib/compiled/12/11-12/stdlib/041_Collection.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/044_Collection.mv rename to vm/stdlib/compiled/12/11-12/stdlib/041_Collection.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/045_Collection2.mv b/vm/stdlib/compiled/12/11-12/stdlib/042_Collection2.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/045_Collection2.mv rename to vm/stdlib/compiled/12/11-12/stdlib/042_Collection2.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/043_Compare.mv b/vm/stdlib/compiled/12/11-12/stdlib/043_Compare.mv new file mode 100644 index 0000000000..4c8e6794b2 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/043_Compare.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/047_ConsensusStrategy.mv b/vm/stdlib/compiled/12/11-12/stdlib/044_ConsensusStrategy.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/047_ConsensusStrategy.mv rename to vm/stdlib/compiled/12/11-12/stdlib/044_ConsensusStrategy.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/048_DaoVoteScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/045_DaoVoteScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/048_DaoVoteScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/045_DaoVoteScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/046_Compare.mv b/vm/stdlib/compiled/12/11-12/stdlib/046_Compare.mv deleted file mode 100644 index e3e7ef4a6a..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/046_Compare.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/049_DummyToken.mv b/vm/stdlib/compiled/12/11-12/stdlib/046_DummyToken.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/049_DummyToken.mv rename to vm/stdlib/compiled/12/11-12/stdlib/046_DummyToken.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/050_DummyTokenScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/047_DummyTokenScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/050_DummyTokenScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/047_DummyTokenScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/048_EVMAddress.mv b/vm/stdlib/compiled/12/11-12/stdlib/048_EVMAddress.mv new file mode 100644 index 0000000000..37daf894b8 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/048_EVMAddress.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/059_Epoch.mv b/vm/stdlib/compiled/12/11-12/stdlib/049_Epoch.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/059_Epoch.mv rename to vm/stdlib/compiled/12/11-12/stdlib/049_Epoch.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/061_FixedPoint32.mv b/vm/stdlib/compiled/12/11-12/stdlib/050_FixedPoint32.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/061_FixedPoint32.mv rename to vm/stdlib/compiled/12/11-12/stdlib/050_FixedPoint32.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/051_EVMAddress.mv b/vm/stdlib/compiled/12/11-12/stdlib/051_EVMAddress.mv deleted file mode 100644 index 9cb4ecebac..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/051_EVMAddress.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/051_FrozenConfig.mv b/vm/stdlib/compiled/12/11-12/stdlib/051_FrozenConfig.mv new file mode 100644 index 0000000000..d8bef1911c Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/051_FrozenConfig.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/052_FrozenConfigStrategy.mv b/vm/stdlib/compiled/12/11-12/stdlib/052_FrozenConfigStrategy.mv new file mode 100644 index 0000000000..598f68b0c2 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/052_FrozenConfigStrategy.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/052_TypeInfo.mv b/vm/stdlib/compiled/12/11-12/stdlib/052_TypeInfo.mv deleted file mode 100644 index 1be6ae9259..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/052_TypeInfo.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/053_GenesisSignerCapability.mv b/vm/stdlib/compiled/12/11-12/stdlib/053_GenesisSignerCapability.mv index 0b2013c145..c7e787b2b2 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/053_GenesisSignerCapability.mv and b/vm/stdlib/compiled/12/11-12/stdlib/053_GenesisSignerCapability.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/055_PriceOracle.mv b/vm/stdlib/compiled/12/11-12/stdlib/055_PriceOracle.mv index b8584e7754..e70a19c6aa 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/055_PriceOracle.mv and b/vm/stdlib/compiled/12/11-12/stdlib/055_PriceOracle.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/056_EasyGas.mv b/vm/stdlib/compiled/12/11-12/stdlib/056_EasyGas.mv deleted file mode 100644 index 9194df2cea..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/056_EasyGas.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/063_STCUSDOracle.mv b/vm/stdlib/compiled/12/11-12/stdlib/056_STCUSDOracle.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/063_STCUSDOracle.mv rename to vm/stdlib/compiled/12/11-12/stdlib/056_STCUSDOracle.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/064_Offer.mv b/vm/stdlib/compiled/12/11-12/stdlib/057_Offer.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/064_Offer.mv rename to vm/stdlib/compiled/12/11-12/stdlib/057_Offer.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/058_EasyGasScript.mv b/vm/stdlib/compiled/12/11-12/stdlib/058_EasyGasScript.mv deleted file mode 100644 index 16d8f1836f..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/058_EasyGasScript.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/058_NFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/058_NFT.mv new file mode 100644 index 0000000000..496fb0c5d2 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/058_NFT.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/066_LanguageVersion.mv b/vm/stdlib/compiled/12/11-12/stdlib/059_LanguageVersion.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/066_LanguageVersion.mv rename to vm/stdlib/compiled/12/11-12/stdlib/059_LanguageVersion.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/060_EventUtil.mv b/vm/stdlib/compiled/12/11-12/stdlib/060_EventUtil.mv deleted file mode 100644 index bbbc6f34f8..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/060_EventUtil.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/067_MerkleProof.mv b/vm/stdlib/compiled/12/11-12/stdlib/060_MerkleProof.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/067_MerkleProof.mv rename to vm/stdlib/compiled/12/11-12/stdlib/060_MerkleProof.mv diff --git a/vm/stdlib/compiled/latest/stdlib/068_MerkleNFTDistributor.mv b/vm/stdlib/compiled/12/11-12/stdlib/061_MerkleNFTDistributor.mv similarity index 98% rename from vm/stdlib/compiled/latest/stdlib/068_MerkleNFTDistributor.mv rename to vm/stdlib/compiled/12/11-12/stdlib/061_MerkleNFTDistributor.mv index bb8c651a7e..21a56f784b 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/068_MerkleNFTDistributor.mv and b/vm/stdlib/compiled/12/11-12/stdlib/061_MerkleNFTDistributor.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/062_GasSchedule.mv b/vm/stdlib/compiled/12/11-12/stdlib/062_GasSchedule.mv deleted file mode 100644 index a88bc854cb..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/062_GasSchedule.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/062_IdentifierNFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/062_IdentifierNFT.mv new file mode 100644 index 0000000000..0b7ad460ec Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/062_IdentifierNFT.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/063_GenesisNFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/063_GenesisNFT.mv new file mode 100644 index 0000000000..59de3f76bb Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/063_GenesisNFT.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/064_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/064_StdlibUpgradeScripts.mv new file mode 100644 index 0000000000..3e9fcaba3b Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/064_StdlibUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/072_Genesis.mv b/vm/stdlib/compiled/12/11-12/stdlib/065_Genesis.mv similarity index 78% rename from vm/stdlib/compiled/latest/stdlib/072_Genesis.mv rename to vm/stdlib/compiled/12/11-12/stdlib/065_Genesis.mv index 78701566bc..33844f2593 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/072_Genesis.mv and b/vm/stdlib/compiled/12/11-12/stdlib/065_Genesis.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/065_NFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/065_NFT.mv deleted file mode 100644 index cf97fbd3cd..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/065_NFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/066_GenesisNFTScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/066_GenesisNFTScripts.mv new file mode 100644 index 0000000000..b7c919154c Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/066_GenesisNFTScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/067_IdentifierNFTScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/067_IdentifierNFTScripts.mv new file mode 100644 index 0000000000..d8b0ad3b91 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/067_IdentifierNFTScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/075_MintDaoProposal.mv b/vm/stdlib/compiled/12/11-12/stdlib/068_MintDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/075_MintDaoProposal.mv rename to vm/stdlib/compiled/12/11-12/stdlib/068_MintDaoProposal.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/069_IdentifierNFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/069_IdentifierNFT.mv deleted file mode 100644 index 44d5f27272..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/069_IdentifierNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/069_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/069_ModuleUpgradeScripts.mv new file mode 100644 index 0000000000..4c03908ff0 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/069_ModuleUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/070_GenesisNFT.mv b/vm/stdlib/compiled/12/11-12/stdlib/070_GenesisNFT.mv deleted file mode 100644 index 803cfbad57..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/070_GenesisNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/070_NFTGallery.mv b/vm/stdlib/compiled/12/11-12/stdlib/070_NFTGallery.mv new file mode 100644 index 0000000000..ad57a31114 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/070_NFTGallery.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/071_NFTGalleryScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/071_NFTGalleryScripts.mv new file mode 100644 index 0000000000..b3b1bc6616 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/071_NFTGalleryScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/071_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/071_StdlibUpgradeScripts.mv deleted file mode 100644 index b53e7f3f3f..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/071_StdlibUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/079_OnChainConfigScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/072_OnChainConfigScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/079_OnChainConfigScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/072_OnChainConfigScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/073_GenesisNFTScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/073_GenesisNFTScripts.mv deleted file mode 100644 index fe06059a19..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/073_GenesisNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/080_PriceOracleAggregator.mv b/vm/stdlib/compiled/12/11-12/stdlib/073_PriceOracleAggregator.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/080_PriceOracleAggregator.mv rename to vm/stdlib/compiled/12/11-12/stdlib/073_PriceOracleAggregator.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/074_IdentifierNFTScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/074_IdentifierNFTScripts.mv deleted file mode 100644 index f495cd7670..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/074_IdentifierNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/074_PriceOracleScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/074_PriceOracleScripts.mv new file mode 100644 index 0000000000..1e1b4c6822 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/074_PriceOracleScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/075_Signature.mv b/vm/stdlib/compiled/12/11-12/stdlib/075_Signature.mv new file mode 100644 index 0000000000..2d57b33358 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/075_Signature.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/076_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/076_ModuleUpgradeScripts.mv deleted file mode 100644 index f2d215e295..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/076_ModuleUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/084_SharedEd25519PublicKey.mv b/vm/stdlib/compiled/12/11-12/stdlib/076_SharedEd25519PublicKey.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/084_SharedEd25519PublicKey.mv rename to vm/stdlib/compiled/12/11-12/stdlib/076_SharedEd25519PublicKey.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/077_NFTGallery.mv b/vm/stdlib/compiled/12/11-12/stdlib/077_NFTGallery.mv deleted file mode 100644 index bda70d9e15..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/077_NFTGallery.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/090_TransactionTimeout.mv b/vm/stdlib/compiled/12/11-12/stdlib/077_TransactionTimeout.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/090_TransactionTimeout.mv rename to vm/stdlib/compiled/12/11-12/stdlib/077_TransactionTimeout.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/078_NFTGalleryScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/078_NFTGalleryScripts.mv deleted file mode 100644 index e9736e40d3..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/078_NFTGalleryScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/078_TransactionManager.mv b/vm/stdlib/compiled/12/11-12/stdlib/078_TransactionManager.mv new file mode 100644 index 0000000000..2fa33f2603 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/078_TransactionManager.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/057_TransferScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/079_TransferScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/057_TransferScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/079_TransferScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/092_TreasuryScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/080_TreasuryScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/092_TreasuryScripts.mv rename to vm/stdlib/compiled/12/11-12/stdlib/080_TreasuryScripts.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/081_Arith.mv b/vm/stdlib/compiled/12/11-12/stdlib/081_Arith.mv new file mode 100644 index 0000000000..5a0bdc47ad Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/081_Arith.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/081_PriceOracleScripts.mv b/vm/stdlib/compiled/12/11-12/stdlib/081_PriceOracleScripts.mv deleted file mode 100644 index 9fc3054e32..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/081_PriceOracleScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/082_Secp256k1.mv b/vm/stdlib/compiled/12/11-12/stdlib/082_Secp256k1.mv deleted file mode 100644 index 5f0dd612f4..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/082_Secp256k1.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/082_U256.mv b/vm/stdlib/compiled/12/11-12/stdlib/082_U256.mv new file mode 100644 index 0000000000..fbb223ad10 Binary files /dev/null and b/vm/stdlib/compiled/12/11-12/stdlib/082_U256.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/083_Signature.mv b/vm/stdlib/compiled/12/11-12/stdlib/083_Signature.mv deleted file mode 100644 index e37f2baf06..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/083_Signature.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/094_YieldFarming.mv b/vm/stdlib/compiled/12/11-12/stdlib/083_YieldFarming.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/094_YieldFarming.mv rename to vm/stdlib/compiled/12/11-12/stdlib/083_YieldFarming.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/095_YieldFarmingV2.mv b/vm/stdlib/compiled/12/11-12/stdlib/084_YieldFarmingV2.mv similarity index 100% rename from vm/stdlib/compiled/12/11-12/stdlib/095_YieldFarmingV2.mv rename to vm/stdlib/compiled/12/11-12/stdlib/084_YieldFarmingV2.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/085_SimpleMap.mv b/vm/stdlib/compiled/12/11-12/stdlib/085_SimpleMap.mv deleted file mode 100644 index 0effeda9fd..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/085_SimpleMap.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/086_StructuredHash.mv b/vm/stdlib/compiled/12/11-12/stdlib/086_StructuredHash.mv deleted file mode 100644 index 41c8858866..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/086_StructuredHash.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/087_StarcoinVerifier.mv b/vm/stdlib/compiled/12/11-12/stdlib/087_StarcoinVerifier.mv deleted file mode 100644 index 684d44fe58..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/087_StarcoinVerifier.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/088_String.mv b/vm/stdlib/compiled/12/11-12/stdlib/088_String.mv deleted file mode 100644 index 4b51f43735..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/088_String.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/089_Table.mv b/vm/stdlib/compiled/12/11-12/stdlib/089_Table.mv deleted file mode 100644 index 297bb011c4..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/089_Table.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/091_TransactionManager.mv b/vm/stdlib/compiled/12/11-12/stdlib/091_TransactionManager.mv deleted file mode 100644 index 178931119d..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/091_TransactionManager.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/093_U256.mv b/vm/stdlib/compiled/12/11-12/stdlib/093_U256.mv deleted file mode 100644 index 5114e77f7f..0000000000 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/093_U256.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/003_FromBCS.mv b/vm/stdlib/compiled/12/stdlib/003_FromBCS.mv deleted file mode 100644 index 6291eb75bc..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/003_FromBCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/004_MintScripts.mv b/vm/stdlib/compiled/12/stdlib/003_MintScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/004_MintScripts.mv rename to vm/stdlib/compiled/12/stdlib/003_MintScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/005_SIP_2.mv b/vm/stdlib/compiled/12/stdlib/004_SIP_2.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/005_SIP_2.mv rename to vm/stdlib/compiled/12/stdlib/004_SIP_2.mv diff --git a/vm/stdlib/compiled/12/stdlib/006_SIP_3.mv b/vm/stdlib/compiled/12/stdlib/005_SIP_3.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/006_SIP_3.mv rename to vm/stdlib/compiled/12/stdlib/005_SIP_3.mv diff --git a/vm/stdlib/compiled/12/stdlib/006_SignedInteger64.mv b/vm/stdlib/compiled/12/stdlib/006_SignedInteger64.mv new file mode 100644 index 0000000000..aaf806024f Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/006_SignedInteger64.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/007_SignedInteger64.mv b/vm/stdlib/compiled/12/stdlib/007_SignedInteger64.mv deleted file mode 100644 index e3b62651c1..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/007_SignedInteger64.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/008_Vector.mv b/vm/stdlib/compiled/12/stdlib/007_Vector.mv similarity index 51% rename from vm/stdlib/compiled/latest/stdlib/008_Vector.mv rename to vm/stdlib/compiled/12/stdlib/007_Vector.mv index fca0c13f9f..6deae25d48 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/008_Vector.mv and b/vm/stdlib/compiled/12/stdlib/007_Vector.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/009_Errors.mv b/vm/stdlib/compiled/12/stdlib/008_Errors.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/009_Errors.mv rename to vm/stdlib/compiled/12/stdlib/008_Errors.mv diff --git a/vm/stdlib/compiled/12/stdlib/009_ACL.mv b/vm/stdlib/compiled/12/stdlib/009_ACL.mv new file mode 100644 index 0000000000..89c46c5234 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/009_ACL.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/010_ACL.mv b/vm/stdlib/compiled/12/stdlib/010_ACL.mv deleted file mode 100644 index 773134f2ee..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/010_ACL.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/011_Signer.mv b/vm/stdlib/compiled/12/stdlib/010_Signer.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/011_Signer.mv rename to vm/stdlib/compiled/12/stdlib/010_Signer.mv diff --git a/vm/stdlib/compiled/12/stdlib/012_Math.mv b/vm/stdlib/compiled/12/stdlib/011_Math.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/012_Math.mv rename to vm/stdlib/compiled/12/stdlib/011_Math.mv diff --git a/vm/stdlib/compiled/12/stdlib/012_BCS.mv b/vm/stdlib/compiled/12/stdlib/012_BCS.mv new file mode 100644 index 0000000000..6d70b3d7a8 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/012_BCS.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/015_Event.mv b/vm/stdlib/compiled/12/stdlib/013_Event.mv similarity index 92% rename from vm/stdlib/compiled/12/stdlib/015_Event.mv rename to vm/stdlib/compiled/12/stdlib/013_Event.mv index a4b3a1b812..471738d288 100644 Binary files a/vm/stdlib/compiled/12/stdlib/015_Event.mv and b/vm/stdlib/compiled/12/stdlib/013_Event.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/014_BCS.mv b/vm/stdlib/compiled/12/stdlib/014_BCS.mv deleted file mode 100644 index d66fd29767..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/014_BCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/014_Token.mv b/vm/stdlib/compiled/12/stdlib/014_Token.mv new file mode 100644 index 0000000000..82d9b31f2b Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/014_Token.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/015_CoreAddresses.mv b/vm/stdlib/compiled/12/stdlib/015_CoreAddresses.mv new file mode 100644 index 0000000000..48361873e4 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/015_CoreAddresses.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/018_Timestamp.mv b/vm/stdlib/compiled/12/stdlib/016_Timestamp.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/018_Timestamp.mv rename to vm/stdlib/compiled/12/stdlib/016_Timestamp.mv diff --git a/vm/stdlib/compiled/12/stdlib/016_Token.mv b/vm/stdlib/compiled/12/stdlib/016_Token.mv deleted file mode 100644 index 4217dbb830..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/016_Token.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/017_CoreAddresses.mv b/vm/stdlib/compiled/12/stdlib/017_CoreAddresses.mv deleted file mode 100644 index 8977cc4410..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/017_CoreAddresses.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/013_Option.mv b/vm/stdlib/compiled/12/stdlib/017_Option.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/013_Option.mv rename to vm/stdlib/compiled/12/stdlib/017_Option.mv diff --git a/vm/stdlib/compiled/12/stdlib/019_Config.mv b/vm/stdlib/compiled/12/stdlib/018_Config.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/019_Config.mv rename to vm/stdlib/compiled/12/stdlib/018_Config.mv diff --git a/vm/stdlib/compiled/12/stdlib/020_ChainId.mv b/vm/stdlib/compiled/12/stdlib/019_ChainId.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/020_ChainId.mv rename to vm/stdlib/compiled/12/stdlib/019_ChainId.mv diff --git a/vm/stdlib/compiled/latest/stdlib/021_VMConfig.mv b/vm/stdlib/compiled/12/stdlib/020_VMConfig.mv similarity index 87% rename from vm/stdlib/compiled/latest/stdlib/021_VMConfig.mv rename to vm/stdlib/compiled/12/stdlib/020_VMConfig.mv index d4a4038b71..ecd23444b4 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/021_VMConfig.mv and b/vm/stdlib/compiled/12/stdlib/020_VMConfig.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/022_Version.mv b/vm/stdlib/compiled/12/stdlib/021_Version.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/022_Version.mv rename to vm/stdlib/compiled/12/stdlib/021_Version.mv diff --git a/vm/stdlib/compiled/latest/stdlib/023_PackageTxnManager.mv b/vm/stdlib/compiled/12/stdlib/022_PackageTxnManager.mv similarity index 91% rename from vm/stdlib/compiled/latest/stdlib/023_PackageTxnManager.mv rename to vm/stdlib/compiled/12/stdlib/022_PackageTxnManager.mv index 75e05951e0..808c7b66c8 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/023_PackageTxnManager.mv and b/vm/stdlib/compiled/12/stdlib/022_PackageTxnManager.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/024_Treasury.mv b/vm/stdlib/compiled/12/stdlib/023_Treasury.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/024_Treasury.mv rename to vm/stdlib/compiled/12/stdlib/023_Treasury.mv diff --git a/vm/stdlib/compiled/12/stdlib/025_Dao.mv b/vm/stdlib/compiled/12/stdlib/024_Dao.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/025_Dao.mv rename to vm/stdlib/compiled/12/stdlib/024_Dao.mv diff --git a/vm/stdlib/compiled/12/stdlib/026_UpgradeModuleDaoProposal.mv b/vm/stdlib/compiled/12/stdlib/025_UpgradeModuleDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/026_UpgradeModuleDaoProposal.mv rename to vm/stdlib/compiled/12/stdlib/025_UpgradeModuleDaoProposal.mv diff --git a/vm/stdlib/compiled/12/stdlib/027_TransactionTimeoutConfig.mv b/vm/stdlib/compiled/12/stdlib/026_TransactionTimeoutConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/027_TransactionTimeoutConfig.mv rename to vm/stdlib/compiled/12/stdlib/026_TransactionTimeoutConfig.mv diff --git a/vm/stdlib/compiled/12/stdlib/028_TransactionPublishOption.mv b/vm/stdlib/compiled/12/stdlib/027_TransactionPublishOption.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/028_TransactionPublishOption.mv rename to vm/stdlib/compiled/12/stdlib/027_TransactionPublishOption.mv diff --git a/vm/stdlib/compiled/12/stdlib/029_RewardConfig.mv b/vm/stdlib/compiled/12/stdlib/028_RewardConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/029_RewardConfig.mv rename to vm/stdlib/compiled/12/stdlib/028_RewardConfig.mv diff --git a/vm/stdlib/compiled/12/stdlib/030_OnChainConfigDao.mv b/vm/stdlib/compiled/12/stdlib/029_OnChainConfigDao.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/030_OnChainConfigDao.mv rename to vm/stdlib/compiled/12/stdlib/029_OnChainConfigDao.mv diff --git a/vm/stdlib/compiled/12/stdlib/031_ModifyDaoConfigProposal.mv b/vm/stdlib/compiled/12/stdlib/030_ModifyDaoConfigProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/031_ModifyDaoConfigProposal.mv rename to vm/stdlib/compiled/12/stdlib/030_ModifyDaoConfigProposal.mv diff --git a/vm/stdlib/compiled/12/stdlib/032_ConsensusConfig.mv b/vm/stdlib/compiled/12/stdlib/031_ConsensusConfig.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/032_ConsensusConfig.mv rename to vm/stdlib/compiled/12/stdlib/031_ConsensusConfig.mv diff --git a/vm/stdlib/compiled/12/stdlib/033_STC.mv b/vm/stdlib/compiled/12/stdlib/032_STC.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/033_STC.mv rename to vm/stdlib/compiled/12/stdlib/032_STC.mv diff --git a/vm/stdlib/compiled/12/stdlib/034_TransactionFee.mv b/vm/stdlib/compiled/12/stdlib/033_TransactionFee.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/034_TransactionFee.mv rename to vm/stdlib/compiled/12/stdlib/033_TransactionFee.mv diff --git a/vm/stdlib/compiled/12/stdlib/035_Hash.mv b/vm/stdlib/compiled/12/stdlib/034_Hash.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/035_Hash.mv rename to vm/stdlib/compiled/12/stdlib/034_Hash.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/036_Authenticator.mv b/vm/stdlib/compiled/12/stdlib/035_Authenticator.mv similarity index 95% rename from vm/stdlib/compiled/12/11-12/stdlib/036_Authenticator.mv rename to vm/stdlib/compiled/12/stdlib/035_Authenticator.mv index c5a74c5072..2b6f62520e 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/036_Authenticator.mv and b/vm/stdlib/compiled/12/stdlib/035_Authenticator.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/036_Account.mv b/vm/stdlib/compiled/12/stdlib/036_Account.mv new file mode 100644 index 0000000000..aa65760485 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/036_Account.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/037_Account.mv b/vm/stdlib/compiled/12/stdlib/037_Account.mv deleted file mode 100644 index 1a3465588c..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/037_Account.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/037_AccountScripts.mv b/vm/stdlib/compiled/12/stdlib/037_AccountScripts.mv new file mode 100644 index 0000000000..07ec865a8b Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/037_AccountScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/038_AccountScripts.mv b/vm/stdlib/compiled/12/stdlib/038_AccountScripts.mv deleted file mode 100644 index 3ea86f9cde..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/038_AccountScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/038_Block.mv b/vm/stdlib/compiled/12/stdlib/038_Block.mv new file mode 100644 index 0000000000..fda9674f72 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/038_Block.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/039_Arith.mv b/vm/stdlib/compiled/12/stdlib/039_Arith.mv deleted file mode 100644 index 61d6433fab..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/039_Arith.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/042_TreasuryWithdrawDaoProposal.mv b/vm/stdlib/compiled/12/stdlib/039_TreasuryWithdrawDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/042_TreasuryWithdrawDaoProposal.mv rename to vm/stdlib/compiled/12/stdlib/039_TreasuryWithdrawDaoProposal.mv diff --git a/vm/stdlib/compiled/12/stdlib/043_BlockReward.mv b/vm/stdlib/compiled/12/stdlib/040_BlockReward.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/043_BlockReward.mv rename to vm/stdlib/compiled/12/stdlib/040_BlockReward.mv diff --git a/vm/stdlib/compiled/12/stdlib/040_Ring.mv b/vm/stdlib/compiled/12/stdlib/040_Ring.mv deleted file mode 100644 index 870e433ee9..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/040_Ring.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/041_Block.mv b/vm/stdlib/compiled/12/stdlib/041_Block.mv deleted file mode 100644 index d07b44aeb4..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/041_Block.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/044_Collection.mv b/vm/stdlib/compiled/12/stdlib/041_Collection.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/044_Collection.mv rename to vm/stdlib/compiled/12/stdlib/041_Collection.mv diff --git a/vm/stdlib/compiled/12/stdlib/045_Collection2.mv b/vm/stdlib/compiled/12/stdlib/042_Collection2.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/045_Collection2.mv rename to vm/stdlib/compiled/12/stdlib/042_Collection2.mv diff --git a/vm/stdlib/compiled/12/stdlib/043_Compare.mv b/vm/stdlib/compiled/12/stdlib/043_Compare.mv new file mode 100644 index 0000000000..4c8e6794b2 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/043_Compare.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/047_ConsensusStrategy.mv b/vm/stdlib/compiled/12/stdlib/044_ConsensusStrategy.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/047_ConsensusStrategy.mv rename to vm/stdlib/compiled/12/stdlib/044_ConsensusStrategy.mv diff --git a/vm/stdlib/compiled/12/stdlib/048_DaoVoteScripts.mv b/vm/stdlib/compiled/12/stdlib/045_DaoVoteScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/048_DaoVoteScripts.mv rename to vm/stdlib/compiled/12/stdlib/045_DaoVoteScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/046_Compare.mv b/vm/stdlib/compiled/12/stdlib/046_Compare.mv deleted file mode 100644 index e3e7ef4a6a..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/046_Compare.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/049_DummyToken.mv b/vm/stdlib/compiled/12/stdlib/046_DummyToken.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/049_DummyToken.mv rename to vm/stdlib/compiled/12/stdlib/046_DummyToken.mv diff --git a/vm/stdlib/compiled/12/stdlib/050_DummyTokenScripts.mv b/vm/stdlib/compiled/12/stdlib/047_DummyTokenScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/050_DummyTokenScripts.mv rename to vm/stdlib/compiled/12/stdlib/047_DummyTokenScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/048_EVMAddress.mv b/vm/stdlib/compiled/12/stdlib/048_EVMAddress.mv new file mode 100644 index 0000000000..37daf894b8 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/048_EVMAddress.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/059_Epoch.mv b/vm/stdlib/compiled/12/stdlib/049_Epoch.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/059_Epoch.mv rename to vm/stdlib/compiled/12/stdlib/049_Epoch.mv diff --git a/vm/stdlib/compiled/12/stdlib/061_FixedPoint32.mv b/vm/stdlib/compiled/12/stdlib/050_FixedPoint32.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/061_FixedPoint32.mv rename to vm/stdlib/compiled/12/stdlib/050_FixedPoint32.mv diff --git a/vm/stdlib/compiled/12/stdlib/051_EVMAddress.mv b/vm/stdlib/compiled/12/stdlib/051_EVMAddress.mv deleted file mode 100644 index 9cb4ecebac..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/051_EVMAddress.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/051_FrozenConfig.mv b/vm/stdlib/compiled/12/stdlib/051_FrozenConfig.mv new file mode 100644 index 0000000000..d8bef1911c Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/051_FrozenConfig.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/052_FrozenConfigStrategy.mv b/vm/stdlib/compiled/12/stdlib/052_FrozenConfigStrategy.mv new file mode 100644 index 0000000000..598f68b0c2 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/052_FrozenConfigStrategy.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/052_TypeInfo.mv b/vm/stdlib/compiled/12/stdlib/052_TypeInfo.mv deleted file mode 100644 index 1be6ae9259..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/052_TypeInfo.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/053_GenesisSignerCapability.mv b/vm/stdlib/compiled/12/stdlib/053_GenesisSignerCapability.mv index 0b2013c145..c7e787b2b2 100644 Binary files a/vm/stdlib/compiled/12/stdlib/053_GenesisSignerCapability.mv and b/vm/stdlib/compiled/12/stdlib/053_GenesisSignerCapability.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/055_PriceOracle.mv b/vm/stdlib/compiled/12/stdlib/055_PriceOracle.mv index b8584e7754..e70a19c6aa 100644 Binary files a/vm/stdlib/compiled/12/stdlib/055_PriceOracle.mv and b/vm/stdlib/compiled/12/stdlib/055_PriceOracle.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/056_EasyGas.mv b/vm/stdlib/compiled/12/stdlib/056_EasyGas.mv deleted file mode 100644 index 9194df2cea..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/056_EasyGas.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/063_STCUSDOracle.mv b/vm/stdlib/compiled/12/stdlib/056_STCUSDOracle.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/063_STCUSDOracle.mv rename to vm/stdlib/compiled/12/stdlib/056_STCUSDOracle.mv diff --git a/vm/stdlib/compiled/12/stdlib/064_Offer.mv b/vm/stdlib/compiled/12/stdlib/057_Offer.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/064_Offer.mv rename to vm/stdlib/compiled/12/stdlib/057_Offer.mv diff --git a/vm/stdlib/compiled/12/stdlib/058_EasyGasScript.mv b/vm/stdlib/compiled/12/stdlib/058_EasyGasScript.mv deleted file mode 100644 index 16d8f1836f..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/058_EasyGasScript.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/058_NFT.mv b/vm/stdlib/compiled/12/stdlib/058_NFT.mv new file mode 100644 index 0000000000..496fb0c5d2 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/058_NFT.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/066_LanguageVersion.mv b/vm/stdlib/compiled/12/stdlib/059_LanguageVersion.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/066_LanguageVersion.mv rename to vm/stdlib/compiled/12/stdlib/059_LanguageVersion.mv diff --git a/vm/stdlib/compiled/12/stdlib/060_EventUtil.mv b/vm/stdlib/compiled/12/stdlib/060_EventUtil.mv deleted file mode 100644 index bbbc6f34f8..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/060_EventUtil.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/067_MerkleProof.mv b/vm/stdlib/compiled/12/stdlib/060_MerkleProof.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/067_MerkleProof.mv rename to vm/stdlib/compiled/12/stdlib/060_MerkleProof.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/068_MerkleNFTDistributor.mv b/vm/stdlib/compiled/12/stdlib/061_MerkleNFTDistributor.mv similarity index 98% rename from vm/stdlib/compiled/12/11-12/stdlib/068_MerkleNFTDistributor.mv rename to vm/stdlib/compiled/12/stdlib/061_MerkleNFTDistributor.mv index bb8c651a7e..21a56f784b 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/068_MerkleNFTDistributor.mv and b/vm/stdlib/compiled/12/stdlib/061_MerkleNFTDistributor.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/062_GasSchedule.mv b/vm/stdlib/compiled/12/stdlib/062_GasSchedule.mv deleted file mode 100644 index a88bc854cb..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/062_GasSchedule.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/062_IdentifierNFT.mv b/vm/stdlib/compiled/12/stdlib/062_IdentifierNFT.mv new file mode 100644 index 0000000000..0b7ad460ec Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/062_IdentifierNFT.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/063_GenesisNFT.mv b/vm/stdlib/compiled/12/stdlib/063_GenesisNFT.mv new file mode 100644 index 0000000000..59de3f76bb Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/063_GenesisNFT.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/064_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/12/stdlib/064_StdlibUpgradeScripts.mv new file mode 100644 index 0000000000..3e9fcaba3b Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/064_StdlibUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/072_Genesis.mv b/vm/stdlib/compiled/12/stdlib/065_Genesis.mv similarity index 78% rename from vm/stdlib/compiled/12/stdlib/072_Genesis.mv rename to vm/stdlib/compiled/12/stdlib/065_Genesis.mv index 78701566bc..33844f2593 100644 Binary files a/vm/stdlib/compiled/12/stdlib/072_Genesis.mv and b/vm/stdlib/compiled/12/stdlib/065_Genesis.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/065_NFT.mv b/vm/stdlib/compiled/12/stdlib/065_NFT.mv deleted file mode 100644 index cf97fbd3cd..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/065_NFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/066_GenesisNFTScripts.mv b/vm/stdlib/compiled/12/stdlib/066_GenesisNFTScripts.mv new file mode 100644 index 0000000000..b7c919154c Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/066_GenesisNFTScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/067_IdentifierNFTScripts.mv b/vm/stdlib/compiled/12/stdlib/067_IdentifierNFTScripts.mv new file mode 100644 index 0000000000..d8b0ad3b91 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/067_IdentifierNFTScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/075_MintDaoProposal.mv b/vm/stdlib/compiled/12/stdlib/068_MintDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/075_MintDaoProposal.mv rename to vm/stdlib/compiled/12/stdlib/068_MintDaoProposal.mv diff --git a/vm/stdlib/compiled/12/stdlib/069_IdentifierNFT.mv b/vm/stdlib/compiled/12/stdlib/069_IdentifierNFT.mv deleted file mode 100644 index 44d5f27272..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/069_IdentifierNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/069_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/12/stdlib/069_ModuleUpgradeScripts.mv new file mode 100644 index 0000000000..4c03908ff0 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/069_ModuleUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/070_GenesisNFT.mv b/vm/stdlib/compiled/12/stdlib/070_GenesisNFT.mv deleted file mode 100644 index 803cfbad57..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/070_GenesisNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/070_NFTGallery.mv b/vm/stdlib/compiled/12/stdlib/070_NFTGallery.mv new file mode 100644 index 0000000000..ad57a31114 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/070_NFTGallery.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/071_NFTGalleryScripts.mv b/vm/stdlib/compiled/12/stdlib/071_NFTGalleryScripts.mv new file mode 100644 index 0000000000..b3b1bc6616 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/071_NFTGalleryScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/071_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/12/stdlib/071_StdlibUpgradeScripts.mv deleted file mode 100644 index b53e7f3f3f..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/071_StdlibUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/079_OnChainConfigScripts.mv b/vm/stdlib/compiled/12/stdlib/072_OnChainConfigScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/079_OnChainConfigScripts.mv rename to vm/stdlib/compiled/12/stdlib/072_OnChainConfigScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/073_GenesisNFTScripts.mv b/vm/stdlib/compiled/12/stdlib/073_GenesisNFTScripts.mv deleted file mode 100644 index fe06059a19..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/073_GenesisNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/080_PriceOracleAggregator.mv b/vm/stdlib/compiled/12/stdlib/073_PriceOracleAggregator.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/080_PriceOracleAggregator.mv rename to vm/stdlib/compiled/12/stdlib/073_PriceOracleAggregator.mv diff --git a/vm/stdlib/compiled/12/stdlib/074_IdentifierNFTScripts.mv b/vm/stdlib/compiled/12/stdlib/074_IdentifierNFTScripts.mv deleted file mode 100644 index f495cd7670..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/074_IdentifierNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/074_PriceOracleScripts.mv b/vm/stdlib/compiled/12/stdlib/074_PriceOracleScripts.mv new file mode 100644 index 0000000000..1e1b4c6822 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/074_PriceOracleScripts.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/075_Signature.mv b/vm/stdlib/compiled/12/stdlib/075_Signature.mv new file mode 100644 index 0000000000..2d57b33358 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/075_Signature.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/076_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/12/stdlib/076_ModuleUpgradeScripts.mv deleted file mode 100644 index f2d215e295..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/076_ModuleUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/084_SharedEd25519PublicKey.mv b/vm/stdlib/compiled/12/stdlib/076_SharedEd25519PublicKey.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/084_SharedEd25519PublicKey.mv rename to vm/stdlib/compiled/12/stdlib/076_SharedEd25519PublicKey.mv diff --git a/vm/stdlib/compiled/12/stdlib/077_NFTGallery.mv b/vm/stdlib/compiled/12/stdlib/077_NFTGallery.mv deleted file mode 100644 index bda70d9e15..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/077_NFTGallery.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/090_TransactionTimeout.mv b/vm/stdlib/compiled/12/stdlib/077_TransactionTimeout.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/090_TransactionTimeout.mv rename to vm/stdlib/compiled/12/stdlib/077_TransactionTimeout.mv diff --git a/vm/stdlib/compiled/12/stdlib/078_NFTGalleryScripts.mv b/vm/stdlib/compiled/12/stdlib/078_NFTGalleryScripts.mv deleted file mode 100644 index e9736e40d3..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/078_NFTGalleryScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/078_TransactionManager.mv b/vm/stdlib/compiled/12/stdlib/078_TransactionManager.mv new file mode 100644 index 0000000000..2fa33f2603 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/078_TransactionManager.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/057_TransferScripts.mv b/vm/stdlib/compiled/12/stdlib/079_TransferScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/057_TransferScripts.mv rename to vm/stdlib/compiled/12/stdlib/079_TransferScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/092_TreasuryScripts.mv b/vm/stdlib/compiled/12/stdlib/080_TreasuryScripts.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/092_TreasuryScripts.mv rename to vm/stdlib/compiled/12/stdlib/080_TreasuryScripts.mv diff --git a/vm/stdlib/compiled/12/stdlib/081_Arith.mv b/vm/stdlib/compiled/12/stdlib/081_Arith.mv new file mode 100644 index 0000000000..5a0bdc47ad Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/081_Arith.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/081_PriceOracleScripts.mv b/vm/stdlib/compiled/12/stdlib/081_PriceOracleScripts.mv deleted file mode 100644 index 9fc3054e32..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/081_PriceOracleScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/082_Secp256k1.mv b/vm/stdlib/compiled/12/stdlib/082_Secp256k1.mv deleted file mode 100644 index 5f0dd612f4..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/082_Secp256k1.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/082_U256.mv b/vm/stdlib/compiled/12/stdlib/082_U256.mv new file mode 100644 index 0000000000..fbb223ad10 Binary files /dev/null and b/vm/stdlib/compiled/12/stdlib/082_U256.mv differ diff --git a/vm/stdlib/compiled/12/stdlib/083_Signature.mv b/vm/stdlib/compiled/12/stdlib/083_Signature.mv deleted file mode 100644 index e37f2baf06..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/083_Signature.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/094_YieldFarming.mv b/vm/stdlib/compiled/12/stdlib/083_YieldFarming.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/094_YieldFarming.mv rename to vm/stdlib/compiled/12/stdlib/083_YieldFarming.mv diff --git a/vm/stdlib/compiled/12/stdlib/095_YieldFarmingV2.mv b/vm/stdlib/compiled/12/stdlib/084_YieldFarmingV2.mv similarity index 100% rename from vm/stdlib/compiled/12/stdlib/095_YieldFarmingV2.mv rename to vm/stdlib/compiled/12/stdlib/084_YieldFarmingV2.mv diff --git a/vm/stdlib/compiled/12/stdlib/085_SimpleMap.mv b/vm/stdlib/compiled/12/stdlib/085_SimpleMap.mv deleted file mode 100644 index 0effeda9fd..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/085_SimpleMap.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/086_StructuredHash.mv b/vm/stdlib/compiled/12/stdlib/086_StructuredHash.mv deleted file mode 100644 index 41c8858866..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/086_StructuredHash.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/087_StarcoinVerifier.mv b/vm/stdlib/compiled/12/stdlib/087_StarcoinVerifier.mv deleted file mode 100644 index 684d44fe58..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/087_StarcoinVerifier.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/088_String.mv b/vm/stdlib/compiled/12/stdlib/088_String.mv deleted file mode 100644 index 4b51f43735..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/088_String.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/089_Table.mv b/vm/stdlib/compiled/12/stdlib/089_Table.mv deleted file mode 100644 index 297bb011c4..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/089_Table.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/091_TransactionManager.mv b/vm/stdlib/compiled/12/stdlib/091_TransactionManager.mv deleted file mode 100644 index 178931119d..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/091_TransactionManager.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/stdlib/093_U256.mv b/vm/stdlib/compiled/12/stdlib/093_U256.mv deleted file mode 100644 index 5114e77f7f..0000000000 Binary files a/vm/stdlib/compiled/12/stdlib/093_U256.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap b/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap index 6d0c381420..a3f23c9a73 100644 Binary files a/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap and b/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap differ diff --git a/vm/stdlib/compiled/latest/stdlib/003_FromBCS.mv b/vm/stdlib/compiled/latest/stdlib/003_FromBCS.mv deleted file mode 100644 index 6291eb75bc..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/003_FromBCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/004_MintScripts.mv b/vm/stdlib/compiled/latest/stdlib/003_MintScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/004_MintScripts.mv rename to vm/stdlib/compiled/latest/stdlib/003_MintScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/005_SIP_2.mv b/vm/stdlib/compiled/latest/stdlib/004_SIP_2.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/005_SIP_2.mv rename to vm/stdlib/compiled/latest/stdlib/004_SIP_2.mv diff --git a/vm/stdlib/compiled/latest/stdlib/006_SIP_3.mv b/vm/stdlib/compiled/latest/stdlib/005_SIP_3.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/006_SIP_3.mv rename to vm/stdlib/compiled/latest/stdlib/005_SIP_3.mv diff --git a/vm/stdlib/compiled/latest/stdlib/006_SignedInteger64.mv b/vm/stdlib/compiled/latest/stdlib/006_SignedInteger64.mv new file mode 100644 index 0000000000..aaf806024f Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/006_SignedInteger64.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/007_SignedInteger64.mv b/vm/stdlib/compiled/latest/stdlib/007_SignedInteger64.mv deleted file mode 100644 index e3b62651c1..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/007_SignedInteger64.mv and /dev/null differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/008_Vector.mv b/vm/stdlib/compiled/latest/stdlib/007_Vector.mv similarity index 51% rename from vm/stdlib/compiled/12/11-12/stdlib/008_Vector.mv rename to vm/stdlib/compiled/latest/stdlib/007_Vector.mv index fca0c13f9f..6deae25d48 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/008_Vector.mv and b/vm/stdlib/compiled/latest/stdlib/007_Vector.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/009_Errors.mv b/vm/stdlib/compiled/latest/stdlib/008_Errors.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/009_Errors.mv rename to vm/stdlib/compiled/latest/stdlib/008_Errors.mv diff --git a/vm/stdlib/compiled/latest/stdlib/009_ACL.mv b/vm/stdlib/compiled/latest/stdlib/009_ACL.mv new file mode 100644 index 0000000000..89c46c5234 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/009_ACL.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/010_ACL.mv b/vm/stdlib/compiled/latest/stdlib/010_ACL.mv deleted file mode 100644 index 773134f2ee..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/010_ACL.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/011_Signer.mv b/vm/stdlib/compiled/latest/stdlib/010_Signer.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/011_Signer.mv rename to vm/stdlib/compiled/latest/stdlib/010_Signer.mv diff --git a/vm/stdlib/compiled/latest/stdlib/012_Math.mv b/vm/stdlib/compiled/latest/stdlib/011_Math.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/012_Math.mv rename to vm/stdlib/compiled/latest/stdlib/011_Math.mv diff --git a/vm/stdlib/compiled/latest/stdlib/012_BCS.mv b/vm/stdlib/compiled/latest/stdlib/012_BCS.mv new file mode 100644 index 0000000000..6d70b3d7a8 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/012_BCS.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/015_Event.mv b/vm/stdlib/compiled/latest/stdlib/013_Event.mv similarity index 92% rename from vm/stdlib/compiled/latest/stdlib/015_Event.mv rename to vm/stdlib/compiled/latest/stdlib/013_Event.mv index a4b3a1b812..471738d288 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/015_Event.mv and b/vm/stdlib/compiled/latest/stdlib/013_Event.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/014_BCS.mv b/vm/stdlib/compiled/latest/stdlib/014_BCS.mv deleted file mode 100644 index d66fd29767..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/014_BCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/014_Token.mv b/vm/stdlib/compiled/latest/stdlib/014_Token.mv new file mode 100644 index 0000000000..82d9b31f2b Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/014_Token.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/015_CoreAddresses.mv b/vm/stdlib/compiled/latest/stdlib/015_CoreAddresses.mv new file mode 100644 index 0000000000..48361873e4 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/015_CoreAddresses.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/018_Timestamp.mv b/vm/stdlib/compiled/latest/stdlib/016_Timestamp.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/018_Timestamp.mv rename to vm/stdlib/compiled/latest/stdlib/016_Timestamp.mv diff --git a/vm/stdlib/compiled/latest/stdlib/016_Token.mv b/vm/stdlib/compiled/latest/stdlib/016_Token.mv deleted file mode 100644 index 4217dbb830..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/016_Token.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/017_CoreAddresses.mv b/vm/stdlib/compiled/latest/stdlib/017_CoreAddresses.mv deleted file mode 100644 index 8977cc4410..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/017_CoreAddresses.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/013_Option.mv b/vm/stdlib/compiled/latest/stdlib/017_Option.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/013_Option.mv rename to vm/stdlib/compiled/latest/stdlib/017_Option.mv diff --git a/vm/stdlib/compiled/latest/stdlib/019_Config.mv b/vm/stdlib/compiled/latest/stdlib/018_Config.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/019_Config.mv rename to vm/stdlib/compiled/latest/stdlib/018_Config.mv diff --git a/vm/stdlib/compiled/latest/stdlib/020_ChainId.mv b/vm/stdlib/compiled/latest/stdlib/019_ChainId.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/020_ChainId.mv rename to vm/stdlib/compiled/latest/stdlib/019_ChainId.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/021_VMConfig.mv b/vm/stdlib/compiled/latest/stdlib/020_VMConfig.mv similarity index 87% rename from vm/stdlib/compiled/12/11-12/stdlib/021_VMConfig.mv rename to vm/stdlib/compiled/latest/stdlib/020_VMConfig.mv index d4a4038b71..ecd23444b4 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/021_VMConfig.mv and b/vm/stdlib/compiled/latest/stdlib/020_VMConfig.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/022_Version.mv b/vm/stdlib/compiled/latest/stdlib/021_Version.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/022_Version.mv rename to vm/stdlib/compiled/latest/stdlib/021_Version.mv diff --git a/vm/stdlib/compiled/12/11-12/stdlib/023_PackageTxnManager.mv b/vm/stdlib/compiled/latest/stdlib/022_PackageTxnManager.mv similarity index 91% rename from vm/stdlib/compiled/12/11-12/stdlib/023_PackageTxnManager.mv rename to vm/stdlib/compiled/latest/stdlib/022_PackageTxnManager.mv index 75e05951e0..808c7b66c8 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/023_PackageTxnManager.mv and b/vm/stdlib/compiled/latest/stdlib/022_PackageTxnManager.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/024_Treasury.mv b/vm/stdlib/compiled/latest/stdlib/023_Treasury.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/024_Treasury.mv rename to vm/stdlib/compiled/latest/stdlib/023_Treasury.mv diff --git a/vm/stdlib/compiled/latest/stdlib/025_Dao.mv b/vm/stdlib/compiled/latest/stdlib/024_Dao.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/025_Dao.mv rename to vm/stdlib/compiled/latest/stdlib/024_Dao.mv diff --git a/vm/stdlib/compiled/latest/stdlib/026_UpgradeModuleDaoProposal.mv b/vm/stdlib/compiled/latest/stdlib/025_UpgradeModuleDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/026_UpgradeModuleDaoProposal.mv rename to vm/stdlib/compiled/latest/stdlib/025_UpgradeModuleDaoProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/027_TransactionTimeoutConfig.mv b/vm/stdlib/compiled/latest/stdlib/026_TransactionTimeoutConfig.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/027_TransactionTimeoutConfig.mv rename to vm/stdlib/compiled/latest/stdlib/026_TransactionTimeoutConfig.mv diff --git a/vm/stdlib/compiled/latest/stdlib/028_TransactionPublishOption.mv b/vm/stdlib/compiled/latest/stdlib/027_TransactionPublishOption.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/028_TransactionPublishOption.mv rename to vm/stdlib/compiled/latest/stdlib/027_TransactionPublishOption.mv diff --git a/vm/stdlib/compiled/latest/stdlib/029_RewardConfig.mv b/vm/stdlib/compiled/latest/stdlib/028_RewardConfig.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/029_RewardConfig.mv rename to vm/stdlib/compiled/latest/stdlib/028_RewardConfig.mv diff --git a/vm/stdlib/compiled/latest/stdlib/030_OnChainConfigDao.mv b/vm/stdlib/compiled/latest/stdlib/029_OnChainConfigDao.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/030_OnChainConfigDao.mv rename to vm/stdlib/compiled/latest/stdlib/029_OnChainConfigDao.mv diff --git a/vm/stdlib/compiled/latest/stdlib/031_ModifyDaoConfigProposal.mv b/vm/stdlib/compiled/latest/stdlib/030_ModifyDaoConfigProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/031_ModifyDaoConfigProposal.mv rename to vm/stdlib/compiled/latest/stdlib/030_ModifyDaoConfigProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/032_ConsensusConfig.mv b/vm/stdlib/compiled/latest/stdlib/031_ConsensusConfig.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/032_ConsensusConfig.mv rename to vm/stdlib/compiled/latest/stdlib/031_ConsensusConfig.mv diff --git a/vm/stdlib/compiled/latest/stdlib/033_STC.mv b/vm/stdlib/compiled/latest/stdlib/032_STC.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/033_STC.mv rename to vm/stdlib/compiled/latest/stdlib/032_STC.mv diff --git a/vm/stdlib/compiled/latest/stdlib/034_TransactionFee.mv b/vm/stdlib/compiled/latest/stdlib/033_TransactionFee.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/034_TransactionFee.mv rename to vm/stdlib/compiled/latest/stdlib/033_TransactionFee.mv diff --git a/vm/stdlib/compiled/latest/stdlib/035_Hash.mv b/vm/stdlib/compiled/latest/stdlib/034_Hash.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/035_Hash.mv rename to vm/stdlib/compiled/latest/stdlib/034_Hash.mv diff --git a/vm/stdlib/compiled/12/stdlib/036_Authenticator.mv b/vm/stdlib/compiled/latest/stdlib/035_Authenticator.mv similarity index 95% rename from vm/stdlib/compiled/12/stdlib/036_Authenticator.mv rename to vm/stdlib/compiled/latest/stdlib/035_Authenticator.mv index c5a74c5072..2b6f62520e 100644 Binary files a/vm/stdlib/compiled/12/stdlib/036_Authenticator.mv and b/vm/stdlib/compiled/latest/stdlib/035_Authenticator.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/036_Account.mv b/vm/stdlib/compiled/latest/stdlib/036_Account.mv new file mode 100644 index 0000000000..aa65760485 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/036_Account.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/037_Account.mv b/vm/stdlib/compiled/latest/stdlib/037_Account.mv deleted file mode 100644 index 1a3465588c..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/037_Account.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/037_AccountScripts.mv b/vm/stdlib/compiled/latest/stdlib/037_AccountScripts.mv new file mode 100644 index 0000000000..07ec865a8b Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/037_AccountScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/038_AccountScripts.mv b/vm/stdlib/compiled/latest/stdlib/038_AccountScripts.mv deleted file mode 100644 index 3ea86f9cde..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/038_AccountScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/038_Block.mv b/vm/stdlib/compiled/latest/stdlib/038_Block.mv new file mode 100644 index 0000000000..fda9674f72 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/038_Block.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/039_Arith.mv b/vm/stdlib/compiled/latest/stdlib/039_Arith.mv deleted file mode 100644 index 61d6433fab..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/039_Arith.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/042_TreasuryWithdrawDaoProposal.mv b/vm/stdlib/compiled/latest/stdlib/039_TreasuryWithdrawDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/042_TreasuryWithdrawDaoProposal.mv rename to vm/stdlib/compiled/latest/stdlib/039_TreasuryWithdrawDaoProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/043_BlockReward.mv b/vm/stdlib/compiled/latest/stdlib/040_BlockReward.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/043_BlockReward.mv rename to vm/stdlib/compiled/latest/stdlib/040_BlockReward.mv diff --git a/vm/stdlib/compiled/latest/stdlib/040_Ring.mv b/vm/stdlib/compiled/latest/stdlib/040_Ring.mv deleted file mode 100644 index 870e433ee9..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/040_Ring.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/041_Block.mv b/vm/stdlib/compiled/latest/stdlib/041_Block.mv deleted file mode 100644 index d07b44aeb4..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/041_Block.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/044_Collection.mv b/vm/stdlib/compiled/latest/stdlib/041_Collection.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/044_Collection.mv rename to vm/stdlib/compiled/latest/stdlib/041_Collection.mv diff --git a/vm/stdlib/compiled/latest/stdlib/045_Collection2.mv b/vm/stdlib/compiled/latest/stdlib/042_Collection2.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/045_Collection2.mv rename to vm/stdlib/compiled/latest/stdlib/042_Collection2.mv diff --git a/vm/stdlib/compiled/latest/stdlib/043_Compare.mv b/vm/stdlib/compiled/latest/stdlib/043_Compare.mv new file mode 100644 index 0000000000..4c8e6794b2 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/043_Compare.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/047_ConsensusStrategy.mv b/vm/stdlib/compiled/latest/stdlib/044_ConsensusStrategy.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/047_ConsensusStrategy.mv rename to vm/stdlib/compiled/latest/stdlib/044_ConsensusStrategy.mv diff --git a/vm/stdlib/compiled/latest/stdlib/048_DaoVoteScripts.mv b/vm/stdlib/compiled/latest/stdlib/045_DaoVoteScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/048_DaoVoteScripts.mv rename to vm/stdlib/compiled/latest/stdlib/045_DaoVoteScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/046_Compare.mv b/vm/stdlib/compiled/latest/stdlib/046_Compare.mv deleted file mode 100644 index e3e7ef4a6a..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/046_Compare.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/049_DummyToken.mv b/vm/stdlib/compiled/latest/stdlib/046_DummyToken.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/049_DummyToken.mv rename to vm/stdlib/compiled/latest/stdlib/046_DummyToken.mv diff --git a/vm/stdlib/compiled/latest/stdlib/050_DummyTokenScripts.mv b/vm/stdlib/compiled/latest/stdlib/047_DummyTokenScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/050_DummyTokenScripts.mv rename to vm/stdlib/compiled/latest/stdlib/047_DummyTokenScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/048_EVMAddress.mv b/vm/stdlib/compiled/latest/stdlib/048_EVMAddress.mv new file mode 100644 index 0000000000..37daf894b8 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/048_EVMAddress.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/059_Epoch.mv b/vm/stdlib/compiled/latest/stdlib/049_Epoch.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/059_Epoch.mv rename to vm/stdlib/compiled/latest/stdlib/049_Epoch.mv diff --git a/vm/stdlib/compiled/latest/stdlib/061_FixedPoint32.mv b/vm/stdlib/compiled/latest/stdlib/050_FixedPoint32.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/061_FixedPoint32.mv rename to vm/stdlib/compiled/latest/stdlib/050_FixedPoint32.mv diff --git a/vm/stdlib/compiled/latest/stdlib/051_EVMAddress.mv b/vm/stdlib/compiled/latest/stdlib/051_EVMAddress.mv deleted file mode 100644 index 9cb4ecebac..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/051_EVMAddress.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/051_FrozenConfig.mv b/vm/stdlib/compiled/latest/stdlib/051_FrozenConfig.mv new file mode 100644 index 0000000000..d8bef1911c Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/051_FrozenConfig.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/052_FrozenConfigStrategy.mv b/vm/stdlib/compiled/latest/stdlib/052_FrozenConfigStrategy.mv new file mode 100644 index 0000000000..598f68b0c2 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/052_FrozenConfigStrategy.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/052_TypeInfo.mv b/vm/stdlib/compiled/latest/stdlib/052_TypeInfo.mv deleted file mode 100644 index 1be6ae9259..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/052_TypeInfo.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/053_GenesisSignerCapability.mv b/vm/stdlib/compiled/latest/stdlib/053_GenesisSignerCapability.mv index 0b2013c145..c7e787b2b2 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/053_GenesisSignerCapability.mv and b/vm/stdlib/compiled/latest/stdlib/053_GenesisSignerCapability.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/055_PriceOracle.mv b/vm/stdlib/compiled/latest/stdlib/055_PriceOracle.mv index b8584e7754..e70a19c6aa 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/055_PriceOracle.mv and b/vm/stdlib/compiled/latest/stdlib/055_PriceOracle.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/056_EasyGas.mv b/vm/stdlib/compiled/latest/stdlib/056_EasyGas.mv deleted file mode 100644 index 9194df2cea..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/056_EasyGas.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/063_STCUSDOracle.mv b/vm/stdlib/compiled/latest/stdlib/056_STCUSDOracle.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/063_STCUSDOracle.mv rename to vm/stdlib/compiled/latest/stdlib/056_STCUSDOracle.mv diff --git a/vm/stdlib/compiled/latest/stdlib/064_Offer.mv b/vm/stdlib/compiled/latest/stdlib/057_Offer.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/064_Offer.mv rename to vm/stdlib/compiled/latest/stdlib/057_Offer.mv diff --git a/vm/stdlib/compiled/latest/stdlib/058_EasyGasScript.mv b/vm/stdlib/compiled/latest/stdlib/058_EasyGasScript.mv deleted file mode 100644 index 16d8f1836f..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/058_EasyGasScript.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/058_NFT.mv b/vm/stdlib/compiled/latest/stdlib/058_NFT.mv new file mode 100644 index 0000000000..496fb0c5d2 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/058_NFT.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/066_LanguageVersion.mv b/vm/stdlib/compiled/latest/stdlib/059_LanguageVersion.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/066_LanguageVersion.mv rename to vm/stdlib/compiled/latest/stdlib/059_LanguageVersion.mv diff --git a/vm/stdlib/compiled/latest/stdlib/060_EventUtil.mv b/vm/stdlib/compiled/latest/stdlib/060_EventUtil.mv deleted file mode 100644 index bbbc6f34f8..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/060_EventUtil.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/067_MerkleProof.mv b/vm/stdlib/compiled/latest/stdlib/060_MerkleProof.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/067_MerkleProof.mv rename to vm/stdlib/compiled/latest/stdlib/060_MerkleProof.mv diff --git a/vm/stdlib/compiled/12/stdlib/068_MerkleNFTDistributor.mv b/vm/stdlib/compiled/latest/stdlib/061_MerkleNFTDistributor.mv similarity index 98% rename from vm/stdlib/compiled/12/stdlib/068_MerkleNFTDistributor.mv rename to vm/stdlib/compiled/latest/stdlib/061_MerkleNFTDistributor.mv index bb8c651a7e..21a56f784b 100644 Binary files a/vm/stdlib/compiled/12/stdlib/068_MerkleNFTDistributor.mv and b/vm/stdlib/compiled/latest/stdlib/061_MerkleNFTDistributor.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/062_GasSchedule.mv b/vm/stdlib/compiled/latest/stdlib/062_GasSchedule.mv deleted file mode 100644 index a88bc854cb..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/062_GasSchedule.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/062_IdentifierNFT.mv b/vm/stdlib/compiled/latest/stdlib/062_IdentifierNFT.mv new file mode 100644 index 0000000000..0b7ad460ec Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/062_IdentifierNFT.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/063_GenesisNFT.mv b/vm/stdlib/compiled/latest/stdlib/063_GenesisNFT.mv new file mode 100644 index 0000000000..59de3f76bb Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/063_GenesisNFT.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/064_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/064_StdlibUpgradeScripts.mv new file mode 100644 index 0000000000..3e9fcaba3b Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/064_StdlibUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/12/11-12/stdlib/072_Genesis.mv b/vm/stdlib/compiled/latest/stdlib/065_Genesis.mv similarity index 78% rename from vm/stdlib/compiled/12/11-12/stdlib/072_Genesis.mv rename to vm/stdlib/compiled/latest/stdlib/065_Genesis.mv index 78701566bc..33844f2593 100644 Binary files a/vm/stdlib/compiled/12/11-12/stdlib/072_Genesis.mv and b/vm/stdlib/compiled/latest/stdlib/065_Genesis.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/065_NFT.mv b/vm/stdlib/compiled/latest/stdlib/065_NFT.mv deleted file mode 100644 index cf97fbd3cd..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/065_NFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/066_GenesisNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/066_GenesisNFTScripts.mv new file mode 100644 index 0000000000..b7c919154c Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/066_GenesisNFTScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/067_IdentifierNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/067_IdentifierNFTScripts.mv new file mode 100644 index 0000000000..d8b0ad3b91 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/067_IdentifierNFTScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/075_MintDaoProposal.mv b/vm/stdlib/compiled/latest/stdlib/068_MintDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/075_MintDaoProposal.mv rename to vm/stdlib/compiled/latest/stdlib/068_MintDaoProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/069_IdentifierNFT.mv b/vm/stdlib/compiled/latest/stdlib/069_IdentifierNFT.mv deleted file mode 100644 index 44d5f27272..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/069_IdentifierNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/069_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/069_ModuleUpgradeScripts.mv new file mode 100644 index 0000000000..4c03908ff0 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/069_ModuleUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/070_GenesisNFT.mv b/vm/stdlib/compiled/latest/stdlib/070_GenesisNFT.mv deleted file mode 100644 index 803cfbad57..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/070_GenesisNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/070_NFTGallery.mv b/vm/stdlib/compiled/latest/stdlib/070_NFTGallery.mv new file mode 100644 index 0000000000..ad57a31114 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/070_NFTGallery.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/071_NFTGalleryScripts.mv b/vm/stdlib/compiled/latest/stdlib/071_NFTGalleryScripts.mv new file mode 100644 index 0000000000..b3b1bc6616 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/071_NFTGalleryScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/071_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/071_StdlibUpgradeScripts.mv deleted file mode 100644 index b53e7f3f3f..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/071_StdlibUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/079_OnChainConfigScripts.mv b/vm/stdlib/compiled/latest/stdlib/072_OnChainConfigScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/079_OnChainConfigScripts.mv rename to vm/stdlib/compiled/latest/stdlib/072_OnChainConfigScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/073_GenesisNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/073_GenesisNFTScripts.mv deleted file mode 100644 index fe06059a19..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/073_GenesisNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/080_PriceOracleAggregator.mv b/vm/stdlib/compiled/latest/stdlib/073_PriceOracleAggregator.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/080_PriceOracleAggregator.mv rename to vm/stdlib/compiled/latest/stdlib/073_PriceOracleAggregator.mv diff --git a/vm/stdlib/compiled/latest/stdlib/074_IdentifierNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/074_IdentifierNFTScripts.mv deleted file mode 100644 index f495cd7670..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/074_IdentifierNFTScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/074_PriceOracleScripts.mv b/vm/stdlib/compiled/latest/stdlib/074_PriceOracleScripts.mv new file mode 100644 index 0000000000..1e1b4c6822 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/074_PriceOracleScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/075_Signature.mv b/vm/stdlib/compiled/latest/stdlib/075_Signature.mv new file mode 100644 index 0000000000..2d57b33358 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/075_Signature.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/076_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/076_ModuleUpgradeScripts.mv deleted file mode 100644 index f2d215e295..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/076_ModuleUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/084_SharedEd25519PublicKey.mv b/vm/stdlib/compiled/latest/stdlib/076_SharedEd25519PublicKey.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/084_SharedEd25519PublicKey.mv rename to vm/stdlib/compiled/latest/stdlib/076_SharedEd25519PublicKey.mv diff --git a/vm/stdlib/compiled/latest/stdlib/077_NFTGallery.mv b/vm/stdlib/compiled/latest/stdlib/077_NFTGallery.mv deleted file mode 100644 index bda70d9e15..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/077_NFTGallery.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/090_TransactionTimeout.mv b/vm/stdlib/compiled/latest/stdlib/077_TransactionTimeout.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/090_TransactionTimeout.mv rename to vm/stdlib/compiled/latest/stdlib/077_TransactionTimeout.mv diff --git a/vm/stdlib/compiled/latest/stdlib/078_NFTGalleryScripts.mv b/vm/stdlib/compiled/latest/stdlib/078_NFTGalleryScripts.mv deleted file mode 100644 index e9736e40d3..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/078_NFTGalleryScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/078_TransactionManager.mv b/vm/stdlib/compiled/latest/stdlib/078_TransactionManager.mv new file mode 100644 index 0000000000..2fa33f2603 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/078_TransactionManager.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/057_TransferScripts.mv b/vm/stdlib/compiled/latest/stdlib/079_TransferScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/057_TransferScripts.mv rename to vm/stdlib/compiled/latest/stdlib/079_TransferScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/092_TreasuryScripts.mv b/vm/stdlib/compiled/latest/stdlib/080_TreasuryScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/092_TreasuryScripts.mv rename to vm/stdlib/compiled/latest/stdlib/080_TreasuryScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/081_Arith.mv b/vm/stdlib/compiled/latest/stdlib/081_Arith.mv new file mode 100644 index 0000000000..5a0bdc47ad Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/081_Arith.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/081_PriceOracleScripts.mv b/vm/stdlib/compiled/latest/stdlib/081_PriceOracleScripts.mv deleted file mode 100644 index 9fc3054e32..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/081_PriceOracleScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/082_Secp256k1.mv b/vm/stdlib/compiled/latest/stdlib/082_Secp256k1.mv deleted file mode 100644 index 5f0dd612f4..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/082_Secp256k1.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/082_U256.mv b/vm/stdlib/compiled/latest/stdlib/082_U256.mv new file mode 100644 index 0000000000..fbb223ad10 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/082_U256.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/083_Signature.mv b/vm/stdlib/compiled/latest/stdlib/083_Signature.mv deleted file mode 100644 index e37f2baf06..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/083_Signature.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/094_YieldFarming.mv b/vm/stdlib/compiled/latest/stdlib/083_YieldFarming.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/094_YieldFarming.mv rename to vm/stdlib/compiled/latest/stdlib/083_YieldFarming.mv diff --git a/vm/stdlib/compiled/latest/stdlib/095_YieldFarmingV2.mv b/vm/stdlib/compiled/latest/stdlib/084_YieldFarmingV2.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/095_YieldFarmingV2.mv rename to vm/stdlib/compiled/latest/stdlib/084_YieldFarmingV2.mv diff --git a/vm/stdlib/compiled/latest/stdlib/085_SimpleMap.mv b/vm/stdlib/compiled/latest/stdlib/085_SimpleMap.mv deleted file mode 100644 index 0effeda9fd..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/085_SimpleMap.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/086_StructuredHash.mv b/vm/stdlib/compiled/latest/stdlib/086_StructuredHash.mv deleted file mode 100644 index 41c8858866..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/086_StructuredHash.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/087_StarcoinVerifier.mv b/vm/stdlib/compiled/latest/stdlib/087_StarcoinVerifier.mv deleted file mode 100644 index 684d44fe58..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/087_StarcoinVerifier.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/088_String.mv b/vm/stdlib/compiled/latest/stdlib/088_String.mv deleted file mode 100644 index 4b51f43735..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/088_String.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/089_Table.mv b/vm/stdlib/compiled/latest/stdlib/089_Table.mv deleted file mode 100644 index 297bb011c4..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/089_Table.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/091_TransactionManager.mv b/vm/stdlib/compiled/latest/stdlib/091_TransactionManager.mv deleted file mode 100644 index 178931119d..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/091_TransactionManager.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/093_U256.mv b/vm/stdlib/compiled/latest/stdlib/093_U256.mv deleted file mode 100644 index 5114e77f7f..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/093_U256.mv and /dev/null differ diff --git a/vm/types/src/on_chain_config/gas_schedule.rs b/vm/types/src/on_chain_config/gas_schedule.rs index 14465e2bc1..52115bbc91 100644 --- a/vm/types/src/on_chain_config/gas_schedule.rs +++ b/vm/types/src/on_chain_config/gas_schedule.rs @@ -2,6 +2,7 @@ use crate::gas_schedule::{ G_MAX_TRANSACTION_SIZE_IN_BYTES_V1, G_MAX_TRANSACTION_SIZE_IN_BYTES_V2, G_MAX_TRANSACTION_SIZE_IN_BYTES_V3, }; + use crate::on_chain_config::OnChainConfig; use anyhow::{format_err, Result}; #[cfg(feature = "print_gas_info")] diff --git a/vm/vm-runtime/Cargo.toml b/vm/vm-runtime/Cargo.toml index 0342015d01..ea938b6aef 100644 --- a/vm/vm-runtime/Cargo.toml +++ b/vm/vm-runtime/Cargo.toml @@ -34,6 +34,7 @@ serde = { features = ["derive"], workspace = true } starcoin-parallel-executor = { workspace = true } rayon = { workspace = true } num_cpus = { workspace = true } +hex = "0.4.3" [dev-dependencies] stdlib = { package = "stdlib", workspace = true } diff --git a/vm/vm-runtime/src/force_upgrade_management.rs b/vm/vm-runtime/src/force_upgrade_management.rs new file mode 100644 index 0000000000..eb0a10712b --- /dev/null +++ b/vm/vm-runtime/src/force_upgrade_management.rs @@ -0,0 +1,84 @@ +// Copyright (c) The Starcoin Core Contributors +// SPDX-License-Identifier: Apache-2 + +use starcoin_crypto::ed25519::{Ed25519PrivateKey, Ed25519PublicKey}; +use starcoin_types::account::Account; +use starcoin_vm_types::genesis_config::ChainId; + +pub const FORCE_UPGRADE_BLOCK_NUMBER: u64 = 17500000; + +pub fn get_force_upgrade_block_number(chain_id: &ChainId) -> u64 { + if chain_id.is_test() { + 50 + } else if chain_id.is_dev() { + 5 + } else if chain_id.is_halley() || chain_id.is_proxima() { + 300 + } else if chain_id.is_barnard() { + 16085000 + } else { + FORCE_UPGRADE_BLOCK_NUMBER + } +} + +pub fn create_account(private_hex: &str) -> anyhow::Result { + let bytes = hex::decode(private_hex)?; + let private_key = Ed25519PrivateKey::try_from(&bytes[..])?; + let public_key = Ed25519PublicKey::from(&private_key); + Ok(Account::with_keypair( + private_key.into(), + public_key.into(), + None, + )) +} + +pub fn get_force_upgrade_account(chain_id: &ChainId) -> anyhow::Result { + if chain_id.is_main() { + // 0x6820910808aba0dda29b486064ffc17f + create_account("70ec43d39c812e0c0f7b7b83e22fd0c70cf136f74c29bded7379e0d9589e4485") + } else if chain_id.is_barnard() || chain_id.is_proxima() || chain_id.is_halley() { + // 0x0b1d07ae560c26af9bbb8264f4c7ee73 + create_account("6105e78821ace0676faf437fb40dd6892e72f01c09351298106bad2964edb007") + } else { + Ok(Account::new_association()) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use move_core_types::account_address::AccountAddress; + + #[test] + fn test_get_force_upgrade_account() -> anyhow::Result<()> { + // Main TODO(BobOng): To fixed + // assert_eq!(get_force_upgrade_account(&ChainId::new(1))?.address(), AccountAddress::from_hex_literal("0x2dd7136c13ed8051fb20147f373f6120")); + // Barnard 251 + assert_eq!( + *get_force_upgrade_account(&ChainId::new(251))?.address(), + AccountAddress::from_hex_literal("0x0b1d07ae560c26af9bbb8264f4c7ee73")? + ); + // Proxima 252 + assert_eq!( + get_force_upgrade_account(&ChainId::new(252))?.address(), + &AccountAddress::from_hex_literal("0x0b1d07ae560c26af9bbb8264f4c7ee73")? + ); + // Halley 253 + assert_eq!( + get_force_upgrade_account(&ChainId::new(253))?.address(), + &AccountAddress::from_hex_literal("0x0b1d07ae560c26af9bbb8264f4c7ee73")? + ); + // Dev 254 + assert_eq!( + get_force_upgrade_account(&ChainId::new(254))?.address(), + &AccountAddress::from_hex_literal("0xA550C18")? + ); + // Test 255 + assert_eq!( + get_force_upgrade_account(&ChainId::new(254))?.address(), + &AccountAddress::from_hex_literal("0xA550C18")? + ); + + Ok(()) + } +} diff --git a/vm/vm-runtime/src/lib.rs b/vm/vm-runtime/src/lib.rs index 2680fefa62..64d1441032 100644 --- a/vm/vm-runtime/src/lib.rs +++ b/vm/vm-runtime/src/lib.rs @@ -12,6 +12,7 @@ use move_core_types::vm_status::VMStatus; pub use move_vm_runtime::{move_vm, session}; mod access_path_cache; mod errors; +pub mod force_upgrade_management; pub mod move_vm_ext; pub mod parallel_executor; use crate::metrics::VMMetrics; @@ -38,7 +39,6 @@ pub trait VMExecutor: Send + Sync { metrics: Option, ) -> Result, VMStatus>; } - /// Get the AccessPath to a resource stored under `address` with type name `tag` fn create_access_path(address: AccountAddress, tag: StructTag) -> AccessPath { AccessPath::resource_access_path(address, tag) diff --git a/vm/vm-runtime/src/starcoin_vm.rs b/vm/vm-runtime/src/starcoin_vm.rs index c9402e5f51..f7e526d385 100644 --- a/vm/vm-runtime/src/starcoin_vm.rs +++ b/vm/vm-runtime/src/starcoin_vm.rs @@ -93,7 +93,7 @@ pub struct StarcoinVM { /// marking of stdlib version which includes vmconfig upgrades. const VMCONFIG_UPGRADE_VERSION_MARK: u64 = 10; -const GAS_SCHEDULE_UPGRADE_VERSION_MARK: u64 = 12; +// const GAS_SCHEDULE_UPGRADE_VERSION_MARK: u64 = 12; impl StarcoinVM { #[cfg(feature = "metrics")] @@ -143,6 +143,7 @@ impl StarcoinVM { } else { self.load_configs_impl(state)?; } + match self.gas_schedule.as_ref() { None => { bail!("failed to load gas schedule!"); @@ -197,9 +198,7 @@ impl StarcoinVM { Some(GasSchedule::from(&gas_cost_table)), "gas schedule from VMConfig", ) - } else if stdlib_version >= StdlibVersion::Version(VMCONFIG_UPGRADE_VERSION_MARK) - && stdlib_version < StdlibVersion::Version(GAS_SCHEDULE_UPGRADE_VERSION_MARK) - { + } else { debug!( "stdlib version: {}, fetch VMConfig from onchain module", stdlib_version @@ -263,13 +262,6 @@ impl StarcoinVM { Some(GasSchedule::from(&cost_table)), "gas schedule from VMConfig", ) - } else { - debug!( - "stdlib version: {}, fetch schedule from onchain module GasSchedule", - stdlib_version - ); - let gas_schedule = GasSchedule::fetch_config(&remote_storage)?; - (gas_schedule, "gas schedule from GasSchedule") }; #[cfg(feature = "print_gas_info")] match self.gas_schedule.as_ref() { @@ -1068,8 +1060,8 @@ impl StarcoinVM { .map_err(|_err| VMStatus::Error(StatusCode::STORAGE_ERROR))?; let mut gas_left = block_gas_limit.unwrap_or(u64::MAX); - let blocks = chunk_block_transactions(transactions); + 'outer: for block in blocks { #[cfg(feature = "metrics")] let txn_type_name = block.type_name().to_string(); @@ -1083,9 +1075,12 @@ impl StarcoinVM { .with_label_values(&[txn_type_name.as_str()]) .start_timer() }); + let gas_unit_price = transaction.gas_unit_price(); + let (status, output) = self .execute_user_transaction(&data_cache.as_move_resolver(), transaction); + // only need to check for user transactions. match gas_left.checked_sub(output.gas_used()) { Some(l) => gas_left = l, @@ -1133,12 +1128,14 @@ impl StarcoinVM { .with_label_values(&[txn_type_name.as_str()]) .start_timer() }); + let (status, output) = match self .process_block_metadata(&data_cache.as_move_resolver(), block_metadata) { Ok(output) => (VMStatus::Executed, output), Err(vm_status) => discard_error_vm_status(vm_status), }; + debug_assert_eq!( output.gas_used(), 0,