Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@

- [#6471](https://github.com/ChainSafe/forest/pull/6471): Moved `forest-tool state` subcommand to `forest-dev`.

- [#6527](https://github.com/ChainSafe/forest/issues/6527): Increased the maximum number of allowed connections to the RPC server to 1000. This can be further configured via the `FOREST_RPC_MAX_CONNECTIONS` environment variable.
Comment thread
LesnyRumcajs marked this conversation as resolved.

### Removed

### Fixed
Expand Down
1 change: 1 addition & 0 deletions docs/docs/users/reference/env_variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ process.
| `FOREST_FORCE_TRUST_PARAMS` | 1 or true | false | 1 | Trust the parameters downloaded from the Cloudflare/IPFS |
| `IPFS_GATEWAY` | URL | `https://proofs.filecoin.io/ipfs/` | `https://proofs.filecoin.io/ipfs/` | The IPFS gateway to use for downloading proofs parameters |
| `FOREST_RPC_DEFAULT_TIMEOUT` | Duration (in seconds) | 60 | 10 | The default timeout for RPC calls |
| `FOREST_RPC_MAX_CONNECTIONS` | positive integer | 1000 | 42 | Maximum number of allowed connections for the RPC server |
| `FOREST_MAX_CONCURRENT_REQUEST_RESPONSE_STREAMS_PER_PEER` | positive integer | 10 | 10 | the maximum concurrent streams per peer for request-response-based p2p protocols |
| `FOREST_BLOCK_DELAY_SECS` | positive integer | Depends on the network | 30 | Duration of each tipset epoch |
| `FOREST_PROPAGATION_DELAY_SECS` | positive integer | Depends on the network | 20 | How long to wait for a block to propagate through the network |
Expand Down
10 changes: 10 additions & 0 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,15 @@ static DEFAULT_REQUEST_TIMEOUT: LazyLock<Duration> = LazyLock::new(|| {
.unwrap_or(Duration::from_secs(60))
});

/// Default maximum connections for the RPC server. This needs to be high enough to
/// accommodate the regular usage for RPC providers.
static DEFAULT_MAX_CONNECTIONS: LazyLock<u32> = LazyLock::new(|| {
env::var("FOREST_RPC_MAX_CONNECTIONS")
.ok()
.and_then(|it| it.parse().ok())
.unwrap_or(1000)
});
Comment thread
LesnyRumcajs marked this conversation as resolved.

const MAX_REQUEST_BODY_SIZE: u32 = 64 * 1024 * 1024;
const MAX_RESPONSE_BODY_SIZE: u32 = MAX_REQUEST_BODY_SIZE;

Expand Down Expand Up @@ -565,6 +574,7 @@ where
// Default size (10 MiB) is not enough for methods like `Filecoin.StateMinerActiveSectors`
.max_request_body_size(MAX_REQUEST_BODY_SIZE)
.max_response_body_size(MAX_RESPONSE_BODY_SIZE)
.max_connections(*DEFAULT_MAX_CONNECTIONS)
.set_id_provider(RandomHexStringIdProvider::new())
.build(),
)
Expand Down
Loading