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

Avoid downloading 700MB groth16 params that we do not need #1584

Open
wants to merge 1 commit into
base: jl777
Choose a base branch
from

Conversation

leto
Copy link

@leto leto commented Jul 6, 2019

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.

@radix42
Copy link

radix42 commented Jul 6, 2019

I've done a build with this against 0.4.0a on ARM v8 and it is currently syncing PIRATE from scratch with no difficulty without the groth16 file present in zcash-params

@radix42
Copy link

radix42 commented Jul 7, 2019

when syncing PIRATE from scratch with this patch applied, its fine until Sapling activation and then it blows up :-(

@leto
Copy link
Author

leto commented Jul 7, 2019

@jl777 @radix42 if a groth16 joinsplit has ever occurred on any KMD chain, this PR is not valid and can be rejected. If not, then there must be some trivial issue in the code somewhere preventing this, but it should be possible.

@radix42
Copy link

radix42 commented Jul 7, 2019

after sapling activation on dec 15 all the sprout txns on asset chains would have been groth16 if I understand the code correctly, so there will be months of them for pirate alone. wiling to be wrong here

@jl777
Copy link
Owner

jl777 commented Jul 7, 2019

i think to do this right, would need to do a checkpoint past dec 15th and suppress any validation using the old sprout method. not sure how involved that would be

@leto
Copy link
Author

leto commented Jul 7, 2019

@jl777 ok, I will look into what that would take, I think it should be possible. If all old sprout joinsplits are no longer validated, then we can get rid of both sprout param files, which is about 1.6GB

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.

3 participants