Skip to content

Commit bb167a9

Browse files
committed
chore: add stack debug
1 parent 66bd590 commit bb167a9

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

core/state/statedb.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)
175175
if db.Scheme() == rawdb.VersionScheme && snaps != nil {
176176
panic("statedb snapshot must be nil in version db.")
177177
}
178-
log.Info("new statedb with type", "scheme", db.Scheme())
179178
// clean up previous traces
180179
db.Reset()
181180

triedb/hashdb/database.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"errors"
2121
"fmt"
2222
"reflect"
23+
"runtime/debug"
2324
"sync"
2425
"time"
2526

@@ -139,6 +140,9 @@ func New(diskdb ethdb.Database, config *Config, resolver ChildResolver) *Databas
139140
if config.CleanCacheSize > 0 {
140141
cleans = fastcache.New(config.CleanCacheSize)
141142
}
143+
log.Info("==========hash triedb==========")
144+
log.Info(string(debug.Stack()))
145+
log.Info("===============================")
142146
log.Info("success to init hash mode triedb")
143147
return &Database{
144148
diskdb: diskdb,

triedb/pathdb/database.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import (
2121
"fmt"
2222
"io"
2323
"os"
24+
"runtime/debug"
2425
"sort"
2526
"strconv"
2627
"sync"
@@ -226,6 +227,9 @@ func New(diskdb ethdb.Database, config *Config) *Database {
226227
log.Crit("Failed to disable database", "err", err) // impossible to happen
227228
}
228229
}
230+
log.Info("==========path triedb==========")
231+
log.Info(string(debug.Stack()))
232+
log.Info("===============================")
229233
log.Info("success to init path mode triedb")
230234
return db
231235
}

triedb/versiondb/versadb.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package versiondb
22

33
import (
4+
"runtime/debug"
5+
46
versa "github.com/bnb-chain/versioned-state-database"
57
"github.com/ethereum/go-ethereum/common"
68
"github.com/ethereum/go-ethereum/core/rawdb"
@@ -41,6 +43,9 @@ func New(config *Config) *VersionDB {
4143
v := &VersionDB{
4244
db: db,
4345
}
46+
log.Info("==========version triedb==========")
47+
log.Info(string(debug.Stack()))
48+
log.Info("===============================")
4449
log.Info("success to init version mode triedb")
4550
return v
4651
}

0 commit comments

Comments
 (0)