diff --git a/Cargo.lock b/Cargo.lock index 93ce0c96f4..e59b9cbda0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1058,12 +1058,6 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64ct" version = "1.5.3" @@ -1654,7 +1648,6 @@ dependencies = [ "js-sys", "num-integer", "num-traits", - "serde", "time 0.1.43", "wasm-bindgen", "winapi 0.3.9", @@ -2521,16 +2514,6 @@ dependencies = [ "darling_macro 0.14.3", ] -[[package]] -name = "darling" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" -dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - [[package]] name = "darling_core" version = "0.9.0" @@ -2587,20 +2570,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "darling_core" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.86", - "quote 1.0.36", - "strsim 0.11.1", - "syn 2.0.72", -] - [[package]] name = "darling_macro" version = "0.9.0" @@ -2645,17 +2614,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "darling_macro" -version = "0.20.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" -dependencies = [ - "darling_core 0.20.10", - "quote 1.0.36", - "syn 2.0.72", -] - [[package]] name = "darwin-libproc" version = "0.1.2" @@ -2848,7 +2806,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", - "serde", ] [[package]] @@ -3115,7 +3072,7 @@ dependencies = [ "rustc_version 0.2.3", "serde", "serde_json", - "serde_with 1.14.0", + "serde_with", "url 2.3.1", "void", ] @@ -4454,7 +4411,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg 1.1.0", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -4465,7 +4421,6 @@ checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown 0.14.5", - "serde", ] [[package]] @@ -9632,25 +9587,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" dependencies = [ "serde", - "serde_with_macros 1.5.2", -] - -[[package]] -name = "serde_with" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" -dependencies = [ - "base64 0.22.1", - "chrono", - "hex", - "indexmap 1.9.3", - "indexmap 2.3.0", - "serde", - "serde_derive", - "serde_json", - "serde_with_macros 3.9.0", - "time 0.3.36", + "serde_with_macros", ] [[package]] @@ -9665,18 +9602,6 @@ dependencies = [ "syn 1.0.107", ] -[[package]] -name = "serde_with_macros" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" -dependencies = [ - "darling 0.20.10", - "proc-macro2 1.0.86", - "quote 1.0.36", - "syn 2.0.72", -] - [[package]] name = "serde_yaml" version = "0.8.26" @@ -12255,7 +12180,6 @@ version = "2.0.1" dependencies = [ "anyhow", "bcs-ext", - "byteorder", "bytes 1.6.1", "claims", "forkable-jellyfish-merkle", @@ -12264,27 +12188,20 @@ dependencies = [ "move-binary-format", "move-bytecode-verifier", "move-core-types", - "move-table-extension", "move-vm-runtime", "move-vm-types", - "num_enum", "once_cell", "proptest", "proptest-derive 0.3.0", "rand 0.8.5", - "rand_core 0.6.4", "schemars", "serde", "serde_bytes", "serde_json", - "serde_with 3.9.0", - "serde_yaml", "starcoin-accumulator", "starcoin-crypto", "starcoin-uint", "starcoin-vm-types", - "strum", - "strum_macros", "thiserror", ] diff --git a/chain/tests/block_test_utils.rs b/chain/tests/block_test_utils.rs index 76fa72a87d..9c85051549 100644 --- a/chain/tests/block_test_utils.rs +++ b/chain/tests/block_test_utils.rs @@ -15,13 +15,15 @@ use starcoin_storage::storage::StorageInstance; use starcoin_storage::Storage; use starcoin_transaction_builder::{empty_txn_payload, DEFAULT_EXPIRATION_TIME}; use starcoin_types::block::BlockHeaderExtra; -use starcoin_types::proptest_types::{AccountInfoUniverse, Index, SignatureCheckedTransactionGen}; use starcoin_types::transaction::{SignedUserTransaction, Transaction, TransactionPayload}; use starcoin_types::{ block::{Block, BlockBody, BlockHeader}, block_metadata::BlockMetadata, U256, }; +use starcoin_vm_types::proptest_types::{ + AccountInfoUniverse, Index, SignatureCheckedTransactionGen, +}; use std::convert::TryFrom; use std::sync::Arc; diff --git a/executor/benchmark/src/lib.rs b/executor/benchmark/src/lib.rs index 964e3cf2f9..1f23ee2850 100644 --- a/executor/benchmark/src/lib.rs +++ b/executor/benchmark/src/lib.rs @@ -15,8 +15,8 @@ use starcoin_statedb::ChainStateDB; use starcoin_storage::storage::StorageInstance; use starcoin_storage::Storage; use starcoin_transaction_builder::{ - create_signed_txn_with_association_account, encode_create_account_script_function, - encode_transfer_script_by_token_code, encode_transfer_script_function, + create_signed_txn_with_association_account, encode_transfer_script_by_token_code, + encode_transfer_script_function, }; use starcoin_types::{ account_address, @@ -25,18 +25,17 @@ use starcoin_types::{ transaction::{Transaction, TransactionPayload}, }; use starcoin_vm_types::account_config::G_STC_TOKEN_CODE; -use starcoin_vm_types::genesis_config::StdlibVersion; -use starcoin_vm_types::token::stc; -use starcoin_vm_types::transaction::authenticator::AuthenticationKey; use std::sync::mpsc; use std::sync::Arc; struct AccountData { + #[allow(dead_code)] public_key: Ed25519PublicKey, address: AccountAddress, } impl AccountData { + #[allow(dead_code)] pub fn public_key(&self) -> &Ed25519PublicKey { &self.public_key } diff --git a/executor/tests/executor_test.rs b/executor/tests/executor_test.rs index 4708c65020..cbb07528ae 100644 --- a/executor/tests/executor_test.rs +++ b/executor/tests/executor_test.rs @@ -7,9 +7,8 @@ use starcoin_config::{BuiltinNetworkID, ChainNetwork}; use starcoin_executor::validate_transaction; use starcoin_logger::prelude::*; use starcoin_transaction_builder::{ - build_batch_payload_same_amount, build_transfer_txn, encode_create_account_script_function, - encode_transfer_script_by_token_code, raw_peer_to_peer_txn, DEFAULT_EXPIRATION_TIME, - DEFAULT_MAX_GAS_AMOUNT, + build_batch_payload_same_amount, build_transfer_txn, encode_transfer_script_by_token_code, + raw_peer_to_peer_txn, DEFAULT_EXPIRATION_TIME, DEFAULT_MAX_GAS_AMOUNT, }; use starcoin_types::account::peer_to_peer_txn; use starcoin_types::identifier::Identifier; @@ -197,7 +196,7 @@ fn test_batch_transfer() -> Result<()> { #[stest::test] fn test_txn_verify_err_case() -> Result<()> { - let (chain_state, net) = prepare_genesis(); + let (chain_state, _net) = prepare_genesis(); let mut vm = StarcoinVM::new(None, &chain_state); let alice = Account::new(); let bob = Account::new(); diff --git a/scripts/nextest.sh b/scripts/nextest.sh index e80b408f5a..151e4f47a1 100755 --- a/scripts/nextest.sh +++ b/scripts/nextest.sh @@ -32,6 +32,8 @@ cargo nextest run \ -p starcoin-chain \ -p starcoin-network \ -p starcoin-storage \ +-p starcoin-types \ +-p starcoin-sync \ --retries 2 --build-jobs 8 --test-threads 12 --no-fail-fast --failure-output immediate-final diff --git a/storage/src/transaction/test.rs b/storage/src/transaction/test.rs index 83df1a6ded..050bebaabc 100644 --- a/storage/src/transaction/test.rs +++ b/storage/src/transaction/test.rs @@ -8,9 +8,9 @@ use crate::storage::StorageInstance; use crate::{Storage, TransactionStore}; use proptest::{collection::vec, prelude::*}; use starcoin_config::RocksdbConfig; -use starcoin_types::{ - proptest_types::{AccountInfoUniverse, Index, SignatureCheckedTransactionGen}, - transaction::Transaction, +use starcoin_types::transaction::Transaction; +use starcoin_vm_types::proptest_types::{ + AccountInfoUniverse, Index, SignatureCheckedTransactionGen, }; fn init_store( diff --git a/types/Cargo.toml b/types/Cargo.toml index d677aefad4..08b9b584ae 100644 --- a/types/Cargo.toml +++ b/types/Cargo.toml @@ -1,15 +1,12 @@ [dependencies] anyhow = { workspace = true } bcs-ext = { workspace = true } -byteorder = { features = ["std"], workspace = true } bytes = { workspace = true } forkable-jellyfish-merkle = { workspace = true } hex = { features = ["serde"], workspace = true } -num_enum = { workspace = true } proptest = { features = ["std"], optional = true, workspace = true } proptest-derive = { optional = true, workspace = true } rand = { workspace = true } -rand_core = { default-features = false, workspace = true } schemars = { workspace = true } serde = { features = ["derive"], workspace = true } serde_json = { workspace = true } @@ -22,18 +19,14 @@ lazy_static = { workspace = true } move-binary-format = { workspace = true } move-bytecode-verifier = { workspace = true } move-core-types = { workspace = true } -move-table-extension = { workspace = true } move-vm-runtime = { workspace = true } move-vm-types = { workspace = true } once_cell = { workspace = true } serde_bytes = { workspace = true } -serde_with = { workspace = true } -serde_yaml = { workspace = true } -strum = { workspace = true } -strum_macros = { workspace = true } [dev-dependencies] claims = { workspace = true } +starcoin-vm-types = { workspace = true } [features] default = [] diff --git a/types/src/block/legacy.rs b/types/src/block/legacy.rs index 401dc2d86a..9360e2968e 100644 --- a/types/src/block/legacy.rs +++ b/types/src/block/legacy.rs @@ -5,6 +5,7 @@ use starcoin_crypto::{ hash::{CryptoHash, CryptoHasher, PlainCryptoHash}, HashValue, }; +use starcoin_vm_types::transaction::authenticator::AuthenticationKey; #[derive(Clone, Debug, Hash, Eq, PartialEq, Serialize, CryptoHasher, CryptoHash, JsonSchema)] #[serde(rename = "BlockHeader")] @@ -19,6 +20,9 @@ pub struct BlockHeader { number: BlockNumber, /// Block author. author: AccountAddress, + /// Block author auth key. + /// this field is deprecated + author_auth_key: Option, /// The transaction accumulator root hash after executing this block. txn_accumulator_root: HashValue, /// The parent block info's block accumulator root hash. @@ -47,6 +51,7 @@ impl BlockHeader { timestamp: u64, number: BlockNumber, author: AccountAddress, + author_auth_key: Option, txn_accumulator_root: HashValue, block_accumulator_root: HashValue, state_root: HashValue, @@ -64,6 +69,7 @@ impl BlockHeader { number, timestamp, author, + author_auth_key, txn_accumulator_root, state_root, gas_used, @@ -94,6 +100,7 @@ impl From for BlockHeader { timestamp: v.timestamp, number: v.number, author: v.author, + author_auth_key: None, txn_accumulator_root: v.txn_accumulator_root, block_accumulator_root: v.block_accumulator_root, state_root: v.state_root, @@ -141,6 +148,7 @@ impl<'de> Deserialize<'de> for BlockHeader { timestamp: u64, number: BlockNumber, author: AccountAddress, + author_auth_key: Option, txn_accumulator_root: HashValue, block_accumulator_root: HashValue, state_root: HashValue, @@ -158,6 +166,7 @@ impl<'de> Deserialize<'de> for BlockHeader { header_data.timestamp, header_data.number, header_data.author, + header_data.author_auth_key, header_data.txn_accumulator_root, header_data.block_accumulator_root, header_data.state_root, diff --git a/types/src/block/tests.rs b/types/src/block/tests.rs index cd9a7ef36d..d0f5b82f71 100644 --- a/types/src/block/tests.rs +++ b/types/src/block/tests.rs @@ -48,6 +48,7 @@ fn this_header() -> BlockHeader { timestamp, number, author, + None, txn_accumulator_root, block_accumulator_root, state_root, diff --git a/types/src/lib.rs b/types/src/lib.rs index dd62d501aa..a043f97ff3 100644 --- a/types/src/lib.rs +++ b/types/src/lib.rs @@ -46,9 +46,6 @@ pub mod event { pub mod filter; -#[cfg(any(test, feature = "fuzzing"))] -pub mod proptest_types; - pub mod sign_message { pub use starcoin_vm_types::sign_message::*; } diff --git a/types/src/proptest_types.rs b/types/src/proptest_types.rs deleted file mode 100644 index 2c7509b3c6..0000000000 --- a/types/src/proptest_types.rs +++ /dev/null @@ -1,4 +0,0 @@ -// Copyright (c) The Starcoin Core Contributors -// SPDX-License-Identifier: Apache-2.0 - -pub use starcoin_vm_types::proptest_types::*;