Skip to content

Commit

Permalink
set mempool
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jul 19, 2024
1 parent 5cf003e commit a56a4d0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,11 @@ import (
memiavlrootmulti "github.com/crypto-org-chain/cronos/store/rootmulti"
)

// FIXME remove this line, dummy
const appName = "chain-maind"
const (
// FIXME remove this line, dummy
appName = "chain-maind"
DefaultMaxTxs = 3000
)

func getGovProposalHandlers() []govclient.ProposalHandler {
var govProposalHandlers []govclient.ProposalHandler
Expand Down Expand Up @@ -287,7 +290,15 @@ 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) {
mempool := mempool.NoOpMempool{}
maxTxs := cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs))
if maxTxs <= 0 {
maxTxs = DefaultMaxTxs
}
mempool := mempool.NewPriorityMempool(mempool.PriorityNonceMempoolConfig[int64]{
TxPriority: mempool.NewDefaultTxPriority(),
SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(),
MaxTx: maxTxs,
})
app.SetMempool(mempool)
handler := baseapp.NewDefaultProposalHandler(mempool, app)
app.SetPrepareProposal(handler.PrepareProposalHandler())
Expand Down

0 comments on commit a56a4d0

Please sign in to comment.