ipfs / ipfs/kubo

dag import: errors with IPLD test vectors

Open
#10,236 0 comments 0 reactions 0 assignees View on GitHub
kind/bug need/triage
Dominant language
Go
Stars
17.1k
Forks
3.2k
Avg merge
3d 18h
Merged PRs (30d)
11

Description

### Version

```Text
0.24.0
```

### Description

Right now we have two edge cases where a CAR fails in GO but loads fine in JS:

Details and CAR to reproduce in the PR at https://github.com/ipld/codec-fixtures/pull/102#issuecomment-1830795380:

> ```
> --- FAIL: TestFixtures/int--11959030306112471732 (0.00s)
> codecs_test.go:39: failed to load fixture: cbor: negative integer out of rage of int64 type
> --- FAIL: TestFixtures/int-11959030306112471731 (0.00s)
> codecs_test.go:39: failed to load fixture: strconv.ParseInt: parsing "11959030306112471731": value out of range
> --- FAIL: TestFixtures/int-18446744073709551615 (0.00s)
> codecs_test.go:39: failed to load fixture: strconv.ParseInt: parsing "18446744073709551615": value out of range
> ```
>
> First one is out, regardless, it's negative max uint64, which isn't a thing in Go. I did have an early proposal in [ipld/go-ipld-prime#413](https://github.com/ipld/go-ipld-prime/pull/413) to return a negative indicator that could deal with this, but the complexity made it not worth it.
>
> The other two failures are dag-json strconv failures. They could potentially be fixed, but are low priority, and I already have other json fixes in play that I can't get over the line ([polydawn/refmt#58](https://github.com/polydawn/refmt/pull/58), not that I've pushed very hard on that).

Kubo 0.24 gives me:

```console
$ ipfs dag import --pin-roots=false tmp/fixtures.car
Error: import failed at block "bafyreieir43khjzemsmgahaozab2vjvtdxavszixhhurvdqg2xkhrwinyi": cbor: negative integer out of rage of int64 type
```

## Bugs to fix

Operating on assumption, IPLD fixtures are what we want to support,
we need to adjust GO side of things to fix:

- [ ] change `ipfs dag import` so it does no IPLD when `--pin-roots=false`
- [ ] negative max uint64
- [ ] dag-json strconv failure due to value out of range

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.