From b0657a7e45319fa8fa7ccb01fa23ea7b445fa686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Thu, 24 Aug 2023 18:15:45 +0200 Subject: [PATCH] fix: disable pruning and prefetch if not flags are provided (#483) Co-authored-by: colin <102356659+colinlyguo@users.noreply.github.com> --- cmd/utils/flags.go | 14 +++++++------- params/version.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 657f971b44..ee28b04f36 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -437,7 +437,7 @@ var ( Usage: "Percentage of cache memory allowance to use for snapshot caching (default = 10% full mode, 20% archive mode)", Value: 10, } - CacheNoPrefetchFlag = cli.BoolTFlag{ + CacheNoPrefetchFlag = cli.BoolFlag{ Name: "cache.noprefetch", Usage: "Disable heuristic state prefetch during block import (less CPU and disk IO, more time waiting for data)", } @@ -1745,15 +1745,15 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { stack.Config().L1Confirmations = rpc.FinalizedBlockNumber log.Info("Setting flag", "--l1.sync.startblock", "4038000") stack.Config().L1DeploymentBlock = 4038000 - // double check correct config + // disable pruning if ctx.GlobalString(GCModeFlag.Name) != GCModeArchive { log.Crit("Must use --gcmode=archive") } - log.Info("Setting flag", "--gcmode", ctx.GlobalString(GCModeFlag.Name)) - if !ctx.GlobalBool(CacheNoPrefetchFlag.Name) { - log.Crit("Must use --cache.noprefetch") - } - log.Info("Setting flag", "--cache.noprefetch", ctx.GlobalBool(CacheNoPrefetchFlag.Name)) + log.Info("Pruning disabled") + cfg.NoPruning = true + // disable prefetch + log.Info("Prefetch disabled") + cfg.NoPrefetch = true case ctx.GlobalBool(DeveloperFlag.Name): if !ctx.GlobalIsSet(NetworkIdFlag.Name) { cfg.NetworkId = 1337 diff --git a/params/version.go b/params/version.go index 882d5e75b7..0c13353e63 100644 --- a/params/version.go +++ b/params/version.go @@ -24,7 +24,7 @@ import ( const ( VersionMajor = 4 // Major version component of the current release VersionMinor = 3 // Minor version component of the current release - VersionPatch = 50 // Patch version component of the current release + VersionPatch = 51 // Patch version component of the current release VersionMeta = "sepolia" // Version metadata to append to the version string )