Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
fix(config): Move on-disk txpool elements to data folder (#1287)
Browse files Browse the repository at this point in the history
Fix for @BrickBera 

<img width="261" alt="image"
src="https://github.com/berachain/polaris/assets/93690142/32f43dff-64a6-4569-aa20-715991ac8ea6">


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## 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.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
itsdevbear committed Nov 5, 2023
1 parent cd12ec4 commit 2c82469
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 9 additions & 0 deletions cosmos/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions eth/polar/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2c82469

Please sign in to comment.