Test failure: Util › Generate content id #7
Closed
opened 2022-11-04 15:21:31 +00:00 by dboreham
·
6 comments
No Branch/Tag Specified
main
roy/graphql-to-ipld
roy/tests-cleanup
roy/rm-hardcoded-records
murali/record-types
ng-eth-tx
feature_test_record_types
bugfix/insufficient_funds
dboreham/test-new-node
release-v0.1.6
auction_nameservice_tests
readme_quick
jest_timeout
run_tests_github_action
murali/fix-tests
fix_tests
murali/proto-gen
dboreham/is-url-is-broken
dboreham/npm-publish-fixes
release-v0.1.4
release-v0.1.3
release-v0.1.2
release-v0.1.1
release-v0.1.0
dboreham/repo-rename
dboreham/doc-fixes
dboreham/release
dboreham/fix-dependency-versions
ng-send-tokens
v0.1.16
v0.1.15
v0.1.14
v0.1.13
v0.1.12
v0.1.11
v0.1.10
v0.1.9
v0.1.8
v0.1.7
v0.1.6
v0.1.5
v0.1.4
v0.1.3
v0.1.2
v0.1.1
v0.1.0
Labels
Clear labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
in progress
invalid
question
wontfix
Copied from Github
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
An issue or PR manually copied from GitHub.
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
The priority is critical
Priority
High
The priority is high
Priority
Low
The priority is low
Priority
Medium
The priority is medium
Reviewed
Confirmed
Issue has been confirmed
Reviewed
Duplicate
This issue or pull request already exists
Reviewed
Invalid
Invalid issue
Reviewed
Won't Fix
This issue won't be fixed
Status
Abandoned
Somebody has started to work on this but abandoned work
Status
Blocked
Something is blocking this issue or pull request
Status
Need More Info
Feedback is required to reproduce issue or to continue work
No labels
Milestone
No items
No Milestone
Projects
Clear projects
No projects
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cerc-io/laconic-sdk#7
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
fails for me too (the only one)
This is the issue I assumed to be due to switching from sha2-512 to sha2-256 in https://github.com/vulcanize/chiba-clonk/pull/45/files
But, that was a change from sha2-512 to sha2-256 in a pending PR. The old go-ipld-cbor codec that we replaced in that PR was already using sha2-256.
Also, if it were due to a change like this I would expect all tests that are testing CIDs to fail.
I think what happened instead is that the content itself was changed when changing the attribute types in https://github.com/cerc-io/laconicd/pull/40 (watcher registration object was changed) and the corresponding changes were not made here.
Just thoughts right now I still need to test things.
Due to the amount of overlap between the two CIDs we can conclude that it is not due to the wrong CID version, multihash prefix, or multicontent prefix being used. It either must be due to differences in the contentg itself, or the IPLD codecs or their encapsulating methods are encoding/decoding incorrectly.
So I’m thinking the problem is:
In the
cbor.FromJSONfunction inside ofCIDFromJSONBytes, the JSON is decoded and converted to a CBOR object before it is marshalled into DAG CBOR. It is then these marshalled DAG CBOR bytes that are hashed into a CID.CIDFromJSONBytesUsingIpldPrimedoes not appear to be doing this, it appears to be computing the CID off the raw input JSON bytes without converting and encoding it as DAG CBOR first.I think we need to reimplement a helper function like
cbor.FromJSONBut instead of using the go-ipld-cbor marshaller here
We would use the go-ipld-prime marshal function
Its possible it is a simple drop in replacement
Closed by:
https://github.com/cerc-io/laconicd/pull/88