From d704c0a0b6fbc042dcb260dbb766bd83bb140cb7 Mon Sep 17 00:00:00 2001 From: Rootul P Date: Wed, 2 Nov 2022 05:25:05 -0600 Subject: [PATCH] docs: describe undocumented `MempoolConfig` fields (#9598) * docs: describe undocumented MempoolConfig fields Co-authored-by: Jasmina Malicevic --- config/config.go | 27 ++++++++++++++++++++++----- config/toml.go | 18 +++++++++++++++++- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/config/config.go b/config/config.go index f072cad2d..bcf083463 100644 --- a/config/config.go +++ b/config/config.go @@ -708,11 +708,28 @@ type MempoolConfig struct { // Mempool version to use: // 1) "v0" - (default) FIFO mempool. // 2) "v1" - prioritized mempool. - Version string `mapstructure:"version"` - RootDir string `mapstructure:"home"` - Recheck bool `mapstructure:"recheck"` - Broadcast bool `mapstructure:"broadcast"` - WalPath string `mapstructure:"wal_dir"` + Version string `mapstructure:"version"` + // RootDir is the root directory for all data. This should be configured via + // the $TMHOME env variable or --home cmd flag rather than overriding this + // struct field. + RootDir string `mapstructure:"home"` + // Recheck (default: true) defines whether Tendermint should recheck the + // validity for all remaining transaction in the mempool after a block. + // Since a block affects the application state, some transactions in the + // mempool may become invalid. If this does not apply to your application, + // you can disable rechecking. + Recheck bool `mapstructure:"recheck"` + // Broadcast (default: true) defines whether the mempool should relay + // transactions to other peers. Setting this to false will stop the mempool + // from relaying transactions to other peers until they are included in a + // block. In other words, if Broadcast is disabled, only the peer you send + // the tx to will see it until it is included in a block. + Broadcast bool `mapstructure:"broadcast"` + // WalPath (default: "") configures the location of the Write Ahead Log + // (WAL) for the mempool. The WAL is disabled by default. To enable, set + // WalPath to where you want the WAL to be written (e.g. + // "data/mempool.wal"). + WalPath string `mapstructure:"wal_dir"` // Maximum number of transactions in the mempool Size int `mapstructure:"size"` // Limit the total size of all txs in the mempool. diff --git a/config/toml.go b/config/toml.go index 540dfed31..d5c2ab710 100644 --- a/config/toml.go +++ b/config/toml.go @@ -349,8 +349,24 @@ dial_timeout = "{{ .P2P.DialTimeout }}" # 2) "v1" - prioritized mempool. version = "{{ .Mempool.Version }}" +# Recheck (default: true) defines whether Tendermint should recheck the +# validity for all remaining transaction in the mempool after a block. +# Since a block affects the application state, some transactions in the +# mempool may become invalid. If this does not apply to your application, +# you can disable rechecking. recheck = {{ .Mempool.Recheck }} + +# Broadcast (default: true) defines whether the mempool should relay +# transactions to other peers. Setting this to false will stop the mempool +# from relaying transactions to other peers until they are included in a +# block. In other words, if Broadcast is disabled, only the peer you send +# the tx to will see it until it is included in a block. broadcast = {{ .Mempool.Broadcast }} + +# WalPath (default: "") configures the location of the Write Ahead Log +# (WAL) for the mempool. The WAL is disabled by default. To enable, set +# WalPath to where you want the WAL to be written (e.g. +# "data/mempool.wal"). wal_dir = "{{ js .Mempool.WalPath }}" # Maximum number of transactions in the mempool @@ -436,7 +452,7 @@ chunk_fetchers = "{{ .StateSync.ChunkFetchers }}" [blocksync] # Block Sync version to use: -# +# # In v0.37, v1 and v2 of the block sync protocols were deprecated. # Please use v0 instead. #