paritytech / srtool

A fork of chevdor's srtool
MIT License
64 stars 18 forks source link

support printing blake2-256 hash #12

Closed chevdor closed 3 years ago

chevdor commented 3 years ago

To upgrade the wasm for parachains, a.k.a. validation function, a hash needs to be authorized in advance. This hash is neither SHA-256 nor proposal, but needs to be hashed with hashing function configured in frame_system::Config via type Hashing, typically blake2-256. It would helpful for parachains wasm build if srtool could print blake2-256 hash as well. Currently we have to do it manually with built wasm file.

chevdor commented 3 years ago

Hi @shaunxw, thanks for this detailled explanation. I see no major issue doing that and I am happy to add this feature to make it more convenient.

I am however trying to slim down srtool itself so it only takes care of the building part in docker. I am in the process of moving some features into external project. One of them being subwasm (https://gitlab.com/chevdor/subwasm).

I think your feature would fit nicely in subwasm and srtool will likely switch to using subwasm as well in the future. That gives you the benefit of also being able get/see this hash without any docker/srtool (assuming you are given pre-built wasm).

I have opened a new issue in subwasm: https://gitlab.com/chevdor/subwasm/-/issues/1

Let me know if you see an issue with that. I close the issue from this repo but I CCed you in the issue of the subwasm repo.