Adjust Node Websocket options (frame sizes) (#4087)

This commit is contained in:
Jaco
2021-10-21 12:54:25 +03:00
committed by GitHub
parent c9b0502542
commit 15ed0723f1
2 changed files with 8 additions and 3 deletions
+1
View File
@@ -8,6 +8,7 @@ Contributed:
Changes:
- Adjust Websocket `maxReceivedFrameSize` under Node
- Fix browser bundle imports for xcm-mapping (move to `types-known`)
- Expose all extracted type names in `PortableRegistry`
+7 -3
View File
@@ -40,6 +40,8 @@ const ALIASES: { [index: string]: string } = {
const RETRY_DELAY = 2500;
const MEGABYTE = 1024 * 1024;
const l = logger('api-ws');
function eraseRecord<T> (record: Record<string, T>, cb?: (item: T) => void): void {
@@ -179,9 +181,11 @@ export class WsProvider implements ProviderInterface {
// default: true
fragmentOutgoingMessages: true,
// default: 16K (bump, the Node has issues with too many fragments, e.g. on setCode)
fragmentationThreshold: 256 * 1024,
// default: 8MB (however Polkadot api.query.staking.erasStakers.entries(356) is over that)
maxReceivedMessageSize: 16 * 1024 * 1024
fragmentationThreshold: 1 * MEGABYTE,
// default: 1MiB (also align with maxReceivedMessageSize)
maxReceivedFrameSize: 24 * MEGABYTE,
// default: 8MB (however Polkadot api.query.staking.erasStakers.entries(356) is over that, 16M is ok there)
maxReceivedMessageSize: 24 * MEGABYTE
});
this.#websocket.onclose = this.#onSocketClose;