Skip to content

Commit

Permalink
bump the grpc-js version and increase message sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
konnov committed Aug 9, 2024
1 parent c9eac44 commit e26b8b0
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
31 changes: 20 additions & 11 deletions quint/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion quint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"url": "https://github.com/informalsystems/quint"
},
"dependencies": {
"@grpc/grpc-js": "^1.8.14",
"@grpc/grpc-js": "^1.11.1",
"@grpc/proto-loader": "^0.7.7",
"@octokit/request": "^8.1.1",
"@sweet-monads/either": "~3.2.0",
Expand Down
9 changes: 7 additions & 2 deletions quint/src/apalache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ type RunResponse =
// The interface for the CmdExecutor service generated by the gRPC library
type CmdExecutor = {
// Constructs a new client service
new (url: string, creds: any): CmdExecutor
new (url: string, creds: any, options: any): CmdExecutor
run: (req: RunRequest, cb: AsyncCallBack<any>) => void
}

Expand Down Expand Up @@ -307,7 +307,12 @@ function loadGrpcClient(serverEndpoint: ServerEndpoint, protoDef: ProtoPackageDe
// See https://basarat.gitbook.io/typescript/type-system/type-assertion#double-assertion
const pkg = protoDescriptor.shai as unknown as ShaiPkg
const connectionString = serverEndpointToConnectionString(serverEndpoint)
const stub: any = new pkg.cmdExecutor.CmdExecutor(connectionString, grpc.credentials.createInsecure())
// bump the maximal message sizes, as the Quint backend in Apalache may send very large JSON files
const options: any = {
'grpc.max_receive_message_length': 1024 * 1024 * 1024,
'grpc.max_send_message_length': 1024 * 1024 * 1024,
}
const stub: any = new pkg.cmdExecutor.CmdExecutor(connectionString, grpc.credentials.createInsecure(), options)
return {
run: promisify((data: RunRequest, cb: AsyncCallBack<any>) => stub.run(data, cb)),
}
Expand Down

0 comments on commit e26b8b0

Please sign in to comment.