Avoid downloading 700MB groth16 params that we do not need #1584
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.
NOTE: Work in progress, needs more testing before merging.
This is a port of this from the Hush codebase. I had to make some manual changes in fetch-params, which is different since Hush does not download any sprout files.
With this change, every KMD asset chain full node no longer must download 700MB file it does not use. This greatly benefits people with slow/expensive internet and mobile use cases.
There is no way to accomplish this task without modifying Rust code in librustzcash. I tried all other ways, but it's not possible. The current code implements a simple patch on top of librustzcash, which the build system knows how to apply. This means we still use upstream ZEC librustzcash releases, and we don't need to change all the URLs and SHA256 hashes in our build system.
Once users have the new code, they can free up disk space by deleting the groth16 file, if they want:
rm ~/.zcash-params/sprout-groth16.params
To fully test this, a full sync of Pirate and any other asset chains which have joinsplits should be done. If anybody can help, that would be great, otherwise it will take me a few days. /cc @radix42
FYI, for Pirate SevenSeas to work with this, just 2 lines need to be deleted, the one that checks for the groth16 file and the line which downloads it.