Skip to content

fix(cli): deduplicate dag stat blocks by multihash - #11098

Closed
lidel wants to merge 1 commit into
masterfrom
fix/dag-stat-multihash-dedup
Closed

fix(cli): deduplicate dag stat blocks by multihash#11098
lidel wants to merge 1 commit into
masterfrom
fix/dag-stat-multihash-dedup

Conversation

@lidel

@lidel lidel commented Dec 9, 2025

Copy link
Copy Markdown
Contributor

This PR closes #8794, but imo is just a formality.

In practice, unlikely this will impact anyone, DAGs with the same block being addressed multiple times with different codec is virtually never happening.

Rationale

since Kubo v0.12.0, blocks are stored by multihash, so identical data with different CIDs (e.g., CIDv0 vs CIDv1) is stored once. dag stat now reflects actual storage by using multihash-based deduplication instead of CID-based.

updated help text to clarify deduplication behavior and note that CAR export (dag export) uses CID-based keying and may include duplicates. this addresses concern raised in #8843 (comment)

added regression test for multihash deduplication.

since Kubo v0.12.0, blocks are stored by multihash, so identical
data with different CIDs (e.g., CIDv0 vs CIDv1) is stored once.
dag stat now reflects actual storage by using multihash-based
deduplication instead of CID-based.

updated help text to clarify deduplication behavior and note that
dag export uses CID-based keying and may include duplicates.

added regression test for multihash deduplication.
@lidel lidel mentioned this pull request Dec 9, 2025
67 tasks
@lidel lidel self-assigned this Dec 10, 2025
@lidel lidel mentioned this pull request Mar 6, 2026
38 tasks
@lidel lidel mentioned this pull request May 5, 2026
40 tasks
@lidel lidel mentioned this pull request Jun 8, 2026
62 tasks
@lidel

lidel commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing: conflicts after the dag stat rework in #11353, and the case it fixes (same block referenced under different codecs in one DAG) does not occur in practice (must be a very special snowflake DAG). Leaving #8794 open for the record, but imo this PR is not worth the rebase.

Related: #8794, #8791

@lidel lidel closed this Sep 3, 2026
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.

ipfs dag stat improperly return size of dags that include the same blocks multiple time as different codecs

2 participants