diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 3acb6758d6..3d0613e34a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -826,6 +826,7 @@ var ( Value: strings.Join(node.DefaultConfig.GraphQLVirtualHosts, ","), Category: flags.APICategory, } + WSEnabledFlag = &cli.BoolFlag{ Name: "ws", Usage: "Enable the WS-RPC server", @@ -2491,7 +2492,7 @@ func parseMiningFeatures(ctx *cli.Context, cfg *ethconfig.Config) string { return "" } var features []string - if cfg.Miner.Mev.Enabled { + if cfg.Miner.Mev.Enabled != nil && *cfg.Miner.Mev.Enabled { features = append(features, "MEV") } if cfg.Miner.VoteEnable { diff --git a/core/txpool/legacypool/legacypool.go b/core/txpool/legacypool/legacypool.go index a8d16fb33c..ae73030285 100644 --- a/core/txpool/legacypool/legacypool.go +++ b/core/txpool/legacypool/legacypool.go @@ -172,13 +172,13 @@ var DefaultConfig = Config{ PriceLimit: 1, PriceBump: 10, - AccountSlots: 16, - GlobalSlots: 4096 + 1024, // urgent + floating queue capacity with 4:1 ratio - AccountQueue: 64, - GlobalQueue: 1024, + AccountSlots: 200, + GlobalSlots: 8000, + AccountQueue: 200, + GlobalQueue: 4000, OverflowPoolSlots: 0, - Lifetime: 3 * time.Hour, + Lifetime: 10 * time.Minute, ReannounceTime: 10 * 365 * 24 * time.Hour, } diff --git a/core/txpool/legacypool/legacypool_test.go b/core/txpool/legacypool/legacypool_test.go index e559da794d..6630cac7b3 100644 --- a/core/txpool/legacypool/legacypool_test.go +++ b/core/txpool/legacypool/legacypool_test.go @@ -1694,7 +1694,7 @@ func TestStableUnderpricing(t *testing.T) { blockchain := newTestBlockChain(params.TestChainConfig, 1000000, statedb, new(event.Feed)) config := testTxPoolConfig - config.GlobalSlots = 128 + config.GlobalSlots = 201 config.GlobalQueue = 0 pool := New(config, blockchain) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index 1ec64a122d..90b28d0ad1 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -58,7 +58,7 @@ var Defaults = Config{ DatabaseCache: 512, TrieCleanCache: 154, TrieDirtyCache: 256, - TrieTimeout: 60 * time.Minute, + TrieTimeout: 10 * time.Minute, TriesInMemory: 128, TriesVerifyMode: core.LocalVerify, SnapshotCache: 102, diff --git a/miner/bid_simulator.go b/miner/bid_simulator.go index f398811c31..b571d67730 100644 --- a/miner/bid_simulator.go +++ b/miner/bid_simulator.go @@ -156,7 +156,7 @@ func newBidSimulator( b.chainHeadSub = b.chain.SubscribeChainHeadEvent(b.chainHeadCh) - if config.Enabled { + if config.Enabled != nil && *config.Enabled { b.bidReceiving.Store(true) b.dialSentryAndBuilders() diff --git a/miner/miner_mev.go b/miner/miner_mev.go index 8be14b904d..ea510ce790 100644 --- a/miner/miner_mev.go +++ b/miner/miner_mev.go @@ -90,9 +90,9 @@ func (miner *Miner) BestPackedBlockReward(parentHash common.Hash) *big.Int { } func (miner *Miner) MevParams() *types.MevParams { - builderFeeCeil, ok := big.NewInt(0).SetString(miner.worker.config.Mev.BuilderFeeCeil, 10) + builderFeeCeil, ok := big.NewInt(0).SetString(*miner.worker.config.Mev.BuilderFeeCeil, 10) if !ok { - log.Error("failed to parse builder fee ceil", "BuilderFeeCeil", miner.worker.config.Mev.BuilderFeeCeil) + log.Error("failed to parse builder fee ceil", "BuilderFeeCeil", *miner.worker.config.Mev.BuilderFeeCeil) return nil } diff --git a/miner/minerconfig/config.go b/miner/minerconfig/config.go index d9d0fb9e27..7c7aee8a88 100644 --- a/miner/minerconfig/config.go +++ b/miner/minerconfig/config.go @@ -32,7 +32,9 @@ var ( defaultRecommit = 10 * time.Second defaultMaxWaitProposalInSecs = uint64(45) // default configurations for MEV + defaultMevEnabled = false defaultGreedyMergeTx bool = true + defaultBuilderFeeCeil string = "0" defaultValidatorCommission uint64 = 100 defaultBidSimulationLeftOver = 50 * time.Millisecond defaultNoInterruptLeftOver = 250 * time.Millisecond @@ -80,9 +82,9 @@ type BuilderConfig struct { } type MevConfig struct { - Enabled bool // Whether to enable Mev or not + Enabled *bool `toml:",omitempty"` // Whether to enable Mev or not GreedyMergeTx *bool `toml:",omitempty"` // Whether to merge local transactions to the bid - BuilderFeeCeil string // The maximum builder fee of a bid + BuilderFeeCeil *string `toml:",omitempty"` // The maximum builder fee of a bid SentryURL string // The url of Mev sentry Builders []BuilderConfig // The list of builders ValidatorCommission *uint64 `toml:",omitempty"` // 100 means the validator claims 1% from block reward @@ -92,8 +94,9 @@ type MevConfig struct { } var DefaultMevConfig = MevConfig{ - Enabled: false, + Enabled: &defaultMevEnabled, GreedyMergeTx: &defaultGreedyMergeTx, + BuilderFeeCeil: &defaultBuilderFeeCeil, SentryURL: "", Builders: nil, ValidatorCommission: &defaultValidatorCommission, @@ -123,6 +126,14 @@ func ApplyDefaultMinerConfig(cfg *Config) { } // check [Eth.Miner.Mev] + if cfg.Mev.Enabled == nil { + cfg.Mev.Enabled = &defaultMevEnabled + log.Info("ApplyDefaultMinerConfig", "Mev.Enabled", *cfg.Mev.Enabled) + } + if cfg.Mev.BuilderFeeCeil == nil { + cfg.Mev.BuilderFeeCeil = &defaultBuilderFeeCeil + log.Info("ApplyDefaultMinerConfig", "Mev.BuilderFeeCeil", *cfg.Mev.BuilderFeeCeil) + } if cfg.Mev.GreedyMergeTx == nil { cfg.Mev.GreedyMergeTx = &defaultGreedyMergeTx log.Info("ApplyDefaultMinerConfig", "Mev.GreedyMergeTx", *cfg.Mev.GreedyMergeTx) diff --git a/node/defaults.go b/node/defaults.go index 2defed7215..f960a7a178 100644 --- a/node/defaults.go +++ b/node/defaults.go @@ -52,6 +52,7 @@ var ( DefaultAuthOrigins = []string{"localhost"} // Default origins for the authenticated apis DefaultAuthPrefix = "" // Default prefix for the authenticated apis DefaultAuthModules = []string{"eth", "engine"} + DefaultTimeFormat = "01-02|15:04:05.000" ) // DefaultConfig contains reasonable default settings. @@ -77,6 +78,9 @@ var DefaultConfig = Config{ }, DBEngine: "", // Use whatever exists, will default to Pebble if non-existent and supported Instance: 1, + LogConfig: &LogConfig{ + TimeFormat: &DefaultTimeFormat, + }, } // DefaultDataDir is the default data directory to use for the databases and other