Skip to content

Commit d5fc98d

Browse files
committed
add debug traces
1 parent 9400229 commit d5fc98d

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

core/blockchain.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1767,6 +1767,8 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error)
17671767
// is the fork block and that the conversion needs to be marked at started.
17681768
if !bc.stateCache.InTransition() && !bc.stateCache.Transitioned() {
17691769
bc.stateCache.StartVerkleTransition(parent.Root, emptyVerkleRoot, bc.Config(), bc.Config().PragueTime, parent.Root)
1770+
} else {
1771+
log.Debug("skipped initialization")
17701772
}
17711773
}
17721774
if parent.Number.Uint64() == conversionBlock {

core/state/database.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package state
1919
import (
2020
"errors"
2121
"fmt"
22+
"runtime/debug"
2223

2324
"github.com/ethereum/go-ethereum/common"
2425
"github.com/ethereum/go-ethereum/common/lru"
@@ -237,6 +238,7 @@ func (db *cachingDB) StartVerkleTransition(originalRoot, translatedRoot common.H
237238
if pragueTime != nil {
238239
chainConfig.PragueTime = pragueTime
239240
}
241+
debug.PrintStack()
240242
}
241243

242244
func (db *cachingDB) ReorgThroughVerkleTransition() {
@@ -355,6 +357,7 @@ func (db *cachingDB) OpenTrie(root common.Hash) (Trie, error) {
355357
// If the verkle conversion has ended, return a single
356358
// verkle trie.
357359
if db.CurrentTransitionState.ended {
360+
debug.PrintStack()
358361
log.Debug("transition ended, returning a simple verkle tree")
359362
return vkt, nil
360363
}
@@ -566,6 +569,8 @@ func (db *cachingDB) LoadTransitionState(root common.Hash) {
566569
// as a verkle database.
567570
ts, ok := db.TransitionStatePerRoot[root]
568571
if !ok || ts == nil {
572+
log.Debug("could not find any transition state, starting with a fresh state", "is verkle", db.triedb.IsVerkle())
573+
debug.PrintStack()
569574
// Start with a fresh state
570575
ts = &TransitionState{ended: db.triedb.IsVerkle()}
571576
}

eth/catalyst/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,10 @@ func (api *ConsensusAPI) newPayload(params engine.ExecutableData, versionedHashe
535535
api.eth.BlockChain().StartVerkleTransition(parent.Root, common.Hash{}, api.eth.BlockChain().Config(), nil, parent.Root)
536536
}
537537
}
538-
// Reset db merge state in case of a reorg
539-
if !api.eth.BlockChain().Config().IsPrague(block.Number(), block.Time()) {
540-
api.eth.BlockChain().ReorgThroughVerkleTransition()
541-
}
538+
// // Reset db merge state in case of a reorg
539+
// if !api.eth.BlockChain().Config().IsPrague(block.Number(), block.Time()) {
540+
// api.eth.BlockChain().ReorgThroughVerkleTransition()
541+
// }
542542
// Another cornercase: if the node is in snap sync mode, but the CL client
543543
// tries to make it import a block. That should be denied as pushing something
544544
// into the database directly will conflict with the assumptions of snap sync

0 commit comments

Comments
 (0)