Skip to content

Commit

Permalink
network: use sui-http for running gRPC http server
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed Jan 2, 2025
1 parent c97668f commit b19b7af
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 339 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/mysten-network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,4 @@ tower.workspace = true
tower-http.workspace = true
pin-project-lite = "0.2.13"
tracing.workspace = true
sui-http.workspace = true
13 changes: 12 additions & 1 deletion crates/mysten-network/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::time::Duration;
use tokio_rustls::rustls::ClientConfig;
use tonic::transport::Channel;

#[derive(Debug, Default, Deserialize, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
pub struct Config {
/// Set the concurrency limit applied to on requests inbound per connection.
pub concurrency_limit_per_connection: Option<usize>,
Expand Down Expand Up @@ -106,4 +106,15 @@ impl Config {
) -> Result<Channel> {
connect_lazy_with_config(addr, tls_config, self)
}

pub(crate) fn http_config(&self) -> sui_http::Config {
sui_http::Config::default()
.initial_stream_window_size(self.http2_initial_stream_window_size)
.initial_connection_window_size(self.http2_initial_connection_window_size)
.max_concurrent_streams(self.http2_max_concurrent_streams)
.http2_keepalive_timeout(self.http2_keepalive_timeout)
.http2_keepalive_interval(self.http2_keepalive_interval)
.tcp_keepalive(self.tcp_keepalive)
.tcp_nodelay(self.tcp_nodelay.unwrap_or_default())
}
}
Loading

0 comments on commit b19b7af

Please sign in to comment.