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

Specify feature flags for Pickles.sideLoaded #1688

Merged
merged 19 commits into from
Jun 18, 2024
Merged

Specify feature flags for Pickles.sideLoaded #1688

merged 19 commits into from
Jun 18, 2024

Conversation

Trivo25
Copy link
Member

@Trivo25 Trivo25 commented Jun 17, 2024

Allows of custom specification of feature flags under the DynamicProof class

bindings o1-labs/o1js-bindings#277

closes #1686

@Trivo25 Trivo25 marked this pull request as ready for review June 17, 2024 15:41
src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
src/snarky.d.ts Show resolved Hide resolved
* You can also toggle specific feature flags manually by specifying them here.
* Alternatively, you can use {@FeatureFlags.fromZkProgram} to compute the set of feature flags that are compatible with a given program.
*/
static featureFlags: FeatureFlags = FeatureFlags.allMaybe;
Copy link
Contributor

Choose a reason for hiding this comment

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

isn't changing the default from None to Maybe a breaking change?

I do agree that maybe makes sense as the default

Copy link
Member Author

Choose a reason for hiding this comment

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

Yea it does, sadly.. I'll set it to none for now to maintain backwards compatibility :/ The good thing is developers will notice that they need to change something when proofs with different feature flags wont verify

src/lib/proof-system/zkprogram.ts Outdated Show resolved Hide resolved
* You can also toggle specific feature flags manually by specifying them here.
* Alternatively, you can use {@FeatureFlags.fromZkProgram} to compute the set of feature flags that are compatible with a given program.
*/
static featureFlags: FeatureFlags = FeatureFlags.allMaybe;
Copy link
Member Author

Choose a reason for hiding this comment

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

Yea it does, sadly.. I'll set it to none for now to maintain backwards compatibility :/ The good thing is developers will notice that they need to change something when proofs with different feature flags wont verify

return flags;
}

function featureFlagsToMlOption(
Copy link
Member Author

@Trivo25 Trivo25 Jun 17, 2024

Choose a reason for hiding this comment

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

I removed the old binary true | false feature flag data structure and replaced it entirely with the new option one, in picklesRuleFromFunction as well so we dont have to maintain multiple of these conversion helpers

Copy link
Contributor

@mitschabaude mitschabaude left a comment

Choose a reason for hiding this comment

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

One final comment, otherwise lgtm!

@@ -40,6 +37,7 @@ import {
import { ProvablePure } from '../provable/types/provable-intf.js';
import { prefixToField } from '../../bindings/lib/binable.js';
import { prefixes } from '../../bindings/crypto/constants.js';
import { rangeCheck0 } from '../provable/gates.js';
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this import is accidental and doesn't belong here

@Trivo25 Trivo25 merged commit 9bf12d0 into main Jun 18, 2024
14 checks passed
@Trivo25 Trivo25 deleted the feature-flag-fix branch June 18, 2024 08:15
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.

Support feature flags for side-loaded keys
3 participants