triedb/pathdb: restore pathdb journal version

This commit is contained in:
Gary Rong 2024-03-07 09:31:08 +08:00
parent aadcb88675
commit a82472e24c
2 changed files with 6 additions and 6 deletions

View file

@ -543,7 +543,7 @@ func TestCorruptedJournal(t *testing.T) {
// Mutate the journal in disk, it should be regarded as invalid
blob := rawdb.ReadTrieJournal(tester.db.diskdb)
blob[0] = 0xa
blob[0] = 0x1
rawdb.WriteTrieJournal(tester.db.diskdb, blob)
// Verify states, all not-yet-written states should be discarded

View file

@ -46,8 +46,7 @@ var (
// Changelog:
//
// - Version 0: initial version
// - Version 1: storage.Incomplete field is removed
const journalVersion uint64 = 1
const journalVersion uint64 = 0
// journalNode represents a trie node persisted in the journal.
type journalNode struct {
@ -70,9 +69,10 @@ type journalAccounts struct {
// journalStorage represents a list of storage slots belong to an account.
type journalStorage struct {
Account common.Address
Hashes []common.Hash
Slots [][]byte
Incomplete bool // Deprecated, keep it for backward compatibility
Account common.Address
Hashes []common.Hash
Slots [][]byte
}
// loadJournal tries to parse the layer journal from the disk.