diff --git a/CHANGELOG.md b/CHANGELOG.md index 123a71a3eb..b3d12ac1d9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ * [#1490](https://github.com/crypto-org-chain/cronos/pull/1490) Update cometbft to v0.38.8. * (versiondb) [#1491](https://github.com/crypto-org-chain/cronos/pull/1491) Free slice data in HasAtVersion. * (versiondb) [#1498](https://github.com/crypto-org-chain/cronos/pull/1498) Reduce scope of copying slice data in iterator. +* [#1500](https://github.com/crypto-org-chain/cronos/pull/1500) Set mempool MaxTx from config. *Jun 18, 2024* diff --git a/app/app.go b/app/app.go index 678ccc0a7b..8ae241fd1a 100644 --- a/app/app.go +++ b/app/app.go @@ -182,6 +182,8 @@ const ( AddrLen = 20 FlagBlockedAddresses = "blocked-addresses" + + DefaultMaxTxs = 1000 ) var Forks = []Fork{} @@ -371,9 +373,14 @@ func New( // NOTE we use custom transaction decoder that supports the sdk.Tx interface instead of sdk.StdTx // Setup Mempool and Proposal Handlers baseAppOptions = append(baseAppOptions, func(app *baseapp.BaseApp) { + maxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs)) + if maxTxs <= 0 { + maxTxs = DefaultMaxTxs + } mempool := mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{ TxPriority: mempool.NewDefaultTxPriority(), SignerExtractor: evmapp.NewEthSignerExtractionAdapter(mempool.NewDefaultSignerExtractionAdapter()), + MaxTx: maxTxs, }) handler := baseapp.NewDefaultProposalHandler(mempool, app) diff --git a/integration_tests/configs/default.jsonnet b/integration_tests/configs/default.jsonnet index 33353020b5..79017e338f 100644 --- a/integration_tests/configs/default.jsonnet +++ b/integration_tests/configs/default.jsonnet @@ -23,6 +23,9 @@ 'block-range-cap': 10000, 'logs-cap': 10000, }, + mempool: { + 'max-txs': 1000, + }, evm: { 'block-executor': 'block-stm', },