diff --git a/cmd/evm/internal/t8ntool/execution.go b/cmd/evm/internal/t8ntool/execution.go index cd5d12b41b1d..9a5bfee4736a 100644 --- a/cmd/evm/internal/t8ntool/execution.go +++ b/cmd/evm/internal/t8ntool/execution.go @@ -456,7 +456,7 @@ func MakePreState(db ethdb.Database, chainConfig *params.ChainConfig, pre *Prest if pre.Env.Started != nil { log.Info("non-nil started", "started", *pre.Env.Started) } - sdb.InitTransitionStatus(pre.Env.Started != nil && *pre.Env.Started, pre.Env.Ended != nil && *pre.Env.Ended) + sdb.InitTransitionStatus(pre.Env.Started != nil && *pre.Env.Started, pre.Env.Ended != nil && *pre.Env.Ended, mptRoot) log.Info("loading current account address, if available", "available", pre.Env.CurrentAccountAddress != nil) if pre.Env.CurrentAccountAddress != nil { log.Info("loading current account address", "address", *pre.Env.CurrentAccountAddress) diff --git a/core/blockchain.go b/core/blockchain.go index 1ffb36ffb523..d3ad0dc6d338 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -326,7 +326,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis // for it to be able to recover if interrupted during the transition // but that's left out to a later PR since there's not really a need // right now. - bc.stateCache.InitTransitionStatus(true, true) + bc.stateCache.InitTransitionStatus(true, true, common.Hash{}) bc.stateCache.EndVerkleTransition() } @@ -1772,7 +1772,7 @@ func (bc *BlockChain) insertChain(chain types.Blocks, setHead bool) (int, error) // If the verkle activation time hasn't started, declare it as "not started". // This is so that if the miner activates the conversion, the insertion happens // in the correct mode. - bc.stateCache.InitTransitionStatus(false, false) + bc.stateCache.InitTransitionStatus(false, false, common.Hash{}) } if parent.Number.Uint64() == conversionBlock { bc.StartVerkleTransition(parent.Root, emptyVerkleRoot, bc.Config(), &parent.Time, parent.Root) diff --git a/core/state/database.go b/core/state/database.go index e612a5145585..cc181d04f08d 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -78,7 +78,7 @@ type Database interface { Transitioned() bool - InitTransitionStatus(bool, bool) + InitTransitionStatus(bool, bool, common.Hash) SetCurrentSlotHash(common.Hash) @@ -245,12 +245,13 @@ func (db *cachingDB) ReorgThroughVerkleTransition() { log.Warn("trying to reorg through the transition, which makes no sense at this point") } -func (db *cachingDB) InitTransitionStatus(started, ended bool) { +func (db *cachingDB) InitTransitionStatus(started, ended bool, baseRoot common.Hash) { db.CurrentTransitionState = &TransitionState{ Ended: ended, Started: started, // TODO add other fields when we handle mid-transition interrupts } + db.baseRoot = baseRoot } func (db *cachingDB) EndVerkleTransition() { diff --git a/light/trie.go b/light/trie.go index 7e7c03bc16c1..2f5999230896 100644 --- a/light/trie.go +++ b/light/trie.go @@ -121,7 +121,7 @@ func (db *odrDatabase) Transitioned() bool { panic("not implemented") // TODO: Implement } -func (db *odrDatabase) InitTransitionStatus(bool, bool) { +func (db *odrDatabase) InitTransitionStatus(bool, bool, common.Hash) { panic("not implemented") // TODO: Implement }