Set stream max message size and increase the max message size to 1GB (#1300)

This commit is contained in:
Ori Newman 2020-12-28 12:53:11 +02:00 committed by GitHub
parent b0251fe1a6
commit c7c8b25c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -53,6 +53,7 @@ func (flow *handleRelayInvsFlow) runIBDIfNotRunning(highHash *externalapi.Domain
}
if blockInfo.BlockStatus == externalapi.StatusHeaderOnly {
log.Infof("Checking if the suggested pruning point %s is compatible to the node DAG", msgIBDRootHash.Hash)
isValid, err := flow.Domain().Consensus().IsValidPruningPoint(msgIBDRootHash.Hash)
if err != nil {
return err

View File

@ -18,7 +18,7 @@ type gRPCServer struct {
}
// MaxMessageSize is the max size allowed for a message
const MaxMessageSize = 1024 * 1024 * 10 // 10MB
const MaxMessageSize = 1024 * 1024 * 1024 // 1GB
// newGRPCServer creates a gRPC server
func newGRPCServer(listeningAddresses []string) *gRPCServer {

View File

@ -47,7 +47,8 @@ func (p *p2pServer) Connect(address string) (server.Connection, error) {
}
client := protowire.NewP2PClient(gRPCClientConnection)
stream, err := client.MessageStream(context.Background(), grpc.UseCompressor(gzip.Name))
stream, err := client.MessageStream(context.Background(), grpc.UseCompressor(gzip.Name),
grpc.MaxCallRecvMsgSize(MaxMessageSize), grpc.MaxCallSendMsgSize(MaxMessageSize))
if err != nil {
return nil, errors.Wrapf(err, "error getting client stream for %s", address)
}