Skip to content

Commit

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

* Update config.go

Co-authored-by: yihuang <[email protected]>
Signed-off-by: mmsqe <[email protected]>

---------

Signed-off-by: mmsqe <[email protected]>
Co-authored-by: yihuang <[email protected]>
  • Loading branch information
mmsqe and yihuang authored Jul 2, 2024
1 parent f9cd15e commit e5b222f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* (app) [#483](https://github.com/crypto-org-chain/ethermint/pull/483) Make keyring-backend client config accessible in app.
* (deps) [#489](https://github.com/crypto-org-chain/ethermint/pull/489) Update cosmos-sdk to `v0.50.7`.
* (rpc) [#491](https://github.com/crypto-org-chain/ethermint/pull/491) Avoid unnecessary tx decode in tx listener.
* [#496](https://github.com/crypto-org-chain/cronos/pull/496) Set mempool MaxTx from config.

## v0.21.x-cronos

Expand Down
5 changes: 5 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,14 @@ func NewEthermintApp(
// 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 = srvconfig.DefaultMaxTxs
}
mempool := mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{
TxPriority: mempool.NewDefaultTxPriority(),
SignerExtractor: NewEthSignerExtractionAdapter(mempool.NewDefaultSignerExtractionAdapter()),
MaxTx: maxTxs,
})
handler := baseapp.NewDefaultProposalHandler(mempool, app)

Expand Down
1 change: 1 addition & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const (

BlockExecutorSequential = "sequential"
BlockExecutorBlockSTM = "block-stm"
DefaultMaxTxs = 3000
)

var (
Expand Down
1 change: 1 addition & 0 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ which accepts a path for the resulting pprof file.

cmd.Flags().Uint64(server.FlagStateSyncSnapshotInterval, 0, "State sync snapshot interval")
cmd.Flags().Uint32(server.FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep")
cmd.Flags().Int(server.FlagMempoolMaxTxs, config.DefaultMaxTxs, "Sets MaxTx value for the app-side mempool")

// add support for all CometBFT-specific command line options
tcmd.AddNodeFlags(cmd)
Expand Down

0 comments on commit e5b222f

Please sign in to comment.