feat: make changes to BlockStore trait based on feedback #286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses the following suggestions and feedback made at ipfs thing. Todo item 3 has been implemented in PR #257.
We want to limit wnfs dependency on
libipld
. Changing the codec type fromIpldCodec
tou64
lets us replacelibipld
withlibipld_core
inwnfs
andwnfs-wasm
crates. In a way this also removes the limitation oflibipld::IpldCodec
enum.We think
bytes::Bytes
is a much more efficient way of getting bytes to and from a BlockStore (for BlockStores implementation that care about that sort of thing). Previously we usedCow<Vec<u8>>
and we have consideredRead/Write
butbytes::Bytes
is just more flexible. This change basically makes block storage and retrieval more efficient and flexible while maintainingno_std
compatibility.This PR implements the following features
wnfs
dependency on libipld.bytes::Bytes
toVec<u8>
in BlockStore interface.Test plan (required)
Testing
scripts/rs-wnfs test
Closing issues
Fixes #251