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

commented Apr 16, 2019

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.

@porcuquine porcuquine requested review from dignifiedquire and laser as code owners Apr 16, 2019

@porcuquine porcuquine force-pushed the compound-requirements branch from 6c1f0c9 to 14166be Apr 16, 2019

}

#[derive(Default)]
pub struct NoRequirements();

This comment has been minimized.

Copy link
@dignifiedquire

dignifiedquire Apr 16, 2019

Member

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
Copy link
Member

left a comment

lgtm, once CI is fixed

@porcuquine porcuquine force-pushed the compound-requirements branch 2 times, most recently from 099142c to 0bd839e Apr 16, 2019

@porcuquine porcuquine force-pushed the compound-requirements branch from 0bd839e to a1a00d1 Apr 16, 2019

@porcuquine porcuquine merged commit 308d408 into master Apr 17, 2019

11 checks passed

ci/circleci: bench_nightly Your tests passed on CircleCI!
Details
ci/circleci: build_darwin_release Your tests passed on CircleCI!
Details
ci/circleci: build_linux_release Your tests passed on CircleCI!
Details
ci/circleci: cargo_fetch Your tests passed on CircleCI!
Details
ci/circleci: clippy Your tests passed on CircleCI!
Details
ci/circleci: ffi_regression Your tests passed on CircleCI!
Details
ci/circleci: rustfmt Your tests passed on CircleCI!
Details
ci/circleci: test Your tests passed on CircleCI!
Details
ci/circleci: test_ignored_release Your tests passed on CircleCI!
Details
ci/circleci: test_nightly Your tests passed on CircleCI!
Details
ci/circleci: test_release Your tests passed on CircleCI!
Details

@porcuquine porcuquine deleted the compound-requirements branch Apr 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.