mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-17 13:36:37 +00:00
cmd/geth: set default cache to 4096 (#33836)
Mainnet was already overriding --cache to 4096. This PR just makes this the default.
This commit is contained in:
parent
6d0dd08860
commit
28dad943f6
2 changed files with 1 additions and 14 deletions
|
|
@ -22,7 +22,6 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"slices"
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/ethereum/go-ethereum/accounts"
|
"github.com/ethereum/go-ethereum/accounts"
|
||||||
|
|
@ -316,18 +315,6 @@ func prepare(ctx *cli.Context) {
|
||||||
case !ctx.IsSet(utils.NetworkIdFlag.Name):
|
case !ctx.IsSet(utils.NetworkIdFlag.Name):
|
||||||
log.Info("Starting Geth on Ethereum mainnet...")
|
log.Info("Starting Geth on Ethereum mainnet...")
|
||||||
}
|
}
|
||||||
// If we're a full node on mainnet without --cache specified, bump default cache allowance
|
|
||||||
if !ctx.IsSet(utils.CacheFlag.Name) && !ctx.IsSet(utils.NetworkIdFlag.Name) {
|
|
||||||
// Make sure we're not on any supported preconfigured testnet either
|
|
||||||
if !ctx.IsSet(utils.HoleskyFlag.Name) &&
|
|
||||||
!ctx.IsSet(utils.SepoliaFlag.Name) &&
|
|
||||||
!ctx.IsSet(utils.HoodiFlag.Name) &&
|
|
||||||
!ctx.IsSet(utils.DeveloperFlag.Name) {
|
|
||||||
// Nope, we're really on mainnet. Bump that cache up!
|
|
||||||
log.Info("Bumping default cache on mainnet", "provided", ctx.Int(utils.CacheFlag.Name), "updated", 4096)
|
|
||||||
ctx.Set(utils.CacheFlag.Name, strconv.Itoa(4096))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// geth is the main entry point into the system if no special subcommand is run.
|
// geth is the main entry point into the system if no special subcommand is run.
|
||||||
|
|
|
||||||
|
|
@ -491,7 +491,7 @@ var (
|
||||||
CacheFlag = &cli.IntFlag{
|
CacheFlag = &cli.IntFlag{
|
||||||
Name: "cache",
|
Name: "cache",
|
||||||
Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)",
|
Usage: "Megabytes of memory allocated to internal caching (default = 4096 mainnet full node, 128 light mode)",
|
||||||
Value: 1024,
|
Value: 4096,
|
||||||
Category: flags.PerfCategory,
|
Category: flags.PerfCategory,
|
||||||
}
|
}
|
||||||
CacheDatabaseFlag = &cli.IntFlag{
|
CacheDatabaseFlag = &cli.IntFlag{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue