Skip to main content

FeatureFlags

FeatureFlags: {
"allMaybe": {
"foreignFieldAdd": undefined;
"foreignFieldMul": undefined;
"lookup": undefined;
"rangeCheck0": undefined;
"rangeCheck1": undefined;
"rot": undefined;
"runtimeTables": undefined;
"xor": undefined;
};
"allNone": {
"foreignFieldAdd": false;
"foreignFieldMul": false;
"lookup": false;
"rangeCheck0": false;
"rangeCheck1": false;
"rot": false;
"runtimeTables": false;
"xor": false;
};
"fromGates": featureFlagsFromGates;
"fromZkProgram": (program: AnalysableProgram) => Promise<FeatureFlags>;
"fromZkProgramList": (programs: AnalysableProgram[]) => Promise<FeatureFlags>;
};

Feature flags indicate what custom gates are used in a proof of circuit. Side loading, for example, requires a set of feature flags in advance (at compile time) in order to verify and side load proofs. If the side loaded proofs and verification keys do not match the specified feature flag configurations, the verification will fail. Flags specified as undefined are considered as maybe by Pickles. This means, proofs can be sided loaded that can, but don't have to, use a specific custom gate. Note: Maybe feature flags incur a proving overhead.

Type declaration

allMaybe

allMaybe: {
"foreignFieldAdd": undefined;
"foreignFieldMul": undefined;
"lookup": undefined;
"rangeCheck0": undefined;
"rangeCheck1": undefined;
"rot": undefined;
"runtimeTables": undefined;
"xor": undefined;
};

Returns a feature flag configuration where all flags are optional.

allMaybe.foreignFieldAdd

foreignFieldAdd: undefined = undefined;

allMaybe.foreignFieldMul

foreignFieldMul: undefined = undefined;

allMaybe.lookup

lookup: undefined = undefined;

allMaybe.rangeCheck0

rangeCheck0: undefined = undefined;

allMaybe.rangeCheck1

rangeCheck1: undefined = undefined;

allMaybe.rot

rot: undefined = undefined;

allMaybe.runtimeTables

runtimeTables: undefined = undefined;

allMaybe.xor

xor: undefined = undefined;

allNone

allNone: {
"foreignFieldAdd": false;
"foreignFieldMul": false;
"lookup": false;
"rangeCheck0": false;
"rangeCheck1": false;
"rot": false;
"runtimeTables": false;
"xor": false;
};

Returns a feature flag configuration where all flags are set to false.

allNone.foreignFieldAdd

foreignFieldAdd: boolean = false;

allNone.foreignFieldMul

foreignFieldMul: boolean = false;

allNone.lookup

lookup: boolean = false;

allNone.rangeCheck0

rangeCheck0: boolean = false;

allNone.rangeCheck1

rangeCheck1: boolean = false;

allNone.rot

rot: boolean = false;

allNone.runtimeTables

runtimeTables: boolean = false;

allNone.xor

xor: boolean = false;

fromGates()

fromGates: (gates: Gate[]) => FeatureFlags = featureFlagsFromGates;

Given a list of gates, returns the feature flag configuration that the gates use.

Parameters

gates: Gate[]

Returns

FeatureFlags

fromZkProgram()

fromZkProgram: (program: AnalysableProgram) => Promise<FeatureFlags>;

Given a ZkProgram, return the feature flag configuration that fits the given program. This function considers all methods of the specified ZkProgram and finds a configuration that fits all.

Parameters

program: AnalysableProgram

Returns

Promise\<FeatureFlags>

fromZkProgramList()

fromZkProgramList: (programs: AnalysableProgram[]) => Promise<FeatureFlags>;

Parameters

programs: AnalysableProgram[]

Returns

Promise\<FeatureFlags>

Source

lib/proof-system/zkprogram.ts:90