Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!: remove v0 mempool #1388

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading