config: rename mempool.size to mempool.max_txs

https://github.com/tendermint/tendermint/pull/3248#discussion_r254034004
This commit is contained in:
Anton Kaliaev
2019-02-06 10:21:26 +04:00
parent 8de0ffc965
commit 39bfa36961
5 changed files with 9 additions and 8 deletions
+4 -4
View File
@@ -534,7 +534,7 @@ type MempoolConfig struct {
Recheck bool `mapstructure:"recheck"`
Broadcast bool `mapstructure:"broadcast"`
WalPath string `mapstructure:"wal_dir"`
Size int `mapstructure:"size"`
MaxTxs int `mapstructure:"max_txs"`
MaxTxsTotalBytes int64 `mapstructure:"max_txs_total_bytes"`
CacheSize int `mapstructure:"cache_size"`
}
@@ -545,9 +545,9 @@ func DefaultMempoolConfig() *MempoolConfig {
Recheck: true,
Broadcast: true,
WalPath: "",
// Each signature verification takes .5ms, Size reduced until we implement
// Each signature verification takes .5ms, MaxTxs reduced until we implement
// ABCI Recheck
Size: 5000,
MaxTxs: 5000,
MaxTxsTotalBytes: 1024 * 1024 * 1024, // 1GB
CacheSize: 10000,
}
@@ -573,7 +573,7 @@ func (cfg *MempoolConfig) WalEnabled() bool {
// ValidateBasic performs basic validation (checking param bounds, etc.) and
// returns an error if any check fails.
func (cfg *MempoolConfig) ValidateBasic() error {
if cfg.Size < 0 {
if cfg.MaxTxs < 0 {
return errors.New("size can't be negative")
}
if cfg.MaxTxsTotalBytes < 0 {
+1 -1
View File
@@ -235,7 +235,7 @@ broadcast = {{ .Mempool.Broadcast }}
wal_dir = "{{ js .Mempool.WalPath }}"
# Maximum number of transactions in the mempool
size = {{ .Mempool.Size }}
max_txs = {{ .Mempool.MaxTxs }}
# Limit the total size of all txs in the mempool.
# This only accounts for raw transactions (e.g. given 1MB transactions and