From af1d16bee97f175c87d251a450b605ff8312ed3e Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 3 Jun 2020 10:54:14 +0400 Subject: [PATCH] lite2: allow bigger requests to LC proxy (#4930) Closes #4838 Previously, we're only setting MaxOpenConnections, whereas we should set all config variables based on user's config.toml. --- cmd/tendermint/commands/lite.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmd/tendermint/commands/lite.go b/cmd/tendermint/commands/lite.go index b2a053cc7..c1b146d29 100644 --- a/cmd/tendermint/commands/lite.go +++ b/cmd/tendermint/commands/lite.go @@ -137,9 +137,21 @@ func runProxy(cmd *cobra.Command, args []string) error { if err != nil { return fmt.Errorf("http client for %s: %w", primaryAddr, err) } + + cfg := rpcserver.DefaultConfig() + cfg.MaxBodyBytes = config.RPC.MaxBodyBytes + cfg.MaxHeaderBytes = config.RPC.MaxHeaderBytes + cfg.MaxOpenConnections = maxOpenConnections + // If necessary adjust global WriteTimeout to ensure it's greater than + // TimeoutBroadcastTxCommit. + // See https://github.com/tendermint/tendermint/issues/3435 + if cfg.WriteTimeout <= config.RPC.TimeoutBroadcastTxCommit { + cfg.WriteTimeout = config.RPC.TimeoutBroadcastTxCommit + 1*time.Second + } + p := lproxy.Proxy{ Addr: listenAddr, - Config: &rpcserver.Config{MaxOpenConnections: maxOpenConnections}, + Config: cfg, Codec: amino.NewCodec(), Client: lrpc.NewClient(rpcClient, c), Logger: logger,