Skip to content

Commit

Permalink
Problem: no MaxTx set from config for mempool (#1500)
Browse files Browse the repository at this point in the history
* Problem: no MaxTx set in mempool

* default max-txs

---------

Co-authored-by: huangyi <huang@crypto.com>
  • Loading branch information
mmsqe and yihuang authored Jul 2, 2024
1 parent 8e418aa commit 86a00f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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*
Expand Down
7 changes: 7 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ const (
AddrLen = 20

FlagBlockedAddresses = "blocked-addresses"

DefaultMaxTxs = 1000
)

var Forks = []Fork{}
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions integration_tests/configs/default.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
'block-range-cap': 10000,
'logs-cap': 10000,
},
mempool: {
'max-txs': 1000,
},
evm: {
'block-executor': 'block-stm',
},
Expand Down

0 comments on commit 86a00f3

Please sign in to comment.