Skip to content

Commit

Permalink
chore: add stack debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joeylichang committed Aug 12, 2024
1 parent 66bd590 commit 78da6b6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions triedb/hashdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"reflect"
"runtime/debug"
"sync"
"time"

Expand Down Expand Up @@ -139,6 +140,9 @@ func New(diskdb ethdb.Database, config *Config, resolver ChildResolver) *Databas
if config.CleanCacheSize > 0 {
cleans = fastcache.New(config.CleanCacheSize)
}
log.Info("==========hash triedb==========")
fmt.Println(string(debug.Stack()))
log.Info("===============================")
log.Info("success to init hash mode triedb")
return &Database{
diskdb: diskdb,
Expand Down
4 changes: 4 additions & 0 deletions triedb/pathdb/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io"
"os"
"runtime/debug"
"sort"
"strconv"
"sync"
Expand Down Expand Up @@ -226,6 +227,9 @@ func New(diskdb ethdb.Database, config *Config) *Database {
log.Crit("Failed to disable database", "err", err) // impossible to happen
}
}
log.Info("==========path triedb==========")
fmt.Println(string(debug.Stack()))
log.Info("===============================")
log.Info("success to init path mode triedb")
return db
}
Expand Down
6 changes: 6 additions & 0 deletions triedb/versiondb/versadb.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package versiondb

import (
"fmt"
"runtime/debug"

versa "github.com/bnb-chain/versioned-state-database"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
Expand Down Expand Up @@ -41,6 +44,9 @@ func New(config *Config) *VersionDB {
v := &VersionDB{
db: db,
}
log.Info("==========version triedb==========")
fmt.Println(string(debug.Stack()))
log.Info("===============================")
log.Info("success to init version mode triedb")
return v
}
Expand Down

0 comments on commit 78da6b6

Please sign in to comment.