Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion chain/network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ lazy_static = "1.4"
tracing = "0.1.13"
strum = { version = "0.20", features = ["derive"] }
near-rust-allocator-proxy = "0.2.9"
size = "0.1.2"
bytesize = "1.0.1"

borsh = "0.8.1"
cached = "0.23"
Expand Down
6 changes: 3 additions & 3 deletions chain/network/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::io::{Error, ErrorKind};

use borsh::{BorshDeserialize, BorshSerialize};
use bytes::{Buf, BufMut, BytesMut};
use bytesize::{GIB, MIB};
use log::error;
use tokio_util::codec::{Decoder, Encoder};

Expand All @@ -11,10 +12,9 @@ use near_performance_metrics::framed_write::EncoderCallBack;
#[cfg(feature = "performance_stats")]
use near_performance_metrics::stats_enabled::get_thread_stats_logger;
use near_rust_allocator_proxy::allocator::get_tid;
use size::{GIBIBYTE, MEBIBYTE};

const NETWORK_MESSAGE_MAX_SIZE: u32 = 512 * MEBIBYTE as u32; // 512MB
const MAX_CAPACITY: u64 = GIBIBYTE;
const NETWORK_MESSAGE_MAX_SIZE: u32 = 512 * MIB as u32;
const MAX_CAPACITY: u64 = GIB;

pub struct Codec {
max_length: u32,
Expand Down