From e8feb96ee53180efabea40b052f900cb4e14e543 Mon Sep 17 00:00:00 2001 From: wphan Date: Thu, 5 Dec 2024 15:45:25 -0800 Subject: [PATCH] disable grpc for general driftclient --- src/publishers/dlobPublisher.ts | 49 ++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/src/publishers/dlobPublisher.ts b/src/publishers/dlobPublisher.ts index dc660c0..170bdda 100644 --- a/src/publishers/dlobPublisher.ts +++ b/src/publishers/dlobPublisher.ts @@ -324,29 +324,34 @@ const main = async () => { let accountSubscription: DriftClientSubscriptionConfig; let slotSource: SlotSource; + // NOTE: disable GRPC for general driftClient subscriptions until we can reliably subscribe + // to multiple streams. Currently this causes the nodes to start killing connections. + // // USE_GRPC=true will override websocket - if (useGrpc) { - accountSubscription = { - type: 'grpc', - resubTimeoutMs: 30_000, - grpcConfigs: { - endpoint, - token, - channelOptions: { - 'grpc.keepalive_time_ms': 10_000, - 'grpc.keepalive_timeout_ms': 1_000, - 'grpc.keepalive_permit_without_calls': 1, - }, - }, - }; - - slotSubscriber = new SlotSubscriber(connection); - await slotSubscriber.subscribe(); - - slotSource = { - getSlot: () => slotSubscriber!.getSlot(), - }; - } else if (!useWebsocket) { + // if (useGrpc) { + // accountSubscription = { + // type: 'grpc', + // resubTimeoutMs: 30_000, + // grpcConfigs: { + // endpoint, + // token, + // channelOptions: { + // 'grpc.keepalive_time_ms': 10_000, + // 'grpc.keepalive_timeout_ms': 1_000, + // 'grpc.keepalive_permit_without_calls': 1, + // }, + // }, + // }; + + // slotSubscriber = new SlotSubscriber(connection); + // await slotSubscriber.subscribe(); + + // slotSource = { + // getSlot: () => slotSubscriber!.getSlot(), + // }; + // } + + if (!useWebsocket) { bulkAccountLoader = new BulkAccountLoader( connection, stateCommitment,