Skip to content

Commit

Permalink
hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
pmnoxx committed Nov 17, 2021
1 parent eb8fb9a commit 15a0640
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 18 deletions.
11 changes: 7 additions & 4 deletions chain/network/src/peer/peer_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ use std::cmp::max;
use std::fmt::Debug;
use std::io;
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use std::time::{Duration, Instant};

use actix::{
Expand All @@ -22,20 +24,21 @@ use near_network_primitives::types::{
ReasonForBan, RoutedMessage, RoutedMessageBody, RoutedMessageFrom, StateResponseInfo,
UPDATE_INTERVAL_LAST_TIME_RECEIVED_MESSAGE,
};
use near_performance_metrics;
use near_performance_metrics::framed_write::{FramedWrite, WriteHandler};
use near_performance_metrics_macros::perf;
use near_primitives::block::GenesisId;
use near_primitives::logging;
use near_primitives::network::PeerId;
use near_primitives::sharding::PartialEncodedChunk;
use near_primitives::time::Clock;
use near_primitives::unwrap_option_or_return;
use near_primitives::utils::DisplayOption;
use near_primitives::version::{
ProtocolVersion, OLDEST_BACKWARD_COMPATIBLE_PROTOCOL_VERSION, PROTOCOL_VERSION,
};
use near_primitives::{logging, unwrap_option_or_return};
use near_rate_limiter::ThrottleController;
use near_rust_allocator_proxy::allocator::get_tid;
use {near_metrics, near_performance_metrics};

use crate::peer::tracker::Tracker;
use crate::routing::codec::{self, bytes_to_peer_message, peer_message_to_bytes, Codec};
Expand Down
4 changes: 2 additions & 2 deletions chain/network/src/peer_manager/peer_manager_actor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use std::collections::{HashMap, HashSet};
use std::mem::swap;
use std::net::SocketAddr;
use std::pin::Pin;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::sync::atomic::Ordering;
use std::sync::{atomic::AtomicUsize, Arc};
use std::time::{Duration, Instant};

use actix::{
Expand Down
6 changes: 4 additions & 2 deletions chain/network/src/peer_manager/peer_store.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::collections::hash_map::{Entry, Iter};
use std::collections::HashMap;
use std::collections::{
hash_map::{Entry, Iter},
HashMap,
};
use std::net::SocketAddr;
use std::sync::Arc;

Expand Down
6 changes: 4 additions & 2 deletions chain/network/src/routing/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ mod test {
use near_primitives::hash::{self, CryptoHash};
use near_primitives::network::{AnnounceAccount, PeerId};
use near_primitives::transaction::{SignedTransaction, Transaction};
use near_primitives::types::EpochId;
use near_primitives::version::{OLDEST_BACKWARD_COMPATIBLE_PROTOCOL_VERSION, PROTOCOL_VERSION};
use near_primitives::{
types::EpochId,
version::{OLDEST_BACKWARD_COMPATIBLE_PROTOCOL_VERSION, PROTOCOL_VERSION},
};

use super::*;
use crate::routing::edge::EdgeInfo;
Expand Down
6 changes: 3 additions & 3 deletions chain/network/src/routing/route_back_cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::collections::{btree_map, BTreeMap, BTreeSet, HashMap};
use std::collections::btree_map;
use std::collections::{BTreeMap, BTreeSet, HashMap};
use std::time::{Duration, Instant};

use near_primitives::hash::CryptoHash;
Expand Down Expand Up @@ -228,8 +229,7 @@ impl RouteBackCache {
mod test {
use super::*;
use near_primitives::hash::hash;
use std::thread;
use std::time::Duration;
use std::{thread, time::Duration};

/// Check internal state of the cache is ok
fn check_consistency(cache: &RouteBackCache) {
Expand Down
3 changes: 1 addition & 2 deletions chain/network/src/routing/routing.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use near_primitives::time::Clock;
use std::collections::hash_map::Entry;
use std::collections::{HashMap, VecDeque};
use std::collections::{hash_map::Entry, HashMap, VecDeque};
use std::hash::Hash;
use std::sync::{Arc, Mutex};
use std::time::{Duration, Instant};
Expand Down
6 changes: 3 additions & 3 deletions chain/network/src/types.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use near_primitives::time::Instant;
use std::collections::HashMap;
use std::fmt;
use std::fmt::{Debug, Formatter};
use std::io;
use std::sync::{Arc, Mutex, RwLock};
use std::{fmt, io};

use actix::dev::{MessageResponse, ResponseChannel};
use actix::{Actor, Addr, MailboxError, Message, Recipient};
use borsh::{BorshDeserialize, BorshSerialize};
use futures::future::BoxFuture;
use futures::FutureExt;
use futures::{future::BoxFuture, FutureExt};
#[cfg(feature = "test_features")]
use serde::Serialize;
use strum::AsStaticStr;
Expand Down

0 comments on commit 15a0640

Please sign in to comment.