Skip to content
Merged
3 changes: 2 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions core/txpool/legacypool/legacypool.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Comment on lines +175 to +178
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The new default queue capacities (200, 8000, 200, 4000) lack explanatory comments; consider adding a note explaining the chosen values or the expected ratio.

Suggested change
AccountSlots: 200,
GlobalSlots: 8000,
AccountQueue: 200,
GlobalQueue: 4000,
AccountSlots: 200, // Number of executable transaction slots guaranteed per account.
GlobalSlots: 8000, // Maximum number of executable transaction slots for all accounts.
AccountQueue: 200, // Maximum number of non-executable transaction slots permitted per account.
GlobalQueue: 4000, // Maximum number of non-executable transaction slots for all accounts.

Copilot uses AI. Check for mistakes.
OverflowPoolSlots: 0,

Lifetime: 3 * time.Hour,
Lifetime: 10 * time.Minute,
ReannounceTime: 10 * 365 * 24 * time.Hour,
}

Expand Down
2 changes: 1 addition & 1 deletion core/txpool/legacypool/legacypool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion eth/ethconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion miner/bid_simulator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
4 changes: 2 additions & 2 deletions miner/miner_mev.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
17 changes: 14 additions & 3 deletions miner/minerconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -92,8 +94,9 @@ type MevConfig struct {
}

var DefaultMevConfig = MevConfig{
Enabled: false,
Enabled: &defaultMevEnabled,
GreedyMergeTx: &defaultGreedyMergeTx,
BuilderFeeCeil: &defaultBuilderFeeCeil,
SentryURL: "",
Builders: nil,
ValidatorCommission: &defaultValidatorCommission,
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions node/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down