Skip to content

Commit 5aed92c

Browse files
authored
improvement(core): increase message size to 64Mb (#4133)
1 parent 75dca6f commit 5aed92c

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Diff for: nodebuilder/core/constructors.go

+17-2
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,25 @@ import (
2222
"github.com/celestiaorg/celestia-node/libs/utils"
2323
)
2424

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+
)
2636

2737
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+
}
2944
if cfg.TLSEnabled {
3045
opts = append(opts, grpc.WithTransportCredentials(
3146
credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})),

0 commit comments

Comments
 (0)