Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipfs add: parameter to control the width of created UnixFS DAG #10751

Open
Tracked by #10760
lidel opened this issue Mar 11, 2025 · 2 comments
Open
Tracked by #10760

ipfs add: parameter to control the width of created UnixFS DAG #10751

lidel opened this issue Mar 11, 2025 · 2 comments
Assignees
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/files Topic files topic/rpc-api Issues related to Kubo RPC API at /api/v0 topic/UnixFS Topic UnixFS

Comments

@lidel
Copy link
Member

lidel commented Mar 11, 2025

TLDR

There is no CLI / RPC / Config option to control max DAG width in Kubo when creating a UnixFS DAG.

Users who want to fully control the final CID need to be able to control this.

Details

and iiuc the implicit defaults are different for files and directories:

ability to pass a static dag width for files could be exposed via ipfs add --help the same way as --chunker and --hash are, but it requires PR against boxo and kubo.

Proposed design

  • Add CLI/RPC parameter dag-width ipfs add --dag-width=N with default being defined in config at Import.UnixFSDAGWidth, similar to Import.UnixFSChunker.
  • Make default in legacy-cid-v0 profile match current default (174?)
  • Consider going with higher value in test-cid-v1 – perhaps 1024, matching Storacha
  • This very likely requires changes to boxo to expose ability to override mentioned Default..

Acceptance criteria / caveats

  • keep current defaults if possible.
  • setting legacy-cid-v0 profile should ensure current behavior does not change
    • we may need separate Import.UnixFSDAGWidth and Import.UnixFSHAMTWidth just to make this profile possible.
  • confirm HAMT-directories continue to work with legacy software
    • confirm custom dag width is compatible with HAMT-directories, namely, what is the relation between dag width parameter here and the fanout of HAMTShard UnixFS node type. if 256 is a hard requirement, keep it. If not, make Import.UnixFSHAMTWidth follow Import.UnixFSDAGWidth unless both are set to different values by the user
@lidel lidel added kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/files Topic files topic/rpc-api Issues related to Kubo RPC API at /api/v0 topic/UnixFS Topic UnixFS labels Mar 11, 2025
@hsanjuan
Copy link
Contributor

Given that the tendency now is to try to come to a sane set of defaults, do we want to expose this?

Users who want to fully control the final CID need to be able to control this.

There must be an interesting story behind this?

@2color
Copy link
Member

2color commented Mar 19, 2025

Given that the tendency now is to try to come to a sane set of defaults, do we want to expose this?

The context in which this came up is this discussion. If we change the defaults here to match current Helia/Storacha defaults, this may confuse users with data already onboarded and merkleised.

By allowing this config to be configurable, we can ensure CID equivalency for the same input across implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature P2 Medium: Good to have, but can wait until someone steps up topic/files Topic files topic/rpc-api Issues related to Kubo RPC API at /api/v0 topic/UnixFS Topic UnixFS
Projects
None yet
Development

No branches or pull requests

3 participants