From 3b9ae01de4ea49987f03b2b420ebc89d7ac75311 Mon Sep 17 00:00:00 2001 From: Jeancarlo Barrios Date: Thu, 1 Dec 2022 19:39:55 -0500 Subject: [PATCH] feat: add tx limit to mempool (#14014) * feat: add bounding max tx to mempool * add bounded condition * sligh improvement on generator * remove unbouded option * add test * added mempool options mechanism * mising test * seting mempool * change function name * change function name * failing test * Revert "failing test" This reverts commit d527982b0d4ec826ff680afb8f43ac1d71809ccf. * fix import block * changelog entries * add ability to do unbounded mempool * remove unesesary variable * small comments * change 0 to mean unbounded * t * small test fix * add the ability to be bounded unbounded and disabled * t * set default maxtx * Update docs/docs/building-apps/02-app-mempool.md Co-authored-by: Aleksandr Bezobchuk * example for opts * remove superflues logs entry * add mempool to configurations * fix more understandable name * remove table in favor of bulletpoints * sender nonce to unbounded * Update docs/docs/building-apps/02-app-mempool.md Co-authored-by: Aleksandr Bezobchuk * Update types/mempool/sender_nonce.go Co-authored-by: Aleksandr Bezobchuk * Update types/mempool/sender_nonce.go Co-authored-by: Aleksandr Bezobchuk * Update docs/docs/building-apps/02-app-mempool.md Co-authored-by: Aleksandr Bezobchuk * Update server/config/config.go Co-authored-by: Aleksandr Bezobchuk * t * add comment for options * fix inport * fix inport Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Emmanuel T Odeke --- simd/cmd/root.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/simd/cmd/root.go b/simd/cmd/root.go index f46f0d6fa055..859c53dba360 100644 --- a/simd/cmd/root.go +++ b/simd/cmd/root.go @@ -34,6 +34,7 @@ import ( snapshottypes "github.com/cosmos/cosmos-sdk/store/snapshots/types" simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/mempool" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" @@ -307,6 +308,7 @@ func newApp( baseapp.SetSnapshot(snapshotStore, snapshotOptions), baseapp.SetIAVLCacheSize(cast.ToInt(appOpts.Get(server.FlagIAVLCacheSize))), baseapp.SetIAVLDisableFastNode(cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))), + baseapp.SetMempool(mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(cast.ToInt(appOpts.Get(server.FlagMempoolMaxTxs))))), ) }