RPC: Limit request payload size to 50kB

This commit is contained in:
Trent Nelson
2020-09-16 12:50:43 -06:00
committed by mergify[bot]
parent f6cda2579f
commit 32dcce0ac1
3 changed files with 5 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
//! The `pubsub` module implements a threaded subscription service on client RPC request
use crate::{
rpc::MAX_REQUEST_PAYLOAD_SIZE,
rpc_pubsub::{RpcSolPubSub, RpcSolPubSubImpl},
rpc_subscriptions::RpcSubscriptions,
};
@@ -44,7 +45,7 @@ impl PubSubService {
session
})
.max_connections(1000) // Arbitrary, default of 100 is too low
.max_payload(10 * 1024 * 1024 + 1024) // max account size (10MB) + extra (1K)
.max_payload(MAX_REQUEST_PAYLOAD_SIZE)
.start(&pubsub_addr);
if let Err(e) = server {