-
Notifications
You must be signed in to change notification settings - Fork 360
fix(mempool): Prevent runTx failures #1425
Changes from 8 commits
b8ff23d
d20570d
b697a60
838fd0c
d50e582
7a2ea33
e8f31ad
a8bc57d
1cb455c
a77f174
69329b1
bc65f34
5262965
9e56706
cf9c1d5
1fdca16
ace17c4
127a25f
0e03eff
324e24a
6bd959e
0c0b3d0
f686f83
dc6302c
c1a9e54
51e7c77
40303ec
d5d59b7
49eb151
a76c9b5
7c420b0
7c758a1
deff092
0292437
af457a4
c82042a
92cadd1
a8222c0
66e3f65
ba7c9dc
f2c30d6
e0e30d7
9f08107
bd216d5
3fc2ac1
e50a5e9
c2870a8
2c752d7
80533a6
1cc85b8
8c96574
8a521ab
9b8fc41
a4363aa
9d39963
fce00ab
b75cafa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
// | ||
// Copyright (C) 2023, Berachain Foundation. All rights reserved. | ||
// Use of this software is govered by the Business Source License included | ||
// in the LICENSE file of this repository and at www.mariadb.com/bsl11. | ||
// | ||
// ANY USE OF THE LICENSED WORK IN VIOLATION OF THIS LICENSE WILL AUTOMATICALLY | ||
// TERMINATE YOUR RIGHTS UNDER THIS LICENSE FOR THE CURRENT AND ALL OTHER | ||
// VERSIONS OF THE LICENSED WORK. | ||
// | ||
// THIS LICENSE DOES NOT GRANT YOU ANY RIGHT IN ANY TRADEMARK OR LOGO OF | ||
// LICENSOR OR ITS AFFILIATES (PROVIDED THAT YOU MAY USE A TRADEMARK OR LOGO OF | ||
// LICENSOR AS EXPRESSLY REQUIRED BY THIS LICENSE). | ||
// | ||
// TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON | ||
// AN “AS IS” BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS, | ||
// EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF | ||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND | ||
// TITLE. | ||
|
||
package config | ||
|
||
import ( | ||
"github.com/berachain/polaris/eth/node" | ||
"github.com/berachain/polaris/eth/polar" | ||
|
||
cmtcfg "github.com/cometbft/cometbft/config" | ||
|
||
serverconfig "github.com/cosmos/cosmos-sdk/server/config" | ||
) | ||
|
||
// RecommendedCometBFTConfig returns the recommended CometBFT config | ||
// for the application. | ||
func RecommendedCometBFTConfig() *cmtcfg.Config { | ||
cfg := cmtcfg.DefaultConfig() | ||
cfg.Mempool.Size = 30000 | ||
cfg.Mempool.CacheSize = 30000 | ||
cfg.Mempool.Recheck = true | ||
cfg.Mempool.Type = "flood" | ||
|
||
cfg.P2P.MaxNumInboundPeers = 10 | ||
cfg.P2P.MaxNumOutboundPeers = 15 | ||
|
||
cfg.TxIndex.Indexer = "null" | ||
|
||
cfg.Instrumentation.Prometheus = true | ||
return cfg | ||
} | ||
|
||
// RecommendedServerConfig returns the recommended server config. | ||
func RecommendedServerConfig() *serverconfig.Config { | ||
cfg := serverconfig.DefaultConfig() | ||
cfg.MinGasPrices = "0abera" | ||
cfg.API.Enable = true | ||
cfg.Telemetry.Enabled = true | ||
cfg.Telemetry.PrometheusRetentionTime = 180 | ||
cfg.Telemetry.EnableHostnameLabel = true | ||
cfg.Telemetry.GlobalLabels = [][]string{} | ||
cfg.IAVLCacheSize = 20000 | ||
return cfg | ||
} | ||
|
||
// DefaultPolarisConfig returns the default polaris config. | ||
func DefaultPolarisConfig() *Config { | ||
nodeCfg := node.DefaultConfig() | ||
nodeCfg.DataDir = "" | ||
nodeCfg.KeyStoreDir = "" | ||
return &Config{ | ||
Polar: *polar.DefaultConfig(), | ||
Node: *nodeCfg, | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The search results indicate that the
DefaultConfig
function is indeed used in various places within the codebase. Specifically, it is referenced in files such aseth/node/config.go
,eth/polar/config.go
,cosmos/precompile/governance/testutil.go
, and several times withincosmos/config/default.go
.Given this information, it appears that the removal of the
DefaultConfig
function fromcosmos/config/config.go
could potentially impact other parts of the codebase where this function is expected to exist.Analysis chain
The removal of the
DefaultConfig
function is not mentioned in the summary. Please confirm that this function is not used elsewhere in the codebase.Scripts Executed
The following scripts were executed for the analysis:
Script:
Length of output: 445