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

dag import: errors with IPLD test vectors #10236

Open
3 tasks
lidel opened this issue Nov 29, 2023 · 0 comments
Open
3 tasks

dag import: errors with IPLD test vectors #10236

lidel opened this issue Nov 29, 2023 · 0 comments
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@lidel
Copy link
Member

lidel commented Nov 29, 2023

Version

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 ipld/codec-fixtures#102 (comment):

--- 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 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, not that I've pushed very hard on that).

Kubo 0.24 gives me:

$ 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
@lidel lidel added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
No open projects
Status: 🥞 Todo
Development

No branches or pull requests

1 participant