From c32319c37788134325d2914ab18d60e76bff728c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CGheisMohammadi=E2=80=9D?= <36589218+GheisMohammadi@users.noreply.github.com> Date: Mon, 11 Mar 2024 08:23:33 +0100 Subject: [PATCH] set SnapshotLimit to zero by default for all networks --- cmd/harmony/config.go | 8 +++++++- cmd/harmony/flags_test.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/harmony/config.go b/cmd/harmony/config.go index 037221835..0b798551a 100644 --- a/cmd/harmony/config.go +++ b/cmd/harmony/config.go @@ -161,9 +161,15 @@ func getDefaultCacheConfig(nt nodeconfig.NetworkType) harmonyconfig.CacheConfig case nodeconfig.Mainnet: cacheConfig.Disabled = true cacheConfig.Preimages = true + cacheConfig.SnapshotLimit = 0 case nodeconfig.Testnet: - cacheConfig.Disabled = false + cacheConfig.Disabled = true + cacheConfig.Preimages = true + cacheConfig.SnapshotLimit = 0 + case nodeconfig.Partner: + cacheConfig.Disabled = true cacheConfig.Preimages = true + cacheConfig.SnapshotLimit = 0 case nodeconfig.Localnet: cacheConfig.Disabled = false cacheConfig.Preimages = false diff --git a/cmd/harmony/flags_test.go b/cmd/harmony/flags_test.go index ffe261b39..50ed02fa2 100644 --- a/cmd/harmony/flags_test.go +++ b/cmd/harmony/flags_test.go @@ -1440,7 +1440,7 @@ func TestCacheFlags(t *testing.T) { TrieNodeLimit: defaultCacheConfig.TrieNodeLimit, TriesInMemory: defaultCacheConfig.TriesInMemory, TrieTimeLimit: defaultCacheConfig.TrieTimeLimit, - SnapshotLimit: defaultCacheConfig.SnapshotLimit, + SnapshotLimit: 0, // based on network type, SnapshotWait: defaultCacheConfig.SnapshotWait, Preimages: defaultCacheConfig.Preimages, // based on network type SnapshotNoBuild: defaultCacheConfig.SnapshotNoBuild,