Browse Source

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.
pull/4945/head
Anton Kaliaev 5 years ago
committed by GitHub
parent
commit
af1d16bee9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 1 deletions
  1. +13
    -1
      cmd/tendermint/commands/lite.go

+ 13
- 1
cmd/tendermint/commands/lite.go View File

@ -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,


Loading…
Cancel
Save