Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The following emojis are used to highlight certain changes:

### Added

- `ipld/unixfs`: `DagModifier` now allows specifying file DAG Width (`MaxLinks`) [#898](https://github.com/ipfs/boxo/pull/898)
- `provider`: added support for walking partial DAGs in offline mode [#905](https://github.com/ipfs/boxo/pull/905)
- a `KeyChanFunc` that traverses DAGs from a given root (`NewDAGProvider`).
- a `KeyChanFunc` that buffers all the CIDs in memory from another `KeyChanFunc` (`NewBufferedProvider`).
Expand Down
4 changes: 3 additions & 1 deletion ipld/unixfs/mod/dagmodifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ type DagModifier struct {

Prefix cid.Prefix
RawLeaves bool
MaxLinks int
Copy link
Member

Choose a reason for hiding this comment

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

@hsanjuan is this enough, given we've added separate setting for HAMT? (#897 (review))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is probably enough since this seems to deal only with files...


read uio.DagReader
}
Expand Down Expand Up @@ -76,6 +77,7 @@ func NewDagModifier(ctx context.Context, from ipld.Node, serv ipld.DAGService, s
ctx: ctx,
Prefix: prefix,
RawLeaves: rawLeaves,
MaxLinks: help.DefaultLinksPerBlock,
}, nil
}

Expand Down Expand Up @@ -358,7 +360,7 @@ func (dm *DagModifier) appendData(nd ipld.Node, spl chunker.Splitter) (ipld.Node
case *mdag.ProtoNode, *mdag.RawNode:
dbp := &help.DagBuilderParams{
Dagserv: dm.dagserv,
Maxlinks: help.DefaultLinksPerBlock,
Maxlinks: dm.MaxLinks,
CidBuilder: dm.Prefix,
RawLeaves: dm.RawLeaves,
}
Expand Down
3 changes: 1 addition & 2 deletions ipld/unixfs/mod/dagmodifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (

dag "github.com/ipfs/boxo/ipld/merkledag"
"github.com/ipfs/boxo/ipld/unixfs"
h "github.com/ipfs/boxo/ipld/unixfs/importer/helpers"
trickle "github.com/ipfs/boxo/ipld/unixfs/importer/trickle"
uio "github.com/ipfs/boxo/ipld/unixfs/io"
testu "github.com/ipfs/boxo/ipld/unixfs/test"
Expand Down Expand Up @@ -46,7 +45,7 @@ func verifyNode(t *testing.T, orig []byte, dm *DagModifier, opts testu.NodeOpts)

err = trickle.VerifyTrickleDagStructure(nd, trickle.VerifyParams{
Getter: dm.dagserv,
Direct: h.DefaultLinksPerBlock,
Direct: dm.MaxLinks,
LayerRepeat: 4,
Prefix: &opts.Prefix,
RawLeaves: opts.RawLeavesUsed,
Expand Down