EspressoSystems / jellyfish

A Rust Implementation of the PLONK ZKP System and Extensions
https://jellyfish.docs.espressosys.com
MIT License
408 stars 106 forks source link

test: add test hook to corrupt share index #664

Open elliedavidson opened 3 months ago

elliedavidson commented 3 months ago

closes: #XXXX

This PR:

This PR adds a small testing function to corrupt VID share indices. The purpose of this function is to create VID shares that fail verify_share with an Ok(Err) result. This PR doesn't need to be merged - it is just to show the bug that was fixed in HotShot. It probably makes sense to instead write logic that returns any form of a corrupt share, instead of writing to specifically corrupt the index of the share.

This PR does not:

Key places to review:


Before we can merge this PR, please make sure that all the following items have been checked off. If any of the checklist items are not applicable, please leave them but write a little note why.

ggutoski commented 3 months ago

Thanks @elliedavidson ! Is there a reason not to merge this PR?

Sucks that you need to touch the VidScheme trait. That could probably be avoided by setting the share index to u32::MAX or whatever so you don't need self.num_storage_nodes. But that might not be worth the trouble.

elliedavidson commented 3 months ago

Thanks @elliedavidson ! Is there a reason not to merge this PR?

Sucks that you need to touch the VidScheme trait. That could probably be avoided by setting the share index to u32::MAX or whatever so you don't need self.num_storage_nodes. But that might not be worth the trouble.

Let me try moving it out of VID Scheme!