Merging MTU changes and setting up transportation config (#293)
* remove block_debug_listen (#286) * remove block_debug_listen caused a panic - need more time to investigate 2024-01-17T20:31:42.913 app[683d392fd45368] ams [info] thread 'tokio-runtime-worker' panicked at cluster-endpoints/src/grpc_inspect.rs:59:21: 2024-01-17T20:31:42.913 app[683d392fd45368] ams [info] Error receiving block: Closed 2024-01-17T20:31:42.922 app[683d392fd45368] ams [info] 2024-01-17T20:31:42.912597Z ERROR lite_rpc: Services quit unexpectedly Err(cluster endpoint failure (Err(JoinError::Panic(Id(20), ...)), 1, [JoinHandle { id: Id(19) }, JoinHandle { id: Id(23) }]) * clippy * Fixing message too long and overflow panics (#288) * Update geyser grpc connector commit (#289) * Updating the transport config to match with solana endpoint (#292) * Updating the transport config to match with solana endpoint * Setting max MTU after groovies comments --------- Co-authored-by: Groovie | Mango <95291500+grooviegermanikus@users.noreply.github.com>
This commit is contained in:
parent
392ffe3103
commit
6cbccd0341
|
@ -2,7 +2,7 @@ use log::trace;
|
|||
use prometheus::{core::GenericGauge, opts, register_int_gauge};
|
||||
use quinn::{
|
||||
ClientConfig, Connection, ConnectionError, Endpoint, EndpointConfig, IdleTimeout, SendStream,
|
||||
TokioRuntime, TransportConfig,
|
||||
TokioRuntime, TransportConfig, VarInt,
|
||||
};
|
||||
use solana_lite_rpc_core::network_utils::apply_gso_workaround;
|
||||
use solana_sdk::pubkey::Pubkey;
|
||||
|
@ -55,12 +55,20 @@ pub struct QuicConnectionUtils {}
|
|||
|
||||
impl QuicConnectionUtils {
|
||||
pub fn create_endpoint(certificate: rustls::Certificate, key: rustls::PrivateKey) -> Endpoint {
|
||||
const DATAGRAM_RECEIVE_BUFFER_SIZE: usize = 64 * 1024 * 1024;
|
||||
const DATAGRAM_SEND_BUFFER_SIZE: usize = 64 * 1024 * 1024;
|
||||
const INITIAL_MAXIMUM_TRANSMISSION_UNIT: u16 = MINIMUM_MAXIMUM_TRANSMISSION_UNIT;
|
||||
const MINIMUM_MAXIMUM_TRANSMISSION_UNIT: u16 = 1280;
|
||||
|
||||
let mut endpoint = {
|
||||
let client_socket =
|
||||
solana_net_utils::bind_in_range(IpAddr::V4(Ipv4Addr::UNSPECIFIED), (8000, 10000))
|
||||
.expect("create_endpoint bind_in_range")
|
||||
.1;
|
||||
let config = EndpointConfig::default();
|
||||
let mut config = EndpointConfig::default();
|
||||
config
|
||||
.max_udp_payload_size(MINIMUM_MAXIMUM_TRANSMISSION_UNIT)
|
||||
.expect("Should set max MTU");
|
||||
quinn::Endpoint::new(config, None, client_socket, Arc::new(TokioRuntime))
|
||||
.expect("create_endpoint quinn::Endpoint::new")
|
||||
};
|
||||
|
@ -79,6 +87,13 @@ impl QuicConnectionUtils {
|
|||
let timeout = IdleTimeout::try_from(Duration::from_secs(1)).unwrap();
|
||||
transport_config.max_idle_timeout(Some(timeout));
|
||||
transport_config.keep_alive_interval(Some(Duration::from_millis(500)));
|
||||
transport_config.datagram_receive_buffer_size(Some(DATAGRAM_RECEIVE_BUFFER_SIZE));
|
||||
transport_config.datagram_send_buffer_size(DATAGRAM_SEND_BUFFER_SIZE);
|
||||
transport_config.initial_mtu(INITIAL_MAXIMUM_TRANSMISSION_UNIT);
|
||||
transport_config.max_concurrent_bidi_streams(VarInt::from(0u8));
|
||||
transport_config.max_concurrent_uni_streams(VarInt::from(0u8));
|
||||
transport_config.min_mtu(MINIMUM_MAXIMUM_TRANSMISSION_UNIT);
|
||||
transport_config.mtu_discovery_config(None);
|
||||
apply_gso_workaround(&mut transport_config);
|
||||
config.transport_config(Arc::new(transport_config));
|
||||
|
||||
|
|
Loading…
Reference in New Issue