Merge pull request #4641 from harmony-one/fix/snapshot_disabled

dev
Soph 9 months ago committed by GitHub
commit 4bdddf7067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  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: case nodeconfig.Mainnet:
cacheConfig.Disabled = true cacheConfig.Disabled = true
cacheConfig.Preimages = true cacheConfig.Preimages = true
cacheConfig.SnapshotLimit = 0
case nodeconfig.Testnet: 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.Preimages = true
cacheConfig.SnapshotLimit = 0
case nodeconfig.Localnet: case nodeconfig.Localnet:
cacheConfig.Disabled = false cacheConfig.Disabled = false
cacheConfig.Preimages = false cacheConfig.Preimages = false

@ -1440,7 +1440,7 @@ func TestCacheFlags(t *testing.T) {
TrieNodeLimit: defaultCacheConfig.TrieNodeLimit, TrieNodeLimit: defaultCacheConfig.TrieNodeLimit,
TriesInMemory: defaultCacheConfig.TriesInMemory, TriesInMemory: defaultCacheConfig.TriesInMemory,
TrieTimeLimit: defaultCacheConfig.TrieTimeLimit, TrieTimeLimit: defaultCacheConfig.TrieTimeLimit,
SnapshotLimit: defaultCacheConfig.SnapshotLimit, SnapshotLimit: 0, // based on network type,
SnapshotWait: defaultCacheConfig.SnapshotWait, SnapshotWait: defaultCacheConfig.SnapshotWait,
Preimages: defaultCacheConfig.Preimages, // based on network type Preimages: defaultCacheConfig.Preimages, // based on network type
SnapshotNoBuild: defaultCacheConfig.SnapshotNoBuild, SnapshotNoBuild: defaultCacheConfig.SnapshotNoBuild,

Loading…
Cancel
Save