mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
add handling for the TransitionTree after rebase
This commit is contained in:
parent
0dd1a0cb28
commit
3b2d6c87eb
3 changed files with 8 additions and 1 deletions
|
|
@ -302,6 +302,8 @@ func mustCopyTrie(t Trie) Trie {
|
||||||
return t.Copy()
|
return t.Copy()
|
||||||
case *trie.VerkleTrie:
|
case *trie.VerkleTrie:
|
||||||
return t.Copy()
|
return t.Copy()
|
||||||
|
case *trie.TransitionTrie:
|
||||||
|
return t.Copy()
|
||||||
default:
|
default:
|
||||||
panic(fmt.Errorf("unknown trie type %T", t))
|
panic(fmt.Errorf("unknown trie type %T", t))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -501,6 +501,10 @@ func (s *stateObject) deepCopy(db *StateDB) *stateObject {
|
||||||
// Verkle uses only one tree, and the copy has already been
|
// Verkle uses only one tree, and the copy has already been
|
||||||
// made in mustCopyTrie.
|
// made in mustCopyTrie.
|
||||||
obj.trie = db.trie
|
obj.trie = db.trie
|
||||||
|
case *trie.TransitionTrie:
|
||||||
|
// Same thing for the transition tree, since the MPT is
|
||||||
|
// read-only.
|
||||||
|
obj.trie = db.trie
|
||||||
case *trie.StateTrie:
|
case *trie.StateTrie:
|
||||||
obj.trie = mustCopyTrie(s.trie)
|
obj.trie = mustCopyTrie(s.trie)
|
||||||
case nil:
|
case nil:
|
||||||
|
|
|
||||||
|
|
@ -211,7 +211,8 @@ func (t *TransitionTrie) UpdateStem(key []byte, values [][]byte) error {
|
||||||
func (t *TransitionTrie) Copy() *TransitionTrie {
|
func (t *TransitionTrie) Copy() *TransitionTrie {
|
||||||
return &TransitionTrie{
|
return &TransitionTrie{
|
||||||
overlay: t.overlay.Copy(),
|
overlay: t.overlay.Copy(),
|
||||||
base: t.base.Copy(),
|
// base in immutable, so there is no need to copy it
|
||||||
|
base: t.base,
|
||||||
storage: t.storage,
|
storage: t.storage,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue