Skip to content

Commit

Permalink
Increase RPC request timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed May 5, 2024
1 parent 3494834 commit 8051efc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/subspace-farmer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
array_windows,
assert_matches,
const_option,
duration_constructors,
exact_size_is_empty,
hash_extract_if,
impl_trait_in_assoc_type,
Expand Down
3 changes: 3 additions & 0 deletions crates/subspace-farmer/src/node_client/node_rpc_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use jsonrpsee::rpc_params;
use jsonrpsee::ws_client::{WsClient, WsClientBuilder};
use std::pin::Pin;
use std::sync::Arc;
use std::time::Duration;
use subspace_core_primitives::{Piece, PieceIndex, SegmentHeader, SegmentIndex};
use subspace_rpc_primitives::{
FarmerAppInfo, RewardSignatureResponse, RewardSigningInfo, SlotInfo, SolutionResponse,
Expand All @@ -17,6 +18,7 @@ const RPC_MAX_CONCURRENT_REQUESTS: usize = 1_000_000;
/// Node is having a hard time responding for many piece requests
// TODO: Remove this once https://github.com/paritytech/jsonrpsee/issues/1189 is resolved
const MAX_CONCURRENT_PIECE_REQUESTS: usize = 10;
const REQUEST_TIMEOUT: Duration = Duration::from_mins(5);

/// `WsClient` wrapper.
#[derive(Debug, Clone)]
Expand All @@ -32,6 +34,7 @@ impl NodeRpcClient {
WsClientBuilder::default()
.max_concurrent_requests(RPC_MAX_CONCURRENT_REQUESTS)
.max_request_size(20 * 1024 * 1024)
.request_timeout(REQUEST_TIMEOUT)
.build(url)
.await?,
);
Expand Down

0 comments on commit 8051efc

Please sign in to comment.