-
-
Notifications
You must be signed in to change notification settings - Fork 55
Use the new dag api and use ipld links for both heads and next pointers #213
Conversation
Do not merge yet, I would like to make two small changes. Will do them as soon as I arrive home. |
Just saw this and haven't checked myself but is the performance issue mitigated? If so, what was it? |
@aphelionz the perceived performance hit was due to monkey-patching here (using memstore to avoid hitting disk) and the new code wasn't using memstore, i.e. hitting disk, hence the slowdown |
I've made the changes. On my end, this is good to go but please test it and inspect both a log and entry hashes in https://explore.ipld.io/ to see how it looks like! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment to address backwards compatibility, and a quick request to move a function to a utils file.
Finally, run |
Should we add this to the Contributing file? |
@RichardLitt Yes, definitely. Thanks for catching that. |
2a9ae2f
to
a52c141
Compare
So I took the journey of adding In order to do this properly I had to dig into the code and I have detected the following:
Please advise regarding the points I mentioned above. Please review the PR to see how it looks like. @shamb0t it would be great if you could test it locally, please :D. |
6f9c52c
to
0091067
Compare
Thanks @satazor will take a look at this today! |
Thanks for this @satazor! I honestly feel while this is the right direction, further changes are required for the hash/cid replacements and is perhaps out of scope for this PR.
This sounds reasonable to me.
This indeed looks like an issue with transforming the exclude to exclude<entry.hashes>, cache[e.cid] = e gives { 'undefined': somehash} bc e is a hash.
Yes agreed we can leave the documentation until merging that PR 👍
This does indeed break backwards compatibility and also requires changing occurrences of Edit: Or how about keeping to/fromCID as I do think its preferable but refraining from changing the occurrences of |
This change is backwards compatible, meaning the old logs can still be read. Also updated IPFS to latest version as the current installed one has breaking changes to the dag api. This way, we are already using the new dag api.
@shamb0t thanks for the response Regarding:
Should I create an issue for this? Since this is a breaking change I guess we should take care of this later.
I've rebased against master, thanks for looking and fixing this.
To have 100% backwards compatible we can:
All these 3 points are very easy to do. Let me know if I'm missing something and if you still prefer to rollback all the |
Agreed we should take care of this later, opened an issue here 👍
Thank you! 👍
These sound good, I would prefer moving forward than rolling back the changes as I think this is the correct direction and is useful. Am I correct in understanding the above would keep consumers of this module from breaking but will not read newly created entries until all We can probably keep fromEntryCid as long as we still have the |
It all looks good to me, but having said that, I haven't worked on this at all and it's hard to confirm for sure on individual implementation details. From what I can tell, it looks correct. I would want to request one final test though: we should have an old log (as fixtures prolly) and make sure it can be opened and operated on with the new version (this PR) in all possible ways: fromCID/toCID/fromMultihash/toMultihash/etc. We should make sure that the entries are indeed old version to make sure it can handle them correctly, ie. instead of You've done great job @satazor and @shamb0t, thank you for doing all this! ❤️ |
I have added a few fixtures, see https://github.com/orbitdb/ipfs-log/tree/040ff46b0f29eb78def3a6ad49e5d329b1162b64/test/fixtures. I will double check if all those scenarios are being tested with these fixtures and add more tests. Moreover, I will be working on:
..so that we get 100% backwards compatibility. Once done, it would be great if you guys could help me testing against some projects to ensure everything is working as expected. |
I've made the changes mentioned above in this last commit. Also I changed I haven't added interop tests for |
- Restore fromEntryHash - Make fromMultihash simply call fromCID
@shamb0t @aphelionz @haadcode this is ready to be reviewed. Some things to point out:
|
Thank you @satazor! Everything lgtm 👍 I've tested and it works with old orbit-db addresses. I'm happy to merge this without additional interop tests, I'll add some to the orbit-db tests too. We can discuss steps re: migration pipeline in #211 looks to me that a lot of the preliminary work is done here which is great! |
Description (Required)
Use the new dag api and use ipld links for both heads and next pointers
The object api is deprecated and might be removed in future releases.
Additionally, we may now use https://explore.ipld.io/ to explore the log & entries!
With this change, we are now dealing with CIDs instead of multihashes. Therefore, this PR introduced
fromCID
andtoCID
. ThefromMultihash
andtoMultihash
became deprecated.Moreover, all occurrences of
hash
were replaced tocid
in both source code and tests.Other changes (e.g. bug fixes, UI tweaks, refactors)
Updated IPFS to latest version as the current installed one has breaking changes to the dag api.
This way, we are already using the new dag api.
TODO
Closes #200, #106