Skip to content

Commit

Permalink
fix: support a verkle pre-tree at the conversion block (#313)
Browse files Browse the repository at this point in the history
* fix: support a verkle pre-tree at the conversion block

* make linter happy
  • Loading branch information
gballet authored Jan 29, 2024
1 parent 10e3065 commit 609c973
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,14 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea
vtrpost = post.Overlay()
okpost = true
default:
panic("invalid tree type")
// This should only happen for the first block of the
// conversion, when the previous tree is a merkle tree.
// Logically, the "previous" verkle tree is an empty tree.
okpre = true
vtrpre = trie.NewVerkleTrie(verkle.New(), state.Database().TrieDB(), utils.NewPointCache(), false)
post := state.GetTrie().(*trie.TransitionTrie)
vtrpost = post.Overlay()
okpost = true
}
if okpre && okpost {
if len(keys) > 0 {
Expand Down

0 comments on commit 609c973

Please sign in to comment.