Currently, there's only 1 private kernel circuit.
That means for the very first iteration, we need to generate dummy 'previous kernel data'. The way we generate this data is inefficient, and the way we generate this data is inefficient (because we're currently generating actual VKs over a mock circuit).
Todo:
- Separate c_bind for calling the initial native previous kernel circuit
- A new struct for
InitialPrivateKernelInputs and InitialPrivateKernelPublicInputs
- Remove code which generates a dummy previous kernel (unless needed for testing, but I don't think we'll need that)
- Write an initial native previous kernel circuit, which skips 'previous kernel proof verification' and any 'recursive case' logic
- Make sure to re-use common codepaths between this circuit and the existing 'recursive' private kernel circuit (refactor to put functions in common files, if needed).
- Make sure this circuit can only be called in the 'base case' (by including appropriate assertions inside the circuit)
- Update the existing 'recursive' private kernel circuit:
- remove:
- The signature verification
- TxRequest validation (we might even be able to remove the SignedTxRequest input altogether)
- The 'base case' logic
- Contract deployment logic (for now)
- keep:
- Verification of the 'previous kernel data'
- recursive case logic
- etc.
- new:
- A check on the previous kernel data's verification key -- that it matches the hard-coded one of the initial kernel circuit, when executing private_call_count = 2. (I.e. we're enforcing that private_call_count = 1 used the 'initial' circuit).
- Note: for subsequent iterations of the kernel circuit, we can't check the verification key within the kernel circuit, because that's cyclic! We defer such verification key checks to the base rollup circuit. (A separate issue will be opened for this).
- Typescript:
- Work with someone to make corresponding changes to all the typescript code (mainly in the
kernel-prover package), including structs.
Currently, there's only 1 private kernel circuit.
That means for the very first iteration, we need to generate dummy 'previous kernel data'. The way we generate this data is inefficient, and the way we generate this data is inefficient (because we're currently generating actual VKs over a mock circuit).
Todo:
InitialPrivateKernelInputsandInitialPrivateKernelPublicInputskernel-proverpackage), including structs.