-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Map id to cid instead of multihash (#336)
* test: ensure that different cids with the same hash work Currently failing because of #335 * fix: use code and hash (so basically cid) as id key That way you can have 2 cids with the same hash but different links. Downside is that you might store the same data twice in the very unlikely case where you have the same data as both raw and dag-cb. ¯\_(ツ)_/¯ * perf: avoid allocation when creating an id key * feat: Add way to get data by hash This is one of the two ways of doing this: - downside: in the rare case where there are 2 cids with the same hash, the data gets stored twice - upside: storing the graph can be done using just u64 ids instead of (code, id) tuples * docs: update comment to match new db layout * refactor: address PR review comments
- Loading branch information
Showing
3 changed files
with
181 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters