From a186d2a69f89fd93f02b16e3296abf5271af50ac Mon Sep 17 00:00:00 2001 From: Jeon Jeongho Date: Tue, 7 Feb 2023 18:19:32 +0900 Subject: [PATCH] docs: correct `rpc-max-body-bytes` config description (#14935) ## Description This config limits the maximum size of HTTP request body, but description said response size. `rpc-max-body-bytes` config affects these: * https://github.com/cometbft/cometbft/blob/38a4caeac0551c188af8a3e209e48380cd514e2d/rpc/jsonrpc/server/http_server.go#L255 * https://github.com/cometbft/cometbft/blob/1cb55d49baa86a227c4b9eadad2d7a344670eb51/rpc/jsonrpc/server/ws_handler.go#L167 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [ ] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [ ] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#pr-targeting)) - [ ] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/main/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [ ] reviewed "Files changed" and left comments if necessary - [ ] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- server/config/config.go | 2 +- server/config/toml.go | 2 +- server/start.go | 2 +- tools/confix/data/v0.45-app.toml | 4 ++-- tools/confix/data/v0.46-app.toml | 4 ++-- tools/confix/data/v0.47-app.toml | 4 ++-- tools/confix/data/v0.48-app.toml | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/config/config.go b/server/config/config.go index fdb9bd5558..bb9d49e067 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -119,7 +119,7 @@ type APIConfig struct { // RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds) RPCWriteTimeout uint `mapstructure:"rpc-write-timeout"` - // RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes) + // RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes) RPCMaxBodyBytes uint `mapstructure:"rpc-max-body-bytes"` // TODO: TLS/Proxy configuration. diff --git a/server/config/toml.go b/server/config/toml.go index dff802a3f1..ecf9dab9e4 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -146,7 +146,7 @@ rpc-read-timeout = {{ .API.RPCReadTimeout }} # RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). rpc-write-timeout = {{ .API.RPCWriteTimeout }} -# RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes). +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). rpc-max-body-bytes = {{ .API.RPCMaxBodyBytes }} # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). diff --git a/server/start.go b/server/start.go index 33679e314d..b23f8474e6 100644 --- a/server/start.go +++ b/server/start.go @@ -173,7 +173,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. cmd.Flags().Uint(FlagAPIMaxOpenConnections, 1000, "Define the number of maximum open connections") cmd.Flags().Uint(FlagRPCReadTimeout, 10, "Define the CometBFT RPC read timeout (in seconds)") cmd.Flags().Uint(FlagRPCWriteTimeout, 0, "Define the CometBFT RPC write timeout (in seconds)") - cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the CometBFT maximum response body (in bytes)") + cmd.Flags().Uint(FlagRPCMaxBodyBytes, 1000000, "Define the CometBFT maximum request body (in bytes)") cmd.Flags().Bool(FlagAPIEnableUnsafeCORS, false, "Define if CORS should be enabled (unsafe - use it at your own risk)") cmd.Flags().Bool(flagGRPCOnly, false, "Start the node in gRPC query only mode (no CometBFT process is started)") diff --git a/tools/confix/data/v0.45-app.toml b/tools/confix/data/v0.45-app.toml index ffc7ead304..e6f15079c8 100644 --- a/tools/confix/data/v0.45-app.toml +++ b/tools/confix/data/v0.45-app.toml @@ -126,7 +126,7 @@ rpc-read-timeout = 10 # RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). @@ -227,4 +227,4 @@ fsync = "false" query_gas_limit = 300000 # This is the number of wasm vm instances we keep cached in memory for speed-up # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 \ No newline at end of file +lru_size = 0 diff --git a/tools/confix/data/v0.46-app.toml b/tools/confix/data/v0.46-app.toml index b6b92b6410..6dd5e64fbf 100644 --- a/tools/confix/data/v0.46-app.toml +++ b/tools/confix/data/v0.46-app.toml @@ -135,7 +135,7 @@ rpc-read-timeout = 10 # RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). @@ -256,4 +256,4 @@ fsync = "false" query_gas_limit = 300000 # This is the number of wasm vm instances we keep cached in memory for speed-up # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 \ No newline at end of file +lru_size = 0 diff --git a/tools/confix/data/v0.47-app.toml b/tools/confix/data/v0.47-app.toml index 89752e09f0..6f26abc13c 100644 --- a/tools/confix/data/v0.47-app.toml +++ b/tools/confix/data/v0.47-app.toml @@ -135,7 +135,7 @@ rpc-read-timeout = 10 # RPCWriteTimeout defines the Tendermint RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the Tendermint maximum response body (in bytes). +# RPCMaxBodyBytes defines the Tendermint maximum request body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). @@ -233,4 +233,4 @@ max-txs = "5000" query_gas_limit = 300000 # This is the number of wasm vm instances we keep cached in memory for speed-up # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 \ No newline at end of file +lru_size = 0 diff --git a/tools/confix/data/v0.48-app.toml b/tools/confix/data/v0.48-app.toml index c4ee54ba52..c8f1171699 100644 --- a/tools/confix/data/v0.48-app.toml +++ b/tools/confix/data/v0.48-app.toml @@ -134,7 +134,7 @@ rpc-read-timeout = 10 # RPCWriteTimeout defines the CometBFT RPC write timeout (in seconds). rpc-write-timeout = 0 -# RPCMaxBodyBytes defines the CometBFT maximum response body (in bytes). +# RPCMaxBodyBytes defines the CometBFT maximum request body (in bytes). rpc-max-body-bytes = 1000000 # EnableUnsafeCORS defines if CORS should be enabled (unsafe - use it at your own risk). @@ -227,4 +227,4 @@ max-txs = "5000" query_gas_limit = 300000 # This is the number of wasm vm instances we keep cached in memory for speed-up # Warning: this is currently unstable and may lead to crashes, best to keep for 0 unless testing locally -lru_size = 0 \ No newline at end of file +lru_size = 0