message: [network] Set TCP_NODELAY for tcp connections
  Closes:
  Approved by: ankushagarwal
diff: @@ -27,6 +27,16 @@ use std::{
  /// A timeout for the connection to open and complete all of the upgrade steps.
  const TRANSPORT_TIMEOUT: Duration = Duration::from_secs(30);
  +const LIBRA_TCP_TRANSPORT: tcp::TcpTransport = tcp::TcpTransport {
  + // Use default options.
  + recv_buffer_size: None,
  + send_buffer_size: None,
  + ttl: None,
  + keepalive: None,
  + // Use TCP_NODELAY for libra tcp connections.
  + nodelay: Some(true),
  +};
  +
  fn identity_key_to_peer_id(
  trusted_peers: &RwLock<HashMap<PeerId, NetworkPublicKeys>>,
  remote_static_key: &[u8],
  @@ -184,10 +194,9 @@ pub fn build_tcp_noise_transport(
  identity_keypair: (X25519StaticPrivateKey, X25519StaticPublicKey),
  trusted_peers: Arc<RwLock<HashMap<PeerId, NetworkPublicKeys>>>,
  ) -> boxed::BoxedTransport<(Identity, impl StreamMultiplexer), impl ::std::error::Error> {
  - let tcp_transport = tcp::TcpTransport::default();
  let noise_config = Arc::new(NoiseConfig::new(identity_keypair));
  - tcp_transport
  + LIBRA_TCP_TRANSPORT
  .and_then(move |socket, origin| {
  async move {
  let (remote_static_key, socket) =
  @@ -227,9 +236,8 @@ pub fn build_permissionless_tcp_noise_transport(
  own_identity: Identity,
  identity_keypair: (X25519StaticPrivateKey, X25519StaticPublicKey),
  ) -> boxed::BoxedTransport<(Identity, impl StreamMultiplexer), impl ::std::error::Error> {
  - let tcp_transport = tcp::TcpTransport::default();
  let noise_config = Arc::new(NoiseConfig::new(identity_keypair));
  - tcp_transport
  + LIBRA_TCP_TRANSPORT
  .and_then(move |socket, origin| {
  async move {
  let (remote_static_key, socket) =
  @@ -266,9 +274,7 @@ pub fn build_permissionless_tcp_noise_transport(
  pub fn build_tcp_transport(
  own_identity: Identity,
  ) -> boxed::BoxedTransport<(Identity, impl StreamMultiplexer), impl ::std::error::Error> {
  - let tcp_transport = tcp::TcpTransport::default();
  -
  - tcp_transport
  + LIBRA_TCP_TRANSPORT
  .and_then(|socket, origin| {
  async move {
  let muxer = Yamux::upgrade_connection(socket, origin).await?;
  