mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-03-30 15:08:33 +00:00
Set stream max message size and increase the max message size to 1GB (#1300)
This commit is contained in:
parent
b0251fe1a6
commit
c7c8b25c09
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user