8000 feat(config): `ipfs add` and `Import` options for controling UnixFS DAG Width by hsanjuan · Pull Request #10774 · ipfs/kubo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(config): ipfs add and Import options for controling UnixFS DAG Width #10774

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

Merged
merged 20 commits into from
Apr 15, 2025

Conversation

hsanjuan
Copy link
Contributor
@hsanjuan hsanjuan commented Apr 5, 2025

This introduces support for setting DAG-shaping options that control the maximum number
of links in that a DAG node can have.

It is supported in two ways: first, via Import configuration options; second, via --max-links and --max-hamt-fanout options ipfs add.

The resulting DAGs will respect MaxLinks (for files and basic directories) and
MaxHAMTFanout for HAMT directories. When options are unset, the previous Kubo
defaults will apply.

This introduces support for setting DAG-shaping options that control the maximum number
of links in that a DAG node can have.

It is supported in two ways: first, via `Import` configuration options; second, via `--max-links` and `--max-hamt-fanout` options `ipfs add`.

The resulting DAGs will respect MaxLinks (for files and basic directories) and
MaxHAMTFanout for HAMT directories. When options are unset, the previous Kubo
defaults will apply.
@hsanjuan hsanjuan force-pushed the feat/10751-dag-width branch from 21cc49d to b015c71 Compare April 7, 2025 22:46
@hsanjuan hsanjuan marked this pull request as ready for review April 7, 2025 22:47
@hsanjuan hsanjuan requested a review from a team as a code owner April 7, 2025 22:47
@hsanjuan
Copy link
Contributor Author
hsanjuan commented Apr 7, 2025

Based on ipfs/boxo#906.

It needs some sharness tests I guess.

I have tested manually at it seems to work, and I have ensured that not setting the new options does not break anything in terms of previous behaviour.

@lidel lidel changed the title ipfs add: --max-width and --max-hamt-fanout options (also Import settings config) feat(config): ipfs add and Import options for controling UnixFS DAG Width Apr 11, 2025
lidel added 2 commits April 11, 2025 20:31
moved `Internal.UnixFSShardingSizeThreshold`
to `Import.UnixFSHAMTDirectorySizeThreshold`
and included it in profiles
@lidel lidel assigned lidel and unassigned hsanjuan Apr 11, 2025
@lidel
Copy link
Member
lidel commented Apr 11, 2025

Looking good, noting remaining work for me next week:

lidel added 8 commits April 14, 2025 22:13
basic smoke test confirming UnixFSFileMaxLinks sets
to 'ipfs add' defaults and informs the DAG shape
keeping old name to minimize noise, just document pre-existing defaults
lets make the fanout match the max links from files
and rename profile to `-wide`

this will make it easier to discuss in ipfs/specs#499
thr
8000
eshold exists only as a global flag, so it was already set, but we
were missing fanout.

this applies both, for global consistency
@lidel lidel force-pushed the feat/10751-dag-width branch from d01209d to 104ede9 Compare April 15, 2025 20:05
if cfg.Internal.UnixFSShardingSizeThreshold is set and
cfg.Import.UnixFSHAMTDirectorySizeThreshold is not, assign old value
to new field and print ERROR urging user to migrate

this way we wont break any existing CI etc
Copy link
Member
@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you @hsanjuan

  • added tests to ./test/cli/add_test.go, looking good
  • moved preexisting Internal.UnixFSShardingSizeThreshold to Import.UnixFSHAMTDirectorySizeThreshold

Merging to test it over Easter, if no issues we will ship this in Kubo 0.35.0-rc1

I'll document these in ipfs/specs#499

@lidel lidel merged commit 6b55e64 into master Apr 15, 2025
16 checks passed
@lidel lidel deleted the feat/10751-dag-width branch April 15, 2025 20:56
lidel added a commit to mishmosh/specs-1 that referenced this pull request Apr 15, 2025
Import.* config params for controlling DAG width were added in:
ipfs/kubo#10774
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
0