From 0fb4d9226be00d29b56797dbba9e8a101b82599d Mon Sep 17 00:00:00 2001 From: CPerezz Date: Tue, 7 Apr 2026 16:13:45 +0200 Subject: [PATCH] triedb/pathdb: bump journal version to 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reserve journal version 4 for the upcoming bintrie flat-state layout (per-stem blobs). Bumping now — with no on-disk format change yet — ensures that any v3 journals belonging to a bintrie database are discarded on load, so the new layout can be introduced cleanly in follow-up commits without a migration shim. MPT behavior is unchanged at this point: the only codec wired to the pathdb Database is still merkleFlatCodec. All pathdb, core/state, core/rawdb, and trie tests pass. --- triedb/pathdb/journal.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/triedb/pathdb/journal.go b/triedb/pathdb/journal.go index efcc3f2549..42eee2b7f8 100644 --- a/triedb/pathdb/journal.go +++ b/triedb/pathdb/journal.go @@ -50,7 +50,11 @@ var ( // - Version 1: storage.Incomplete field is removed // - Version 2: add post-modification state values // - Version 3: a flag has been added to indicate whether the storage slot key is the raw key or a hash -const journalVersion uint64 = 3 +// - Version 4: reserved for bintrie flat-state (per-stem layout). Bumping now +// discards any v3 journals belonging to a bintrie database so +// that the new layout can be introduced cleanly in follow-up +// commits without a migration path. +const journalVersion uint64 = 4 // loadJournal tries to parse the layer journal from the disk. func (db *Database) loadJournal(diskRoot common.Hash) (layer, error) {