diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b7b1d7ec5e1..08492a3f518 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -124,11 +124,12 @@ steps: # artifact_paths: # - "rainbow-bridge/logs/**/*.log" - - label: "cargo release check" + - label: "cargo check nearcore library (without Cargo.lock)" command: | source ~/.cargo/env rm Cargo.lock - RUSTFLAGS='-D warnings' cargo build + cd nearcore + RUSTFLAGS='-D warnings' cargo check timeout: 30 agents: diff --git a/CODEOWNERS b/CODEOWNERS index a97641b2772..dddd8161e3d 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -22,7 +22,8 @@ /tools/indexer/ @khorolets @frol /core/ @bowenwang1996 @frol @evgenykuzyakov @nearmax @SkidanovAlex -/neard/ @bowenwang1996 @frol @evgenykuzyakov @nearmax @SkidanovAlex +/neard/ @bowenwang1996 @frol +/nearcore/ @bowenwang1996 @frol @evgenykuzyakov @SkidanovAlex /.buildkite/ @chefsale @mhalambek /scripts/ @chefsale @mhalambek diff --git a/Cargo.lock b/Cargo.lock index 44f4b48ca86..e559bb1c6b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2050,7 +2050,7 @@ dependencies = [ "near-network", "near-primitives", "near-runtime-utils", - "neard", + "nearcore", "node-runtime", "serde", "serde_json", @@ -2077,7 +2077,7 @@ dependencies = [ "near-store", "near-telemetry", "near-test-contracts", - "neard", + "nearcore", "tempfile", ] @@ -2629,7 +2629,7 @@ version = "0.1.0" dependencies = [ "clap 2.33.3", "near-crypto", - "neard", + "nearcore", ] [[package]] @@ -2769,7 +2769,7 @@ dependencies = [ "near-primitives", "near-store", "near-test-contracts", - "neard", + "nearcore", "node-runtime", "rand 0.7.3", "reqwest", @@ -3121,7 +3121,7 @@ dependencies = [ "near-store", "near-telemetry", "near-test-contracts", - "neard", + "nearcore", "num-rational", "rand 0.7.3", "reed-solomon-erasure", @@ -3247,7 +3247,7 @@ dependencies = [ "near-client", "near-crypto", "near-primitives", - "neard", + "nearcore", "node-runtime", "rocksdb", "serde", @@ -3682,41 +3682,20 @@ dependencies = [ [[package]] name = "nearcore" -version = "0.1.0" -dependencies = [ - "funty", - "near-chain", - "near-chain-configs", - "near-crypto", - "near-jsonrpc", - "near-logger-utils", - "near-network", - "near-primitives", - "near-store", - "neard", - "node-runtime", - "rand 0.7.3", - "restored-receipts-verifier", - "runtime-params-estimator", - "testlib", -] - -[[package]] -name = "neard" version = "1.2.0" dependencies = [ "actix", "actix-rt", + "actix_derive", "awc", "borsh", "byteorder", "chrono", - "clap 2.33.3", "delay-detector", "dirs", "easy-ext", + "funty", "futures", - "git-version", "jemallocator", "lazy-static-include", "near-actix-test-utils", @@ -3739,15 +3718,41 @@ dependencies = [ "near-telemetry", "node-runtime", "num-rational", - "openssl-probe", "primitive-types", "rand 0.7.3", + "restored-receipts-verifier", + "runtime-params-estimator", "serde", "serde_json", "tempfile", "testlib", "thiserror", "tracing", +] + +[[package]] +name = "neard" +version = "1.2.0" +dependencies = [ + "actix", + "clap 2.33.3", + "git-version", + "near-chain", + "near-chain-configs", + "near-client", + "near-epoch-manager", + "near-jsonrpc", + "near-network", + "near-performance-metrics", + "near-primitives", + "near-rosetta-rpc", + "near-rust-allocator-proxy", + "near-store", + "nearcore", + "node-runtime", + "openssl-probe", + "testlib", + "tracing", "tracing-subscriber", ] @@ -4777,7 +4782,7 @@ dependencies = [ "near-crypto", "near-jsonrpc-client", "near-primitives", - "neard", + "nearcore", "testlib", ] @@ -4790,7 +4795,7 @@ dependencies = [ "near-jsonrpc", "near-primitives", "near-store", - "neard", + "nearcore", "serde_json", ] @@ -4864,7 +4869,7 @@ dependencies = [ "near-store", "near-vm-logic", "near-vm-runner", - "neard", + "nearcore", "node-runtime", "num-rational", "num-traits", @@ -5290,7 +5295,7 @@ dependencies = [ "near-network", "near-primitives", "near-store", - "neard", + "nearcore", "node-runtime", "serde_json", ] @@ -5374,7 +5379,7 @@ dependencies = [ "near-logger-utils", "near-primitives", "near-store", - "neard", + "nearcore", "serde_json", "testlib", ] @@ -5563,7 +5568,7 @@ dependencies = [ "near-store", "near-test-contracts", "near-vm-errors", - "neard", + "nearcore", "node-runtime", "num-rational", "rand 0.7.3", diff --git a/Cargo.toml b/Cargo.toml index 3acb11faa40..339a728f956 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,5 @@ -[package] -name = "nearcore" -version = "0.1.0" -authors = ["Near Inc "] -edition = "2018" - [workspace] +resolver = "2" members = [ "core/chain-configs", "core/crypto", @@ -36,7 +31,8 @@ members = [ "test-utils/loadtester", "test-utils/state-viewer", "test-utils/store-validator", - "neard/", + "neard", + "nearcore", "tools/rpctypegen/core", "tools/rpctypegen/macro", "genesis-tools/genesis-csv-to-json", @@ -49,36 +45,12 @@ members = [ "tools/restored-receipts-verifier" ] -[dev-dependencies] -# Pin dependency to avoid compilation errors -funty = "=1.1.0" - -rand = "0.7" - -near-logger-utils = { path = "./test-utils/logger" } -near-chain-configs = { path = "./core/chain-configs" } -near-crypto = { path = "./core/crypto" } -near-primitives = { path = "./core/primitives" } -near-store = { path = "./core/store" } -runtime-params-estimator = { path = "./runtime/runtime-params-estimator", default_features = false } -restored-receipts-verifier = { path = "./tools/restored-receipts-verifier"} -near-chain = { path = "./chain/chain" } - -node-runtime = { path = "./runtime/runtime" } - -near-jsonrpc = { path = "./chain/jsonrpc" } -near-network = { path = "./chain/network" } - -neard = { path = "./neard"} - -testlib = { path = "./test-utils/testlib" } - [patch.crates-io] ethereum-types = { path = "./patches/ethereum-types-0.10.0-to-0.11.0" } # Temporary wasmer fork which disables rayon (parallel compilation) # https://github.com/wasmerio/wasmer/pull/2262 # Revome this when the new version of wasmer is published. -wasmer-compiler-singlepass = { git = "https://github.com/near/wasmer", branch = "1.0.2-single-threaded"} +wasmer-compiler-singlepass = { git = "https://github.com/near/wasmer", branch = "1.0.2-single-threaded" } [profile.release] lto = true # Enable full link-time optimization. @@ -101,38 +73,3 @@ opt-level = 3 # BLS library is too slow to use in debug [profile.dev.package.bs58] opt-level = 3 # bs58 library is too slow to use in debug - -[features] -performance_stats = ["neard/performance_stats", "near-network/performance_stats"] -memory_stats = ["neard/memory_stats"] -c_memory_stats = ["neard/c_memory_stats"] -expensive_tests = ["neard/expensive_tests"] -regression_tests = [] -old_tests = [] -adversarial = ["neard/adversarial", "near-jsonrpc/adversarial", "near-store/adversarial"] -no_cache = ["neard/no_cache"] -metric_recorder = ["neard/metric_recorder"] -delay_detector = ["neard/delay_detector"] -rosetta_rpc = ["neard/rosetta_rpc"] -nightly_protocol = ["near-primitives/nightly_protocol", "near-jsonrpc/nightly_protocol", "testlib/nightly_protocol", "neard/nightly_protocol"] -nightly_protocol_features = ["nightly_protocol", "neard/nightly_protocol_features", "protocol_feature_evm", "protocol_feature_block_header_v3", "protocol_feature_alt_bn128", "protocol_feature_add_account_versions", "protocol_feature_tx_size_limit", "protocol_feature_allow_create_account_on_delete", "testlib/nightly_protocol_features", "protocol_feature_fix_storage_usage", "protocol_feature_restore_receipts_after_fix", "protocol_feature_cap_max_gas_price"] -protocol_feature_evm = ["neard/protocol_feature_evm", "testlib/protocol_feature_evm", "runtime-params-estimator/protocol_feature_evm"] -protocol_feature_alt_bn128 = ["neard/protocol_feature_alt_bn128", "testlib/protocol_feature_alt_bn128", "runtime-params-estimator/protocol_feature_alt_bn128"] -protocol_feature_block_header_v3 = ["near-primitives/protocol_feature_block_header_v3", "near-chain/protocol_feature_block_header_v3", "neard/protocol_feature_block_header_v3"] -protocol_feature_tx_size_limit = ["near-primitives/protocol_feature_tx_size_limit", "node-runtime/protocol_feature_tx_size_limit", "neard/protocol_feature_tx_size_limit"] -protocol_feature_allow_create_account_on_delete = ["testlib/protocol_feature_allow_create_account_on_delete", "near-primitives/protocol_feature_allow_create_account_on_delete", "node-runtime/protocol_feature_allow_create_account_on_delete", "neard/protocol_feature_allow_create_account_on_delete"] -protocol_feature_add_account_versions = ["near-primitives/protocol_feature_add_account_versions"] -protocol_feature_fix_storage_usage = ["near-primitives/protocol_feature_fix_storage_usage", "neard/protocol_feature_fix_storage_usage", "node-runtime/protocol_feature_fix_storage_usage"] -protocol_feature_restore_receipts_after_fix = ["near-primitives/protocol_feature_restore_receipts_after_fix", "near-chain/protocol_feature_restore_receipts_after_fix", "neard/protocol_feature_restore_receipts_after_fix", "node-runtime/protocol_feature_restore_receipts_after_fix", "restored-receipts-verifier/protocol_feature_restore_receipts_after_fix"] -protocol_feature_cap_max_gas_price = ["near-primitives/protocol_feature_cap_max_gas_price", "neard/protocol_feature_cap_max_gas_price", "near-chain/protocol_feature_cap_max_gas_price"] - -# enable this to build neard with wasmer 1.0 runner -# now if none of wasmer0_default, wasmer1_default or wasmtime_default is enabled, wasmer0 would be default -wasmer1_default = ["node-runtime/wasmer1_default"] -wasmer0_default = ["node-runtime/wasmer0_default"] -wasmtime_default = ["node-runtime/wasmtime_default"] -# enable some of these to run runtime tests with wasmer 1.0, 0.x and wasmtime vm enabled -# but would not change default runner used by neard -wasmer1_vm = ["node-runtime/wasmer1_vm"] -wasmer0_vm = ["node-runtime/wasmer0_vm"] -wasmtime_vm = ["node-runtime/wasmtime_vm"] diff --git a/chain/chunks/Cargo.toml b/chain/chunks/Cargo.toml index 6b34196bc2b..c902a8d9b38 100644 --- a/chain/chunks/Cargo.toml +++ b/chain/chunks/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Near Inc "] edition = "2018" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" futures = "0.3" rand = "0.7" chrono = "0.4.6" diff --git a/chain/client-primitives/Cargo.toml b/chain/client-primitives/Cargo.toml index ac30ebde123..d8d008a9fbb 100644 --- a/chain/client-primitives/Cargo.toml +++ b/chain/client-primitives/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" chrono = { version = "0.4.4", features = ["serde"] } serde = { version = "1", features = ["derive"] } strum = { version = "0.20", features = ["derive"] } diff --git a/chain/client/Cargo.toml b/chain/client/Cargo.toml index da7c7695391..8ba87da561f 100644 --- a/chain/client/Cargo.toml +++ b/chain/client/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] ansi_term = "0.12" -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" actix-rt = "2" futures = "0.3" chrono = { version = "0.4.4", features = ["serde"] } @@ -45,7 +45,7 @@ delay-detector = { path = "../../tools/delay_detector", optional = true } near-logger-utils = { path = "../../test-utils/logger" } near-actix-test-utils = { path = "../../test-utils/actix-test-utils" } testlib = { path = "../../test-utils/testlib" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-test-contracts = { path = "../../runtime/near-test-contracts" } [features] diff --git a/chain/client/src/client.rs b/chain/client/src/client.rs index 8b9987122ed..b2dc6686d09 100644 --- a/chain/client/src/client.rs +++ b/chain/client/src/client.rs @@ -1685,7 +1685,7 @@ mod test { use near_primitives::version::ProtocolFeature; use near_primitives::version::PROTOCOL_VERSION; use near_store::test_utils::create_test_store; - use neard::config::GenesisExt; + use nearcore::config::GenesisExt; use crate::test_utils::TestEnv; use near_network::test_utils::MockNetworkAdapter; @@ -1700,7 +1700,7 @@ mod test { pub fn create_nightshade_runtimes(genesis: &Genesis, n: usize) -> Vec> { (0..n) .map(|_| { - Arc::new(neard::NightshadeRuntime::new( + Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis, diff --git a/chain/client/tests/challenges.rs b/chain/client/tests/challenges.rs index 2420f43eb0c..f0eb6c7b943 100644 --- a/chain/client/tests/challenges.rs +++ b/chain/client/tests/challenges.rs @@ -31,8 +31,8 @@ use near_primitives::utils::MaybeValidated; use near_primitives::validator_signer::InMemoryValidatorSigner; use near_primitives::version::PROTOCOL_VERSION; use near_store::test_utils::create_test_store; -use neard::config::{GenesisExt, FISHERMEN_THRESHOLD}; -use neard::NightshadeRuntime; +use nearcore::config::{GenesisExt, FISHERMEN_THRESHOLD}; +use nearcore::NightshadeRuntime; use num_rational::Rational; #[test] @@ -270,7 +270,7 @@ fn test_verify_chunk_invalid_state_challenge() { let store1 = create_test_store(); let genesis = Genesis::test(vec!["test0", "test1"], 1); let transaction_validity_period = genesis.config.transaction_validity_period; - let runtimes: Vec> = vec![Arc::new(neard::NightshadeRuntime::new( + let runtimes: Vec> = vec![Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), store1, &genesis, @@ -562,7 +562,7 @@ fn test_fishermen_challenge() { let mut genesis = Genesis::test(vec!["test0", "test1", "test2"], 1); genesis.config.epoch_length = 5; let create_runtime = || -> Arc { - Arc::new(neard::NightshadeRuntime::new( + Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis.clone(), @@ -624,7 +624,7 @@ fn test_challenge_in_different_epoch() { genesis.config.epoch_length = 2; // genesis.config.validator_kickout_threshold = 10; let network_adapter = Arc::new(MockNetworkAdapter::default()); - let runtime1 = Arc::new(neard::NightshadeRuntime::new( + let runtime1 = Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis.clone(), @@ -632,7 +632,7 @@ fn test_challenge_in_different_epoch() { vec![], None, )); - let runtime2 = Arc::new(neard::NightshadeRuntime::new( + let runtime2 = Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis.clone(), diff --git a/chain/client/tests/process_blocks.rs b/chain/client/tests/process_blocks.rs index f33403a8aae..7179ca1d0ac 100644 --- a/chain/client/tests/process_blocks.rs +++ b/chain/client/tests/process_blocks.rs @@ -59,15 +59,15 @@ use near_primitives::views::{ }; use near_store::get; use near_store::test_utils::create_test_store; -use neard::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; +use nearcore::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; #[cfg(feature = "protocol_feature_restore_receipts_after_fix")] -use neard::migrations::load_migration_data; -use neard::NEAR_BASE; +use nearcore::migrations::load_migration_data; +use nearcore::NEAR_BASE; pub fn create_nightshade_runtimes(genesis: &Genesis, n: usize) -> Vec> { (0..n) .map(|_| { - Arc::new(neard::NightshadeRuntime::new( + Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), genesis, @@ -1786,7 +1786,7 @@ fn test_invalid_block_root() { fn test_incorrect_validator_key_produce_block() { let genesis = Genesis::test(vec!["test0", "test1"], 2); let chain_genesis = ChainGenesis::from(&genesis); - let runtime_adapter: Arc = Arc::new(neard::NightshadeRuntime::new( + let runtime_adapter: Arc = Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis, @@ -2924,7 +2924,7 @@ mod protocol_feature_restore_receipts_after_fix_tests { genesis.config.epoch_length = EPOCH_LENGTH; genesis.config.protocol_version = protocol_version; let chain_genesis = ChainGenesis::from(&genesis); - let runtime = neard::NightshadeRuntime::new( + let runtime = nearcore::NightshadeRuntime::new( Path::new("."), create_test_store(), &genesis, diff --git a/chain/indexer/Cargo.toml b/chain/indexer/Cargo.toml index 7397c838f47..274929aad91 100644 --- a/chain/indexer/Cargo.toml +++ b/chain/indexer/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Near Inc "] edition = "2018" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" async-recursion = "0.3.2" tracing = "0.1.13" futures = "0.3.5" @@ -14,7 +14,7 @@ serde = { version = "1", features = [ "derive" ] } serde_json = "1.0.55" tokio = { version = "1.1", features = ["time", "sync"] } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-client = { path = "../client" } near-chain-configs = { path = "../../core/chain-configs" } near-crypto = { path = "../../core/crypto" } diff --git a/chain/indexer/src/lib.rs b/chain/indexer/src/lib.rs index f98c4c9e289..a115e2aa8c9 100644 --- a/chain/indexer/src/lib.rs +++ b/chain/indexer/src/lib.rs @@ -9,7 +9,7 @@ //! [example]: https://github.com/nearprotocol/nearcore/tree/master/tools/indexer/example use tokio::sync::mpsc; -pub use neard::{get_default_home, init_configs, NearConfig}; +pub use nearcore::{get_default_home, init_configs, NearConfig}; mod streamer; pub use self::streamer::{ @@ -19,7 +19,7 @@ pub use self::streamer::{ }; pub use near_primitives; -/// Config wrapper to simplify signature and usage of `neard::init_configs` +/// Config wrapper to simplify signature and usage of `nearcore::init_configs` /// function by making args more explicit via struct #[derive(Debug, Clone)] pub struct InitConfigArgs { @@ -75,7 +75,7 @@ pub struct IndexerConfig { /// This is the core component, which handles `nearcore` and internal `streamer`. pub struct Indexer { indexer_config: IndexerConfig, - near_config: neard::NearConfig, + near_config: nearcore::NearConfig, view_client: actix::Addr, client: actix::Addr, } @@ -83,8 +83,8 @@ pub struct Indexer { impl Indexer { /// Initialize Indexer by configuring `nearcore` pub fn new(indexer_config: IndexerConfig) -> Self { - let near_config = neard::load_config(&indexer_config.home_dir); - neard::genesis_validate::validate_genesis(&near_config.genesis); + let near_config = nearcore::load_config(&indexer_config.home_dir); + nearcore::genesis_validate::validate_genesis(&near_config.genesis); assert!( !&near_config.client_config.tracked_shards.is_empty(), "Indexer should track at least one shard. \n\ @@ -93,7 +93,7 @@ impl Indexer { indexer_config.home_dir.join("config.json").display() ); let (client, view_client, _) = - neard::start_with_config(&indexer_config.home_dir, near_config.clone()); + nearcore::start_with_config(&indexer_config.home_dir, near_config.clone()); Self { view_client, client, near_config, indexer_config } } @@ -110,7 +110,7 @@ impl Indexer { } /// Expose neard config - pub fn near_config(&self) -> &neard::NearConfig { + pub fn near_config(&self) -> &nearcore::NearConfig { &self.near_config } diff --git a/chain/indexer/src/streamer/mod.rs b/chain/indexer/src/streamer/mod.rs index 56dae8b5ea3..fdf70782031 100644 --- a/chain/indexer/src/streamer/mod.rs +++ b/chain/indexer/src/streamer/mod.rs @@ -203,7 +203,7 @@ pub(crate) async fn start( blocks_sink: mpsc::Sender, ) { info!(target: INDEXER, "Starting Streamer..."); - let mut indexer_db_path = neard::get_store_path(&indexer_config.home_dir); + let mut indexer_db_path = nearcore::get_store_path(&indexer_config.home_dir); indexer_db_path.push_str("/indexer"); // TODO: implement proper error handling diff --git a/chain/jsonrpc-primitives/Cargo.toml b/chain/jsonrpc-primitives/Cargo.toml index b132191bf0f..7d6eb7b0633 100644 --- a/chain/jsonrpc-primitives/Cargo.toml +++ b/chain/jsonrpc-primitives/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" lazy_static = "1.4" serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/chain/jsonrpc/Cargo.toml b/chain/jsonrpc/Cargo.toml index be5806b2c2e..e2858edceac 100644 --- a/chain/jsonrpc/Cargo.toml +++ b/chain/jsonrpc/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Near Inc "] edition = "2018" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" awc = "3.0.0-beta.5" actix-web = "4.0.0-beta.6" actix-cors = { git = "https://github.com/near/actix-extras.git", branch="actix-web-4-beta.6" } diff --git a/chain/jsonrpc/fuzz/Cargo.toml b/chain/jsonrpc/fuzz/Cargo.toml index f5838192b24..85d04df75b7 100644 --- a/chain/jsonrpc/fuzz/Cargo.toml +++ b/chain/jsonrpc/fuzz/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" cargo-fuzz = true [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" arbitrary = { version = "0.4.7", features = ["derive"] } base64 = "0.13" lazy_static = "1.4" diff --git a/chain/jsonrpc/test-utils/Cargo.toml b/chain/jsonrpc/test-utils/Cargo.toml index e1e16d83257..9ab98d40d60 100644 --- a/chain/jsonrpc/test-utils/Cargo.toml +++ b/chain/jsonrpc/test-utils/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Near Inc "] edition = "2018" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" lazy_static = "1.4" near-chain-configs = { path = "../../../core/chain-configs" } diff --git a/chain/jsonrpc/test-utils/src/lib.rs b/chain/jsonrpc/test-utils/src/lib.rs index 6cd0b53c356..072a02025d5 100644 --- a/chain/jsonrpc/test-utils/src/lib.rs +++ b/chain/jsonrpc/test-utils/src/lib.rs @@ -9,7 +9,7 @@ use near_primitives::types::NumBlocks; lazy_static::lazy_static! { pub static ref TEST_GENESIS_CONFIG: GenesisConfig = - GenesisConfig::from_json(include_str!("../../../../neard/res/genesis_config.json")); + GenesisConfig::from_json(include_str!("../../../../nearcore/res/genesis_config.json")); } pub enum NodeType { diff --git a/chain/jsonrpc/tests/test_utils/mod.rs b/chain/jsonrpc/tests/test_utils/mod.rs index 0f39eb79659..a96255bf06b 100644 --- a/chain/jsonrpc/tests/test_utils/mod.rs +++ b/chain/jsonrpc/tests/test_utils/mod.rs @@ -13,7 +13,7 @@ use near_jsonrpc_primitives::message::{from_slice, Message}; lazy_static::lazy_static! { pub static ref TEST_GENESIS_CONFIG: GenesisConfig = - GenesisConfig::from_json(include_str!("../../../../neard/res/genesis_config.json")); + GenesisConfig::from_json(include_str!("../../../../nearcore/res/genesis_config.json")); } pub enum NodeType { diff --git a/chain/network/Cargo.toml b/chain/network/Cargo.toml index 1ec47738d89..038a2e1d6e7 100644 --- a/chain/network/Cargo.toml +++ b/chain/network/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] bytes = "1" -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" tokio = { version = "1.1", features = ["full"] } tokio-util = { version = "0.6", features = ["codec"] } tokio-stream = { version = "0.1.2", features = ["net"] } diff --git a/chain/rosetta-rpc/Cargo.toml b/chain/rosetta-rpc/Cargo.toml index 2cedffbebb3..41b125694a6 100644 --- a/chain/rosetta-rpc/Cargo.toml +++ b/chain/rosetta-rpc/Cargo.toml @@ -13,7 +13,7 @@ lazy_static = "1.4" strum = { version = "0.20", features = ["derive"] } awc = "3.0.0-beta.5" -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" actix-web = "4.0.0-beta.6" actix-cors = { git = "https://github.com/near/actix-extras.git", branch="actix-web-4-beta.6" } futures = "0.3.5" diff --git a/chain/telemetry/Cargo.toml b/chain/telemetry/Cargo.toml index 78494d8daec..284ac8beb03 100644 --- a/chain/telemetry/Cargo.toml +++ b/chain/telemetry/Cargo.toml @@ -9,7 +9,7 @@ openssl = { version = "0.10", features = ["vendored"] } awc = "3.0.0-beta.5" actix-web = { version = "4.0.0-beta.6", features = [ "openssl" ] } futures = "0.3" -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" serde = { version = "1", features = [ "derive" ] } serde_json = "1" tracing = "0.1.13" diff --git a/deny.toml b/deny.toml index a825a917473..961dbb98bf5 100644 --- a/deny.toml +++ b/deny.toml @@ -21,6 +21,12 @@ deny = [ ] skip = [ + { name = "clap", version = "=2.33.3" }, + { name = "env_logger", version = "=0.7.1" }, + { name = "humantime", version = "=2.1.0" }, + { name = "socket2", version = "=0.3.19" }, + { name = "textwrap", version = "=0.12.1" }, + # crypto-mac 0.7.0 still uses it: https://github.com/RustCrypto/traits/issues/43 { name = "subtle", version = "=1.0.0" }, @@ -72,9 +78,6 @@ skip = [ # chain and param estimator { name = "num-rational", version = "=0.3.2" }, - # tokia via actix and actix-server - { name = "miow", version = "=0.3.6" }, - # crossbeam-epoch and wasmtime-runtime { name = "memoffset", version = "=0.6.1" }, diff --git a/genesis-tools/genesis-csv-to-json/Cargo.toml b/genesis-tools/genesis-csv-to-json/Cargo.toml index b0140879a05..37932c960b8 100644 --- a/genesis-tools/genesis-csv-to-json/Cargo.toml +++ b/genesis-tools/genesis-csv-to-json/Cargo.toml @@ -10,7 +10,7 @@ csv = "1.1.1" serde = { version = "1", features = ["derive"] } clap = "2.33.0" -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-chain-configs = { path = "../../core/chain-configs" } near-crypto = { path = "../../core/crypto" } near-primitives = { path = "../../core/primitives" } diff --git a/genesis-tools/genesis-csv-to-json/src/csv_to_json_configs.rs b/genesis-tools/genesis-csv-to-json/src/csv_to_json_configs.rs index 646d9720561..04b61b9485b 100644 --- a/genesis-tools/genesis-csv-to-json/src/csv_to_json_configs.rs +++ b/genesis-tools/genesis-csv-to-json/src/csv_to_json_configs.rs @@ -5,14 +5,14 @@ use near_chain_configs::{Genesis, GenesisConfig}; use near_primitives::types::{Balance, NumShards, ShardId}; use near_primitives::utils::get_num_seats_per_shard; use near_primitives::version::PROTOCOL_VERSION; -use neard::config::{ +use nearcore::config::{ Config, BLOCK_PRODUCER_KICKOUT_THRESHOLD, CHUNK_PRODUCER_KICKOUT_THRESHOLD, CONFIG_FILENAME, EXPECTED_EPOCH_LENGTH, FISHERMEN_THRESHOLD, GAS_PRICE_ADJUSTMENT_RATE, GENESIS_CONFIG_FILENAME, INITIAL_GAS_LIMIT, MAX_INFLATION_RATE, MIN_GAS_PRICE, NODE_KEY_FILE, NUM_BLOCKS_PER_YEAR, NUM_BLOCK_PRODUCER_SEATS, PROTOCOL_REWARD_RATE, PROTOCOL_UPGRADE_NUM_EPOCHS, PROTOCOL_UPGRADE_STAKE_THRESHOLD, TRANSACTION_VALIDITY_PERIOD, }; -use neard::NEAR_BASE; +use nearcore::NEAR_BASE; const ACCOUNTS_FILE: &str = "accounts.csv"; const NUM_SHARDS: NumShards = 8; diff --git a/genesis-tools/genesis-csv-to-json/src/main.rs b/genesis-tools/genesis-csv-to-json/src/main.rs index 0a4344c06d2..09f682f33f9 100644 --- a/genesis-tools/genesis-csv-to-json/src/main.rs +++ b/genesis-tools/genesis-csv-to-json/src/main.rs @@ -1,6 +1,6 @@ use clap::{App, Arg}; use near_primitives::types::ShardId; -use neard::get_default_home; +use nearcore::get_default_home; use std::collections::HashSet; use std::path::Path; diff --git a/genesis-tools/genesis-populate/Cargo.toml b/genesis-tools/genesis-populate/Cargo.toml index f1a3da2d898..70ec6df3957 100644 --- a/genesis-tools/genesis-populate/Cargo.toml +++ b/genesis-tools/genesis-populate/Cargo.toml @@ -11,7 +11,7 @@ indicatif = "0.15.0" clap = "2.33.0" tempfile = "3" -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-chain-configs = { path = "../../core/chain-configs" } near-crypto = { path = "../../core/crypto" } near-primitives = { path = "../../core/primitives" } diff --git a/genesis-tools/genesis-populate/src/lib.rs b/genesis-tools/genesis-populate/src/lib.rs index 7a5272d6c3e..4d53fe15de7 100644 --- a/genesis-tools/genesis-populate/src/lib.rs +++ b/genesis-tools/genesis-populate/src/lib.rs @@ -23,7 +23,7 @@ use near_primitives::types::{AccountId, Balance, EpochId, ShardId, StateChangeCa use near_store::{ create_store, get_account, set_access_key, set_account, set_code, ColState, Store, TrieUpdate, }; -use neard::{get_store_path, NightshadeRuntime}; +use nearcore::{get_store_path, NightshadeRuntime}; fn get_account_id(account_index: u64) -> String { format!("near_{}_{}", account_index, account_index) diff --git a/genesis-tools/genesis-populate/src/main.rs b/genesis-tools/genesis-populate/src/main.rs index 2b2e0508899..da1455e3f3c 100644 --- a/genesis-tools/genesis-populate/src/main.rs +++ b/genesis-tools/genesis-populate/src/main.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use clap::{App, Arg}; use near_store::create_store; -use neard::{get_default_home, get_store_path, load_config}; +use nearcore::{get_default_home, get_store_path, load_config}; use genesis_populate::GenesisBuilder; diff --git a/genesis-tools/keypair-generator/Cargo.toml b/genesis-tools/keypair-generator/Cargo.toml index 5788e08e016..c648ec7a563 100644 --- a/genesis-tools/keypair-generator/Cargo.toml +++ b/genesis-tools/keypair-generator/Cargo.toml @@ -7,6 +7,6 @@ edition = "2018" [dependencies] clap = "2.33.0" -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-crypto = { path = "../../core/crypto" } diff --git a/genesis-tools/keypair-generator/src/main.rs b/genesis-tools/keypair-generator/src/main.rs index d16150108f8..92496523f5c 100644 --- a/genesis-tools/keypair-generator/src/main.rs +++ b/genesis-tools/keypair-generator/src/main.rs @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; use clap::{App, AppSettings, Arg, SubCommand}; use near_crypto::{InMemorySigner, KeyType, SecretKey, Signer}; -use neard::get_default_home; +use nearcore::get_default_home; fn generate_key_to_file(account_id: &str, key: SecretKey, path: PathBuf) { let signer = InMemorySigner::from_secret_key(account_id.to_string(), key); @@ -88,7 +88,7 @@ fn main() { let account_id = account_id.expect("Account id must be specified if --generate-config is used"); let mut path = home_dir.to_path_buf(); - path.push(neard::config::VALIDATOR_KEY_FILE); + path.push(nearcore::config::VALIDATOR_KEY_FILE); generate_key_to_file(account_id, key, path); } } @@ -97,7 +97,7 @@ fn main() { println!("PK: {}", key.public_key()); if generate_config { let mut path = home_dir.to_path_buf(); - path.push(neard::config::NODE_KEY_FILE); + path.push(nearcore::config::NODE_KEY_FILE); generate_key_to_file("", key, path); } } diff --git a/nearcore/Cargo.toml b/nearcore/Cargo.toml new file mode 100644 index 00000000000..58e9b6e7827 --- /dev/null +++ b/nearcore/Cargo.toml @@ -0,0 +1,91 @@ +[package] +name = "nearcore" +version = "1.2.0" +authors = ["Near Inc "] +edition = "2018" + +[dependencies] +jemallocator = "0.3" +awc = "3.0.0-beta.5" +actix = "=0.11.0-beta.2" # Pinned the version to avoid compilation errors +actix_derive = "=0.6.0-beta.1" # Pinned dependency in addition to actix dependecy (remove this line once the pinning is not needed) +actix-rt = "2" +byteorder = "1.2" +easy-ext = "0.2" +chrono = { version = "0.4.4", features = ["serde"] } +futures = "0.3" +rand = "0.7" +serde = { version = "1", features = ["derive"] } +serde_json = "1" +dirs = "3" +borsh = "0.8.1" +thiserror = "1.0" +tracing = "0.1.13" +num-rational = { version = "0.3", features = ["serde"] } +near-rust-allocator-proxy = "0.2.8" +lazy-static-include = "3" + +near-crypto = { path = "../core/crypto" } +near-primitives = { path = "../core/primitives" } +near-chain-configs = { path = "../core/chain-configs" } +near-store = { path = "../core/store" } +node-runtime = { path = "../runtime/runtime" } +near-chain = { path = "../chain/chain" } +near-chunks = { path = "../chain/chunks" } +near-client = { path = "../chain/client" } +near-pool = { path = "../chain/pool" } +near-network = { path = "../chain/network" } +near-jsonrpc = { path = "../chain/jsonrpc" } +near-rosetta-rpc = { path = "../chain/rosetta-rpc", optional = true } +near-telemetry = { path = "../chain/telemetry" } +near-epoch-manager = { path = "../chain/epoch_manager" } +near-performance-metrics = { path = "../utils/near-performance-metrics" } + +delay-detector = { path = "../tools/delay_detector", optional = true } + +[dev-dependencies] +funty = "=1.1.0" # Pin dependency to avoid compilation errors: https://github.com/myrrlyn/funty/issues/3 +rand = "0.7" +runtime-params-estimator = { path = "../runtime/runtime-params-estimator", default_features = false } +near-logger-utils = { path = "../test-utils/logger" } +near-actix-test-utils = { path = "../test-utils/actix-test-utils" } +tempfile = "3" +testlib = { path = "../test-utils/testlib" } +near-jsonrpc-primitives = { path = "../chain/jsonrpc-primitives" } +primitive-types = "0.9" +restored-receipts-verifier = { path = "../tools/restored-receipts-verifier"} + +[features] +performance_stats = ["near-performance-metrics/performance_stats"] +memory_stats = ["near-performance-metrics/memory_stats"] +c_memory_stats = ["near-performance-metrics/c_memory_stats"] +adversarial = ["near-client/adversarial", "near-network/adversarial", "near-store/adversarial"] +expensive_tests = ["near-client/expensive_tests", "near-epoch-manager/expensive_tests", "near-chain/expensive_tests"] +metric_recorder = ["near-network/metric_recorder", "near-client/metric_recorder"] +no_cache = ["node-runtime/no_cache", "near-store/no_cache", "near-chain/no_cache"] +delay_detector = ["near-client/delay_detector"] +rosetta_rpc = ["near-rosetta-rpc"] +protocol_feature_evm = ["near-primitives/protocol_feature_evm", "node-runtime/protocol_feature_evm", "near-chain-configs/protocol_feature_evm", "near-chain/protocol_feature_evm"] +protocol_feature_alt_bn128 = ["near-primitives/protocol_feature_alt_bn128", "node-runtime/protocol_feature_alt_bn128"] +protocol_feature_block_header_v3 = ["near-epoch-manager/protocol_feature_block_header_v3", "near-store/protocol_feature_block_header_v3", "near-primitives/protocol_feature_block_header_v3", "near-chain/protocol_feature_block_header_v3", "near-client/protocol_feature_block_header_v3"] +protocol_feature_add_account_versions = ["near-primitives/protocol_feature_add_account_versions"] +protocol_feature_tx_size_limit = ["near-primitives/protocol_feature_tx_size_limit", "node-runtime/protocol_feature_tx_size_limit"] +protocol_feature_allow_create_account_on_delete = ["node-runtime/protocol_feature_allow_create_account_on_delete"] +protocol_feature_fix_storage_usage = ["near-primitives/protocol_feature_fix_storage_usage", "node-runtime/protocol_feature_fix_storage_usage"] +nightly_protocol_features = ["nightly_protocol", "near-primitives/nightly_protocol_features", "near-client/nightly_protocol_features", "near-epoch-manager/nightly_protocol_features", "near-store/nightly_protocol_features", "protocol_feature_evm", "protocol_feature_block_header_v3", "protocol_feature_alt_bn128", "protocol_feature_add_account_versions", "protocol_feature_tx_size_limit", "protocol_feature_allow_create_account_on_delete", "protocol_feature_fix_storage_usage", "protocol_feature_restore_receipts_after_fix"] +nightly_protocol = ["near-primitives/nightly_protocol", "near-jsonrpc/nightly_protocol"] +protocol_feature_restore_receipts_after_fix = ["near-primitives/protocol_feature_restore_receipts_after_fix", "near-chain/protocol_feature_restore_receipts_after_fix", "node-runtime/protocol_feature_restore_receipts_after_fix", "restored-receipts-verifier/protocol_feature_restore_receipts_after_fix"] + +# enable this to build neard with wasmer 1.0 runner +# now if none of wasmer0_default, wasmer1_default or wasmtime_default is enabled, wasmer0 would be default +wasmer1_default = ["node-runtime/wasmer1_default"] +wasmer0_default = ["node-runtime/wasmer0_default"] +wasmtime_default = ["node-runtime/wasmtime_default"] +# enable some of these to run runtime tests with wasmer 1.0, 0.x and wasmtime vm enabled +# but would not change default runner used by neard +wasmer1_vm = ["node-runtime/wasmer1_vm"] +wasmer0_vm = ["node-runtime/wasmer0_vm"] +wasmtime_vm = ["node-runtime/wasmtime_vm"] + +[package.metadata.workspaces] +independent = true diff --git a/neard/res/genesis_config.json b/nearcore/res/genesis_config.json similarity index 100% rename from neard/res/genesis_config.json rename to nearcore/res/genesis_config.json diff --git a/neard/res/mainnet_genesis.json b/nearcore/res/mainnet_genesis.json similarity index 100% rename from neard/res/mainnet_genesis.json rename to nearcore/res/mainnet_genesis.json diff --git a/neard/res/mainnet_restored_receipts.json b/nearcore/res/mainnet_restored_receipts.json similarity index 100% rename from neard/res/mainnet_restored_receipts.json rename to nearcore/res/mainnet_restored_receipts.json diff --git a/neard/res/storage_usage_delta.json b/nearcore/res/storage_usage_delta.json similarity index 100% rename from neard/res/storage_usage_delta.json rename to nearcore/res/storage_usage_delta.json diff --git a/neard/src/config.rs b/nearcore/src/config.rs similarity index 100% rename from neard/src/config.rs rename to nearcore/src/config.rs diff --git a/neard/src/genesis_validate.rs b/nearcore/src/genesis_validate.rs similarity index 100% rename from neard/src/genesis_validate.rs rename to nearcore/src/genesis_validate.rs diff --git a/neard/src/lib.rs b/nearcore/src/lib.rs similarity index 100% rename from neard/src/lib.rs rename to nearcore/src/lib.rs diff --git a/neard/src/migrations.rs b/nearcore/src/migrations.rs similarity index 100% rename from neard/src/migrations.rs rename to nearcore/src/migrations.rs diff --git a/neard/src/runtime/errors.rs b/nearcore/src/runtime/errors.rs similarity index 100% rename from neard/src/runtime/errors.rs rename to nearcore/src/runtime/errors.rs diff --git a/neard/src/runtime/mod.rs b/nearcore/src/runtime/mod.rs similarity index 100% rename from neard/src/runtime/mod.rs rename to nearcore/src/runtime/mod.rs diff --git a/neard/src/shard_tracker.rs b/nearcore/src/shard_tracker.rs similarity index 100% rename from neard/src/shard_tracker.rs rename to nearcore/src/shard_tracker.rs diff --git a/tests/add.wasm b/nearcore/tests/add.wasm similarity index 100% rename from tests/add.wasm rename to nearcore/tests/add.wasm diff --git a/neard/tests/economics.rs b/nearcore/tests/economics.rs similarity index 98% rename from neard/tests/economics.rs rename to nearcore/tests/economics.rs index 1fbdd6d7648..9a9f5b36588 100644 --- a/neard/tests/economics.rs +++ b/nearcore/tests/economics.rs @@ -11,7 +11,7 @@ use near_crypto::{InMemorySigner, KeyType}; use near_logger_utils::init_integration_logger; use near_primitives::transaction::SignedTransaction; use near_store::test_utils::create_test_store; -use neard::config::GenesisExt; +use nearcore::config::GenesisExt; use testlib::fees_utils::FeeHelper; use primitive_types::U256; @@ -25,7 +25,7 @@ fn setup_env(f: &mut dyn FnMut(&mut Genesis) -> ()) -> (TestEnv, FeeHelper) { genesis.config.runtime_config.transaction_costs.clone(), genesis.config.min_gas_price, ); - let runtimes: Vec> = vec![Arc::new(neard::NightshadeRuntime::new( + let runtimes: Vec> = vec![Arc::new(nearcore::NightshadeRuntime::new( Path::new("."), store1, &genesis, diff --git a/tests/hello.wasm b/nearcore/tests/hello.wasm similarity index 100% rename from tests/hello.wasm rename to nearcore/tests/hello.wasm diff --git a/neard/tests/load_genesis.rs b/nearcore/tests/load_genesis.rs similarity index 100% rename from neard/tests/load_genesis.rs rename to nearcore/tests/load_genesis.rs diff --git a/neard/tests/node_cluster.rs b/nearcore/tests/node_cluster.rs similarity index 100% rename from neard/tests/node_cluster.rs rename to nearcore/tests/node_cluster.rs diff --git a/neard/tests/rpc_nodes.rs b/nearcore/tests/rpc_nodes.rs similarity index 100% rename from neard/tests/rpc_nodes.rs rename to nearcore/tests/rpc_nodes.rs diff --git a/neard/tests/run_nodes.rs b/nearcore/tests/run_nodes.rs similarity index 100% rename from neard/tests/run_nodes.rs rename to nearcore/tests/run_nodes.rs diff --git a/tests/singlepass_crash.wasm b/nearcore/tests/singlepass_crash.wasm similarity index 100% rename from tests/singlepass_crash.wasm rename to nearcore/tests/singlepass_crash.wasm diff --git a/neard/tests/stake_nodes.rs b/nearcore/tests/stake_nodes.rs similarity index 99% rename from neard/tests/stake_nodes.rs rename to nearcore/tests/stake_nodes.rs index 947f291d42f..e0d79701d32 100644 --- a/neard/tests/stake_nodes.rs +++ b/nearcore/tests/stake_nodes.rs @@ -19,8 +19,8 @@ use near_primitives::hash::CryptoHash; use near_primitives::transaction::SignedTransaction; use near_primitives::types::{AccountId, BlockHeightDelta, BlockReference, NumSeats}; use near_primitives::views::{QueryRequest, QueryResponseKind, ValidatorInfo}; -use neard::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; -use neard::{load_test_config, start_with_config, NearConfig, NEAR_BASE}; +use nearcore::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; +use nearcore::{load_test_config, start_with_config, NearConfig, NEAR_BASE}; use testlib::{genesis_hash, test_helpers::heavy_test}; use {near_primitives::types::BlockId, primitive_types::U256}; diff --git a/neard/tests/sync_nodes.rs b/nearcore/tests/sync_nodes.rs similarity index 99% rename from neard/tests/sync_nodes.rs rename to nearcore/tests/sync_nodes.rs index 8549b211218..3a9ff86cef2 100644 --- a/neard/tests/sync_nodes.rs +++ b/nearcore/tests/sync_nodes.rs @@ -21,8 +21,8 @@ use near_primitives::types::validator_stake::ValidatorStake; use near_primitives::types::{BlockHeightDelta, EpochId}; use near_primitives::validator_signer::{InMemoryValidatorSigner, ValidatorSigner}; use near_primitives::version::PROTOCOL_VERSION; -use neard::config::{GenesisExt, TESTING_INIT_STAKE}; -use neard::{load_test_config, start_with_config, NearConfig}; +use nearcore::config::{GenesisExt, TESTING_INIT_STAKE}; +use nearcore::{load_test_config, start_with_config, NearConfig}; use testlib::{genesis_block, test_helpers::heavy_test}; // This assumes that there is no height skipped. Otherwise epoch hash calculation will be wrong. diff --git a/neard/tests/sync_state_nodes.rs b/nearcore/tests/sync_state_nodes.rs similarity index 99% rename from neard/tests/sync_state_nodes.rs rename to nearcore/tests/sync_state_nodes.rs index cb462978c38..6749ef369da 100644 --- a/neard/tests/sync_state_nodes.rs +++ b/nearcore/tests/sync_state_nodes.rs @@ -9,7 +9,7 @@ use near_chain_configs::Genesis; use near_client::GetBlock; use near_logger_utils::init_integration_logger; use near_network::test_utils::{convert_boot_nodes, open_port, WaitOrTimeout}; -use neard::{config::GenesisExt, load_test_config, start_with_config}; +use nearcore::{config::GenesisExt, load_test_config, start_with_config}; use testlib::test_helpers::heavy_test; /// One client is in front, another must sync to it using state (fast) sync. diff --git a/tests/test_cases_runtime.rs b/nearcore/tests/test_cases_runtime.rs similarity index 99% rename from tests/test_cases_runtime.rs rename to nearcore/tests/test_cases_runtime.rs index 239a45f173f..17398aee70e 100644 --- a/tests/test_cases_runtime.rs +++ b/nearcore/tests/test_cases_runtime.rs @@ -3,7 +3,7 @@ mod test { use near_chain_configs::Genesis; use near_primitives::state_record::StateRecord; use near_primitives::version::PROTOCOL_VERSION; - use neard::config::{GenesisExt, TESTING_INIT_BALANCE}; + use nearcore::config::{GenesisExt, TESTING_INIT_BALANCE}; use testlib::node::RuntimeNode; use testlib::runtime_utils::{add_test_contract, alice_account, bob_account}; #[cfg(feature = "protocol_feature_evm")] diff --git a/tests/test_cases_testnet_rpc.rs b/nearcore/tests/test_cases_testnet_rpc.rs similarity index 100% rename from tests/test_cases_testnet_rpc.rs rename to nearcore/tests/test_cases_testnet_rpc.rs diff --git a/tests/test_catchup.rs b/nearcore/tests/test_catchup.rs similarity index 100% rename from tests/test_catchup.rs rename to nearcore/tests/test_catchup.rs diff --git a/tests/test_errors.rs b/nearcore/tests/test_errors.rs similarity index 96% rename from tests/test_errors.rs rename to nearcore/tests/test_errors.rs index f48d1638418..c2fb042fe80 100644 --- a/tests/test_errors.rs +++ b/nearcore/tests/test_errors.rs @@ -9,8 +9,8 @@ use near_primitives::errors::{InvalidAccessKeyError, InvalidTxError}; use near_primitives::transaction::{ Action, AddKeyAction, CreateAccountAction, SignedTransaction, TransferAction, }; -use neard::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; -use neard::load_test_config; +use nearcore::config::{GenesisExt, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; +use nearcore::load_test_config; use testlib::node::{Node, ThreadNode}; fn start_node() -> ThreadNode { diff --git a/tests/test_overflows.rs b/nearcore/tests/test_overflows.rs similarity index 100% rename from tests/test_overflows.rs rename to nearcore/tests/test_overflows.rs diff --git a/tests/test_rejoin.rs b/nearcore/tests/test_rejoin.rs similarity index 100% rename from tests/test_rejoin.rs rename to nearcore/tests/test_rejoin.rs diff --git a/tests/test_simple.rs b/nearcore/tests/test_simple.rs similarity index 100% rename from tests/test_simple.rs rename to nearcore/tests/test_simple.rs diff --git a/tests/test_tps_regression.rs b/nearcore/tests/test_tps_regression.rs similarity index 100% rename from tests/test_tps_regression.rs rename to nearcore/tests/test_tps_regression.rs diff --git a/tests/tidy.rs b/nearcore/tests/tidy.rs similarity index 100% rename from tests/tidy.rs rename to nearcore/tests/tidy.rs diff --git a/neard/tests/track_shards.rs b/nearcore/tests/track_shards.rs similarity index 100% rename from neard/tests/track_shards.rs rename to nearcore/tests/track_shards.rs diff --git a/neard/Cargo.toml b/neard/Cargo.toml index 14278699f00..e4e1f2f7adc 100644 --- a/neard/Cargo.toml +++ b/neard/Cargo.toml @@ -5,61 +5,42 @@ authors = ["Near Inc "] edition = "2018" default-run = "neard" +[[bin]] +path = "src/main.rs" +name = "neard" + +[[bin]] +path = "src/../src/main.rs" +name = "near" + [dependencies] -jemallocator = { version = "0.3" } -awc = "3.0.0-beta.5" -actix = "0.11.0-beta.2" -actix-rt = "2" -byteorder = "1.2" -easy-ext = "0.2" -chrono = { version = "0.4.4", features = ["serde"] } -git-version = "0.3.1" -futures = "0.3" clap = "2.32" -rand = "0.7" -serde = { version = "1", features = [ "derive" ] } -serde_json = "1" -dirs = "3" -borsh = "0.8.1" -thiserror = "1.0" +actix = "=0.11.0-beta.2" tracing = "0.1.13" +git-version = "0.3.1" tracing-subscriber = "0.2.4" -num-rational = { version = "0.3", features = ["serde"] } -openssl-probe = { version = "0.1.2" } +openssl-probe = "0.1.2" near-rust-allocator-proxy = "0.2.8" -lazy-static-include = "3" -near-crypto = { path = "../core/crypto" } +nearcore = { path = "../nearcore" } near-primitives = { path = "../core/primitives" } near-chain-configs = { path = "../core/chain-configs" } near-store = { path = "../core/store" } -node-runtime = { path = "../runtime/runtime"} +node-runtime = { path = "../runtime/runtime" } near-chain = { path = "../chain/chain" } -near-chunks = { path = "../chain/chunks"} near-client = { path = "../chain/client" } -near-pool = { path = "../chain/pool" } near-network = { path = "../chain/network" } near-jsonrpc = { path = "../chain/jsonrpc" } near-rosetta-rpc = { path = "../chain/rosetta-rpc", optional = true } -near-telemetry = { path = "../chain/telemetry" } near-epoch-manager = { path = "../chain/epoch_manager" } near-performance-metrics = { path = "../utils/near-performance-metrics" } - -delay-detector = { path = "../tools/delay_detector", optional = true } - -[dev-dependencies] -near-logger-utils = { path = "../test-utils/logger" } -near-actix-test-utils = { path = "../test-utils/actix-test-utils" } -tempfile = "3" testlib = { path = "../test-utils/testlib" } -near-jsonrpc-primitives = { path = "../chain/jsonrpc-primitives" } -primitive-types = "0.9" [features] performance_stats = ["near-performance-metrics/performance_stats"] memory_stats = ["near-performance-metrics/memory_stats"] c_memory_stats = ["near-performance-metrics/c_memory_stats"] -adversarial = ["near-client/adversarial", "near-network/adversarial", "near-store/adversarial"] +adversarial = ["near-client/adversarial", "near-network/adversarial", "near-store/adversarial"] expensive_tests = ["near-client/expensive_tests", "near-epoch-manager/expensive_tests", "near-chain/expensive_tests"] metric_recorder = ["near-network/metric_recorder", "near-client/metric_recorder"] no_cache = ["node-runtime/no_cache", "near-store/no_cache", "near-chain/no_cache"] @@ -70,20 +51,20 @@ protocol_feature_alt_bn128 = ["near-primitives/protocol_feature_alt_bn128", "nod protocol_feature_block_header_v3 = ["near-epoch-manager/protocol_feature_block_header_v3", "near-store/protocol_feature_block_header_v3", "near-primitives/protocol_feature_block_header_v3", "near-chain/protocol_feature_block_header_v3", "near-client/protocol_feature_block_header_v3"] protocol_feature_add_account_versions = ["near-primitives/protocol_feature_add_account_versions"] protocol_feature_tx_size_limit = ["near-primitives/protocol_feature_tx_size_limit", "node-runtime/protocol_feature_tx_size_limit"] -protocol_feature_allow_create_account_on_delete = ["node-runtime/protocol_feature_allow_create_account_on_delete"] +protocol_feature_allow_create_account_on_delete = ["node-runtime/protocol_feature_allow_create_account_on_delete", "testlib/protocol_feature_allow_create_account_on_delete"] protocol_feature_fix_storage_usage = ["near-primitives/protocol_feature_fix_storage_usage", "node-runtime/protocol_feature_fix_storage_usage"] protocol_feature_restore_receipts_after_fix = ["near-primitives/protocol_feature_restore_receipts_after_fix"] protocol_feature_cap_max_gas_price = ["near-primitives/protocol_feature_cap_max_gas_price", "near-chain/protocol_feature_cap_max_gas_price"] nightly_protocol_features = ["nightly_protocol", "near-primitives/nightly_protocol_features", "near-client/nightly_protocol_features", "near-epoch-manager/nightly_protocol_features", "near-store/nightly_protocol_features", "protocol_feature_evm", "protocol_feature_block_header_v3", "protocol_feature_alt_bn128", "protocol_feature_add_account_versions", "protocol_feature_tx_size_limit", "protocol_feature_allow_create_account_on_delete", "protocol_feature_fix_storage_usage", "protocol_feature_restore_receipts_after_fix", "protocol_feature_cap_max_gas_price"] nightly_protocol = ["near-primitives/nightly_protocol", "near-jsonrpc/nightly_protocol"] -[[bin]] -path = "src/main.rs" -name = "neard" - -[[bin]] -path = "src/../src/main.rs" -name = "near" - -[package.metadata.workspaces] -independent = true +# enable this to build neard with wasmer 1.0 runner +# now if none of wasmer0_default, wasmer1_default or wasmtime_default is enabled, wasmer0 would be default +wasmer1_default = ["node-runtime/wasmer1_default"] +wasmer0_default = ["node-runtime/wasmer0_default"] +wasmtime_default = ["node-runtime/wasmtime_default"] +# enable some of these to run runtime tests with wasmer 1.0, 0.x and wasmtime vm enabled +# but would not change default runner used by neard +wasmer1_vm = ["node-runtime/wasmer1_vm"] +wasmer0_vm = ["node-runtime/wasmer0_vm"] +wasmtime_vm = ["node-runtime/wasmtime_vm"] diff --git a/neard/src/main.rs b/neard/src/main.rs index b32b125f6fb..50037dec46e 100644 --- a/neard/src/main.rs +++ b/neard/src/main.rs @@ -11,14 +11,15 @@ use tracing::info; use tracing_subscriber::filter::LevelFilter; use tracing_subscriber::EnvFilter; +use actix; use git_version::git_version; use near_performance_metrics; use near_primitives::version::{Version, DB_VERSION, PROTOCOL_VERSION}; #[cfg(feature = "memory_stats")] use near_rust_allocator_proxy::allocator::MyAllocator; -use neard::config::{init_testnet_configs, load_config_without_genesis_records}; -use neard::genesis_validate::validate_genesis; -use neard::{get_default_home, get_store_path, init_configs, start_with_config}; +use nearcore::config::{init_testnet_configs, load_config_without_genesis_records}; +use nearcore::genesis_validate::validate_genesis; +use nearcore::{get_default_home, get_store_path, init_configs, start_with_config}; #[cfg(feature = "memory_stats")] #[global_allocator] diff --git a/pytest/tests/sanity/state_migration.py b/pytest/tests/sanity/state_migration.py index 130d4d0dac1..c704ac3c5db 100755 --- a/pytest/tests/sanity/state_migration.py +++ b/pytest/tests/sanity/state_migration.py @@ -21,7 +21,6 @@ import cluster from utils import wait_for_blocks_or_timeout - def main(): node_root = '/tmp/near/state_migration' if os.path.exists(node_root): @@ -93,8 +92,9 @@ def main(): # New genesis can be deserialized by new near is verified above (new near can produce blocks) # Also test new genesis protocol_version matches neard/res/genesis_config's - new_genesis = json.load(open(os.path.join(node_root, 'test0/genesis.json'))) - res_genesis = json.load(open('../neard/res/genesis_config.json')) + new_genesis = json.load( + open(os.path.join(node_root, 'test0/genesis.json'))) + res_genesis = json.load(open('../nearcore/res/genesis_config.json')) assert new_genesis['protocol_version'] == res_genesis['protocol_version'] diff --git a/pytest/tests/stress/hundred_nodes/create_gcloud_image.py b/pytest/tests/stress/hundred_nodes/create_gcloud_image.py index 3852e5711cf..649c2e2fdd9 100644 --- a/pytest/tests/stress/hundred_nodes/create_gcloud_image.py +++ b/pytest/tests/stress/hundred_nodes/create_gcloud_image.py @@ -9,7 +9,8 @@ additional_flags = '' -toolchain = open(os.path.join(os.path.dirname(__file__), '../../../../rust-toolchain')).read().strip() +toolchain = open(os.path.join(os.path.dirname(__file__), + '../../../../rust-toolchain')).read().strip() try: image_name = sys.argv[1] diff --git a/runtime/near-vm-runner-standalone/Cargo.toml b/runtime/near-vm-runner-standalone/Cargo.toml index 22d744e186c..2cb9d214e9e 100644 --- a/runtime/near-vm-runner-standalone/Cargo.toml +++ b/runtime/near-vm-runner-standalone/Cargo.toml @@ -23,8 +23,8 @@ serde_json = "1" clap = "2.33.0" base64 = "0.13" strum = "0.20" -num-rational = { version = "0.3" } -tracing = { version = "0.1"} +num-rational = "0.3" +tracing = "0.1" tracing-subscriber = "0.2" near-vm-logic = { path = "../near-vm-logic", version = "3.0.0", features = ["costs_counting"]} diff --git a/runtime/near-vm-runner/Cargo.toml b/runtime/near-vm-runner/Cargo.toml index 64bac7e6c94..a6b495a478b 100644 --- a/runtime/near-vm-runner/Cargo.toml +++ b/runtime/near-vm-runner/Cargo.toml @@ -23,7 +23,7 @@ wasmer-types = { version = "1.0.2", optional = true } wasmer-compiler-singlepass = { version = "1.0.2", optional = true, default-features = false, features = ["std", "enable-serde"] } # disable `rayon` feature. wasmer-compiler-cranelift = { version = "1.0.2", optional = true } wasmer-engine-native = { version = "1.0.2", optional = true } -wasmer-vm = { version = "1.0.2" } +wasmer-vm = "1.0.2" pwasm-utils = "0.12" parity-wasm = "0.41" wasmtime = { version = "0.25.0", default-features = false, optional = true } diff --git a/runtime/runtime-params-estimator/Cargo.toml b/runtime/runtime-params-estimator/Cargo.toml index e899ff5569d..c1ab0985a09 100644 --- a/runtime/runtime-params-estimator/Cargo.toml +++ b/runtime/runtime-params-estimator/Cargo.toml @@ -31,8 +31,8 @@ near-store = { path = "../../core/store" } near-primitives = { path = "../../core/primitives" } testlib = { path = "../../test-utils/testlib" } state-viewer = { path = "../../test-utils/state-viewer" } -neard = { path = "../../neard" } -rocksdb = { version = "0.15.0"} +nearcore = { path = "../../nearcore" } +rocksdb = "0.15.0" glob = "0.3.0" walrus = "0.18.0" near-evm-runner = { path = "../../runtime/near-evm-runner", optional = true } @@ -62,7 +62,7 @@ protocol_feature_alt_bn128 = [ "near-vm-runner/protocol_feature_alt_bn128", "node-runtime/protocol_feature_alt_bn128", "testlib/protocol_feature_alt_bn128", - "neard/protocol_feature_alt_bn128", + "nearcore/protocol_feature_alt_bn128", ] protocol_feature_evm = ["near-evm-runner/protocol_feature_evm", "near-vm-runner/protocol_feature_evm", diff --git a/runtime/runtime-params-estimator/src/main.rs b/runtime/runtime-params-estimator/src/main.rs index 41cbbbf4fcd..deb72492204 100644 --- a/runtime/runtime-params-estimator/src/main.rs +++ b/runtime/runtime-params-estimator/src/main.rs @@ -1,6 +1,6 @@ use clap::{App, Arg}; use near_vm_runner::VMKind; -use neard::get_default_home; +use nearcore::get_default_home; use runtime_params_estimator::cases::run; use runtime_params_estimator::testbed_runners::Config; use runtime_params_estimator::testbed_runners::GasMetric; diff --git a/runtime/runtime-params-estimator/src/testbed.rs b/runtime/runtime-params-estimator/src/testbed.rs index e595b11a8e9..efd355be535 100644 --- a/runtime/runtime-params-estimator/src/testbed.rs +++ b/runtime/runtime-params-estimator/src/testbed.rs @@ -14,7 +14,7 @@ use near_primitives::types::{Gas, MerkleHash, StateRoot}; use near_primitives::version::PROTOCOL_VERSION; use near_store::{create_store, ColState, ShardTries, StoreCompiledContractCache}; use near_vm_logic::VMLimitConfig; -use neard::get_store_path; +use nearcore::get_store_path; use node_runtime::{ApplyState, Runtime}; use std::sync::Arc; diff --git a/runtime/runtime-params-estimator/src/vm_estimator.rs b/runtime/runtime-params-estimator/src/vm_estimator.rs index e30b0abb4ab..00d266d6e38 100644 --- a/runtime/runtime-params-estimator/src/vm_estimator.rs +++ b/runtime/runtime-params-estimator/src/vm_estimator.rs @@ -9,7 +9,7 @@ use near_store::{create_store, StoreCompiledContractCache}; use near_vm_logic::mocks::mock_external::MockedExternal; use near_vm_logic::{VMConfig, VMContext, VMOutcome}; use near_vm_runner::{compile_module, precompile_contract_vm, prepare, run_vm, VMError, VMKind}; -use neard::get_store_path; +use nearcore::get_store_path; use num_rational::Ratio; use num_traits::ToPrimitive; use std::convert::TryFrom; diff --git a/scripts/state/update_res.py b/scripts/state/update_res.py index a1cc2f29fbe..e606adc116a 100755 --- a/scripts/state/update_res.py +++ b/scripts/state/update_res.py @@ -21,7 +21,7 @@ def main(): genesis_config_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), - '../../neard/res/genesis_config.json') + '../../nearcore/res/genesis_config.json') def near_init_genesis(): diff --git a/test-utils/loadtester/Cargo.toml b/test-utils/loadtester/Cargo.toml index 5e09dff0756..3cab8651335 100644 --- a/test-utils/loadtester/Cargo.toml +++ b/test-utils/loadtester/Cargo.toml @@ -26,5 +26,5 @@ near-store = { path = "../../core/store" } near-jsonrpc = { path = "../../chain/jsonrpc" } near-jsonrpc-primitives = { path = "../../chain/jsonrpc-primitives" } near-test-contracts = { path = "../../runtime/near-test-contracts" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } testlib = { path = "../testlib" } diff --git a/test-utils/loadtester/src/main.rs b/test-utils/loadtester/src/main.rs index f3a560bdec2..d581ef9c382 100644 --- a/test-utils/loadtester/src/main.rs +++ b/test-utils/loadtester/src/main.rs @@ -17,8 +17,8 @@ use near_primitives::types::{NumSeats, NumShards}; use near_primitives::validator_signer::ValidatorSigner; use near_primitives::version::Version; use near_store::{create_store, ColState}; -use neard::config::create_testnet_configs; -use neard::{get_default_home, get_store_path}; +use nearcore::config::create_testnet_configs; +use nearcore::{get_default_home, get_store_path}; use remote_node::RemoteNode; use crate::transactions_executor::Executor; diff --git a/test-utils/state-viewer/Cargo.toml b/test-utils/state-viewer/Cargo.toml index 68c46961d3b..9ce74d7de3e 100644 --- a/test-utils/state-viewer/Cargo.toml +++ b/test-utils/state-viewer/Cargo.toml @@ -18,7 +18,7 @@ near-store = { path = "../../core/store" } node-runtime = { path = "../../runtime/runtime" } near-chain = { path = "../../chain/chain" } near-network = { path = "../../chain/network" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } [dev-dependencies] serde_json = "1" diff --git a/test-utils/state-viewer/src/main.rs b/test-utils/state-viewer/src/main.rs index 2a739a8c69b..a388c349f49 100644 --- a/test-utils/state-viewer/src/main.rs +++ b/test-utils/state-viewer/src/main.rs @@ -25,7 +25,7 @@ use near_primitives::types::chunk_extra::ChunkExtra; use near_primitives::types::{BlockHeight, ShardId, StateRoot}; use near_store::test_utils::create_test_store; use near_store::{create_store, Store, TrieIterator}; -use neard::{get_default_home, get_store_path, load_config, NearConfig, NightshadeRuntime}; +use nearcore::{get_default_home, get_store_path, load_config, NearConfig, NightshadeRuntime}; use node_runtime::adapter::ViewRuntimeAdapter; use state_dump::state_dump; diff --git a/test-utils/state-viewer/src/state_dump.rs b/test-utils/state-viewer/src/state_dump.rs index 563d60a0410..bf741ef81f3 100644 --- a/test-utils/state-viewer/src/state_dump.rs +++ b/test-utils/state-viewer/src/state_dump.rs @@ -6,7 +6,7 @@ use near_primitives::block::BlockHeader; use near_primitives::state_record::StateRecord; use near_primitives::types::{AccountInfo, StateRoot}; use near_store::TrieIterator; -use neard::NightshadeRuntime; +use nearcore::NightshadeRuntime; pub fn state_dump( runtime: NightshadeRuntime, @@ -78,10 +78,10 @@ mod test { use near_primitives::types::NumBlocks; use near_store::test_utils::create_test_store; use near_store::Store; - use neard::config::GenesisExt; - use neard::config::TESTING_INIT_STAKE; - use neard::genesis_validate::validate_genesis; - use neard::NightshadeRuntime; + use nearcore::config::GenesisExt; + use nearcore::config::TESTING_INIT_STAKE; + use nearcore::genesis_validate::validate_genesis; + use nearcore::NightshadeRuntime; use crate::state_dump::state_dump; diff --git a/test-utils/store-validator/Cargo.toml b/test-utils/store-validator/Cargo.toml index 63d19ba6a5b..de8c5f803ce 100644 --- a/test-utils/store-validator/Cargo.toml +++ b/test-utils/store-validator/Cargo.toml @@ -13,7 +13,7 @@ near-logger-utils = { path = "../../test-utils/logger" } near-primitives = { path = "../../core/primitives" } near-store = { path = "../../core/store" } near-chain = { path = "../../chain/chain" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } [dev-dependencies] testlib = { path = "../../test-utils/testlib" } diff --git a/test-utils/store-validator/src/main.rs b/test-utils/store-validator/src/main.rs index 5de95b2cfad..919fef92fbd 100644 --- a/test-utils/store-validator/src/main.rs +++ b/test-utils/store-validator/src/main.rs @@ -9,7 +9,7 @@ use near_chain::store_validator::StoreValidator; use near_chain::RuntimeAdapter; use near_logger_utils::init_integration_logger; use near_store::create_store; -use neard::{get_default_home, get_store_path, load_config}; +use nearcore::{get_default_home, get_store_path, load_config}; fn main() { init_integration_logger(); @@ -31,7 +31,7 @@ fn main() { let store = create_store(&get_store_path(&home_dir)); - let runtime_adapter: Arc = Arc::new(neard::NightshadeRuntime::new( + let runtime_adapter: Arc = Arc::new(nearcore::NightshadeRuntime::new( &home_dir, store.clone(), &near_config.genesis, diff --git a/test-utils/testlib/Cargo.toml b/test-utils/testlib/Cargo.toml index 3f078bfb9e1..02d673e316a 100644 --- a/test-utils/testlib/Cargo.toml +++ b/test-utils/testlib/Cargo.toml @@ -8,7 +8,7 @@ name = "run-nodes" path = "src/run_nodes.rs" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" actix-rt = "2" clap = "2.33" log = "0.4" @@ -44,7 +44,7 @@ near-jsonrpc-primitives = { path = "../../chain/jsonrpc-primitives" } near-network = { path = "../../chain/network" } near-jsonrpc-client = { path = "../../chain/jsonrpc/client" } near-test-contracts = { path = "../../runtime/near-test-contracts" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-evm-runner = { path = "../../runtime/near-evm-runner", optional = true } [features] @@ -54,8 +54,8 @@ protocol_feature_alt_bn128 = [ "node-runtime/protocol_feature_alt_bn128", "near-vm-errors/protocol_feature_alt_bn128", ] -protocol_feature_evm = ["near-evm-runner/protocol_feature_evm", "near-primitives/protocol_feature_evm", "neard/protocol_feature_evm", "node-runtime/protocol_feature_evm", "near-chain-configs/protocol_feature_evm", "near-chain/protocol_feature_evm"] +protocol_feature_evm = ["near-evm-runner/protocol_feature_evm", "near-primitives/protocol_feature_evm", "nearcore/protocol_feature_evm", "node-runtime/protocol_feature_evm", "near-chain-configs/protocol_feature_evm", "near-chain/protocol_feature_evm"] protocol_feature_tx_size_limit = ["near-primitives/protocol_feature_tx_size_limit", "node-runtime/protocol_feature_tx_size_limit"] protocol_feature_allow_create_account_on_delete = ["near-primitives/protocol_feature_allow_create_account_on_delete"] -nightly_protocol_features = ["nightly_protocol", "neard/nightly_protocol_features"] -nightly_protocol = ["neard/nightly_protocol"] +nightly_protocol_features = ["nightly_protocol", "nearcore/nightly_protocol_features"] +nightly_protocol = ["nearcore/nightly_protocol"] diff --git a/test-utils/testlib/src/lib.rs b/test-utils/testlib/src/lib.rs index 925bdb35919..9ba36373a51 100644 --- a/test-utils/testlib/src/lib.rs +++ b/test-utils/testlib/src/lib.rs @@ -13,7 +13,7 @@ use near_primitives::block::{Block, BlockHeader}; use near_primitives::hash::CryptoHash; use near_primitives::types::{BlockHeight, BlockHeightDelta, NumSeats, NumShards, ShardId}; use near_store::test_utils::create_test_store; -use neard::{config::GenesisExt, load_test_config, start_with_config, NightshadeRuntime}; +use nearcore::{config::GenesisExt, load_test_config, start_with_config, NightshadeRuntime}; pub mod fees_utils; pub mod node; diff --git a/test-utils/testlib/src/node/mod.rs b/test-utils/testlib/src/node/mod.rs index 8cfb040fe49..fbda6484d87 100644 --- a/test-utils/testlib/src/node/mod.rs +++ b/test-utils/testlib/src/node/mod.rs @@ -9,10 +9,10 @@ use near_primitives::transaction::SignedTransaction; use near_primitives::types::{AccountId, Balance, NumSeats}; use near_primitives::validator_signer::InMemoryValidatorSigner; use near_primitives::views::AccountView; -use neard::config::{ +use nearcore::config::{ create_testnet_configs, create_testnet_configs_from_seeds, Config, GenesisExt, }; -use neard::NearConfig; +use nearcore::NearConfig; pub use crate::node::process_node::ProcessNode; pub use crate::node::runtime_node::RuntimeNode; diff --git a/test-utils/testlib/src/node/process_node.rs b/test-utils/testlib/src/node/process_node.rs index c7685c734b2..ce6e78c4986 100644 --- a/test-utils/testlib/src/node/process_node.rs +++ b/test-utils/testlib/src/node/process_node.rs @@ -10,7 +10,7 @@ use rand::Rng; use near_chain_configs::Genesis; use near_crypto::{InMemorySigner, KeyType, Signer}; use near_primitives::types::AccountId; -use neard::config::NearConfig; +use nearcore::config::NearConfig; use crate::node::Node; use crate::user::rpc_user::RpcUser; diff --git a/test-utils/testlib/src/node/runtime_node.rs b/test-utils/testlib/src/node/runtime_node.rs index 2c99a51ab8c..45aa5091586 100644 --- a/test-utils/testlib/src/node/runtime_node.rs +++ b/test-utils/testlib/src/node/runtime_node.rs @@ -6,7 +6,7 @@ use near_primitives::account::Account; use near_primitives::hash::CryptoHash; use near_primitives::state_record::StateRecord; use near_primitives::types::AccountId; -use neard::config::{GenesisExt, TESTING_INIT_BALANCE}; +use nearcore::config::{GenesisExt, TESTING_INIT_BALANCE}; use crate::node::Node; use crate::runtime_utils::{ diff --git a/test-utils/testlib/src/node/thread_node.rs b/test-utils/testlib/src/node/thread_node.rs index 397414910c1..8987752d4d5 100644 --- a/test-utils/testlib/src/node/thread_node.rs +++ b/test-utils/testlib/src/node/thread_node.rs @@ -5,7 +5,7 @@ use near_actix_test_utils::ShutdownableThread; use near_chain_configs::Genesis; use near_crypto::{InMemorySigner, KeyType, Signer}; use near_primitives::types::AccountId; -use neard::{start_with_config, NearConfig}; +use nearcore::{start_with_config, NearConfig}; use crate::node::Node; use crate::user::rpc_user::RpcUser; diff --git a/test-utils/testlib/src/runtime_utils.rs b/test-utils/testlib/src/runtime_utils.rs index 4b7b445f11b..6d219dd6aee 100644 --- a/test-utils/testlib/src/runtime_utils.rs +++ b/test-utils/testlib/src/runtime_utils.rs @@ -7,7 +7,7 @@ use near_primitives::state_record::{state_record_to_account_id, StateRecord}; use near_primitives::types::{AccountId, StateRoot}; use near_store::test_utils::create_tries; use near_store::{ShardTries, TrieUpdate}; -use neard::config::GenesisExt; +use nearcore::config::GenesisExt; use node_runtime::{state_viewer::TrieViewer, Runtime}; use std::collections::HashSet; diff --git a/test-utils/testlib/src/standard_test_cases.rs b/test-utils/testlib/src/standard_test_cases.rs index 4f606d2deea..89dec202d26 100644 --- a/test-utils/testlib/src/standard_test_cases.rs +++ b/test-utils/testlib/src/standard_test_cases.rs @@ -16,7 +16,7 @@ use near_primitives::views::{ AccessKeyView, AccountView, FinalExecutionOutcomeView, FinalExecutionStatus, }; use near_vm_errors::MethodResolveError; -use neard::config::{NEAR_BASE, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; +use nearcore::config::{NEAR_BASE, TESTING_INIT_BALANCE, TESTING_INIT_STAKE}; use crate::fees_utils::FeeHelper; use crate::node::Node; diff --git a/test-utils/testlib/src/user/runtime_user.rs b/test-utils/testlib/src/user/runtime_user.rs index ab6a7c6d5ca..41f1d93a142 100644 --- a/test-utils/testlib/src/user/runtime_user.rs +++ b/test-utils/testlib/src/user/runtime_user.rs @@ -19,9 +19,9 @@ use near_primitives::views::{ FinalExecutionOutcomeView, FinalExecutionStatus, ViewApplyState, ViewStateResult, }; use near_store::{ShardTries, TrieUpdate}; -use neard::config::MIN_GAS_PRICE; +use nearcore::config::MIN_GAS_PRICE; #[cfg(feature = "protocol_feature_evm")] -use neard::config::TESTNET_EVM_CHAIN_ID; +use nearcore::config::TESTNET_EVM_CHAIN_ID; use node_runtime::state_viewer::TrieViewer; use node_runtime::{ApplyState, Runtime}; diff --git a/tools/indexer/example/Cargo.toml b/tools/indexer/example/Cargo.toml index 4de312d4706..51692737c76 100644 --- a/tools/indexer/example/Cargo.toml +++ b/tools/indexer/example/Cargo.toml @@ -5,9 +5,9 @@ authors = ["Near Inc "] edition = "2018" [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" clap = "3.0.0-beta.1" -openssl-probe = { version = "0.1.2" } +openssl-probe = "0.1.2" serde_json = "1.0.55" tokio = { version = "1.1", features = ["sync"] } tracing = "0.1.13" diff --git a/tools/restaked/Cargo.toml b/tools/restaked/Cargo.toml index f79b9173d34..4dca8898e03 100644 --- a/tools/restaked/Cargo.toml +++ b/tools/restaked/Cargo.toml @@ -12,6 +12,6 @@ env_logger = "0.8" near-crypto = { path = "../../core/crypto" } near-primitives = { path = "../../core/primitives" } near-jsonrpc-client = { path = "../../chain/jsonrpc/client" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } testlib = { path = "../../test-utils/testlib" } diff --git a/tools/restaked/src/main.rs b/tools/restaked/src/main.rs index 2f30c46f126..0421113e690 100644 --- a/tools/restaked/src/main.rs +++ b/tools/restaked/src/main.rs @@ -7,8 +7,8 @@ use log::{error, info, LevelFilter}; use near_crypto::{InMemorySigner, KeyFile}; use near_primitives::views::CurrentEpochValidatorInfo; -use neard::config::{Config, BLOCK_PRODUCER_KICKOUT_THRESHOLD, CONFIG_FILENAME}; -use neard::get_default_home; +use nearcore::config::{Config, BLOCK_PRODUCER_KICKOUT_THRESHOLD, CONFIG_FILENAME}; +use nearcore::get_default_home; // TODO(1905): Move out RPC interface for transacting into separate production crate. use testlib::user::{rpc_user::RpcUser, User}; diff --git a/tools/restored-receipts-verifier/Cargo.toml b/tools/restored-receipts-verifier/Cargo.toml index 263bb8d0a1a..96cf5bc6bb8 100644 --- a/tools/restored-receipts-verifier/Cargo.toml +++ b/tools/restored-receipts-verifier/Cargo.toml @@ -11,7 +11,7 @@ clap = "3.0.0-beta.1" serde_json = "1" near-primitives = { path = "../../core/primitives" } -neard = { path = "../../neard" } +nearcore = { path = "../../nearcore" } near-store = { path = "../../core/store" } near-chain = { path = "../../chain/chain" } near-jsonrpc = { path = "../../chain/jsonrpc" } diff --git a/tools/restored-receipts-verifier/src/main.rs b/tools/restored-receipts-verifier/src/main.rs index 1d220c085be..8f0d7e002bb 100644 --- a/tools/restored-receipts-verifier/src/main.rs +++ b/tools/restored-receipts-verifier/src/main.rs @@ -12,8 +12,8 @@ use near_primitives::receipt::Receipt; use near_primitives::receipt::ReceiptResult; use near_store::create_store; #[cfg(feature = "protocol_feature_restore_receipts_after_fix")] -use neard::migrations::load_migration_data; -use neard::{get_default_home, get_store_path, load_config, NightshadeRuntime}; +use nearcore::migrations::load_migration_data; +use nearcore::{get_default_home, get_store_path, load_config, NightshadeRuntime}; fn get_receipt_hashes_in_repo() -> Vec { #[cfg(not(feature = "protocol_feature_restore_receipts_after_fix"))] diff --git a/utils/near-performance-metrics/Cargo.toml b/utils/near-performance-metrics/Cargo.toml index 6345dda0a2c..8013dbc5e6d 100644 --- a/utils/near-performance-metrics/Cargo.toml +++ b/utils/near-performance-metrics/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -actix = "0.11.0-beta.2" +actix = "=0.11.0-beta.2" futures = "0.3.5" log = "0.4" once_cell = "1.5.2"