mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-26 19:21:44 +00:00
mempool: make max_msg_bytes configurable (#3826)
* mempool: make max_msg_bytes configurable * apply suggestions from code review * update changelog pending * apply suggestions from code review again
This commit is contained in:
committed by
Jack Zampolin
parent
5ed39fd0b3
commit
df6df61ea9
@ -631,6 +631,7 @@ type MempoolConfig struct {
|
||||
Size int `mapstructure:"size"`
|
||||
MaxTxsBytes int64 `mapstructure:"max_txs_bytes"`
|
||||
CacheSize int `mapstructure:"cache_size"`
|
||||
MaxMsgBytes int `mapstructure:"max_msg_bytes"`
|
||||
}
|
||||
|
||||
// DefaultMempoolConfig returns a default configuration for the Tendermint mempool
|
||||
@ -644,6 +645,7 @@ func DefaultMempoolConfig() *MempoolConfig {
|
||||
Size: 5000,
|
||||
MaxTxsBytes: 1024 * 1024 * 1024, // 1GB
|
||||
CacheSize: 10000,
|
||||
MaxMsgBytes: 1024 * 1024, // 1MB
|
||||
}
|
||||
}
|
||||
|
||||
@ -676,6 +678,9 @@ func (cfg *MempoolConfig) ValidateBasic() error {
|
||||
if cfg.CacheSize < 0 {
|
||||
return errors.New("cache_size can't be negative")
|
||||
}
|
||||
if cfg.MaxMsgBytes < 0 {
|
||||
return errors.New("max_msg_bytes can't be negative")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user