From 9410e7ea12664920a9675a10e3d8df7271ec6ba0 Mon Sep 17 00:00:00 2001 From: Logan Nguyen Date: Sat, 11 May 2024 02:38:07 -0400 Subject: [PATCH] fix: enabled WS_BATCH_REQUESTS_ENABLED by default Signed-off-by: Logan Nguyen --- docs/configuration.md | 4 ++-- packages/ws-server/src/utils/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/configuration.md b/docs/configuration.md index a1f8a1f5bc..7f79d3d167 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -26,9 +26,9 @@ Unless you need to set a non-default value, it is recommended to only populate o | Name | Default | Description | | ---------------------------- | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `BATCH_REQUESTS_ENABLED` | "false" | Flag to disable or enable batch requests. | +| `BATCH_REQUESTS_ENABLED` | "true" | Flag to disable or enable batch requests. | | `BATCH_REQUESTS_MAX_SIZE` | "100" | Maximum number of requests allowed in a batch. | -| `WS_BATCH_REQUESTS_ENABLED` | "false" | Flag to enable batch requests on the websocket server. | +| `WS_BATCH_REQUESTS_ENABLED` | "true" | Flag to disable or enable batch requests on the websocket server. | | `WS_BATCH_REQUESTS_MAX_SIZE` | "20" | Maximum number of requests allowed in a batch on websocket server. | | `CHAIN_ID` | "" | The network chain id. Local and previewnet envs should use `0x12a` (298). Previewnet, Testnet and Mainnet should use `0x129` (297), `0x128` (296) and `0x127` (295) respectively. | | `HBAR_RATE_LIMIT_DURATION` | "80000" | hbar budget limit duration. This creates a timestamp, which resets all limits, when it's reached. Default is to 80000 (80 seconds). | diff --git a/packages/ws-server/src/utils/utils.ts b/packages/ws-server/src/utils/utils.ts index aae68b2234..50c3c39b89 100644 --- a/packages/ws-server/src/utils/utils.ts +++ b/packages/ws-server/src/utils/utils.ts @@ -148,7 +148,7 @@ export const getMultipleAddressesEnabled = (): boolean => { * @returns {boolean} A boolean indicating whether WebSocket batch requests are enabled. */ export const getWsBatchRequestsEnabled = (): boolean => { - return process.env.WS_BATCH_REQUESTS_ENABLED === 'true'; + return process.env.WS_BATCH_REQUESTS_ENABLED === 'true' || true; }; /**