Skip to content

Commit a243a27

Browse files
authored
feat: grpcs options for triton better resiliency (#2111)
1 parent 22574d0 commit a243a27

File tree

2 files changed

+7615
-5253
lines changed

2 files changed

+7615
-5253
lines changed

sdk/src/accounts/grpcProgramAccountSubscriber.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,15 @@ export class grpcProgramAccountSubscriber<
5454
},
5555
resubOpts?: ResubOpts
5656
): Promise<grpcProgramAccountSubscriber<U>> {
57+
const channelOptions: GrpcConfigs['channelOptions'] = {
58+
...(grpcConfigs.channelOptions ?? {}),
59+
grpcDefaultCompressionAlgorithm: 1, // always use zstd compression
60+
grpcHttp2AdaptiveWindow: true, // enable adaptive window size management
61+
};
5762
const client = await createClient(
5863
grpcConfigs.endpoint,
5964
grpcConfigs.token,
60-
grpcConfigs.channelOptions ?? {}
65+
channelOptions
6166
);
6267
const commitmentLevel =
6368
// @ts-ignore :: isomorphic exported enum fails typescript but will work at runtime

0 commit comments

Comments
 (0)