Skip to content

Commit

Permalink
feat: add mempool to the config
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Sep 25, 2023
1 parent e397795 commit 4ba33a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/testground/compositions/standard/plan.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ inbound_peer_count = "40"
outbound_peer_count = "10"
gov_max_square_size = "128"
max_block_bytes = "8000000"
mempool = "v1"


[[groups]]
Expand Down
1 change: 1 addition & 0 deletions test/testground/manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ inbound_peer_count = { type = "int", default = 40 }
outbound_peer_count = { type = "int", default = 10 }
gov_max_square_size = { type = "int", default = 128 }
max_block_bytes = { type = "int", deafult = 8000000 }
mempool = { type = "string", default = "v1" }
7 changes: 7 additions & 0 deletions test/testground/network/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (

"github.com/celestiaorg/celestia-app/app"
"github.com/celestiaorg/celestia-app/app/encoding"
testgroundconsts "github.com/celestiaorg/celestia-app/pkg/appconsts/testground"
"github.com/celestiaorg/celestia-app/test/util/genesis"
blobtypes "github.com/celestiaorg/celestia-app/x/blob/types"
srvconfig "github.com/cosmos/cosmos-sdk/server/config"
Expand All @@ -33,6 +34,7 @@ const (
OutboundPeerCountParam = "outbound_peer_count"
GovMaxSquareSizeParam = "gov_max_square_size"
MaxBlockBytesParam = "max_block_bytes"
MempoolParam = "mempool"
)

type Params struct {
Expand All @@ -54,6 +56,7 @@ type Params struct {
MaxBlockBytes int
TimeoutCommit time.Duration
TimeoutPropose time.Duration
Mempool string
}

func ParseParams(ecfg encoding.Config, runenv *runtime.RunEnv) (*Params, error) {
Expand Down Expand Up @@ -106,6 +109,8 @@ func ParseParams(ecfg encoding.Config, runenv *runtime.RunEnv) (*Params, error)

p.Pex = runenv.BooleanParam(PexParam)

p.Mempool = runenv.StringParam(MempoolParam)

return p, p.ValidateBasic()
}

Expand Down Expand Up @@ -134,6 +139,7 @@ func StandardCometConfig(params *Params) *tmconfig.Config {
cmtcfg.Consensus.TimeoutCommit = params.TimeoutCommit
cmtcfg.Consensus.TimeoutPropose = params.TimeoutPropose
cmtcfg.TxIndex.Indexer = "kv"
cmtcfg.Mempool.Version = params.Mempool
return cmtcfg
}

Expand All @@ -144,6 +150,7 @@ func StandardAppConfig(_ *Params) *srvconfig.Config {
func StandardConsensusParams(params *Params) *tmproto.ConsensusParams {
cp := app.DefaultConsensusParams()
cp.Block.MaxBytes = int64(params.MaxBlockBytes)
cp.Version.AppVersion = testgroundconsts.Version
return cp
}

Expand Down

0 comments on commit 4ba33a6

Please sign in to comment.