File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -22,10 +22,25 @@ import (
22
22
"github.com/celestiaorg/celestia-node/libs/utils"
23
23
)
24
24
25
- const xtokenFileName = "xtoken.json"
25
+ const (
26
+ // gRPC client requires fetching a block on initialization that can be larger
27
+ // than the default message size set in gRPC. Increasing defaults up to 64MB
28
+ // to avoid fixing it every time the block size increases.
29
+ // Tested on mainnet node:
30
+ // square size = 128
31
+ // actual response size = 10,85mb
32
+ // TODO(@vgonkivs): Revisit this constant once the block size reaches 64MB.
33
+ defaultGRPCMessageSize = 64 * 1024 * 1024 // 64Mb
34
+ xtokenFileName = "xtoken.json"
35
+ )
26
36
27
37
func grpcClient (lc fx.Lifecycle , cfg Config ) (* grpc.ClientConn , error ) {
28
- var opts []grpc.DialOption
38
+ opts := []grpc.DialOption {
39
+ grpc .WithDefaultCallOptions (
40
+ grpc .MaxCallRecvMsgSize (defaultGRPCMessageSize ),
41
+ grpc .MaxCallSendMsgSize (defaultGRPCMessageSize ),
42
+ ),
43
+ }
29
44
if cfg .TLSEnabled {
30
45
opts = append (opts , grpc .WithTransportCredentials (
31
46
credentials .NewTLS (& tls.Config {MinVersion : tls .VersionTLS12 })),
You can’t perform that action at this time.
0 commit comments