Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[avalanche-types] Set max message size to usize.MAX for gRPC client/severs #77

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[avalanche-types] Set max message size to uint.MAX for gRPC client/se…
…rvers

Signed-off-by: Sam Batschelet <sam.batschelet@avalabs.org>
  • Loading branch information
hexfusion committed Oct 19, 2023
commit e3802f30a87306ef59770a158898de56032cc8b9
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ pub struct DatabaseClient {
impl DatabaseClient {
pub fn new(client_conn: Channel) -> BoxedDatabase {
Box::new(Self {
inner: RpcDbDatabaseClient::new(client_conn),
inner: RpcDbDatabaseClient::new(client_conn)
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX),
closed: Arc::new(AtomicBool::new(false)),
})
}
Expand Down
2 changes: 2 additions & 0 deletions crates/avalanche-types/src/subnet/rpc/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ where
.add_service(reflection_service)
.add_service(VmServer::new(vm))
.serve_with_shutdown(addr, stop_ch.recv().map(|_| ()))
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX)
.await
.map_err(|e| Error::new(ErrorKind::Other, format!("grpc server failed: {:?}", e)))?;
log::info!("grpc server shutdown complete: {}", addr);
Expand Down
4 changes: 3 additions & 1 deletion crates/avalanche-types/src/subnet/rpc/runtime/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ pub struct Client {
impl Client {
pub fn new(client_conn: Channel) -> Self {
Self {
inner: RuntimeClient::new(client_conn),
inner: RuntimeClient::new(client_conn)
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ pub struct AppSenderClient {
impl AppSenderClient {
pub fn new(client_conn: Channel) -> Self {
Self {
inner: app_sender_client::AppSenderClient::new(client_conn),
inner: app_sender_client::AppSenderClient::new(client_conn)
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ pub struct ValidatorStateClient {
impl ValidatorStateClient {
pub fn new(client_conn: Channel) -> Self {
Self {
inner: validator_state_client::ValidatorStateClient::new(client_conn),
inner: validator_state_client::ValidatorStateClient::new(client_conn)
.max_decoding_message_size(usize::MAX)
.max_encoding_message_size(usize::MAX),
}
}
}
Expand Down