Skip to content

execution/commitment: unify unfoldStorageBase branch-read path with unfoldBranchNode #21986

Description

@awskii

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions