Skip to content

feat: fold storage pool ID into pooled blob object consistency digest#3494

Merged
halfprice merged 2 commits into
mainfrom
zhewu/pool_blob_object_consistency_check_add_pool_id
Jun 30, 2026
Merged

feat: fold storage pool ID into pooled blob object consistency digest#3494
halfprice merged 2 commits into
mainfrom
zhewu/pool_blob_object_consistency_check_add_pool_id

Conversation

@halfprice

Copy link
Copy Markdown
Collaborator

Summary

The pooled per-object blob consistency check (added in #3490) folded only the certified blob object ID (the ObjectID key) into the cross-node digest. This PR also folds each entry's storage pool ID into the hash, so a node that disagrees about which pool a blob object belongs to is detected as a cross-node inconsistency.

Changes

  • Make compose_blob_object_list_digest take an extra_hash_input closure (Fn(&T) -> impl AsRef<[u8]>) that contributes extra value-derived bytes per entry.
    • The regular per-object caller passes an empty slice ([0u8; 0]), so its digest is unchanged.
    • The pooled caller folds in storage_pool_id().
  • Add a PerObjectPooledBlobInfo::storage_pool_id() accessor (plus a #[cfg(test)] constructor).
  • Add unit tests verifying the pooled digest differs when only the storage pool ID differs, and matches for identical entries.

Testing

  • cargo nextest run -p walrus-service — all pass (including the two new tests pooled_digest_detects_storage_pool_id_inconsistency and pooled_digest_matches_for_identical_entries).
  • clippy and cargo-doc clean.

The existing simtest infrastructure (storage_node_certified_pooled_blob_object_digest fail point wired into BlobInfoConsistencyCheck) already verifies pooled digests match across all nodes; with this change those checks now also cover pool-ID divergence end-to-end.

The pooled per-object blob consistency check previously folded only the
certified blob object ID (the ObjectID key) into the cross-node digest.
Also fold each entry's storage pool ID into the hash, so a node that
disagrees about which pool a blob object belongs to is detected as a
cross-node inconsistency.

- Make `compose_blob_object_list_digest` take an `extra_hash_input`
  closure that contributes extra value-derived bytes per entry. The
  regular per-object caller passes an empty slice (digest unchanged);
  the pooled caller folds in `storage_pool_id()`.
- Add a `PerObjectPooledBlobInfo::storage_pool_id()` accessor.
- Add unit tests verifying the pooled digest differs when only the
  storage pool ID differs, and matches for identical entries.
Address review feedback on the pooled blob object consistency digest:

- Change `compose_blob_object_list_digest`'s `extra_hash_input` from a
  closure to `Option<F>`, so the key-only case is expressed as `None`
  rather than an empty-slice closure. The regular per-object caller
  passes `None` (digest unchanged); the pooled caller passes
  `Some(|info| info.storage_pool_id())`.
- Combine the two pooled-digest unit tests into one that checks both
  that a differing storage pool ID changes the digest and that an
  identical pool ID reproduces it.

@shuowang12 shuowang12 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I agree pool ID an important property to be included in the consistency digest.

@halfprice halfprice merged commit 6adf93f into main Jun 30, 2026
29 checks passed
@halfprice halfprice deleted the zhewu/pool_blob_object_consistency_check_add_pool_id branch June 30, 2026 06:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants