Skip to content

Commit

Permalink
improvement(core): increase message size to 64Mb (#4133)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs authored Feb 24, 2025
1 parent 75dca6f commit 5aed92c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions nodebuilder/core/constructors.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,25 @@ import (
"github.com/celestiaorg/celestia-node/libs/utils"
)

const xtokenFileName = "xtoken.json"
const (
// gRPC client requires fetching a block on initialization that can be larger
// than the default message size set in gRPC. Increasing defaults up to 64MB
// to avoid fixing it every time the block size increases.
// Tested on mainnet node:
// square size = 128
// actual response size = 10,85mb
// TODO(@vgonkivs): Revisit this constant once the block size reaches 64MB.
defaultGRPCMessageSize = 64 * 1024 * 1024 // 64Mb
xtokenFileName = "xtoken.json"
)

func grpcClient(lc fx.Lifecycle, cfg Config) (*grpc.ClientConn, error) {
var opts []grpc.DialOption
opts := []grpc.DialOption{
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(defaultGRPCMessageSize),
grpc.MaxCallSendMsgSize(defaultGRPCMessageSize),
),
}
if cfg.TLSEnabled {
opts = append(opts, grpc.WithTransportCredentials(
credentials.NewTLS(&tls.Config{MinVersion: tls.VersionTLS12})),
Expand Down

0 comments on commit 5aed92c

Please sign in to comment.