Skip to content

Commit

Permalink
review feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Ignacio Hagopian <[email protected]>
  • Loading branch information
jsign committed Jul 31, 2024
1 parent 0859182 commit 61b6915
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/evm/internal/t8ntool/execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
GetHash: getHash,
}

// We save the current state of the Verkle Tree before applying the transactions.
// Note that if the Verkle fork isn't active, this will be a noop.
switch tr := statedb.GetTrie().(type) {
case *trie.VerkleTrie:
vtrpre = tr.Copy()
Expand Down Expand Up @@ -451,6 +453,8 @@ func MakePreState(db ethdb.Database, chainConfig *params.ChainConfig, pre *Prest
panic(err)
}

// If the current tree is a VerkleTrie, it means the state conversion has ended.
// We don't need to continue with conversion setups and can return early.
if _, ok := statedb.GetTrie().(*trie.VerkleTrie); ok {
return statedb
}
Expand Down

0 comments on commit 61b6915

Please sign in to comment.