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

chore: update mempool defaults (backport #4284) #4293

Merged
merged 1 commit into from
Feb 4, 2025
Merged
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
11 changes: 7 additions & 4 deletions app/default_overrides.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ import (
coretypes "github.com/tendermint/tendermint/types"
)

const (
mebibyte = 1048576
)

// bankModule defines a custom wrapper around the x/bank module's AppModuleBasic
// implementation to provide custom default genesis state.
type bankModule struct {
Expand Down Expand Up @@ -263,9 +267,9 @@ func DefaultConsensusConfig() *tmcfg.Config {

cfg.Mempool.TTLNumBlocks = 12
cfg.Mempool.TTLDuration = 75 * time.Second
cfg.Mempool.MaxTxBytes = 7_897_088
cfg.Mempool.MaxTxsBytes = 39_485_440
cfg.Mempool.Version = "v1" // prioritized mempool
cfg.Mempool.MaxTxBytes = 2 * mebibyte
cfg.Mempool.MaxTxsBytes = 80 * mebibyte
cfg.Mempool.Version = "v2" // Content Addressable Transaction (CAT) mempool

cfg.Consensus.TimeoutPropose = appconsts.GetTimeoutPropose(appconsts.LatestVersion)
cfg.Consensus.TimeoutCommit = appconsts.GetTimeoutCommit(appconsts.LatestVersion)
Expand All @@ -274,7 +278,6 @@ func DefaultConsensusConfig() *tmcfg.Config {
cfg.TxIndex.Indexer = "null"
cfg.Storage.DiscardABCIResponses = true

const mebibyte = 1048576
cfg.P2P.SendRate = 10 * mebibyte
cfg.P2P.RecvRate = 10 * mebibyte

Expand Down
7 changes: 3 additions & 4 deletions app/default_overrides_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ func TestDefaultAppConfig(t *testing.T) {
assert.Equal(t, uint32(2), cfg.StateSync.SnapshotKeepRecent)
assert.Equal(t, "0.002utia", cfg.MinGasPrices)

mebibyte := 1048576
assert.Equal(t, 20*mebibyte, cfg.GRPC.MaxRecvMsgSize)
}

Expand All @@ -84,11 +83,11 @@ func TestDefaultConsensusConfig(t *testing.T) {
WalPath: tmcfg.DefaultMempoolConfig().WalPath,

// Overrides
MaxTxBytes: 7_897_088,
MaxTxsBytes: 39_485_440,
MaxTxBytes: 2 * mebibyte,
MaxTxsBytes: 80 * mebibyte,
TTLDuration: 75 * time.Second,
TTLNumBlocks: 12,
Version: "v1",
Version: "v2",
}
assert.Equal(t, want, *got.Mempool)
})
Expand Down