Skip to content

Commit

Permalink
Read & set from rpc config (#940)
Browse files Browse the repository at this point in the history
  • Loading branch information
yaziciahmet authored Aug 1, 2024
1 parent 9df32cc commit f814631
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion crates/fullnode/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use borsh::de::BorshDeserialize;
use citrea_primitives::types::SoftConfirmationHash;
use citrea_primitives::{get_da_block_at_height, L1BlockCache, SyncError};
use jsonrpsee::core::client::Error as JsonrpseeError;
use jsonrpsee::server::{BatchRequestConfig, ServerBuilder};
use jsonrpsee::RpcModule;
use rs_merkle::algorithms::Sha256;
use rs_merkle::MerkleTree;
Expand Down Expand Up @@ -172,11 +173,17 @@ where

let max_connections = self.rpc_config.max_connections;
let max_subscriptions_per_connection = self.rpc_config.max_subscriptions_per_connection;
let max_request_body_size = self.rpc_config.max_request_body_size;
let max_response_body_size = self.rpc_config.max_response_body_size;
let batch_requests_limit = self.rpc_config.batch_requests_limit;

let _handle = tokio::spawn(async move {
let server = jsonrpsee::server::ServerBuilder::default()
let server = ServerBuilder::default()
.max_connections(max_connections)
.max_subscriptions_per_connection(max_subscriptions_per_connection)
.max_request_body_size(max_request_body_size)
.max_response_body_size(max_response_body_size)
.set_batch_request_config(BatchRequestConfig::Limit(batch_requests_limit))
.build([listen_address].as_ref())
.await;

Expand Down
9 changes: 8 additions & 1 deletion crates/prover/src/runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use borsh::de::BorshDeserialize;
use citrea_primitives::types::SoftConfirmationHash;
use citrea_primitives::{get_da_block_at_height, L1BlockCache};
use jsonrpsee::core::client::Error as JsonrpseeError;
use jsonrpsee::server::{BatchRequestConfig, ServerBuilder};
use jsonrpsee::RpcModule;
use rand::Rng;
use sequencer_client::{GetSoftBatchResponse, SequencerClient};
Expand Down Expand Up @@ -177,11 +178,17 @@ where

let max_connections = self.rpc_config.max_connections;
let max_subscriptions_per_connection = self.rpc_config.max_subscriptions_per_connection;
let max_request_body_size = self.rpc_config.max_request_body_size;
let max_response_body_size = self.rpc_config.max_response_body_size;
let batch_requests_limit = self.rpc_config.batch_requests_limit;

let _handle = tokio::spawn(async move {
let server = jsonrpsee::server::ServerBuilder::default()
let server = ServerBuilder::default()
.max_connections(max_connections)
.max_subscriptions_per_connection(max_subscriptions_per_connection)
.max_request_body_size(max_request_body_size)
.max_response_body_size(max_response_body_size)
.set_batch_request_config(BatchRequestConfig::Limit(batch_requests_limit))
.build([listen_address].as_ref())
.await;

Expand Down

0 comments on commit f814631

Please sign in to comment.