Geth 1.13 (Deneb/Cancun) update #7
@ -108,11 +108,11 @@ func validateTrie() {
|
|||||||
WithField("storage root", storageRoot).
|
WithField("storage root", storageRoot).
|
||||||
Debug("Validating storage trie")
|
Debug("Validating storage trie")
|
||||||
if err = v.ValidateStorageTrie(stateRoot, addr, storageRoot); err != nil {
|
if err = v.ValidateStorageTrie(stateRoot, addr, storageRoot); err != nil {
|
||||||
logWithCommand.Fatalf("Validation failed", err)
|
logWithCommand.Fatal("Validation failed", err)
|
||||||
}
|
}
|
||||||
logWithCommand.Infof("Storage trie for contract %s and root %s is complete", addr, storageRoot)
|
logWithCommand.Infof("Storage trie for contract %s and root %s is complete", addr, storageRoot)
|
||||||
default:
|
default:
|
||||||
logWithCommand.Fatalf("Invalid traversal level: '%s'", traversal)
|
logWithCommand.Fatal("Invalid traversal level:", traversal)
|
||||||
}
|
}
|
||||||
|
|
||||||
stats := v.GetCacheStats()
|
stats := v.GetCacheStats()
|
||||||
|
@ -302,22 +302,22 @@ var _ = Describe("PG-IPFS Validator", func() {
|
|||||||
err = ResetTestDB(db)
|
err = ResetTestDB(db)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
It("Returns an error the storage root node is missing", func() {
|
It("Returns an error if the storage root node is missing", func() {
|
||||||
loadTrie(trieStateNodes, missingRootStorageNodes)
|
loadTrie(nil, missingRootStorageNodes)
|
||||||
err = v.ValidateStorageTrie(stateRoot, contractAddr, storageRoot)
|
err = v.ValidateStorageTrie(common.Hash{}, contractAddr, storageRoot)
|
||||||
Expect(err).To(HaveOccurred())
|
Expect(err).To(HaveOccurred())
|
||||||
Expect(err.Error()).To(ContainSubstring("missing trie node"))
|
Expect(err.Error()).To(ContainSubstring("missing trie node"))
|
||||||
})
|
})
|
||||||
It("Returns an error if the entire storage trie cannot be validated", func() {
|
It("Returns an error if the entire storage trie cannot be validated", func() {
|
||||||
loadTrie(trieStateNodes, missingNodeStorageNodes)
|
loadTrie(nil, missingNodeStorageNodes)
|
||||||
err = v.ValidateStorageTrie(stateRoot, contractAddr, storageRoot)
|
err = v.ValidateStorageTrie(common.Hash{}, contractAddr, storageRoot)
|
||||||
Expect(err).To(HaveOccurred())
|
Expect(err).To(HaveOccurred())
|
||||||
Expect(err.Error()).To(ContainSubstring("missing trie node"))
|
Expect(err.Error()).To(ContainSubstring("missing trie node"))
|
||||||
Expect(err.Error()).To(ContainSubstring("path %x", missingStorageNodePath))
|
Expect(err.Error()).To(ContainSubstring("path %x", missingStorageNodePath))
|
||||||
})
|
})
|
||||||
It("Returns no error if the entire storage trie can be validated", func() {
|
It("Returns no error if the entire storage trie can be validated", func() {
|
||||||
loadTrie(trieStateNodes, trieStorageNodes)
|
loadTrie(nil, trieStorageNodes)
|
||||||
err = v.ValidateStorageTrie(stateRoot, contractAddr, storageRoot)
|
err = v.ValidateStorageTrie(common.Hash{}, contractAddr, storageRoot)
|
||||||
Expect(err).ToNot(HaveOccurred())
|
Expect(err).ToNot(HaveOccurred())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user