Skip to content

Commit c5ff404

Browse files
committed
fix: assume that having to create a new transaction state mean it hasn't happened.
This is a workaround, because it will always be false when restarting a node that has started the transition but not necessarily completed it.
1 parent 5375ac2 commit c5ff404

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

core/blockchain.go

-2
Original file line numberDiff line numberDiff line change
@@ -1767,8 +1767,6 @@ 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")
17721770
}
17731771
}
17741772
if parent.Number.Uint64() == conversionBlock {

core/state/database.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package state
1919
import (
2020
"errors"
2121
"fmt"
22-
"runtime/debug"
2322

2423
"github.com/ethereum/go-ethereum/common"
2524
"github.com/ethereum/go-ethereum/common/lru"
@@ -238,7 +237,6 @@ func (db *cachingDB) StartVerkleTransition(originalRoot, translatedRoot common.H
238237
if pragueTime != nil {
239238
chainConfig.PragueTime = pragueTime
240239
}
241-
debug.PrintStack()
242240
}
243241

244242
func (db *cachingDB) ReorgThroughVerkleTransition() {
@@ -357,7 +355,6 @@ func (db *cachingDB) OpenTrie(root common.Hash) (Trie, error) {
357355
// If the verkle conversion has ended, return a single
358356
// verkle trie.
359357
if db.CurrentTransitionState.ended {
360-
debug.PrintStack()
361358
log.Debug("transition ended, returning a simple verkle tree")
362359
return vkt, nil
363360
}
@@ -570,9 +567,8 @@ func (db *cachingDB) LoadTransitionState(root common.Hash) {
570567
ts, ok := db.TransitionStatePerRoot[root]
571568
if !ok || ts == nil {
572569
log.Debug("could not find any transition state, starting with a fresh state", "is verkle", db.triedb.IsVerkle())
573-
debug.PrintStack()
574570
// Start with a fresh state
575-
ts = &TransitionState{ended: db.triedb.IsVerkle()}
571+
ts = &TransitionState{ended: false}
576572
}
577573

578574
// Copy so that the CurrentAddress pointer in the map

eth/catalyst/api.go

-4
Original file line numberDiff line numberDiff line change
@@ -535,10 +535,6 @@ 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-
// }
542538
// Another cornercase: if the node is in snap sync mode, but the CL client
543539
// tries to make it import a block. That should be denied as pushing something
544540
// into the database directly will conflict with the assumptions of snap sync

0 commit comments

Comments
 (0)