Follow-up to #21945 — review comment #21945 (comment).
The DecodeBranchInto → touch/after-map → deriveHashedKeys sequence is now shared via decodeBranchIntoRow (hex_patricia_hashed.go), called by both unfoldBranchNode and unfoldStorageBase.
The branch read still diverges:
unfoldBranchNode reads via readBranchAndCheckForFlushing (flush-before-read) and emits BranchLoad metrics + depthsToTxNum bookkeeping.
unfoldStorageBase uses the raw branchFromCacheOrDB and does neither.
Harmless today — the storage-base worker has no pending deferred writes for the storage-root prefix when it unfolds — but a wire-format or flush-invariant change would have to be mirrored in both paths.
Task: route unfoldStorageBase through the same flush-checked read (or a shared read helper keyed by (row, depth, key, deleted)), so the on-disk read path is unified too — or, if the raw read is deliberately safe here, assert/document that invariant.
Follow-up to #21945 — review comment #21945 (comment).
The
DecodeBranchInto→ touch/after-map →deriveHashedKeyssequence is now shared viadecodeBranchIntoRow(hex_patricia_hashed.go), called by bothunfoldBranchNodeandunfoldStorageBase.The branch read still diverges:
unfoldBranchNodereads viareadBranchAndCheckForFlushing(flush-before-read) and emitsBranchLoadmetrics +depthsToTxNumbookkeeping.unfoldStorageBaseuses the rawbranchFromCacheOrDBand does neither.Harmless today — the storage-base worker has no pending deferred writes for the storage-root prefix when it unfolds — but a wire-format or flush-invariant change would have to be mirrored in both paths.
Task: route
unfoldStorageBasethrough the same flush-checked read (or a shared read helper keyed by(row, depth, key, deleted)), so the on-disk read path is unified too — or, if the raw read is deliberately safe here, assert/document that invariant.