datrs / hypercore

Secure, distributed, append-only log
https://docs.rs/hypercore
Apache License 2.0
326 stars 37 forks source link

bugfix: fixed skewed range in put_data of Storage #110

Closed khodzha closed 4 years ago

khodzha commented 4 years ago

This is a bug fix:

ensure! macro was mutating the range so by the end of the macro evaluation the range was in wrong state

Checklist

Context

this fixes test in #108 if my comment in that PR is addressed

Semver Changes

no changes? idk :man_shrugging:

Frando commented 4 years ago

Wow, great find @khodzha! I can confirm that this fixes the put method. #108 passes if the proof call is changed to not include hashes. And I can now successfully put data into a hypercore through hypercore-protocol-rs (in the dev branch).

Frando commented 4 years ago

I fixed and rebased the put test in #111, which I think should also be a fine test for this (so the box above can be ticket IMO).

bltavares commented 4 years ago

I'm trying to test on my local prototype, but I'm not finding the correct combination of forks between hypercore, bitfield-rle and this branch that compiles yet.

I'll try again on the weekend, but it looks like a good changeset in combination with the tests of #111

@Frando If you want, I could try to do a octopus merge of both and run locally the tests to merge both on master.

bltavares commented 4 years ago

Thanks @khodzha and @Frando. Both PRs are merged on master and released as the beta release.