Review report

core: PR #33324

Design and approach

Clarify the Windows durability guarantee (src/util/fs_helpers.cpp:148, head)

On Windows, DirectoryCommit returns true without syncing directory metadata. MigrateBlockFile relies on this check before deleting the original, and activation also treats directory commits as successful. Flushing the staged file's contents does not establish that its directory entry is durable before source deletion or a key transition. Is power-loss-safe resumption required on Windows? If so, use a platform mechanism that establishes the needed ordering before deleting originals. If not, qualify the resumability guarantee so it does not imply that level of crash recovery.

๐ŸŸ  Major

Resume does not recommit the staged XOR key (src/node/blockstorage.cpp:240, head)

If writing xor.dat.reobfuscated previously failed at Commit() but left an eight-byte file, a retry accepts it based on size and reads it without committing its contents. The later directory commit does not make the file contents durable. If migration removes the originals and a subsequent crash loses the uncommitted key contents, the rewritten files may no longer be recoverable with their intended key. Recommit an existing staged key before migrating or activating files, and fail initialization if that commit fails.

๐ŸŸก Minor

Activation renames unrelated .reobfuscated files (src/node/blockstorage.cpp:1382, head)

This scan excludes only xor.dat.reobfuscated and does not limit staged files to names derived from blk*.dat or rev*.dat. If another regular file in the blocks directory has the .reobfuscated suffix, activation renames it to its stem, potentially changing or replacing unrelated user data. Restrict activation to the block and undo filename patterns created by this migration.

๐Ÿ’ก Suggestion

Document the fresh modification-time policy (src/node/blockstorage.cpp:258, head)

The staged replacement is newly created, and its timestamp is not restored before activation, so rewritten files receive fresh modification times. The supplied PR description says timestamps are preserved, while the commit rationale says fresh timestamps are deliberate so size-and-mtime backup tools copy rewritten files. Align the user-facing description and release notes with the intended behavior: fresh timestamps can make incremental backups recopy a large block and undo dataset, while preserving old timestamps could cause those backups to miss files whose XOR encoding changed.

Review coverage was incomplete. The adversarial review had incomplete evidence.