diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index fdf6d64969..7421b21622 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -228,9 +228,6 @@ func initGenesis(ctx *cli.Context) error { defer chaindb.Close() triedb := utils.MakeTrieDatabase(ctx, stack, chaindb, ctx.Bool(utils.CachePreimagesFlag.Name), false, genesis.IsVerkle()) - if triedb.Config().PathDB != nil { - triedb.Config().PathDB.UseBase = true - } defer triedb.Close() _, hash, err := core.SetupGenesisBlockWithOverride(chaindb, triedb, genesis, &overrides) diff --git a/core/genesis.go b/core/genesis.go index cd587c70cd..8434bafd7e 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -187,10 +187,8 @@ func flushAlloc(ga *types.GenesisAlloc, db ethdb.Database, triedb *triedb.Databa if err != nil { return err } - log.Info("m2mdf223") // Commit newly generated states into disk if it's not empty. if root != types.EmptyRootHash { - log.Info("flushAlloc", "use base", triedb.Config().PathDB.UseBase) if err := triedb.Commit(root, true); err != nil { return err } @@ -319,7 +317,6 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g } else { log.Info("Writing custom genesis block") } - log.Info("23n8923u8u23r3", "db use base", triedb.Config().PathDB.UseBase) applyOverrides(genesis.Config) block, err := genesis.Commit(db, triedb) if err != nil { @@ -549,7 +546,6 @@ func (g *Genesis) Commit(db ethdb.Database, triedb *triedb.Database) (*types.Blo // All the checks has passed, flushAlloc the states derived from the genesis // specification as well as the specification itself into the provided // database. - log.Info("before flush", "use base", triedb.Config().PathDB.UseBase) if err := flushAlloc(&g.Alloc, db, triedb, block.Hash()); err != nil { return nil, err } diff --git a/triedb/pathdb/database.go b/triedb/pathdb/database.go index e39cd22f74..032f0c5872 100644 --- a/triedb/pathdb/database.go +++ b/triedb/pathdb/database.go @@ -21,6 +21,7 @@ import ( "fmt" "io" "os" + "path/filepath" "sync" "time" @@ -181,10 +182,14 @@ func New(diskdb ethdb.Database, config *Config) *Database { useBase: config.UseBase, } - log.Info("d2nid23nf390293", "db use base", db.useBase, "config use base", config.UseBase) + if db.useBase { + + } + // Open the freezer for state history if the passed database contains an // ancient store. Otherwise, all the relevant functionalities are disabled. if ancient, err := diskdb.AncientDatadir(); err == nil && ancient != "" && !db.readOnly { + db.useBase = !common.FileExist(filepath.Join(ancient, rawdb.StateFreezerName)) db.fastRecovery = checkAncientAndNodeBuffer(ancient, config.TrieNodeBufferType) freezer, err := rawdb.NewStateFreezer(ancient, false, db.fastRecovery) if err != nil { @@ -299,7 +304,6 @@ func (db *Database) Commit(root common.Hash, report bool) error { defer db.lock.Unlock() defer db.capLock.Unlock() - log.Info("pathdb commit", "use base", db.useBase) // Short circuit if the mutation is not allowed. if err := db.modifyAllowed(); err != nil { return err diff --git a/triedb/pathdb/nodebufferlist.go b/triedb/pathdb/nodebufferlist.go index 3a327a0b2b..a35af5271a 100644 --- a/triedb/pathdb/nodebufferlist.go +++ b/triedb/pathdb/nodebufferlist.go @@ -149,7 +149,6 @@ func newNodeBufferList( keepFunc: keepFunc, } nf.useBase.Store(useBase) - log.Info("23hd312hnud91e9dnm", "nf use base", useBase, "load", nf.useBase.Load()) } go nf.loop() @@ -446,7 +445,6 @@ func (nf *nodebufferlist) flush(db ethdb.KeyValueStore, clean *fastcache.Cache, nf.forceKeepCh <- struct{}{} <-nf.waitForceKeepCh - log.Info("23nu2fnuef2ju", "use base", nf.useBase.Load()) // hang user read/write and background write nf.mux.Lock() nf.baseMux.Lock()