Skip to content

Commit

Permalink
fix: support a verkle pre-tree at the conversion block
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Nov 28, 2023
1 parent 7f310da commit cd0ddad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,15 @@ 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 cd0ddad

Please sign in to comment.