mempool: v1 implementation (#6466)

This commit is contained in:
Aleksandr Bezobchuk
2021-06-01 11:17:45 -04:00
committed by GitHub
parent 4e06dfef8c
commit 1e4bc04cd6
42 changed files with 3323 additions and 736 deletions
+7 -2
View File
@@ -30,6 +30,9 @@ const (
BlockchainV0 = "v0"
BlockchainV2 = "v2"
MempoolV0 = "v0"
MempoolV1 = "v1"
)
// NOTE: Most of the structs & relevant comments + the
@@ -731,8 +734,9 @@ func (cfg *P2PConfig) ValidateBasic() error {
//-----------------------------------------------------------------------------
// MempoolConfig
// MempoolConfig defines the configuration options for the Tendermint mempool
// MempoolConfig defines the configuration options for the Tendermint mempool.
type MempoolConfig struct {
Version string `mapstructure:"version"`
RootDir string `mapstructure:"home"`
Recheck bool `mapstructure:"recheck"`
Broadcast bool `mapstructure:"broadcast"`
@@ -757,9 +761,10 @@ type MempoolConfig struct {
MaxBatchBytes int `mapstructure:"max-batch-bytes"`
}
// DefaultMempoolConfig returns a default configuration for the Tendermint mempool
// DefaultMempoolConfig returns a default configuration for the Tendermint mempool.
func DefaultMempoolConfig() *MempoolConfig {
return &MempoolConfig{
Version: MempoolV1,
Recheck: true,
Broadcast: true,
// Each signature verification takes .5ms, Size reduced until we implement
+5
View File
@@ -363,6 +363,11 @@ dial-timeout = "{{ .P2P.DialTimeout }}"
#######################################################
[mempool]
# Mempool version to use:
# 1) "v0" - The legacy non-prioritized mempool reactor.
# 2) "v1" (default) - The prioritized mempool reactor.
version = "{{ .Mempool.Version }}"
recheck = {{ .Mempool.Recheck }}
broadcast = {{ .Mempool.Broadcast }}