ipfs dag stat should skip downloading raw leaves
- Dominant language
- Go
- Stars
- 17.1k
- Forks
- 3.2k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 11
Description
### Checklist
- [X] My issue is specific & actionable.
- [X] I am not suggesting a protocol enhancement.
- [X] I have searched on the [issue tracker](https://github.com/ipfs/go-ipfs/issues?q=is%3Aissue) for my issue.
### Description
```
ipfs dag stat Qmfoo
```
Will download all desandant of Qmfoo. Even raw leaves.
We can skip raw leaves when the dag size or chunk size is included in the parent block (which is the default) because they do not give more information we doesn't already have.
This would speed up `ipfs dag stat` a lot when used with files using raw leaves.
### Security impact
`dag stat` is used sometime to get the true IPLD size, this is usefull for pinning services, it would be possible to create big raw leaves but with 0 dag sizes in the parent, lying to the true size to the pinning service, and if we don't check the raw leaves we can't know that, so we would need a mode to toggle that.
Contributor guide
Research direction
Start by reproducing `ipfs dag stat Qmfoo` with a DAG containing raw leaves, then locate the `dag stat` traversal entry point in the Go code. Determine how parent dag or chunk sizes are handled and define the option needed to verify true size for pinning services; done means raw leaves are skipped by default without preventing full-size verification.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100