diff --git a/Cargo.lock b/Cargo.lock index 534d1b9bc7c..b7edd049733 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7502,9 +7502,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d09dc0ba83ddaceb9b0846ed11a6c26a449b69fa2709e0335d268f44491921" +checksum = "46fdae7245128f284476e6db9653ef0a15b011975091bcd7f9d7303132409662" dependencies = [ "enumset", "rkyv", @@ -7518,9 +7518,9 @@ dependencies = [ [[package]] name = "wasmer-compiler-singlepass-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f34bf0625219766759851c1f92e0797787b8b10b424c0a273ee4e0328a2ff7" +checksum = "ac4af0e438015585eb27b2c6f6869c58c540bfe27408b686b1778470bf301050" dependencies = [ "byteorder", "dynasm 1.2.3", @@ -7537,9 +7537,9 @@ dependencies = [ [[package]] name = "wasmer-engine-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8353167be3099f3bd033cb9c8479a02d69917777cf4c2e52a09946d5582457" +checksum = "4048411cabb2c94c7d8d11d9d0282cc6b15308b61ebc1e122c40e89865ebb5c5" dependencies = [ "backtrace", "enumset", @@ -7556,9 +7556,9 @@ dependencies = [ [[package]] name = "wasmer-engine-universal-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c34fb4f6af2209a36c5e6ed407c9e057fdd2e722e762f702dbd8575896349c62" +checksum = "c5f31c3d2850ac7957406d3c9581d9435ea8126a26478709fa7e931b6f562b4d" dependencies = [ "cfg-if 1.0.0", "enumset", @@ -7639,9 +7639,9 @@ dependencies = [ [[package]] name = "wasmer-types-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1131dfac4d92947acef554a75b433122ca635414c23934f53434ec0efc5994d" +checksum = "1ba154adffb0fbd33f5dabd3788a1744d846b43e6e090d44269c7ee8fa5743e4" dependencies = [ "indexmap", "rkyv", @@ -7650,9 +7650,9 @@ dependencies = [ [[package]] name = "wasmer-vm-near" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a47f13d5c412974a38bba01a8b009e1e49bffbee45387198403b269a74d7374" +checksum = "70a5585596f6e9915d606de944aece51626736fb1191aefb5b2ef108c6f7604a" dependencies = [ "backtrace", "cc", diff --git a/Cargo.toml b/Cargo.toml index a53b4c5ff6e..b4ced74e725 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ version = "0.0.0" # managed by cargo-workspaces, see below authors = ["Near Inc "] edition = "2021" -rust-version = "1.69.0" +rust-version = "1.70.0" repository = "https://github.com/near/nearcore" license = "MIT OR Apache-2.0" @@ -316,14 +316,14 @@ trybuild = "1.0.11" turn = "0.6" validator = "0.12" wasm-encoder = "0.27.0" -wasmer-compiler = { package = "wasmer-compiler-near", version = "=2.4.0" } -wasmer-compiler-singlepass = { package = "wasmer-compiler-singlepass-near", version = "=2.4.0" } -wasmer-engine = { package = "wasmer-engine-near", version = "=2.4.0" } -wasmer-engine-universal = { package = "wasmer-engine-universal-near", version = "=2.4.0", features = ["compiler"] } +wasmer-compiler = { package = "wasmer-compiler-near", version = "=2.4.1" } +wasmer-compiler-singlepass = { package = "wasmer-compiler-singlepass-near", version = "=2.4.1" } +wasmer-engine = { package = "wasmer-engine-near", version = "=2.4.1" } +wasmer-engine-universal = { package = "wasmer-engine-universal-near", version = "=2.4.1", features = ["compiler"] } wasmer-runtime = { version = "0.18.0", package = "wasmer-runtime-near", features = ["default-backend-singlepass"], default-features = false } wasmer-runtime-core = { version = "0.18.2", package = "wasmer-runtime-core-near" } -wasmer-types = { package = "wasmer-types-near", version = "=2.4.0" } -wasmer-vm = { package = "wasmer-vm-near", version = "=2.4.0" } +wasmer-types = { package = "wasmer-types-near", version = "=2.4.1" } +wasmer-vm = { package = "wasmer-vm-near", version = "=2.4.1" } wasmparser = "0.78" # TODO: unify at least the versions of wasmparser we have in our codebase wasmprinter = "0.2" wasm-smith = "0.10" diff --git a/chain/chain/src/store.rs b/chain/chain/src/store.rs index 334ddcd7d51..906cf51e5e0 100644 --- a/chain/chain/src/store.rs +++ b/chain/chain/src/store.rs @@ -3280,6 +3280,7 @@ mod tests { let genesis = chain.get_block_by_height(0).unwrap(); let signer = Arc::new(create_test_signer("test1")); let mut short_fork = vec![]; + #[allow(clippy::redundant_clone)] let mut prev_block = genesis.clone(); for i in 1..(transaction_validity_period + 2) { let mut store_update = chain.mut_store().store_update(); @@ -3300,6 +3301,7 @@ mod tests { Err(InvalidTxError::Expired) ); let mut long_fork = vec![]; + #[allow(clippy::redundant_clone)] let mut prev_block = genesis.clone(); for i in 1..(transaction_validity_period * 5) { let mut store_update = chain.mut_store().store_update(); @@ -3524,6 +3526,7 @@ mod tests { let mut chain = get_chain_with_epoch_length(1); let genesis = chain.get_block_by_height(0).unwrap(); let signer = Arc::new(create_test_signer("test1")); + #[allow(clippy::redundant_clone)] let mut prev_block = genesis.clone(); let mut blocks = vec![prev_block.clone()]; { diff --git a/chain/client-primitives/src/types.rs b/chain/client-primitives/src/types.rs index 80a4829d328..73fe7937197 100644 --- a/chain/client-primitives/src/types.rs +++ b/chain/client-primitives/src/types.rs @@ -177,7 +177,7 @@ impl From for ShardSyncDownloadView { } } -#[derive(Debug)] +#[derive(Debug, Default)] pub struct StateSplitApplyingStatus { /// total number of parts to be applied pub total_parts: OnceCell, @@ -185,12 +185,6 @@ pub struct StateSplitApplyingStatus { pub done_parts: AtomicU64, } -impl StateSplitApplyingStatus { - pub fn new() -> Self { - StateSplitApplyingStatus { total_parts: OnceCell::new(), done_parts: AtomicU64::new(0) } - } -} - /// Stores status of shard sync and statuses of downloading shards. #[derive(Clone, Debug)] pub struct ShardSyncDownload { diff --git a/chain/client/src/debug.rs b/chain/client/src/debug.rs index 90e37e90465..b16d3d15f74 100644 --- a/chain/client/src/debug.rs +++ b/chain/client/src/debug.rs @@ -391,7 +391,7 @@ impl ClientActor { let mut blocks: HashMap = HashMap::new(); let mut missed_heights: Vec = Vec::new(); - let mut last_epoch_id = head.epoch_id.clone(); + let mut last_epoch_id = head.epoch_id; let initial_gas_price = self.client.chain.genesis_block().header().gas_price(); let mut height_to_fetch = starting_height.unwrap_or(header_head.height); @@ -537,6 +537,7 @@ impl ClientActor { min(head.height + DEBUG_MAX_PRODUCTION_BLOCKS_TO_SHOW, estimated_epoch_end), ); + #[allow(clippy::redundant_clone)] let mut epoch_id = head.epoch_id.clone(); for height in head.height.saturating_sub(DEBUG_PRODUCTION_OLD_BLOCKS_TO_SHOW)..=max_height diff --git a/chain/client/src/sync/state.rs b/chain/client/src/sync/state.rs index 5e659190570..8515d84124c 100644 --- a/chain/client/src/sync/state.rs +++ b/chain/client/src/sync/state.rs @@ -1168,7 +1168,7 @@ impl StateSync { state_split_scheduler: &dyn Fn(StateSplitRequest), me: &Option, ) -> Result<(), near_chain::Error> { - let status = Arc::new(StateSplitApplyingStatus::new()); + let status = Arc::new(StateSplitApplyingStatus::default()); chain.build_state_for_split_shards_preprocessing( &sync_hash, shard_id, diff --git a/chain/client/src/tests/catching_up.rs b/chain/client/src/tests/catching_up.rs index 883fe83a6c8..1e3b6cd501a 100644 --- a/chain/client/src/tests/catching_up.rs +++ b/chain/client/src/tests/catching_up.rs @@ -691,8 +691,6 @@ fn test_chunk_grieving() { let grieving_chunk_hash = Arc::new(RwLock::new(ChunkHash::default())); let unaccepted_block_hash = Arc::new(RwLock::new(CryptoHash::default())); - let _connectors1 = connectors.clone(); - let block_prod_time: u64 = 3500; let (_, conn, _) = setup_mock_all_validators( vs, @@ -852,7 +850,6 @@ fn test_all_chunks_accepted_common( let verbose = false; - let _connectors1 = connectors.clone(); let seen_chunk_same_sender = Arc::new(RwLock::new(HashSet::<(AccountId, u64, u64)>::new())); let requested = Arc::new(RwLock::new(HashSet::<(AccountId, Vec, ChunkHash)>::new())); let responded = Arc::new(RwLock::new(HashSet::<(CryptoHash, Vec, ChunkHash)>::new())); diff --git a/integration-tests/src/tests/client/features/access_key_nonce_for_implicit_accounts.rs b/integration-tests/src/tests/client/features/access_key_nonce_for_implicit_accounts.rs index 515f2257da7..eec91272d3b 100644 --- a/integration-tests/src/tests/client/features/access_key_nonce_for_implicit_accounts.rs +++ b/integration-tests/src/tests/client/features/access_key_nonce_for_implicit_accounts.rs @@ -132,7 +132,7 @@ fn get_status_of_tx_hash_collision_for_implicit_account( let signer1 = InMemorySigner::from_seed("test1".parse().unwrap(), KeyType::ED25519, "test1"); - let public_key = signer1.public_key.clone(); + let public_key = &signer1.public_key; let raw_public_key = public_key.unwrap_as_ed25519().0.to_vec(); let implicit_account_id = AccountId::try_from(hex::encode(&raw_public_key)).unwrap(); let implicit_account_signer = diff --git a/pytest/tools/prober/prober_split.py b/pytest/tools/prober/prober_split.py index 73df7456ef1..fa9ed35892a 100755 --- a/pytest/tools/prober/prober_split.py +++ b/pytest/tools/prober/prober_split.py @@ -113,15 +113,14 @@ def check_view_call(legacy_url, split_url): "method_name": "get_num", "args_base64": "e30=" } - legacy_response = json_rpc('query', params, legacy_url) - split_response = json_rpc('query', params, split_url) + legacy_resp = json_rpc('query', params, legacy_url) + split_resp = json_rpc('query', params, split_url) - if legacy_response['result']['result'] != split_response['result'][ - 'result']: + if legacy_resp['result']['result'] != split_resp['result']['result']: logger.error( f'View call check failed, the legacy response and the split response are different' - f'\nlegacy response\n{legacy_response}' - f'\nsplit response\n{split_response}') + f'\nlegacy response\n{legacy_resp}' + f'\nsplit response\n{split_resp}') sys.exit(1) diff --git a/runtime/near-vm-runner/src/tests/cache.rs b/runtime/near-vm-runner/src/tests/cache.rs index c7a401523b3..4c2720686d7 100644 --- a/runtime/near-vm-runner/src/tests/cache.rs +++ b/runtime/near-vm-runner/src/tests/cache.rs @@ -123,11 +123,11 @@ fn test_wasmer2_artifact_output_stability() { let compiled_hashes = [ 16241863964906842660, 9891733092817574479, - 10546692418763942004, - 13653435153125107606, + 17353479639813695155, + 14282522049460604929, 10549554738494211661, - 11197084127324548219, - 6788687979647989853, + 15523181531223292814, + 1999054137996096555, ]; let mut got_compiled_hashes = Vec::with_capacity(seeds.len()); for seed in seeds { diff --git a/runtime/near-vm-runner/src/wasmer2_runner.rs b/runtime/near-vm-runner/src/wasmer2_runner.rs index ad9ccba772f..6bdc4d1a623 100644 --- a/runtime/near-vm-runner/src/wasmer2_runner.rs +++ b/runtime/near-vm-runner/src/wasmer2_runner.rs @@ -220,7 +220,7 @@ impl Wasmer2Config { // major version << 6 // minor version const WASMER2_CONFIG: Wasmer2Config = Wasmer2Config { - seed: (1 << 10) | (10 << 6) | 0, + seed: (1 << 10) | (11 << 6) | 0, engine: WasmerEngine::Universal, compiler: WasmerCompiler::Singlepass, }; diff --git a/runtime/near-vm/compiler-test-derive/src/lib.rs b/runtime/near-vm/compiler-test-derive/src/lib.rs index 652b0d6d196..16b6979e304 100644 --- a/runtime/near-vm/compiler-test-derive/src/lib.rs +++ b/runtime/near-vm/compiler-test-derive/src/lib.rs @@ -32,7 +32,7 @@ macro_rules! parse_macro_input { pub fn compiler_test(attrs: TokenStream, input: TokenStream) -> TokenStream { let path: Option = parse::(attrs).ok(); let mut my_fn: ItemFn = parse_macro_input!(input as ItemFn); - let fn_name = my_fn.sig.ident.clone(); + let fn_name = &my_fn.sig.ident; // Let's build the ignores to append an `#[ignore]` macro to the // autogenerated tests in case the test appears in the `ignores.txt` path; diff --git a/runtime/runtime-params-estimator/emu-cost/Dockerfile b/runtime/runtime-params-estimator/emu-cost/Dockerfile index 8f911bdc4ee..6b3856e7936 100644 --- a/runtime/runtime-params-estimator/emu-cost/Dockerfile +++ b/runtime/runtime-params-estimator/emu-cost/Dockerfile @@ -1,5 +1,5 @@ # our local base image -FROM rust:1.69.0 +FROM rust:1.70.0 LABEL description="Container for builds" diff --git a/runtime/runtime/src/actions.rs b/runtime/runtime/src/actions.rs index f593e35843a..70b0f28ebec 100644 --- a/runtime/runtime/src/actions.rs +++ b/runtime/runtime/src/actions.rs @@ -1376,13 +1376,13 @@ mod tests { #[test] fn test_validate_delegate_action_key_update_nonce() { let (_, signed_delegate_action) = create_delegate_action_receipt(); - let sender_id = signed_delegate_action.delegate_action.sender_id.clone(); - let sender_pub_key = signed_delegate_action.delegate_action.public_key.clone(); + let sender_id = &signed_delegate_action.delegate_action.sender_id; + let sender_pub_key = &signed_delegate_action.delegate_action.public_key; let access_key = AccessKey { nonce: 19000000, permission: AccessKeyPermission::FullAccess }; let apply_state = create_apply_state(signed_delegate_action.delegate_action.max_block_height); - let mut state_update = setup_account(&sender_id, &sender_pub_key, &access_key); + let mut state_update = setup_account(sender_id, sender_pub_key, &access_key); // Everything is ok let mut result = ActionResult::default(); diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b2d89484fb7..02fb9bb7c5d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -2,6 +2,6 @@ # This specifies the version of Rust we use to build. # Individual crates in the workspace may support a lower version, as indicated by `rust-version` field in each crate's `Cargo.toml`. # The version specified below, should be at least as high as the maximum `rust-version` within the workspace. -channel = "1.69.0" +channel = "1.70.0" components = [ "rustfmt" ] targets = [ "wasm32-unknown-unknown" ]