From c82ff997d32d2e644d5367f9e1c68d06c4033040 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Thu, 28 Sep 2023 12:19:35 +0200 Subject: [PATCH] fix: ensure read-only values are resolved in post trie (#285) --- consensus/beacon/consensus.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/consensus/beacon/consensus.go b/consensus/beacon/consensus.go index 82abe65ca1..6a18084fdb 100644 --- a/consensus/beacon/consensus.go +++ b/consensus/beacon/consensus.go @@ -435,6 +435,19 @@ func (beacon *Beacon) FinalizeAndAssemble(chain consensus.ChainHeaderReader, hea if err != nil { panic(err) } + + // WORKAROUND: the post trie would normally not + // need to be searched for keys, as all of them + // were resolved during block execution. + // But since the prefetcher isn't currently used + // with verkle, the values that are read but not + // written to, are not resolved as they are read + // straight from the snapshot. They must be read + // in order to build the proof. + _, err = vtrpost.GetWithHashedKey(key) + if err != nil { + panic(err) + } } if len(keys) > 0 {