Skip to content

Commit

Permalink
Increase debug gRPC message size to 128MB (prysmaticlabs#9661)
Browse files Browse the repository at this point in the history
Co-authored-by: Raul Jordan <[email protected]>
Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Sep 23, 2021
1 parent 1fbe052 commit 2952bb3
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion beacon-chain/node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"bytes"
"context"
"fmt"
"math"
"os"
"os/signal"
"path/filepath"
Expand Down Expand Up @@ -56,6 +57,9 @@ import (

const testSkipPowFlag = "test-skip-pow"

// 128MB max message size when enabling debug endpoints.
const debugGrpcMaxMsgSize = 1 << 27

// BeaconNode defines a struct that handles the services running a random beacon chain
// full PoS node. It handles the lifecycle of the entire system and registers
// services to a service registry.
Expand Down Expand Up @@ -568,8 +572,13 @@ func (b *BeaconNode) registerRPCService() error {
cert := b.cliCtx.String(flags.CertFlag.Name)
key := b.cliCtx.String(flags.KeyFlag.Name)
mockEth1DataVotes := b.cliCtx.Bool(flags.InteropMockEth1DataVotesFlag.Name)
enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name)

maxMsgSize := b.cliCtx.Int(cmd.GrpcMaxCallRecvMsgSizeFlag.Name)
enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name)
if enableDebugRPCEndpoints {
maxMsgSize = int(math.Max(float64(maxMsgSize), debugGrpcMaxMsgSize))
}

p2pService := b.fetchP2P()
rpcService := rpc.NewService(b.ctx, &rpc.Config{
Host: host,
Expand Down Expand Up @@ -661,6 +670,9 @@ func (b *BeaconNode) registerGRPCGateway() error {
enableDebugRPCEndpoints := b.cliCtx.Bool(flags.EnableDebugRPCEndpoints.Name)
selfCert := b.cliCtx.String(flags.CertFlag.Name)
maxCallSize := b.cliCtx.Uint64(cmd.GrpcMaxCallRecvMsgSizeFlag.Name)
if enableDebugRPCEndpoints {
maxCallSize = uint64(math.Max(float64(maxCallSize), debugGrpcMaxMsgSize))
}

gatewayConfig := gateway2.DefaultConfig(enableDebugRPCEndpoints)

Expand Down

0 comments on commit 2952bb3

Please sign in to comment.