Skip to content

Commit

Permalink
add sanitize logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Brindrajsinh-Chauhan committed May 6, 2024
1 parent 1dcf9e5 commit dae311f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core/state/snapshot/snapshot.go
Expand Up @@ -164,6 +164,7 @@ func (c *Config) sanitize() Config {
conf := *c

if conf.CommitThreshold == 0 {
log.Warn("Sanitizing commit threshold", "provided", conf.CommitThreshold, "updated", defaultCommitThreshold)
conf.CommitThreshold = defaultCommitThreshold
}
return conf
Expand Down Expand Up @@ -209,14 +210,12 @@ type Tree struct {
func New(config Config, diskdb ethdb.KeyValueStore, triedb *triedb.Database, root common.Hash) (*Tree, error) {
// Create a new, empty snapshot tree
snap := &Tree{
config: config,
config: config.sanitize(),
diskdb: diskdb,
triedb: triedb,
layers: make(map[common.Hash]snapshot),
}

config = config.sanitize()

// Attempt to load a previously persisted snapshot and rebuild one if failed
head, disabled, err := loadSnapshot(diskdb, triedb, root, config.CacheSize, config.Recovery, config.NoBuild)
if disabled {
Expand Down

0 comments on commit dae311f

Please sign in to comment.