set SnapshotLimit to zero by default for all networks

fix/snapshot_disabled
“GheisMohammadi” 9 months ago
parent b3aebb62d2
commit c32319c377
No known key found for this signature in database
GPG Key ID: 15073AED3829FE90
  1. 8
      cmd/harmony/config.go
  2. 2
      cmd/harmony/flags_test.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

@ -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,

Loading…
Cancel
Save