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

Use upstream cid #850

Merged
merged 8 commits into from
Nov 17, 2020
Merged

Use upstream cid #850

merged 8 commits into from
Nov 17, 2020

Conversation

vmx
Copy link
Contributor

@vmx vmx commented Nov 13, 2020

Instead of a custom implementation of cid, wrap the upstream version.

Summary of changes
Changes introduced in this pull request:

  • Using upstream rust-cid

Other information and links

I removed the "default CID" case from the CID serializer as the old default CID won't work with rust-cid as it was an invalid CID.

This PR is intentionally using the rust-cid master branch and not a release as I would like to see if things would work with that version of rust-cid or if any changes would be nice/needed before I do a release (as this release is a huge breaking one, so it's the chance to break more things).

There is a new_from_cbor() function which I made into a module's function instead of adding it to the Cid impl. The reason is that I wanted to keep the Cid a pure wrapper around the upstream Cid without additional methods. Though I'm happy to change that if requested.

Feedback in welcome.

Copy link
Contributor

@austinabell austinabell left a comment

Choose a reason for hiding this comment

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

Looks good! I'll just need to run interop tests and make sure no regressions as well as waiting for a few interop PRs to come in before merging this in though since this is a change that touches pretty much everything

ipld/cid/src/lib.rs Outdated Show resolved Hide resolved
ipld/src/lib.rs Outdated Show resolved Hide resolved
@vmx
Copy link
Contributor Author

vmx commented Nov 16, 2020

@austinabell what about this plan:

  1. You run the integration tests. On success I'll cut a rust-cid release and update this PR. On failure I'll have a look into the failure (resp. helping you looking into).
  2. Once all PRs that should get merged before that one are in, you let me know and I'll then try to rebase this PR as quickly as possible, so that it doesn't block things.

@austinabell
Copy link
Contributor

@austinabell what about this plan:

  1. You run the integration tests. On success I'll cut a rust-cid release and update this PR. On failure I'll have a look into the failure (resp. helping you looking into).
  2. Once all PRs that should get merged before that one are in, you let me know and I'll then try to rebase this PR as quickly as possible, so that it doesn't block things.

Sounds great to me, the PRs I would like to get in before retesting are #847 #849 and #851 and I will let you know when those come in. I do believe your changes should be good as is, as I did some testing of it, I just want to check a couple things first and be completely sure if you don't mind

Instead of a custom implementation of cid, wrap the upstream version.
An assert was commented out during development and was forgotten to be
commented in again.
The `DAG_PB` constant isn't really needed.
Copy link
Contributor

@austinabell austinabell left a comment

Choose a reason for hiding this comment

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

LGTM, should be good for release (these two comments are local changes, unless the display format is intended)

ipld/cid/src/lib.rs Show resolved Hide resolved
ipld/blockstore/Cargo.toml Outdated Show resolved Hide resolved
@austinabell austinabell merged commit f9249b1 into ChainSafe:main Nov 17, 2020
@austinabell
Copy link
Contributor

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants