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

Update the tool to use more modern dependencies #2

Closed

Conversation

LefterisJP
Copy link

@LefterisJP LefterisJP commented Jun 15, 2023

Fix #1

As mentioned there, the dependencies were outdated and archived. Since they are no longer maintained, their dependencies are pinned to outdated versions and this causes conflicts when this package is used in more complex projects where transitive dependencies also need the same ones and can't solve the dependency resolution.

The solution is simple. Update to more modern packages.

After looking around a bit it seems that the proper package to use here is https://github.com/hashberg-io/multiformats
It contains everything needed for the content hash EIP, plus I added some more dependencies to do small stuff like base58 encode/decode and use keccak.

Have a small constraint I added temporarily due to hashberg-io/multiformats#10 but this can be removed soon.

I checked that all tests pass with the changes, so I am at least sure that the functionality is the same. Only thing I had to change was the -ns suffix for some protocols as this is not understood/supported in multiformats package.

Since we want to use this in production in rotki: https://github.com/rotki/rotki/ and I am not sure if this repo is still maintained I went ahead and made a fork and uploaded it to pypi with those changes in this PR so we and others can use it easily.

But if the changes make it into the upstream we can just keep using this package and retire the fork.

Since py-cid is deprecated and archived, use a library that is still
maintained.
Part of filips123#1
Basically replaces py-multicodec and py-multihash with multiformats
and adds base58check for base58 encoding/decoding and pysha3 so that
keccak-256 decoding can work.

Also temporarily pins typing extensions to 4.5.0 due to
hashberg-io/multiformats#10

All tests now pass again
@filips123
Copy link
Owner

Thanks! I'll review this PR next week as I don't have much time at the moment.

@filips123
Copy link
Owner

I've noticed that pysha3 is also no longer supported because SHA3 is now (since Python 3.6) available in standard library's hashlib. Can you please switch to that and also increase minimum Python version to 3.7 in setup.py (because 3.7 is also required by multiformats)?

@filips123
Copy link
Owner

Also, I've replaced Travis CI with GitHub Actions, so please update your branch so tests become available.

@LefterisJP
Copy link
Author

Hey I am just writing to say these days are really busy but will get to it at some point! Have not forgotten it

@sg495
Copy link

sg495 commented Dec 20, 2023

Heya.

Just wanted to say that issue hashberg-io/multiformats#10 is now closed, along with all other outstanding issues, and that multiformats is going to be regularly maintained. Following pull request hashberg-io/multiformats#16 and starting from version multiformats>=0.3.1.post4, the pysha3 dependency for keccak has been dropped in favour of pycryptodomex.

If you need help in your codebase transition to multiformats, feel free to give me a shout. Always happy to integrate new functionality.

@filips123 filips123 mentioned this pull request Dec 23, 2023
@filips123 filips123 closed this Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All dependencies are archived and deprecated. Let's upgrade
3 participants