diff --git a/Cargo.lock b/Cargo.lock index 43732af616..d4aaab9669 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9441,7 +9441,7 @@ dependencies = [ [[package]] name = "starcoin-framework" version = "11.0.0" -source = "git+https://github.com/starcoinorg/starcoin-framework?rev=cf1deda180af40a8b3e26c0c7b548c4c290cd7e7#cf1deda180af40a8b3e26c0c7b548c4c290cd7e7" +source = "git+https://github.com/starcoinorg/starcoin-framework?rev=0d37c891a2d660fb94b3b8c0d396b67890691a00#0d37c891a2d660fb94b3b8c0d396b67890691a00" dependencies = [ "anyhow", "include_dir", diff --git a/chain/tests/test_block_chain.rs b/chain/tests/test_block_chain.rs index 94417a40ff..11f2c78243 100644 --- a/chain/tests/test_block_chain.rs +++ b/chain/tests/test_block_chain.rs @@ -15,8 +15,11 @@ use starcoin_executor::{build_transfer_from_association, DEFAULT_EXPIRATION_TIME use starcoin_types::account_address; use starcoin_types::block::{Block, BlockHeader}; use starcoin_types::filter::Filter; +use starcoin_types::identifier::Identifier; +use starcoin_types::language_storage::TypeTag; use starcoin_vm_types::account_config::genesis_address; -use starcoin_vm_types::event::EventKey; +use starcoin_vm_types::language_storage::StructTag; +use std::str::FromStr; use std::sync::Arc; #[stest::test(timeout = 120)] @@ -24,14 +27,24 @@ fn test_chain_filter_events() { let mut mock_chain = MockChain::new(ChainNetwork::new_test()).unwrap(); let times = 10; mock_chain.produce_and_apply_times(times).unwrap(); + + let event_type_tag = TypeTag::Struct(StructTag { + address: genesis_address(), + module: Identifier::from_str("Block").unwrap(), + name: Identifier::from_str("NewBlockEvent").unwrap(), + type_params: vec![], + }); + + // Origin block event index is 4, after https://github.com/starcoinorg/starcoin-framework/pull/42 , Genesis account create more event_handles, so the block event index is 7. + // So we should use type_tags to filter event, do not dependent on event key. + // let evt_key = EventKey::new_from_address(&genesis_address(), 7); { - let evt_key = EventKey::new_from_address(&genesis_address(), 4); let event_filter = Filter { from_block: 1, to_block: 5, - event_keys: vec![evt_key], + event_keys: vec![], addrs: vec![], - type_tags: vec![], + type_tags: vec![event_type_tag.clone()], limit: None, reverse: false, }; @@ -40,16 +53,16 @@ fn test_chain_filter_events() { let evt = evts.first().unwrap(); assert_eq!(evt.block_number, 1); assert_eq!(evt.transaction_index, 0); - assert_eq!(evt.event.key(), &evt_key); + assert_eq!(evt.event.type_tag(), &event_type_tag); } { let event_filter = Filter { from_block: 1, to_block: 10, - event_keys: vec![EventKey::new_from_address(&genesis_address(), 4)], + event_keys: vec![], addrs: vec![], - type_tags: vec![], + type_tags: vec![event_type_tag.clone()], limit: Some(5), reverse: false, }; @@ -63,9 +76,9 @@ fn test_chain_filter_events() { let event_filter = Filter { from_block: 1, to_block: 10, - event_keys: vec![EventKey::new_from_address(&genesis_address(), 4)], + event_keys: vec![], addrs: vec![], - type_tags: vec![], + type_tags: vec![event_type_tag.clone()], limit: Some(5), reverse: true, }; @@ -81,9 +94,9 @@ fn test_chain_filter_events() { let event_filter = Filter { from_block: 0, to_block: 10, - event_keys: vec![EventKey::new_from_address(&genesis_address(), 4)], + event_keys: vec![], addrs: vec![], - type_tags: vec![], + type_tags: vec![event_type_tag.clone()], limit: Some(20), reverse: true, }; @@ -99,9 +112,9 @@ fn test_chain_filter_events() { let event_filter = Filter { from_block: 0, to_block: 20, - event_keys: vec![EventKey::new_from_address(&genesis_address(), 4)], + event_keys: vec![], addrs: vec![], - type_tags: vec![], + type_tags: vec![event_type_tag], limit: Some(20), reverse: true, }; diff --git a/cmd/starcoin/src/dev/tests.rs b/cmd/starcoin/src/dev/tests.rs index ed8b3afbab..1351126aa0 100644 --- a/cmd/starcoin/src/dev/tests.rs +++ b/cmd/starcoin/src/dev/tests.rs @@ -170,14 +170,11 @@ fn create_default_account( .account_sign_txn(transfer_raw_txn) .unwrap(); let transfer_txn_id = transfer_txn.id(); - cli_state - .client() - .submit_transaction(transfer_txn.clone()) - .unwrap(); + debug!("transfer_txn: {}", transfer_txn_id); + cli_state.client().submit_transaction(transfer_txn).unwrap(); - sleep(Duration::from_millis(500)); - let block = node_handle.generate_block().unwrap(); - assert!(block.transactions().contains(&transfer_txn)); + sleep(Duration::from_millis(1000)); + let _block = node_handle.generate_block().unwrap(); let transfer_txn_info = cli_state .client() .chain_get_transaction_info(transfer_txn_id) @@ -187,9 +184,11 @@ fn create_default_account( transfer_amount } +//TODO replace this with integration-test #[stest::test(timeout = 300)] fn test_upgrade_module() { - let node_config = NodeConfig::random_for_test(); + let mut node_config = NodeConfig::random_for_test(); + node_config.miner.disable_mint_empty_block = Some(true); let config = Arc::new(node_config); let node_handle = run_node_by_config(config.clone()).unwrap(); let rpc_service = node_handle.rpc_service().unwrap(); @@ -258,7 +257,7 @@ fn test_upgrade_module() { .chain_get_transaction_info(proposal_txn_id) .unwrap() .unwrap(); - info!("step1 txn status : {:?}", proposal_txn_info); + debug!("step1 txn status : {:?}", proposal_txn_info); assert_eq!(proposal_txn_info.status, TransactionStatusView::Executed); // 2. transfer @@ -434,9 +433,11 @@ fn test_upgrade_module() { node_handle.stop().unwrap(); } +//TODO replace this with integration-test #[stest::test(timeout = 300)] fn test_only_new_module() { - let node_config = NodeConfig::random_for_test(); + let mut node_config = NodeConfig::random_for_test(); + node_config.miner.disable_mint_empty_block = Some(true); let config = Arc::new(node_config); let node_handle = run_node_by_config(config.clone()).unwrap(); let rpc_service = node_handle.rpc_service().unwrap(); diff --git a/genesis/generated/halley/genesis b/genesis/generated/halley/genesis index 96cd86f540..e3f4551115 100644 Binary files a/genesis/generated/halley/genesis and b/genesis/generated/halley/genesis differ diff --git a/sync/src/block_connector/test_illegal_block.rs b/sync/src/block_connector/test_illegal_block.rs index 88be5c52ba..17ceaf2c5c 100644 --- a/sync/src/block_connector/test_illegal_block.rs +++ b/sync/src/block_connector/test_illegal_block.rs @@ -300,7 +300,7 @@ async fn test_verify_consensus_failed() { } } -#[stest::test] +#[stest::test(timeout = 120)] async fn test_verify_new_epoch_block_uncle_should_none_failed() { let apply_failed = test_verify_uncles_in_old_epoch(true).await; assert!(apply_failed.is_err()); @@ -727,7 +727,7 @@ async fn test_verify_uncles_in_old_epoch(begin_epoch: bool) -> Result { ) } -#[stest::test] +#[stest::test(timeout = 120)] async fn test_verify_uncles_in_old_epoch_failed() { let apply_failed = test_verify_uncles_in_old_epoch(false).await; assert!(apply_failed.is_err()); @@ -736,7 +736,7 @@ async fn test_verify_uncles_in_old_epoch_failed() { } } -#[stest::test] +#[stest::test(timeout = 120)] async fn test_verify_uncles_uncle_exist_failed() { let count = 5; let (uncle_header, mut writeable_block_chain_service, node_config, storage) = @@ -860,7 +860,7 @@ async fn test_verify_uncle_and_parent_number_failed() { } } -#[stest::test] +#[stest::test(timeout = 120)] async fn test_verify_uncle_which_parent_is_end_block_in_last_epoch() { let count = G_TEST_CONFIG.consensus_config.epoch_block_count; let (uncle_header, mut writeable_block_chain_service, node_config, storage) = diff --git a/sync/src/block_connector/test_write_block_chain.rs b/sync/src/block_connector/test_write_block_chain.rs index 900c06c665..d19cd5544f 100644 --- a/sync/src/block_connector/test_write_block_chain.rs +++ b/sync/src/block_connector/test_write_block_chain.rs @@ -172,7 +172,7 @@ async fn test_block_chain_forks() { ); } -#[stest::test] +#[stest::test(timeout = 120)] async fn test_block_chain_switch_main() { let times = 10; let (mut writeable_block_chain_service, node_config, _) = create_writeable_block_chain().await; diff --git a/sync/src/tasks/tests.rs b/sync/src/tasks/tests.rs index 39ce7fe932..ee4753dd6a 100644 --- a/sync/src/tasks/tests.rs +++ b/sync/src/tasks/tests.rs @@ -41,7 +41,7 @@ use stream_task::{ }; use test_helper::DummyNetworkService; -#[stest::test] +#[stest::test(timeout = 120)] pub async fn test_full_sync_new_node() -> Result<()> { let net1 = ChainNetwork::new_builtin(BuiltinNetworkID::Test); let mut node1 = SyncNodeMocker::new(net1, 1, 50)?; @@ -210,7 +210,7 @@ pub async fn test_failed_block() -> Result<()> { } } -#[stest::test] +#[stest::test(timeout = 120)] pub async fn test_full_sync_fork() -> Result<()> { let net1 = ChainNetwork::new_builtin(BuiltinNetworkID::Test); let mut node1 = SyncNodeMocker::new(net1, 1, 50)?; diff --git a/vm/stdlib/Cargo.toml b/vm/stdlib/Cargo.toml index 621e98208d..58ebc93175 100644 --- a/vm/stdlib/Cargo.toml +++ b/vm/stdlib/Cargo.toml @@ -22,7 +22,7 @@ serde = {version = "1.0.130", default-features = false} sha2 = "0.10.2" simplelog = "0.9.0" starcoin-crypto = {git = "https://github.com/starcoinorg/starcoin-crypto", rev = "d871dfb4216f034ee334a575926c101574d9d6dc"} -starcoin-framework = {git = "https://github.com/starcoinorg/starcoin-framework", rev = "cf1deda180af40a8b3e26c0c7b548c4c290cd7e7"} +starcoin-framework = {git = "https://github.com/starcoinorg/starcoin-framework", rev = "0d37c891a2d660fb94b3b8c0d396b67890691a00"} starcoin-move-compiler = {path = "../../vm/compiler"} starcoin-vm-types = {path = "../types"} tempfile = "3.2.0" diff --git a/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap b/vm/stdlib/compiled/latest/error_descriptions/error_descriptions.errmap index 69b33125e1..84535a5a57 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/11_BCS.mv b/vm/stdlib/compiled/latest/stdlib/11_BCS.mv deleted file mode 100644 index 262389f2cd..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/11_BCS.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/16_Option.mv b/vm/stdlib/compiled/latest/stdlib/11_Option.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/16_Option.mv rename to vm/stdlib/compiled/latest/stdlib/11_Option.mv diff --git a/vm/stdlib/compiled/latest/stdlib/12_BCS.mv b/vm/stdlib/compiled/latest/stdlib/12_BCS.mv new file mode 100644 index 0000000000..6bc6bc1d3c Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/12_BCS.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/12_Event.mv b/vm/stdlib/compiled/latest/stdlib/13_Event.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/12_Event.mv rename to vm/stdlib/compiled/latest/stdlib/13_Event.mv diff --git a/vm/stdlib/compiled/latest/stdlib/13_Token.mv b/vm/stdlib/compiled/latest/stdlib/14_Token.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/13_Token.mv rename to vm/stdlib/compiled/latest/stdlib/14_Token.mv diff --git a/vm/stdlib/compiled/latest/stdlib/14_CoreAddresses.mv b/vm/stdlib/compiled/latest/stdlib/15_CoreAddresses.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/14_CoreAddresses.mv rename to vm/stdlib/compiled/latest/stdlib/15_CoreAddresses.mv diff --git a/vm/stdlib/compiled/latest/stdlib/15_Timestamp.mv b/vm/stdlib/compiled/latest/stdlib/16_Timestamp.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/15_Timestamp.mv rename to vm/stdlib/compiled/latest/stdlib/16_Timestamp.mv diff --git a/vm/stdlib/compiled/latest/stdlib/21_PackageTxnManager.mv b/vm/stdlib/compiled/latest/stdlib/21_PackageTxnManager.mv index 2c4f0246fb..1c27d3b9f7 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/21_PackageTxnManager.mv and b/vm/stdlib/compiled/latest/stdlib/21_PackageTxnManager.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/22_Treasury.mv b/vm/stdlib/compiled/latest/stdlib/22_Treasury.mv index 2ec6646892..54ca3c4792 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/22_Treasury.mv and b/vm/stdlib/compiled/latest/stdlib/22_Treasury.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/35_Account.mv b/vm/stdlib/compiled/latest/stdlib/35_Account.mv index 5351b7a7e6..35c1be9813 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/35_Account.mv and b/vm/stdlib/compiled/latest/stdlib/35_Account.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/36_AccountScripts.mv b/vm/stdlib/compiled/latest/stdlib/36_AccountScripts.mv index 9bcee9f347..f2f9121cfb 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/36_AccountScripts.mv and b/vm/stdlib/compiled/latest/stdlib/36_AccountScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/37_Block.mv b/vm/stdlib/compiled/latest/stdlib/37_Block.mv deleted file mode 100644 index c6049e5ec0..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/37_Block.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/37_StructuredHash.mv b/vm/stdlib/compiled/latest/stdlib/37_StructuredHash.mv new file mode 100644 index 0000000000..d071695d7d Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/37_StructuredHash.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/38_StarcoinVerifier.mv b/vm/stdlib/compiled/latest/stdlib/38_StarcoinVerifier.mv new file mode 100644 index 0000000000..3cb2ae2807 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/38_StarcoinVerifier.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/39_SnapshotUtil.mv b/vm/stdlib/compiled/latest/stdlib/39_SnapshotUtil.mv new file mode 100644 index 0000000000..6a6cf71cb5 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/39_SnapshotUtil.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/40_SBTVoteStrategy.mv b/vm/stdlib/compiled/latest/stdlib/40_SBTVoteStrategy.mv new file mode 100644 index 0000000000..e3f6b72b98 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/40_SBTVoteStrategy.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/41_GenesisSignerCapability.mv b/vm/stdlib/compiled/latest/stdlib/41_GenesisSignerCapability.mv new file mode 100644 index 0000000000..97db645e89 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/41_GenesisSignerCapability.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/55_NFT.mv b/vm/stdlib/compiled/latest/stdlib/42_NFT.mv similarity index 54% rename from vm/stdlib/compiled/latest/stdlib/55_NFT.mv rename to vm/stdlib/compiled/latest/stdlib/42_NFT.mv index 3d86127a17..70ffe949f4 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/55_NFT.mv and b/vm/stdlib/compiled/latest/stdlib/42_NFT.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/67_NFTGallery.mv b/vm/stdlib/compiled/latest/stdlib/43_NFTGallery.mv similarity index 57% rename from vm/stdlib/compiled/latest/stdlib/67_NFTGallery.mv rename to vm/stdlib/compiled/latest/stdlib/43_NFTGallery.mv index d1e3cb7e60..14374d03a0 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/67_NFTGallery.mv and b/vm/stdlib/compiled/latest/stdlib/43_NFTGallery.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/44_IdentifierNFT.mv b/vm/stdlib/compiled/latest/stdlib/44_IdentifierNFT.mv new file mode 100644 index 0000000000..4965211c8a Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/44_IdentifierNFT.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/45_DAORegistry.mv b/vm/stdlib/compiled/latest/stdlib/45_DAORegistry.mv new file mode 100644 index 0000000000..843b29a42d Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/45_DAORegistry.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/46_DAOAccount.mv b/vm/stdlib/compiled/latest/stdlib/46_DAOAccount.mv new file mode 100644 index 0000000000..9398f6e5f5 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/46_DAOAccount.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/47_Ring.mv b/vm/stdlib/compiled/latest/stdlib/47_Ring.mv new file mode 100644 index 0000000000..d14fabefea Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/47_Ring.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/48_Block.mv b/vm/stdlib/compiled/latest/stdlib/48_Block.mv new file mode 100644 index 0000000000..8f6528d022 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/48_Block.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/49_DAOSpace.mv b/vm/stdlib/compiled/latest/stdlib/49_DAOSpace.mv new file mode 100644 index 0000000000..db35b548ff Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/49_DAOSpace.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/50_GenesisSignerCapability.mv b/vm/stdlib/compiled/latest/stdlib/50_GenesisSignerCapability.mv deleted file mode 100644 index d2321ed4e7..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/50_GenesisSignerCapability.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/50_InstallPluginProposalPlugin.mv b/vm/stdlib/compiled/latest/stdlib/50_InstallPluginProposalPlugin.mv new file mode 100644 index 0000000000..2a0abfb3bb Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/50_InstallPluginProposalPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/51_AnyMemberPlugin.mv b/vm/stdlib/compiled/latest/stdlib/51_AnyMemberPlugin.mv new file mode 100644 index 0000000000..9dc76138c2 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/51_AnyMemberPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/52_Arith.mv b/vm/stdlib/compiled/latest/stdlib/52_Arith.mv new file mode 100644 index 0000000000..1b36c0f723 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/52_Arith.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/38_TreasuryWithdrawDaoProposal.mv b/vm/stdlib/compiled/latest/stdlib/53_TreasuryWithdrawDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/38_TreasuryWithdrawDaoProposal.mv rename to vm/stdlib/compiled/latest/stdlib/53_TreasuryWithdrawDaoProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/39_BlockReward.mv b/vm/stdlib/compiled/latest/stdlib/54_BlockReward.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/39_BlockReward.mv rename to vm/stdlib/compiled/latest/stdlib/54_BlockReward.mv diff --git a/vm/stdlib/compiled/latest/stdlib/55_CheckpointScript.mv b/vm/stdlib/compiled/latest/stdlib/55_CheckpointScript.mv new file mode 100644 index 0000000000..1c29b19776 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/55_CheckpointScript.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/40_Collection.mv b/vm/stdlib/compiled/latest/stdlib/56_Collection.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/40_Collection.mv rename to vm/stdlib/compiled/latest/stdlib/56_Collection.mv diff --git a/vm/stdlib/compiled/latest/stdlib/41_Collection2.mv b/vm/stdlib/compiled/latest/stdlib/57_Collection2.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/41_Collection2.mv rename to vm/stdlib/compiled/latest/stdlib/57_Collection2.mv diff --git a/vm/stdlib/compiled/latest/stdlib/42_Compare.mv b/vm/stdlib/compiled/latest/stdlib/58_Compare.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/42_Compare.mv rename to vm/stdlib/compiled/latest/stdlib/58_Compare.mv diff --git a/vm/stdlib/compiled/latest/stdlib/59_ConfigProposalPlugin.mv b/vm/stdlib/compiled/latest/stdlib/59_ConfigProposalPlugin.mv new file mode 100644 index 0000000000..ed22fe5d1b Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/59_ConfigProposalPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/59_IdentifierNFT.mv b/vm/stdlib/compiled/latest/stdlib/59_IdentifierNFT.mv deleted file mode 100644 index bb53a0ebe9..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/59_IdentifierNFT.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/43_ConsensusStrategy.mv b/vm/stdlib/compiled/latest/stdlib/60_ConsensusStrategy.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/43_ConsensusStrategy.mv rename to vm/stdlib/compiled/latest/stdlib/60_ConsensusStrategy.mv diff --git a/vm/stdlib/compiled/latest/stdlib/44_DaoVoteScripts.mv b/vm/stdlib/compiled/latest/stdlib/61_DaoVoteScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/44_DaoVoteScripts.mv rename to vm/stdlib/compiled/latest/stdlib/61_DaoVoteScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/61_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/61_StdlibUpgradeScripts.mv deleted file mode 100644 index 55b53b9dff..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/61_StdlibUpgradeScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/45_DummyToken.mv b/vm/stdlib/compiled/latest/stdlib/62_DummyToken.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/45_DummyToken.mv rename to vm/stdlib/compiled/latest/stdlib/62_DummyToken.mv diff --git a/vm/stdlib/compiled/latest/stdlib/46_DummyTokenScripts.mv b/vm/stdlib/compiled/latest/stdlib/63_DummyTokenScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/46_DummyTokenScripts.mv rename to vm/stdlib/compiled/latest/stdlib/63_DummyTokenScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/47_EVMAddress.mv b/vm/stdlib/compiled/latest/stdlib/64_EVMAddress.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/47_EVMAddress.mv rename to vm/stdlib/compiled/latest/stdlib/64_EVMAddress.mv diff --git a/vm/stdlib/compiled/latest/stdlib/48_Epoch.mv b/vm/stdlib/compiled/latest/stdlib/65_Epoch.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/48_Epoch.mv rename to vm/stdlib/compiled/latest/stdlib/65_Epoch.mv diff --git a/vm/stdlib/compiled/latest/stdlib/49_FixedPoint32.mv b/vm/stdlib/compiled/latest/stdlib/66_FixedPoint32.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/49_FixedPoint32.mv rename to vm/stdlib/compiled/latest/stdlib/66_FixedPoint32.mv diff --git a/vm/stdlib/compiled/latest/stdlib/51_Oracle.mv b/vm/stdlib/compiled/latest/stdlib/67_Oracle.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/51_Oracle.mv rename to vm/stdlib/compiled/latest/stdlib/67_Oracle.mv diff --git a/vm/stdlib/compiled/latest/stdlib/68_NFTGalleryScripts.mv b/vm/stdlib/compiled/latest/stdlib/68_NFTGalleryScripts.mv deleted file mode 100644 index 4e52141b88..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/68_NFTGalleryScripts.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/52_PriceOracle.mv b/vm/stdlib/compiled/latest/stdlib/68_PriceOracle.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/52_PriceOracle.mv rename to vm/stdlib/compiled/latest/stdlib/68_PriceOracle.mv diff --git a/vm/stdlib/compiled/latest/stdlib/53_STCUSDOracle.mv b/vm/stdlib/compiled/latest/stdlib/69_STCUSDOracle.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/53_STCUSDOracle.mv rename to vm/stdlib/compiled/latest/stdlib/69_STCUSDOracle.mv diff --git a/vm/stdlib/compiled/latest/stdlib/54_Offer.mv b/vm/stdlib/compiled/latest/stdlib/70_Offer.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/54_Offer.mv rename to vm/stdlib/compiled/latest/stdlib/70_Offer.mv diff --git a/vm/stdlib/compiled/latest/stdlib/56_LanguageVersion.mv b/vm/stdlib/compiled/latest/stdlib/71_LanguageVersion.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/56_LanguageVersion.mv rename to vm/stdlib/compiled/latest/stdlib/71_LanguageVersion.mv diff --git a/vm/stdlib/compiled/latest/stdlib/57_MerkleProof.mv b/vm/stdlib/compiled/latest/stdlib/72_MerkleProof.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/57_MerkleProof.mv rename to vm/stdlib/compiled/latest/stdlib/72_MerkleProof.mv diff --git a/vm/stdlib/compiled/latest/stdlib/58_MerkleNFTDistributor.mv b/vm/stdlib/compiled/latest/stdlib/73_MerkleNFTDistributor.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/58_MerkleNFTDistributor.mv rename to vm/stdlib/compiled/latest/stdlib/73_MerkleNFTDistributor.mv diff --git a/vm/stdlib/compiled/latest/stdlib/60_GenesisNFT.mv b/vm/stdlib/compiled/latest/stdlib/74_GenesisNFT.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/60_GenesisNFT.mv rename to vm/stdlib/compiled/latest/stdlib/74_GenesisNFT.mv diff --git a/vm/stdlib/compiled/latest/stdlib/75_StdlibUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/75_StdlibUpgradeScripts.mv new file mode 100644 index 0000000000..dd3fcc9b16 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/75_StdlibUpgradeScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/62_Genesis.mv b/vm/stdlib/compiled/latest/stdlib/76_Genesis.mv similarity index 80% rename from vm/stdlib/compiled/latest/stdlib/62_Genesis.mv rename to vm/stdlib/compiled/latest/stdlib/76_Genesis.mv index ac1c22e95b..fd475392dc 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/62_Genesis.mv and b/vm/stdlib/compiled/latest/stdlib/76_Genesis.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/63_GenesisNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/77_GenesisNFTScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/63_GenesisNFTScripts.mv rename to vm/stdlib/compiled/latest/stdlib/77_GenesisNFTScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/78_Arith.mv b/vm/stdlib/compiled/latest/stdlib/78_Arith.mv deleted file mode 100644 index ab9a3fe638..0000000000 Binary files a/vm/stdlib/compiled/latest/stdlib/78_Arith.mv and /dev/null differ diff --git a/vm/stdlib/compiled/latest/stdlib/78_GrantProposalPlugin.mv b/vm/stdlib/compiled/latest/stdlib/78_GrantProposalPlugin.mv new file mode 100644 index 0000000000..09c28665b7 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/78_GrantProposalPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/64_IdentifierNFTScripts.mv b/vm/stdlib/compiled/latest/stdlib/79_IdentifierNFTScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/64_IdentifierNFTScripts.mv rename to vm/stdlib/compiled/latest/stdlib/79_IdentifierNFTScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/80_MemberProposalPlugin.mv b/vm/stdlib/compiled/latest/stdlib/80_MemberProposalPlugin.mv new file mode 100644 index 0000000000..0a9249fc7e Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/80_MemberProposalPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/65_MintDaoProposal.mv b/vm/stdlib/compiled/latest/stdlib/81_MintDaoProposal.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/65_MintDaoProposal.mv rename to vm/stdlib/compiled/latest/stdlib/81_MintDaoProposal.mv diff --git a/vm/stdlib/compiled/latest/stdlib/66_ModuleUpgradeScripts.mv b/vm/stdlib/compiled/latest/stdlib/82_ModuleUpgradeScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/66_ModuleUpgradeScripts.mv rename to vm/stdlib/compiled/latest/stdlib/82_ModuleUpgradeScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/83_NFTGalleryScripts.mv b/vm/stdlib/compiled/latest/stdlib/83_NFTGalleryScripts.mv new file mode 100644 index 0000000000..8b82da2e46 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/83_NFTGalleryScripts.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/69_OnChainConfigScripts.mv b/vm/stdlib/compiled/latest/stdlib/84_OnChainConfigScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/69_OnChainConfigScripts.mv rename to vm/stdlib/compiled/latest/stdlib/84_OnChainConfigScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/70_PriceOracleAggregator.mv b/vm/stdlib/compiled/latest/stdlib/85_PriceOracleAggregator.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/70_PriceOracleAggregator.mv rename to vm/stdlib/compiled/latest/stdlib/85_PriceOracleAggregator.mv diff --git a/vm/stdlib/compiled/latest/stdlib/71_PriceOracleScripts.mv b/vm/stdlib/compiled/latest/stdlib/86_PriceOracleScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/71_PriceOracleScripts.mv rename to vm/stdlib/compiled/latest/stdlib/86_PriceOracleScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/87_SalaryGovPlugin.mv b/vm/stdlib/compiled/latest/stdlib/87_SalaryGovPlugin.mv new file mode 100644 index 0000000000..d9b47366ba Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/87_SalaryGovPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/72_Signature.mv b/vm/stdlib/compiled/latest/stdlib/88_Signature.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/72_Signature.mv rename to vm/stdlib/compiled/latest/stdlib/88_Signature.mv diff --git a/vm/stdlib/compiled/latest/stdlib/73_SharedEd25519PublicKey.mv b/vm/stdlib/compiled/latest/stdlib/89_SharedEd25519PublicKey.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/73_SharedEd25519PublicKey.mv rename to vm/stdlib/compiled/latest/stdlib/89_SharedEd25519PublicKey.mv diff --git a/vm/stdlib/compiled/latest/stdlib/90_StakeToSBTPlugin.mv b/vm/stdlib/compiled/latest/stdlib/90_StakeToSBTPlugin.mv new file mode 100644 index 0000000000..776de6a488 Binary files /dev/null and b/vm/stdlib/compiled/latest/stdlib/90_StakeToSBTPlugin.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/74_TransactionTimeout.mv b/vm/stdlib/compiled/latest/stdlib/91_TransactionTimeout.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/74_TransactionTimeout.mv rename to vm/stdlib/compiled/latest/stdlib/91_TransactionTimeout.mv diff --git a/vm/stdlib/compiled/latest/stdlib/75_TransactionManager.mv b/vm/stdlib/compiled/latest/stdlib/92_TransactionManager.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/75_TransactionManager.mv rename to vm/stdlib/compiled/latest/stdlib/92_TransactionManager.mv diff --git a/vm/stdlib/compiled/latest/stdlib/76_TransferScripts.mv b/vm/stdlib/compiled/latest/stdlib/93_TransferScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/76_TransferScripts.mv rename to vm/stdlib/compiled/latest/stdlib/93_TransferScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/77_TreasuryScripts.mv b/vm/stdlib/compiled/latest/stdlib/94_TreasuryScripts.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/77_TreasuryScripts.mv rename to vm/stdlib/compiled/latest/stdlib/94_TreasuryScripts.mv diff --git a/vm/stdlib/compiled/latest/stdlib/79_U256.mv b/vm/stdlib/compiled/latest/stdlib/95_U256.mv similarity index 89% rename from vm/stdlib/compiled/latest/stdlib/79_U256.mv rename to vm/stdlib/compiled/latest/stdlib/95_U256.mv index f1cf9559b8..0d9c2da9fa 100644 Binary files a/vm/stdlib/compiled/latest/stdlib/79_U256.mv and b/vm/stdlib/compiled/latest/stdlib/95_U256.mv differ diff --git a/vm/stdlib/compiled/latest/stdlib/80_YieldFarming.mv b/vm/stdlib/compiled/latest/stdlib/96_YieldFarming.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/80_YieldFarming.mv rename to vm/stdlib/compiled/latest/stdlib/96_YieldFarming.mv diff --git a/vm/stdlib/compiled/latest/stdlib/81_YieldFarmingV2.mv b/vm/stdlib/compiled/latest/stdlib/97_YieldFarmingV2.mv similarity index 100% rename from vm/stdlib/compiled/latest/stdlib/81_YieldFarmingV2.mv rename to vm/stdlib/compiled/latest/stdlib/97_YieldFarmingV2.mv diff --git a/vm/stdlib/src/lib.rs b/vm/stdlib/src/lib.rs index 1cb55fa1f3..e49c0f594b 100644 --- a/vm/stdlib/src/lib.rs +++ b/vm/stdlib/src/lib.rs @@ -64,7 +64,7 @@ pub const STDLIB_DIR: Dir = starcoin_framework::SOURCES_DIR; // The current stdlib that is freshly built. This will never be used in deployment so we don't need // to pull the same trick here in order to include this in the Rust binary. static G_FRESH_MOVELANG_STDLIB: Lazy>> = Lazy::new(|| { - build_stdlib(STARCOIN_FRAMEWORK_SOURCES.files.as_slice()) + build_stdlib(STARCOIN_FRAMEWORK_SOURCES.files().as_slice()) .values() .map(|m| { let mut blob = vec![]; @@ -184,7 +184,7 @@ fn module_to_package( } pub fn stdlib_files() -> Vec { - STARCOIN_FRAMEWORK_SOURCES.files.clone() + STARCOIN_FRAMEWORK_SOURCES.files() } pub fn build_stdlib(targets: &[String]) -> BTreeMap { diff --git a/vm/stdlib/src/main.rs b/vm/stdlib/src/main.rs index d4c0cbd451..21f4d2d1b1 100644 --- a/vm/stdlib/src/main.rs +++ b/vm/stdlib/src/main.rs @@ -296,7 +296,7 @@ fn main() { std::env::set_current_dir(&base_path).expect("failed to change directory"); let sources = &STARCOIN_FRAMEWORK_SOURCES; - let new_modules = build_stdlib(&sources.files); + let new_modules = build_stdlib(&sources.files()); if !no_check_compatibility { if let Some((pre_stable_version, pre_stable_modules)) = pre_version diff --git a/vm/vm-runtime/src/errors.rs b/vm/vm-runtime/src/errors.rs index 34937d01ba..71d6b2ea89 100644 --- a/vm/vm-runtime/src/errors.rs +++ b/vm/vm-runtime/src/errors.rs @@ -44,7 +44,7 @@ pub fn convert_prologue_runtime_error(error: VMError) -> Result<(), VMStatus> { let status = error.into_vm_status(); Err(match status { VMStatus::Executed => VMStatus::Executed, - VMStatus::MoveAbort(_location, code) => { + VMStatus::MoveAbort(location, code) => { let (category, reason) = error_split(code); let new_major_status = match (category, reason) { (REQUIRES_ADDRESS, PROLOGUE_ACCOUNT_DOES_NOT_EXIST) => { @@ -88,8 +88,8 @@ pub fn convert_prologue_runtime_error(error: VMError) -> Result<(), VMStatus> { } (category, reason) => { warn!( - "prologue runtime unknown: category({}), reason:({})", - category, reason + "prologue runtime unknown: category({}), reason:({}), location:({})", + category, reason, location ); StatusCode::UNEXPECTED_ERROR_FROM_KNOWN_MOVE_FUNCTION }