You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

462 lines
17 KiB

limit number of /subscribe clients and queries per client (#3269) * limit number of /subscribe clients and queries per client Add the following config variables (under [rpc] section): * max_subscription_clients * max_subscriptions_per_client * timeout_broadcast_tx_commit Fixes #2826 new HTTPClient interface for subscriptions finalize HTTPClient events interface remove EventSubscriber fix data race ``` WARNING: DATA RACE Read at 0x00c000a36060 by goroutine 129: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe.func1() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:168 +0x1f0 Previous write at 0x00c000a36060 by goroutine 132: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:191 +0x4e0 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 129 (running) created at: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:164 +0x4b7 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 132 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:878 +0x659 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:119 +0x186 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 ================== ``` lite client works (tested manually) godoc comments httpclient: do not close the out channel use TimeoutBroadcastTxCommit no timeout for unsubscribe but 1s Local (5s HTTP) timeout for resubscribe format code change Subscribe#out cap to 1 and replace config vars with RPCConfig TimeoutBroadcastTxCommit can't be greater than rpcserver.WriteTimeout rpc: Context as first parameter to all functions reformat code fixes after my own review fixes after Ethan's review add test stubs fix config.toml * fixes after manual testing - rpc: do not recommend to use BroadcastTxCommit because it's slow and wastes Tendermint resources (pubsub) - rpc: better error in Subscribe and BroadcastTxCommit - HTTPClient: do not resubscribe if err = ErrAlreadySubscribed * fixes after Ismail's review * Update rpc/grpc/grpc_test.go Co-Authored-By: melekes <anton.kalyaev@gmail.com>
6 years ago
limit number of /subscribe clients and queries per client (#3269) * limit number of /subscribe clients and queries per client Add the following config variables (under [rpc] section): * max_subscription_clients * max_subscriptions_per_client * timeout_broadcast_tx_commit Fixes #2826 new HTTPClient interface for subscriptions finalize HTTPClient events interface remove EventSubscriber fix data race ``` WARNING: DATA RACE Read at 0x00c000a36060 by goroutine 129: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe.func1() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:168 +0x1f0 Previous write at 0x00c000a36060 by goroutine 132: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:191 +0x4e0 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 129 (running) created at: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:164 +0x4b7 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 132 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:878 +0x659 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:119 +0x186 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 ================== ``` lite client works (tested manually) godoc comments httpclient: do not close the out channel use TimeoutBroadcastTxCommit no timeout for unsubscribe but 1s Local (5s HTTP) timeout for resubscribe format code change Subscribe#out cap to 1 and replace config vars with RPCConfig TimeoutBroadcastTxCommit can't be greater than rpcserver.WriteTimeout rpc: Context as first parameter to all functions reformat code fixes after my own review fixes after Ethan's review add test stubs fix config.toml * fixes after manual testing - rpc: do not recommend to use BroadcastTxCommit because it's slow and wastes Tendermint resources (pubsub) - rpc: better error in Subscribe and BroadcastTxCommit - HTTPClient: do not resubscribe if err = ErrAlreadySubscribed * fixes after Ismail's review * Update rpc/grpc/grpc_test.go Co-Authored-By: melekes <anton.kalyaev@gmail.com>
6 years ago
blockchain: Reorg reactor (#3561) * go routines in blockchain reactor * Added reference to the go routine diagram * Initial commit * cleanup * Undo testing_logger change, committed by mistake * Fix the test loggers * pulled some fsm code into pool.go * added pool tests * changes to the design added block requests under peer moved the request trigger in the reactor poolRoutine, triggered now by a ticker in general moved everything required for making block requests smarter in the poolRoutine added a simple map of heights to keep track of what will need to be requested next added a few more tests * send errors to FSM in a different channel than blocks send errors (RemovePeer) from switch on a different channel than the one receiving blocks renamed channels added more pool tests * more pool tests * lint errors * more tests * more tests * switch fast sync to new implementation * fixed data race in tests * cleanup * finished fsm tests * address golangci comments :) * address golangci comments :) * Added timeout on next block needed to advance * updating docs and cleanup * fix issue in test from previous cleanup * cleanup * Added termination scenarios, tests and more cleanup * small fixes to adr, comments and cleanup * Fix bug in sendRequest() If we tried to send a request to a peer not present in the switch, a missing continue statement caused the request to be blackholed in a peer that was removed and never retried. While this bug was manifesting, the reactor kept asking for other blocks that would be stored and never consumed. Added the number of unconsumed blocks in the math for requesting blocks ahead of current processing height so eventually there will be no more blocks requested until the already received ones are consumed. * remove bpPeer's didTimeout field * Use distinct err codes for peer timeout and FSM timeouts * Don't allow peers to update with lower height * review comments from Ethan and Zarko * some cleanup, renaming, comments * Move block execution in separate goroutine * Remove pool's numPending * review comments * fix lint, remove old blockchain reactor and duplicates in fsm tests * small reorg around peer after review comments * add the reactor spec * verify block only once * review comments * change to int for max number of pending requests * cleanup and godoc * Add configuration flag fast sync version * golangci fixes * fix config template * move both reactor versions under blockchain * cleanup, golint, renaming stuff * updated documentation, fixed more golint warnings * integrate with behavior package * sync with master * gofmt * add changelog_pending entry * move to improvments * suggestion to changelog entry
5 years ago
blockchain: Reorg reactor (#3561) * go routines in blockchain reactor * Added reference to the go routine diagram * Initial commit * cleanup * Undo testing_logger change, committed by mistake * Fix the test loggers * pulled some fsm code into pool.go * added pool tests * changes to the design added block requests under peer moved the request trigger in the reactor poolRoutine, triggered now by a ticker in general moved everything required for making block requests smarter in the poolRoutine added a simple map of heights to keep track of what will need to be requested next added a few more tests * send errors to FSM in a different channel than blocks send errors (RemovePeer) from switch on a different channel than the one receiving blocks renamed channels added more pool tests * more pool tests * lint errors * more tests * more tests * switch fast sync to new implementation * fixed data race in tests * cleanup * finished fsm tests * address golangci comments :) * address golangci comments :) * Added timeout on next block needed to advance * updating docs and cleanup * fix issue in test from previous cleanup * cleanup * Added termination scenarios, tests and more cleanup * small fixes to adr, comments and cleanup * Fix bug in sendRequest() If we tried to send a request to a peer not present in the switch, a missing continue statement caused the request to be blackholed in a peer that was removed and never retried. While this bug was manifesting, the reactor kept asking for other blocks that would be stored and never consumed. Added the number of unconsumed blocks in the math for requesting blocks ahead of current processing height so eventually there will be no more blocks requested until the already received ones are consumed. * remove bpPeer's didTimeout field * Use distinct err codes for peer timeout and FSM timeouts * Don't allow peers to update with lower height * review comments from Ethan and Zarko * some cleanup, renaming, comments * Move block execution in separate goroutine * Remove pool's numPending * review comments * fix lint, remove old blockchain reactor and duplicates in fsm tests * small reorg around peer after review comments * add the reactor spec * verify block only once * review comments * change to int for max number of pending requests * cleanup and godoc * Add configuration flag fast sync version * golangci fixes * fix config template * move both reactor versions under blockchain * cleanup, golint, renaming stuff * updated documentation, fixed more golint warnings * integrate with behavior package * sync with master * gofmt * add changelog_pending entry * move to improvments * suggestion to changelog entry
5 years ago
  1. ---
  2. order: 3
  3. ---
  4. # Configuration
  5. Tendermint Core can be configured via a TOML file in
  6. `$TMHOME/config/config.toml`. Some of these parameters can be overridden by
  7. command-line flags. For most users, the options in the `##### main base configuration options #####` are intended to be modified while config options
  8. further below are intended for advance power users.
  9. ## Options
  10. The default configuration file create by `tendermint init` has all
  11. the parameters set with their default values. It will look something
  12. like the file below, however, double check by inspecting the
  13. `config.toml` created with your version of `tendermint` installed:
  14. ```toml
  15. # This is a TOML config file.
  16. # For more information, see https://github.com/toml-lang/toml
  17. # NOTE: Any path below can be absolute (e.g. "/var/myawesomeapp/data") or
  18. # relative to the home directory (e.g. "data"). The home directory is
  19. # "$HOME/.tendermint" by default, but could be changed via $TMHOME env variable
  20. # or --home cmd flag.
  21. #######################################################################
  22. ### Main Base Config Options ###
  23. #######################################################################
  24. # TCP or UNIX socket address of the ABCI application,
  25. # or the name of an ABCI application compiled in with the Tendermint binary
  26. proxy_app = "tcp://127.0.0.1:26658"
  27. # A custom human readable name for this node
  28. moniker = "anonymous"
  29. # If this node is many blocks behind the tip of the chain, FastSync
  30. # allows them to catchup quickly by downloading blocks in parallel
  31. # and verifying their commits
  32. fast_sync = true
  33. # Database backend: goleveldb | cleveldb | boltdb | rocksdb | badgerdb
  34. # * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
  35. # - pure go
  36. # - stable
  37. # * cleveldb (uses levigo wrapper)
  38. # - fast
  39. # - requires gcc
  40. # - use cleveldb build tag (go build -tags cleveldb)
  41. # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
  42. # - EXPERIMENTAL
  43. # - may be faster is some use-cases (random reads - indexer)
  44. # - use boltdb build tag (go build -tags boltdb)
  45. # * rocksdb (uses github.com/tecbot/gorocksdb)
  46. # - EXPERIMENTAL
  47. # - requires gcc
  48. # - use rocksdb build tag (go build -tags rocksdb)
  49. # * badgerdb (uses github.com/dgraph-io/badger)
  50. # - EXPERIMENTAL
  51. # - use badgerdb build tag (go build -tags badgerdb)
  52. db_backend = "goleveldb"
  53. # Database directory
  54. db_dir = "data"
  55. # Output level for logging, including package level options
  56. log_level = "main:info,state:info,statesync:info,*:error"
  57. # Output format: 'plain' (colored text) or 'json'
  58. log_format = "plain"
  59. ##### additional base config options #####
  60. # Path to the JSON file containing the initial validator set and other meta data
  61. genesis_file = "config/genesis.json"
  62. # Path to the JSON file containing the private key to use as a validator in the consensus protocol
  63. priv_validator_key_file = "config/priv_validator_key.json"
  64. # Path to the JSON file containing the last sign state of a validator
  65. priv_validator_state_file = "data/priv_validator_state.json"
  66. # TCP or UNIX socket address for Tendermint to listen on for
  67. # connections from an external PrivValidator process
  68. priv_validator_laddr = ""
  69. # Path to the JSON file containing the private key to use for node authentication in the p2p protocol
  70. node_key_file = "config/node_key.json"
  71. # Mechanism to connect to the ABCI application: socket | grpc
  72. abci = "socket"
  73. # If true, query the ABCI app on connecting to a new peer
  74. # so the app can decide if we should keep the connection or not
  75. filter_peers = false
  76. #######################################################################
  77. ### Advanced Configuration Options ###
  78. #######################################################################
  79. #######################################################
  80. ### RPC Server Configuration Options ###
  81. #######################################################
  82. [rpc]
  83. # TCP or UNIX socket address for the RPC server to listen on
  84. laddr = "tcp://127.0.0.1:26657"
  85. # A list of origins a cross-domain request can be executed from
  86. # Default value '[]' disables cors support
  87. # Use '["*"]' to allow any origin
  88. cors_allowed_origins = []
  89. # A list of methods the client is allowed to use with cross-domain requests
  90. cors_allowed_methods = ["HEAD", "GET", "POST", ]
  91. # A list of non simple headers the client is allowed to use with cross-domain requests
  92. cors_allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "X-Server-Time", ]
  93. # TCP or UNIX socket address for the gRPC server to listen on
  94. # NOTE: This server only supports /broadcast_tx_commit
  95. grpc_laddr = ""
  96. # Maximum number of simultaneous connections.
  97. # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
  98. # If you want to accept a larger number than the default, make sure
  99. # you increase your OS limits.
  100. # 0 - unlimited.
  101. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  102. # 1024 - 40 - 10 - 50 = 924 = ~900
  103. grpc_max_open_connections = 900
  104. # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
  105. unsafe = false
  106. # Maximum number of simultaneous connections (including WebSocket).
  107. # Does not include gRPC connections. See grpc_max_open_connections
  108. # If you want to accept a larger number than the default, make sure
  109. # you increase your OS limits.
  110. # 0 - unlimited.
  111. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  112. # 1024 - 40 - 10 - 50 = 924 = ~900
  113. max_open_connections = 900
  114. # Maximum number of unique clientIDs that can /subscribe
  115. # If you're using /broadcast_tx_commit, set to the estimated maximum number
  116. # of broadcast_tx_commit calls per block.
  117. max_subscription_clients = 100
  118. # Maximum number of unique queries a given client can /subscribe to
  119. # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
  120. # the estimated # maximum number of broadcast_tx_commit calls per block.
  121. max_subscriptions_per_client = 5
  122. # How long to wait for a tx to be committed during /broadcast_tx_commit.
  123. # WARNING: Using a value larger than 10s will result in increasing the
  124. # global HTTP write timeout, which applies to all connections and endpoints.
  125. # See https://github.com/tendermint/tendermint/issues/3435
  126. timeout_broadcast_tx_commit = "10s"
  127. # Maximum size of request body, in bytes
  128. max_body_bytes = 1000000
  129. # Maximum size of request header, in bytes
  130. max_header_bytes = 1048576
  131. # The path to a file containing certificate that is used to create the HTTPS server.
  132. # Migth be either absolute path or path related to tendermint's config directory.
  133. # If the certificate is signed by a certificate authority,
  134. # the certFile should be the concatenation of the server's certificate, any intermediates,
  135. # and the CA's certificate.
  136. # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
  137. # Otherwise, HTTP server is run.
  138. tls_cert_file = ""
  139. # The path to a file containing matching private key that is used to create the HTTPS server.
  140. # Migth be either absolute path or path related to tendermint's config directory.
  141. # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
  142. # Otherwise, HTTP server is run.
  143. tls_key_file = ""
  144. # pprof listen address (https://golang.org/pkg/net/http/pprof)
  145. pprof_laddr = ""
  146. #######################################################
  147. ### P2P Configuration Options ###
  148. #######################################################
  149. [p2p]
  150. # Address to listen for incoming connections
  151. laddr = "tcp://0.0.0.0:26656"
  152. # Address to advertise to peers for them to dial
  153. # If empty, will use the same port as the laddr,
  154. # and will introspect on the listener or use UPnP
  155. # to figure out the address.
  156. external_address = ""
  157. # Comma separated list of seed nodes to connect to
  158. seeds = ""
  159. # Comma separated list of nodes to keep persistent connections to
  160. persistent_peers = ""
  161. # UPNP port forwarding
  162. upnp = false
  163. # Path to address book
  164. addr_book_file = "config/addrbook.json"
  165. # Set true for strict address routability rules
  166. # Set false for private or local networks
  167. addr_book_strict = true
  168. # Maximum number of inbound peers
  169. max_num_inbound_peers = 40
  170. # Maximum number of outbound peers to connect to, excluding persistent peers
  171. max_num_outbound_peers = 10
  172. # List of node IDs, to which a connection will be (re)established ignoring any existing limits
  173. unconditional_peer_ids = ""
  174. # Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
  175. persistent_peers_max_dial_period = "0s"
  176. # Time to wait before flushing messages out on the connection
  177. flush_throttle_timeout = "100ms"
  178. # Maximum size of a message packet payload, in bytes
  179. max_packet_msg_payload_size = 1024
  180. # Rate at which packets can be sent, in bytes/second
  181. send_rate = 5120000
  182. # Rate at which packets can be received, in bytes/second
  183. recv_rate = 5120000
  184. # Set true to enable the peer-exchange reactor
  185. pex = true
  186. # Seed mode, in which node constantly crawls the network and looks for
  187. # peers. If another node asks it for addresses, it responds and disconnects.
  188. #
  189. # Does not work if the peer-exchange reactor is disabled.
  190. seed_mode = false
  191. # Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
  192. private_peer_ids = ""
  193. # Toggle to disable guard against peers connecting from the same ip.
  194. allow_duplicate_ip = false
  195. # Peer connection configuration.
  196. handshake_timeout = "20s"
  197. dial_timeout = "3s"
  198. #######################################################
  199. ### Mempool Configurattion Option ###
  200. #######################################################
  201. [mempool]
  202. recheck = true
  203. broadcast = true
  204. wal_dir = ""
  205. # Maximum number of transactions in the mempool
  206. size = 5000
  207. # Limit the total size of all txs in the mempool.
  208. # This only accounts for raw transactions (e.g. given 1MB transactions and
  209. # max_txs_bytes=5MB, mempool will only accept 5 transactions).
  210. max_txs_bytes = 1073741824
  211. # Size of the cache (used to filter transactions we saw earlier) in transactions
  212. cache_size = 10000
  213. # Maximum size of a single transaction.
  214. # NOTE: the max size of a tx transmitted over the network is {max_tx_bytes}.
  215. max_tx_bytes = 1048576
  216. #######################################################
  217. ### State Sync Configuration Options ###
  218. #######################################################
  219. [statesync]
  220. # State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine
  221. # snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in
  222. # the network to take and serve state machine snapshots. State sync is not attempted if the node
  223. # has any local state (LastBlockHeight > 0). The node will have a truncated block history,
  224. # starting from the height of the snapshot.
  225. enable = false
  226. # RPC servers (comma-separated) for light client verification of the synced state machine and
  227. # retrieval of state data for node bootstrapping. Also needs a trusted height and corresponding
  228. # header hash obtained from a trusted source, and a period during which validators can be trusted.
  229. #
  230. # For Cosmos SDK-based chains, trust_period should usually be about 2/3 of the unbonding time (~2
  231. # weeks) during which they can be financially punished (slashed) for misbehavior.
  232. rpc_servers = ""
  233. trust_height = 0
  234. trust_hash = ""
  235. trust_period = "0s"
  236. # Temporary directory for state sync snapshot chunks, defaults to the OS tempdir (typically /tmp).
  237. # Will create a new, randomly named directory within, and remove it when done.
  238. temp_dir = ""
  239. #######################################################
  240. ### Fast Sync Configuration Connections ###
  241. #######################################################
  242. [fastsync]
  243. # Fast Sync version to use:
  244. # 1) "v0" (default) - the legacy fast sync implementation
  245. # 2) "v1" - refactor of v0 version for better testability
  246. # 2) "v2" - complete redesign of v0, optimized for testability & readability
  247. version = "v0"
  248. #######################################################
  249. ### Consensus Configuration Options ###
  250. #######################################################
  251. [consensus]
  252. wal_file = "data/cs.wal/wal"
  253. timeout_propose = "3s"
  254. timeout_propose_delta = "500ms"
  255. timeout_prevote = "1s"
  256. timeout_prevote_delta = "500ms"
  257. timeout_precommit = "1s"
  258. timeout_precommit_delta = "500ms"
  259. timeout_commit = "1s"
  260. # How many blocks to look back to check existence of the node's consensus votes before joining consensus
  261. # When non-zero, the node will panic upon restart
  262. # if the same consensus key was used to sign {double_sign_check_height} last blocks.
  263. # So, validators should stop the state machine, wait for some blocks, and then restart the state machine to avoid panic.
  264. double_sign_check_height = 0
  265. # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
  266. skip_timeout_commit = false
  267. # EmptyBlocks mode and possible interval between empty blocks
  268. create_empty_blocks = true
  269. create_empty_blocks_interval = "0s"
  270. # Reactor sleep duration parameters
  271. peer_gossip_sleep_duration = "100ms"
  272. peer_query_maj23_sleep_duration = "2s"
  273. #######################################################
  274. ### Transaction Indexer Configuration Options ###
  275. #######################################################
  276. [tx_index]
  277. # What indexer to use for transactions
  278. #
  279. # The application will set which txs to index. In some cases a node operator will be able
  280. # to decide which txs to index based on configuration set in the application.
  281. #
  282. # Options:
  283. # 1) "null"
  284. # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
  285. # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed.
  286. indexer = "kv"
  287. #######################################################
  288. ### Instrumentation Configuration Options ###
  289. #######################################################
  290. [instrumentation]
  291. # When true, Prometheus metrics are served under /metrics on
  292. # PrometheusListenAddr.
  293. # Check out the documentation for the list of available metrics.
  294. prometheus = false
  295. # Address to listen for Prometheus collector(s) connections
  296. prometheus_listen_addr = ":26660"
  297. # Maximum number of simultaneous connections.
  298. # If you want to accept a larger number than the default, make sure
  299. # you increase your OS limits.
  300. # 0 - unlimited.
  301. max_open_connections = 3
  302. # Instrumentation namespace
  303. namespace = "tendermint"
  304. ```
  305. ## Empty blocks VS no empty blocks
  306. ### create_empty_blocks = true
  307. If `create_empty_blocks` is set to `true` in your config, blocks will be
  308. created ~ every second (with default consensus parameters). You can regulate
  309. the delay between blocks by changing the `timeout_commit`. E.g. `timeout_commit = "10s"` should result in ~ 10 second blocks.
  310. ### create_empty_blocks = false
  311. In this setting, blocks are created when transactions received.
  312. Note after the block H, Tendermint creates something we call a "proof block"
  313. (only if the application hash changed) H+1. The reason for this is to support
  314. proofs. If you have a transaction in block H that changes the state to X, the
  315. new application hash will only be included in block H+1. If after your
  316. transaction is committed, you want to get a light-client proof for the new state
  317. (X), you need the new block to be committed in order to do that because the new
  318. block has the new application hash for the state X. That's why we make a new
  319. (empty) block if the application hash changes. Otherwise, you won't be able to
  320. make a proof for the new state.
  321. Plus, if you set `create_empty_blocks_interval` to something other than the
  322. default (`0`), Tendermint will be creating empty blocks even in the absence of
  323. transactions every `create_empty_blocks_interval`. For instance, with
  324. `create_empty_blocks = false` and `create_empty_blocks_interval = "30s"`,
  325. Tendermint will only create blocks if there are transactions, or after waiting
  326. 30 seconds without receiving any transactions.
  327. ## Consensus timeouts explained
  328. There's a variety of information about timeouts in [Running in
  329. production](./running-in-production.md)
  330. You can also find more detailed technical explanation in the spec: [The latest
  331. gossip on BFT consensus](https://arxiv.org/abs/1807.04938).
  332. ```toml
  333. [consensus]
  334. ...
  335. timeout_propose = "3s"
  336. timeout_propose_delta = "500ms"
  337. timeout_prevote = "1s"
  338. timeout_prevote_delta = "500ms"
  339. timeout_precommit = "1s"
  340. timeout_precommit_delta = "500ms"
  341. timeout_commit = "1s"
  342. ```
  343. Note that in a successful round, the only timeout that we absolutely wait no
  344. matter what is `timeout_commit`.
  345. Here's a brief summary of the timeouts:
  346. - `timeout_propose` = how long we wait for a proposal block before prevoting
  347. nil
  348. - `timeout_propose_delta` = how much timeout_propose increases with each round
  349. - `timeout_prevote` = how long we wait after receiving +2/3 prevotes for
  350. anything (ie. not a single block or nil)
  351. - `timeout_prevote_delta` = how much the timeout_prevote increases with each
  352. round
  353. - `timeout_precommit` = how long we wait after receiving +2/3 precommits for
  354. anything (ie. not a single block or nil)
  355. - `timeout_precommit_delta` = how much the timeout_precommit increases with
  356. each round
  357. - `timeout_commit` = how long we wait after committing a block, before starting
  358. on the new height (this gives us a chance to receive some more precommits,
  359. even though we already have +2/3)