Skip to content

Commit 4133497

Browse files
authored
merge redundant conversion base tree hash vars (#450)
* merge redundant conversion base tree hash vars * remove extra traces * revert new var assignment
1 parent a586f0d commit 4133497

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

core/state/database.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,6 @@ type cachingDB struct {
312312

313313
// Transition-specific fields
314314
// TODO ensure that this info is in the DB
315-
LastMerkleRoot common.Hash // root hash of the read-only base tree
316315
CurrentTransitionState *TransitionState
317316
TransitionStatePerRoot lru.BasicLRU[common.Hash, *TransitionState]
318317
transitionStateLock sync.Mutex
@@ -415,8 +414,8 @@ func (db *cachingDB) OpenStorageTrie(stateRoot common.Hash, address common.Addre
415414
}
416415
}
417416
if db.InTransition() {
418-
fmt.Printf("OpenStorageTrie during transition, state root=%x root=%x\n", stateRoot, root)
419-
mpt, err := db.openStorageMPTrie(db.LastMerkleRoot, address, root, nil)
417+
log.Info("OpenStorageTrie during transition", "state root", stateRoot, "root", root)
418+
mpt, err := db.openStorageMPTrie(db.baseRoot, address, root, nil)
420419
if err != nil {
421420
return nil, err
422421
}
@@ -548,7 +547,7 @@ func (db *cachingDB) AddRootTranslation(originalRoot, translatedRoot common.Hash
548547
}
549548

550549
func (db *cachingDB) SetLastMerkleRoot(merkleRoot common.Hash) {
551-
db.LastMerkleRoot = merkleRoot
550+
db.baseRoot = merkleRoot
552551
}
553552

554553
func (db *cachingDB) SaveTransitionState(root common.Hash) {

0 commit comments

Comments
 (0)