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

Add CompoundProof Requirements + ChallengeRequirements #605

Merged
merged 1 commit into from
Apr 17, 2019

Conversation

porcuquine
Copy link
Collaborator

This lays the groundwork for ensuring proofs meets some minimum challenge requirement, regardless of how many partitions are used. Previously we had no way of enforcing aggregate requirements. This corrects that.

It adds a general mechanism allowing Requirements to be specified to any ProofScheme. These requirements are passed as a parameter to a new satisifies_requirements trait method. This method also receives public parameters and number of partitions. This allows it to determine whether the proof's public parameters meet requirements when divided into a given number of partitions.

Also included is a simple ChallengeRequirements impelementation for layered proofs. This ensures that the total number of challenges across all partitions is at least some minimum. For now, I set the minimum for all PoReps created from the API at 1. So this should never fail. Eventually, this should prevent us from creating configurations (or somehow accidentally attempting to verify proofs) which don't meet challenge security.

Testing this will be a bit annoying, so I leave that for later when we have something meaningful to test.

}

#[derive(Default)]
pub struct NoRequirements();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can make this an empty struct: pub struct NoRequirements, that way you should be able to pass it as my_fn(&NoRequirements) instead of the my_fn(&NoRequirements())

dignifiedquire
dignifiedquire previously approved these changes Apr 16, 2019
Copy link
Contributor

@dignifiedquire dignifiedquire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, once CI is fixed

@porcuquine porcuquine force-pushed the compound-requirements branch 2 times, most recently from 099142c to 0bd839e Compare April 16, 2019 23:13
@porcuquine porcuquine force-pushed the compound-requirements branch from 0bd839e to a1a00d1 Compare April 16, 2019 23:26
@porcuquine porcuquine merged commit 308d408 into master Apr 17, 2019
@porcuquine porcuquine deleted the compound-requirements branch April 17, 2019 00:22
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.

2 participants