gballet / go-ethereum

Official Go implementation of the Ethereum protocol
https://geth.ethereum.org
GNU Lesser General Public License v3.0
23 stars 13 forks source link

trie/verkle: fix identification of empty account #447

Closed jsign closed 5 months ago

jsign commented 5 months ago

A bug was identified by replaying Byzantium data which worked correctly with stride=10k but failed with stride=1k.

After lots of debugging, the issue was related to a wrong identification of an empty account if that same account is in progress of being converted (i.e: storage slots being converted but not yet account basic data).

I've confirmed this fix solves the bad-block in the replay.

jsign commented 5 months ago

LGTM. I don't think these tricks should remain in the main branch for long, since we are trying to support "legacy" blocks that we shouldn't worry about in the future. But for now, I get that is simplifies the branching. Maybe just adding a comment to do so would be useful.

Added a comment to explain a bit more, and remember we could simplify this depending if the node is running during or after the conversion.