Skip to content

Commit

Permalink
chore: update mempool defaults (#4284)
Browse files Browse the repository at this point in the history
updates the default mempool values

---------

Co-authored-by: Rootul P <[email protected]>
  • Loading branch information
evan-forbes and rootulp authored Feb 4, 2025
1 parent de7cab4 commit abad811
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
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

0 comments on commit abad811

Please sign in to comment.