verify root hashes after commit

pull/4514/head
Diego Nava 1 year ago
parent e20524267e
commit 8b6df6b449
No known key found for this signature in database
GPG Key ID: 61AFC8738DA8B8B1
  1. 4
      core/preimages.go

@ -240,8 +240,10 @@ func GeneratePreimages(chain BlockChain, start, end uint64) error {
}
if stateAt != nil {
if _, err := endingState.Commit(false); err != nil {
if root, err := endingState.Commit(false); err != nil {
return fmt.Errorf("unabe to commit state for block '%d': %w", i, err)
} else if root.Hex() != block.Root().Hex() {
return fmt.Errorf("block root hashes different after commit commitRoot='%s' blockRoot='%s'", root.Hex(), block.Root().Hex())
}
if err := chain.CommitPreimages(); err != nil {

Loading…
Cancel
Save