From 1ebc677ec0540ce0d369fb32d1a5d6bd657c0412 Mon Sep 17 00:00:00 2001 From: niuxiaojie81 <85773309@qq.com> Date: Mon, 30 Oct 2023 16:18:44 +0800 Subject: [PATCH 1/2] Increase the number of cache blocks downloaded --- eth/downloader/queue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/downloader/queue.go b/eth/downloader/queue.go index b4534377a3..784ac23c8e 100644 --- a/eth/downloader/queue.go +++ b/eth/downloader/queue.go @@ -40,8 +40,8 @@ const ( ) var ( - blockCacheMaxItems = 128 // Maximum number of blocks to cache before throttling the download - blockCacheInitialItems = 128 // Initial number of blocks to start fetching, before we know the sizes of the blocks + blockCacheMaxItems = 1024 // Maximum number of blocks to cache before throttling the download + blockCacheInitialItems = 256 // Initial number of blocks to start fetching, before we know the sizes of the blocks blockCacheMemory = 256 * 1024 * 1024 // Maximum amount of memory to use for block caching blockCacheSizeWeight = 0.1 // Multiplier to approximate the average block size based on past ones ) From cf2fb086efa2cb766bed3cfbe3bbbdc94c03b5a9 Mon Sep 17 00:00:00 2001 From: niuxiaojie81 <85773309@qq.com> Date: Mon, 30 Oct 2023 16:23:32 +0800 Subject: [PATCH 2/2] snapshot enable by default --- cmd/utils/flags.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 6d018d449d..d8a81ba536 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -282,9 +282,9 @@ var ( Usage: "Time interval to regenerate the trie cache journal", Value: ethconfig.Defaults.TrieCleanCacheRejournal, } - SnapshotFlag = cli.BoolFlag{ + SnapshotFlag = cli.BoolTFlag{ Name: "snapshot", - Usage: `Enables snapshot-database mode`, + Usage: `Enables snapshot-database mode (default = enable)`, } BloomFilterSizeFlag = cli.Uint64Flag{ Name: "bloomfilter.size",