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

Refactor blockstore and Cid for usage #230

Merged
merged 7 commits into from
Feb 19, 2020
Merged

Conversation

austinabell
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Moved blockstore into own crate to be used more easily by crates now and in the near future
    • Removes need to import AMT to use just that and also removes need to have duplicates inside of HAMT or otherwise
  • Refactored cid crate for easier upstream and non-forest specific logic
    • Having default cid function is nice, but removing for now to be specific about which hashes are actually being used. (default was 2b512 before when 256 wasn't available and wouldn't run into issues until we generated our own Cids to compare with Lotus)
    • Makes easier to upstream or share changes with rust-ipld in future to not have opinionated functions

This shouldn't cause any actual conflicts, maybe only minor if you were referencing blockstore in AMT crate or generating a cid from bytes default (I don't think that's the case for any of you guys rn)

Reference issue to close (if applicable)

Other information and links

@@ -10,16 +10,17 @@ amt = { package = "ipld_amt", path = "../../ipld/amt" }
blocks = { package = "forest_blocks", path = "../blocks" }
db = { path = "../../node/db" }
encoding = { package = "forest_encoding", path = "../../encoding" }
libp2p = { git = "https://github.com/SigP/rust-libp2p", rev = "776d13ef046358964c7d64cda3295a3a3cb24743" }
libp2p = { git = "https://github.com/SigP/rust-libp2p", rev = "776d13ef046358964c7d64cda3295a3a3cb24743" }
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be libp2p = "0.15.0"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah I didn't notice, this was auto formatted. Will swap. This must have come in after the swap to libp2p base

@austinabell
Copy link
Contributor Author

Re-requested review since I also removed raw-block crate by updating the Cbor trait we use in encoding.

Also removed dependency of Cid crate on our local encoding utility and seperated the serde stuff into a feature so now the Cid crate can very easily be upstreamed as is.

Copy link
Contributor

@dutterbutter dutterbutter left a comment

Choose a reason for hiding this comment

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

Much cleaner

@austinabell austinabell merged commit 1bd9a59 into master Feb 19, 2020
@austinabell austinabell deleted the austin/blockstore/refactor branch February 19, 2020 02:02
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