Skip to content

Conversation

@lidel
Copy link
Member

@lidel lidel commented Aug 30, 2025

Important

This PR fixes #6011:

  • validate --inline-limit against verifcid.MaxDigestSize
  • add error when --hash=identity exceeds size limit
  • add tests for identity CID overflow scenarios
  • update help text to show maximum inline limit

This prevents creation of unbounded identity CIDs by enforcing the 128-byte limit defined in verifcid + automatically switches to non-identity once limit is reached.

- validate --inline-limit against verifcid.MaxDigestSize
- add error when --hash=identity exceeds size limit
- add tests for identity CID overflow scenarios
- update help text to show maximum inline limit

This prevents creation of unbounded identity CIDs by enforcing
the 128-byte limit defined in verifcid.MaxDigestSize.

Fixes #6011
@lidel lidel force-pushed the feat/identity-cid-size-limits branch from eda9f67 to f3a5642 Compare August 30, 2025 02:46
lidel added 5 commits August 30, 2025 05:00
- replace deprecated ErrBelowMinimumHashLength with ErrDigestTooSmall
- update sharness test error messages to match new sentinel errors
- replace hardcoded 128 byte limit with named constant
- improve code clarity and maintainability
- align with boxo verifcid package updates
- document --inline-limit enforcement using DefaultMaxIdentityDigestSize
- note ipfs files write fixes for codec preservation and raw node support
- highlight identity CID overflow prevention
- update test to match actual error message format
- remove unnecessary empty line in files.go
@lidel lidel marked this pull request as ready for review September 2, 2025 02:03
@lidel lidel requested a review from a team as a code owner September 2, 2025 02:03
highlight that identity CIDs were an experimental feature that was
easy to misuse and could become an anti-pattern without proper limits
correct claim that --hash=identity auto-switches to SHA-256; it errors instead
@lidel
Copy link
Member Author

lidel commented Sep 9, 2025

Merged ipfs/boxo#1018 and switched this PR to latest boxo@main.

Once CI is green, ok to squash-merge I think, and include in 0.38 RC1.

@lidel lidel merged commit 20f8151 into master Sep 9, 2025
16 checks passed
@lidel lidel deleted the feat/identity-cid-size-limits branch September 9, 2025 18:22
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.

Carefully audit and reason through inline CIDs

2 participants