Skip to content

Commit

Permalink
Reduce anemo message limit to 1G (#13231) (#13240)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran authored Jul 31, 2023
1 parent 53ac107 commit 8459599
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/mysten-network/src/codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub mod anemo {

fn decode(&mut self, buf: bytes::Bytes) -> Result<Self::Item, Self::Error> {
let compressed_size = buf.len();
let mut snappy_decoder = snap::read::FrameDecoder::new(buf.reader());
let mut snappy_decoder = snap::read::FrameDecoder::new(buf.reader()).take(1 << 30);
let mut bytes = Vec::with_capacity(compressed_size);
snappy_decoder.read_to_end(&mut bytes)?;
bcs::from_bytes(bytes.as_slice())
Expand Down
4 changes: 2 additions & 2 deletions crates/sui-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -797,9 +797,9 @@ impl SuiNode {
.into_inner();

let mut anemo_config = config.p2p_config.anemo_config.clone().unwrap_or_default();
// Set the max_frame_size to be 2 GB to work around the issue of there being too many
// Set the max_frame_size to be 1 GB to work around the issue of there being too many
// staking events in the epoch change txn.
anemo_config.max_frame_size = Some(2 << 30);
anemo_config.max_frame_size = Some(1 << 30);

// Set a higher default value for socket send/receive buffers if not already
// configured.
Expand Down
4 changes: 2 additions & 2 deletions narwhal/primary/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ impl Primary {
quic_config.keep_alive_interval_ms = Some(5_000);
let mut config = anemo::Config::default();
config.quic = Some(quic_config);
// Set the max_frame_size to be 2 GB to work around the issue of there being too many
// Set the max_frame_size to be 1 GB to work around the issue of there being too many
// delegation events in the epoch change txn.
config.max_frame_size = Some(2 << 30);
config.max_frame_size = Some(1 << 30);
// Set a default timeout of 300s for all RPC requests
config.inbound_request_timeout_ms = Some(300_000);
config.outbound_request_timeout_ms = Some(300_000);
Expand Down
4 changes: 2 additions & 2 deletions narwhal/worker/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,9 @@ impl Worker {
quic_config.keep_alive_interval_ms = Some(5_000);
let mut config = anemo::Config::default();
config.quic = Some(quic_config);
// Set the max_frame_size to be 2 GB to work around the issue of there being too many
// Set the max_frame_size to be 1 GB to work around the issue of there being too many
// delegation events in the epoch change txn.
config.max_frame_size = Some(2 << 30);
config.max_frame_size = Some(1 << 30);
// Set a default timeout of 300s for all RPC requests
config.inbound_request_timeout_ms = Some(300_000);
config.outbound_request_timeout_ms = Some(300_000);
Expand Down

0 comments on commit 8459599

Please sign in to comment.