Skip to content

Commit

Permalink
refactor!: remove v0 mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
ninabarbakadze committed Jun 11, 2024
1 parent abc5163 commit 7787416
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 2,508 deletions.
4 changes: 1 addition & 3 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ const (
// DefaultLogLevel defines a default log level as INFO.
DefaultLogLevel = "info"

// Mempool versions. V1 is prioritized mempool, v0 is regular mempool.
// Default is v0.
MempoolV0 = "v0"
// Mempool versions. v1 (prioritized) is the current default.
MempoolV1 = "v1"
MempoolV2 = "v2"
)
Expand Down
7 changes: 0 additions & 7 deletions consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (

cfg "github.com/cometbft/cometbft/config"
mempoolv2 "github.com/cometbft/cometbft/mempool/cat"
mempoolv0 "github.com/cometbft/cometbft/mempool/v0"
mempoolv1 "github.com/cometbft/cometbft/mempool/v1"
"github.com/cometbft/cometbft/p2p"
cmtcons "github.com/cometbft/cometbft/proto/tendermint/consensus"
Expand Down Expand Up @@ -75,12 +74,6 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
var mempool mempl.Mempool

switch thisConfig.Mempool.Version {
case cfg.MempoolV0:
mempool = mempoolv0.NewCListMempool(config.Mempool,
proxyAppConnConMem,
state.LastBlockHeight,
mempoolv0.WithPreCheck(sm.TxPreCheck(state)),
mempoolv0.WithPostCheck(sm.TxPostCheck(state)))
case cfg.MempoolV1:
mempool = mempoolv1.NewTxMempool(logger,
config.Mempool,
Expand Down
8 changes: 0 additions & 8 deletions consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
cmtsync "github.com/cometbft/cometbft/libs/sync"
mempl "github.com/cometbft/cometbft/mempool"
mempoolv2 "github.com/cometbft/cometbft/mempool/cat"
mempoolv0 "github.com/cometbft/cometbft/mempool/v0"
mempoolv1 "github.com/cometbft/cometbft/mempool/v1"
"github.com/cometbft/cometbft/p2p"
"github.com/cometbft/cometbft/privval"
Expand Down Expand Up @@ -402,13 +401,6 @@ func newStateWithConfigAndBlockStore(
var mempool mempl.Mempool

switch config.Mempool.Version {
case cfg.MempoolV0:
mempool = mempoolv0.NewCListMempool(config.Mempool,
proxyAppConnConMem,
state.LastBlockHeight,
mempoolv0.WithMetrics(memplMetrics),
mempoolv0.WithPreCheck(sm.TxPreCheck(state)),
mempoolv0.WithPostCheck(sm.TxPostCheck(state)))
case cfg.MempoolV1:
logger := consensusLogger()
mempool = mempoolv1.NewTxMempool(logger,
Expand Down
8 changes: 0 additions & 8 deletions consensus/reactor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
cmtsync "github.com/cometbft/cometbft/libs/sync"
mempl "github.com/cometbft/cometbft/mempool"
mempoolv2 "github.com/cometbft/cometbft/mempool/cat"
mempoolv0 "github.com/cometbft/cometbft/mempool/v0"
mempoolv1 "github.com/cometbft/cometbft/mempool/v1"
"github.com/cometbft/cometbft/p2p"
p2pmock "github.com/cometbft/cometbft/p2p/mock"
Expand Down Expand Up @@ -169,13 +168,6 @@ func TestReactorWithEvidence(t *testing.T) {
var mempool mempl.Mempool

switch config.Mempool.Version {
case cfg.MempoolV0:
mempool = mempoolv0.NewCListMempool(config.Mempool,
proxyAppConnConMem,
state.LastBlockHeight,
mempoolv0.WithMetrics(memplMetrics),
mempoolv0.WithPreCheck(sm.TxPreCheck(state)),
mempoolv0.WithPostCheck(sm.TxPostCheck(state)))
case cfg.MempoolV1:
mempool = mempoolv1.NewTxMempool(logger,
config.Mempool,
Expand Down
101 changes: 0 additions & 101 deletions mempool/v0/bench_test.go

This file was deleted.

81 changes: 0 additions & 81 deletions mempool/v0/cache_test.go

This file was deleted.

Loading

0 comments on commit 7787416

Please sign in to comment.