triedb/pathdb: bump journal version to 4

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.
This commit is contained in:
CPerezz 2026-04-07 16:13:45 +02:00
parent f1d7143afa
commit 0fb4d9226b
No known key found for this signature in database
GPG key ID: 62045F34B97177DD

View file

@ -50,7 +50,11 @@ var (
// - Version 1: storage.Incomplete field is removed // - Version 1: storage.Incomplete field is removed
// - Version 2: add post-modification state values // - 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 // - 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. // loadJournal tries to parse the layer journal from the disk.
func (db *Database) loadJournal(diskRoot common.Hash) (layer, error) { func (db *Database) loadJournal(diskRoot common.Hash) (layer, error) {