From 2c82469cd6f7531d6b72fce669cde43587227a8d Mon Sep 17 00:00:00 2001 From: Devon Bear Date: Sun, 5 Nov 2023 14:02:32 -0500 Subject: [PATCH] fix(config): Move on-disk txpool elements to data folder (#1287) Fix for @BrickBera image ## Summary by CodeRabbit - **New Features** - Introduced a default value for the transaction journal in the legacy transaction pool if not provided, enhancing the reliability of the system. - **Refactor** - Updated the configuration structure to use the default legacy transaction pool configuration, improving code readability and maintainability. --- cosmos/config/config.go | 9 +++++++++ eth/polar/config.go | 6 ++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/cosmos/config/config.go b/cosmos/config/config.go index 2bbf8648b..8fffcae5b 100644 --- a/cosmos/config/config.go +++ b/cosmos/config/config.go @@ -279,6 +279,15 @@ func readConfigFromAppOptsParser(parser AppOptionsParser) (*Config, error) { return nil, err } + if conf.Polar.LegacyTxPool.Journal == "" { + conf.Polar.LegacyTxPool.Journal, err = + parser.GetString(sdkflags.FlagHome) + if err != nil { + return nil, err + } + conf.Polar.LegacyTxPool.Journal += "/data/transactions.rlp" + } + if conf.Polar.LegacyTxPool.Rejournal, err = parser.GetTimeDuration(flags.ReJournal); err != nil { return nil, err diff --git a/eth/polar/config.go b/eth/polar/config.go index a5e0c9e81..2f25f038e 100644 --- a/eth/polar/config.go +++ b/eth/polar/config.go @@ -51,12 +51,14 @@ func DefaultConfig() *Config { gpoConfig.Default = big.NewInt(gpoDefault) minerCfg := miner.DefaultConfig minerCfg.Etherbase = common.HexToAddress(developmentCoinbase) - // TODO: setup proper command line flags + legacyPool := legacypool.DefaultConfig + legacyPool.Journal = "" + return &Config{ Chain: *params.DefaultChainConfig, Miner: minerCfg, GPO: gpoConfig, - LegacyTxPool: legacypool.DefaultConfig, + LegacyTxPool: legacyPool, RPCGasCap: ethconfig.Defaults.RPCGasCap, RPCTxFeeCap: ethconfig.Defaults.RPCTxFeeCap, RPCEVMTimeout: ethconfig.Defaults.RPCEVMTimeout,