From 7b1e56489f84ef93a74290d537dd3ede3b5759e8 Mon Sep 17 00:00:00 2001 From: Mitchell Tracy Date: Fri, 9 Feb 2024 13:52:39 -0500 Subject: [PATCH] cleanup and comment --- .../kernel/combined_accumulated_data.ts | 6 +-- ...ate_kernel_inner_circuit_private_inputs.ts | 2 +- ...vate_kernel_inner_circuit_public_inputs.ts | 5 +- ...vate_kernel_tail_circuit_private_inputs.ts | 3 ++ ...ivate_kernel_tail_circuit_public_inputs.ts | 3 ++ .../kernel/private_kernel_tail_data.ts | 4 +- .../public_kernel_circuit_public_inputs.ts | 4 ++ .../src/structs/kernel/public_kernel_data.ts | 2 +- .../structs/private_circuit_public_inputs.ts | 2 +- .../circuits.js/src/tests/factories.ts | 38 +++++++------- .../crates/public-kernel-lib/src/common.nr | 30 +---------- .../src/public_kernel_app_logic.nr | 2 +- .../src/public_kernel_setup.nr | 2 +- .../noir-protocol-circuits/src/index.ts | 16 +++--- .../src/type_conversion.ts | 50 +++++++------------ .../pxe/src/kernel_prover/proof_creator.ts | 4 +- .../src/sequencer/abstract_phase_manager.ts | 16 +++--- .../application_logic_phase_manager.ts | 2 +- 18 files changed, 81 insertions(+), 110 deletions(-) diff --git a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts index 366c63c011a..028c0d4088c 100644 --- a/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/combined_accumulated_data.ts @@ -456,15 +456,15 @@ export class FinalAccumulatedData { export class AccumulatedNonRevertibleData { constructor( /** - * The new commitments made in this transaction. + * The new non-revertible commitments made in this transaction. */ public newCommitments: Tuple, /** - * The new nullifiers made in this transaction. + * The new non-revertible nullifiers made in this transaction. */ public newNullifiers: Tuple, /** - * Current public call stack. + * Current public call stack that will produce non-revertible side effects. */ public publicCallStack: Tuple, ) {} diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_private_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_private_inputs.ts index ea08dffe155..233f2d015b2 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_private_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_private_inputs.ts @@ -9,7 +9,7 @@ import { PrivateKernelInnerData } from './private_kernel_inner_data.js'; export class PrivateKernelInnerCircuitPrivateInputs { constructor( /** - * The previous kernel data (dummy if this is the first kernel). + * The previous kernel data */ public previousKernel: PrivateKernelInnerData, /** diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_public_inputs.ts index 90cd3b8f597..510759d072b 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_inner_circuit_public_inputs.ts @@ -5,6 +5,9 @@ import { AggregationObject } from '../aggregation_object.js'; import { CombinedAccumulatedData } from './combined_accumulated_data.js'; import { CombinedConstantData } from './combined_constant_data.js'; +/** + * Public inputs to the inner private kernel circuit + */ export class PrivateKernelInnerCircuitPublicInputs { constructor( /** @@ -12,7 +15,7 @@ export class PrivateKernelInnerCircuitPublicInputs { */ public aggregationObject: AggregationObject, // Contains the aggregated proof of all previous kernel iterations /** - * The side effect counter that meta side effects are all beneath. + * The side effect counter that non-revertible side effects are all beneath. */ public maxNonRevertibleSideEffectCounter: Fr, /** diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts index 2106226e48a..a3e2a3edc7b 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_private_inputs.ts @@ -11,6 +11,9 @@ import { Fr, GrumpkinScalar } from '../index.js'; import { SideEffect, SideEffectLinkedToNoteHash } from '../side_effects.js'; import { PrivateKernelInnerData } from './private_kernel_inner_data.js'; +/** + * Input to the private kernel circuit - tail call. + */ export class PrivateKernelTailCircuitPrivateInputs { constructor( /** diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts index 0b5e0dcf48e..55d852313f5 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_circuit_public_inputs.ts @@ -4,6 +4,9 @@ import { AggregationObject } from '../aggregation_object.js'; import { AccumulatedNonRevertibleData, FinalAccumulatedData } from './combined_accumulated_data.js'; import { CombinedConstantData } from './combined_constant_data.js'; +/** + * Output from to the private kernel circuit - tail call. + */ export class PrivateKernelTailCircuitPublicInputs { constructor( /** diff --git a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_data.ts b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_data.ts index 0f5c0819daf..52afd0a3efd 100644 --- a/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/private_kernel_tail_data.ts @@ -9,12 +9,12 @@ import { VerificationKey } from '../verification_key.js'; import { PrivateKernelTailCircuitPublicInputs } from './private_kernel_tail_circuit_public_inputs.js'; /** - * Data of the previous kernel iteration in the chain of kernels. + * Data of the private kernel tail. */ export class PrivateKernelTailData { constructor( /** - * Public inputs of the previous kernel. + * Outputs of the private kernel tail. */ public publicInputs: PrivateKernelTailCircuitPublicInputs, /** diff --git a/yarn-project/circuits.js/src/structs/kernel/public_kernel_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/kernel/public_kernel_circuit_public_inputs.ts index fe30e841000..ded0fb6ace4 100644 --- a/yarn-project/circuits.js/src/structs/kernel/public_kernel_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/kernel/public_kernel_circuit_public_inputs.ts @@ -4,6 +4,10 @@ import { AggregationObject } from '../aggregation_object.js'; import { AccumulatedNonRevertibleData, CombinedAccumulatedData } from './combined_accumulated_data.js'; import { CombinedConstantData } from './combined_constant_data.js'; +/** + * Outputs from the public kernel circuits. + * All Public kernels use this shape for outputs. + */ export class PublicKernelCircuitPublicInputs { constructor( /** diff --git a/yarn-project/circuits.js/src/structs/kernel/public_kernel_data.ts b/yarn-project/circuits.js/src/structs/kernel/public_kernel_data.ts index 3977c698574..2dfcb7fe992 100644 --- a/yarn-project/circuits.js/src/structs/kernel/public_kernel_data.ts +++ b/yarn-project/circuits.js/src/structs/kernel/public_kernel_data.ts @@ -9,7 +9,7 @@ import { VerificationKey } from '../verification_key.js'; import { PublicKernelCircuitPublicInputs } from './public_kernel_circuit_public_inputs.js'; /** - * Data of the previous kernel iteration in the chain of kernels. + * Data of the previous public kernel iteration in the chain of kernels. */ export class PublicKernelData { constructor( diff --git a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts index d5f3a71b6bd..03d7501ceb9 100644 --- a/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts +++ b/yarn-project/circuits.js/src/structs/private_circuit_public_inputs.ts @@ -42,7 +42,7 @@ export class PrivateCircuitPublicInputs { */ public returnValues: Tuple, /** - * The side-effect high watermark of the irrevertible part of the function call. + * The side-effect counter under which all side effects are non-revertible. */ public maxNonRevertibleSideEffectCounter: Fr, /** diff --git a/yarn-project/circuits.js/src/tests/factories.ts b/yarn-project/circuits.js/src/tests/factories.ts index ccfa7c48e06..3ea1a2b196e 100644 --- a/yarn-project/circuits.js/src/tests/factories.ts +++ b/yarn-project/circuits.js/src/tests/factories.ts @@ -289,11 +289,11 @@ export function makeFinalAccumulatedData(seed = 1, full = false): FinalAccumulat } /** - * Creates arbitrary accumulated data for a Tx's meta phase. + * Creates arbitrary accumulated data for a Tx's non-revertible side effects. * @param seed - The seed to use for generating the data. - * @returns An instance of AccumulatedMetaData. + * @returns An instance of AccumulatedNonRevertibleData. */ -export function makeAccumulatedMetaData(seed = 1, full = false): AccumulatedNonRevertibleData { +export function makeAccumulatedNonRevertibleData(seed = 1, full = false): AccumulatedNonRevertibleData { const tupleGenerator = full ? makeTuple : makeHalfFullTuple; return new AccumulatedNonRevertibleData( @@ -376,9 +376,9 @@ export function makePublicCircuitPublicInputs( } /** - * Creates arbitrary kernel circuit public inputs. + * Creates arbitrary public kernel circuit public inputs. * @param seed - The seed to use for generating the kernel circuit public inputs. - * @returns Kernel circuit public inputs. + * @returns Public kernel circuit public inputs. */ export function makePublicKernelCircuitPublicInputs( seed = 1, @@ -386,16 +386,16 @@ export function makePublicKernelCircuitPublicInputs( ): PublicKernelCircuitPublicInputs { return new PublicKernelCircuitPublicInputs( makeAggregationObject(seed), - makeAccumulatedMetaData(seed, fullAccumulatedData), + makeAccumulatedNonRevertibleData(seed, fullAccumulatedData), makeAccumulatedData(seed, fullAccumulatedData), makeConstantData(seed + 0x100), true, ); } /** - * Creates arbitrary kernel circuit public inputs. + * Creates arbitrary private kernel inner circuit public inputs. * @param seed - The seed to use for generating the kernel circuit public inputs. - * @returns Kernel circuit public inputs. + * @returns Private kernel circuit public inputs. */ export function makePrivateKernelInnerCircuitPublicInputs( seed = 1, @@ -411,14 +411,14 @@ export function makePrivateKernelInnerCircuitPublicInputs( } /** - * Creates arbitrary kernel circuit public inputs. + * Creates arbitrary private kernel tail circuit public inputs. * @param seed - The seed to use for generating the kernel circuit public inputs. - * @returns Kernel circuit public inputs. + * @returns Private kernel tail circuit public inputs. */ export function makePrivateKernelTailCircuitPublicInputs(seed = 1, full = true): PrivateKernelTailCircuitPublicInputs { return new PrivateKernelTailCircuitPublicInputs( makeAggregationObject(seed), - makeAccumulatedMetaData(seed, full), + makeAccumulatedNonRevertibleData(seed, full), makeFinalAccumulatedData(seed, full), makeConstantData(seed + 0x100), true, @@ -518,9 +518,9 @@ export function makeGrumpkinPrivateKey(seed = 1): GrumpkinPrivateKey { } /** - * Makes arbitrary previous kernel data. + * Makes arbitrary public kernel data. * @param seed - The seed to use for generating the previous kernel data. - * @param kernelPublicInputs - The kernel public inputs to use for generating the previous kernel data. + * @param kernelPublicInputs - The public kernel public inputs to use for generating the public kernel data. * @returns A previous kernel data. */ export function makePublicKernelData(seed = 1, kernelPublicInputs?: PublicKernelCircuitPublicInputs): PublicKernelData { @@ -536,7 +536,7 @@ export function makePublicKernelData(seed = 1, kernelPublicInputs?: PublicKernel /** * Makes arbitrary previous kernel data. * @param seed - The seed to use for generating the previous kernel data. - * @param inputs - The kernel public inputs to use for generating the previous kernel data. + * @param inputs - The kernel public inputs to use for generating the private kernel inner data. * @returns A previous kernel data. */ export function makePrivateKernelInnerData( @@ -562,18 +562,18 @@ export function makeProof(seed = 1) { } /** - * Makes arbitrary private kernel inputs - initial call. + * Makes arbitrary private kernel init private inputs * @param seed - The seed to use for generating the private kernel inputs. - * @returns Private kernel inputs. + * @returns Private kernel init private inputs. */ export function makePrivateKernelInitCircuitPrivateInputs(seed = 1): PrivateKernelInitCircuitPrivateInputs { return new PrivateKernelInitCircuitPrivateInputs(makeTxRequest(seed), makePrivateCallData(seed + 0x1000)); } /** - * Makes arbitrary private kernel inputs - inner call. + * Makes arbitrary private kernel inner private inputs * @param seed - The seed to use for generating the private kernel inputs. - * @returns Private kernel inputs. + * @returns Private kernel inner private inputs. */ export function makePrivateKernelInnerCircuitPrivateInputs(seed = 1): PrivateKernelInnerCircuitPrivateInputs { return new PrivateKernelInnerCircuitPrivateInputs( @@ -644,7 +644,7 @@ export function makePublicKernelCircuitPrivateInputs(seed = 1): PublicKernelCirc } /** - * Makes arbitrary public kernel inputs. + * Makes arbitrary public kernel private inputs. * @param seed - The seed to use for generating the public kernel inputs. * @param tweak - An optional function to tweak the output before computing hashes. * @returns Public kernel inputs. diff --git a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/common.nr b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/common.nr index 9b25b414b8d..8841ecd5bee 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/common.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/common.nr @@ -54,35 +54,7 @@ pub fn validate_inputs(public_call: PublicCallData) { assert(public_call.bytecode_hash != 0, "Bytecode hash cannot be zero"); } -pub fn initialize_end_values_from_private_kernel_tail_data( - previous_kernel: PrivateKernelTailData, - circuit_outputs: &mut PublicKernelCircuitPublicInputsBuilder -) { - // Initialises the circuit outputs with the end state of the previous iteration - circuit_outputs.constants = previous_kernel.public_inputs.constants; - - // Ensure the arrays are the same as previously, before we start pushing more data onto them in other - // functions within this circuit: - let start = previous_kernel.public_inputs.end; - - circuit_outputs.end.new_commitments = array_to_bounded_vec(start.new_commitments); - circuit_outputs.end.new_nullifiers = array_to_bounded_vec(start.new_nullifiers); - - circuit_outputs.end.private_call_stack = array_to_bounded_vec(start.private_call_stack); - circuit_outputs.end.public_call_stack = array_to_bounded_vec(start.public_call_stack); - circuit_outputs.end.new_l2_to_l1_msgs = array_to_bounded_vec(start.new_l2_to_l1_msgs); - - circuit_outputs.end.public_data_update_requests = BoundedVec::new(PublicDataUpdateRequest::empty()); - circuit_outputs.end.public_data_reads = BoundedVec::new(PublicDataRead::empty()); - - // Public kernel does not modify encrypted logs values --> we just copy them to output - circuit_outputs.end.encrypted_logs_hash = start.encrypted_logs_hash; - circuit_outputs.end.encrypted_log_preimages_length = start.encrypted_log_preimages_length; - - circuit_outputs.end.new_contracts = array_to_bounded_vec(previous_kernel.public_inputs.end.new_contracts); -} - -pub fn initialize_end_values_from_public_kernel_data( +pub fn initialize_end_values( previous_kernel: PublicKernelData, circuit_outputs: &mut PublicKernelCircuitPublicInputsBuilder ) { diff --git a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_app_logic.nr b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_app_logic.nr index a6d82704e9f..b5b7089aaff 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_app_logic.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_app_logic.nr @@ -25,7 +25,7 @@ impl PublicKernelAppLogicCircuitPrivateInputs { let mut public_inputs: PublicKernelCircuitPublicInputsBuilder = unsafe::zeroed(); // initialise the end state with our provided previous kernel state - common::initialize_end_values_from_public_kernel_data(self.previous_kernel, &mut public_inputs); + common::initialize_end_values(self.previous_kernel, &mut public_inputs); // validate the inputs common to all invocation circumstances common::validate_inputs(self.public_call); diff --git a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_setup.nr b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_setup.nr index a5c09cf3e39..05594ed0f2a 100644 --- a/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_setup.nr +++ b/yarn-project/noir-protocol-circuits/src/crates/public-kernel-lib/src/public_kernel_setup.nr @@ -43,7 +43,7 @@ impl PublicKernelSetupCircuitPrivateInputs { let mut public_inputs: PublicKernelCircuitPublicInputsBuilder = unsafe::zeroed(); // initialise the end state with our provided previous kernel state - common::initialize_end_values_from_public_kernel_data(self.previous_kernel, &mut public_inputs); + common::initialize_end_values(self.previous_kernel, &mut public_inputs); // validate the inputs common to all invocation circumstances common::validate_inputs(self.public_call); diff --git a/yarn-project/noir-protocol-circuits/src/index.ts b/yarn-project/noir-protocol-circuits/src/index.ts index 588391fa5c5..303bc90f52b 100644 --- a/yarn-project/noir-protocol-circuits/src/index.ts +++ b/yarn-project/noir-protocol-circuits/src/index.ts @@ -112,7 +112,7 @@ const getSolver = (): Promise => { /** * Executes the inner private kernel. - * @param privateKernelInitCircuitPrivateInputs - The private inputs to the inner private kernel. + * @param privateKernelInnerCircuitPrivateInputs - The private inputs to the inner private kernel. * @returns The public inputs. */ export async function executeInner( @@ -129,7 +129,7 @@ export async function executeInner( /** * Executes the tail private kernel. - * @param privateKernelInputsTail - The private inputs to the tail private kernel. + * @param privateKernelInnerCircuitPrivateInputs - The private inputs to the tail private kernel. * @returns The public inputs. */ export async function executeTail( @@ -145,8 +145,8 @@ export async function executeTail( } /** - * Executes the public kernel. - * @param privateKernelInputsInit - The public kernel private inputs. + * Executes the public kernel in the setup phase. + * @param publicKernelPrivateInputs - The public kernel setup circuit private inputs. * @returns The public inputs. */ export async function executePublicKernelSetup( @@ -162,8 +162,8 @@ export async function executePublicKernelSetup( } /** - * Executes the inner public kernel. - * @param privateKernelInputsInit - The public kernel private inputs. + * Executes the public kernel in the app logic phase. + * @param publicKernelPrivateInputs - The public kernel app logic circuit private inputs. * @returns The public inputs. */ export async function executePublicKernelAppLogic( @@ -173,7 +173,7 @@ export async function executePublicKernelAppLogic( input: mapPublicKernelCircuitPrivateInputsToNoir(publicKernelPrivateInputs), }; - const returnType = await executePublicKernelPublicPreviousWithACVM(params); + const returnType = await executePublicKernelAppLogicWithACVM(params); return mapPublicKernelCircuitPublicInputsFromNoir(returnType); } @@ -333,7 +333,7 @@ async function executePublicKernelSetupWithACVM(input: PublicSetupInputType): Pr /** * Executes the ordering private kernel with the given inputs using the acvm. */ -async function executePublicKernelPublicPreviousWithACVM( +async function executePublicKernelAppLogicWithACVM( input: PublicPublicPreviousInputType, ): Promise { const initialWitnessMap = abiEncode(PublicKernelPublicPreviousSimulatedJson.abi as Abi, input as any); diff --git a/yarn-project/noir-protocol-circuits/src/type_conversion.ts b/yarn-project/noir-protocol-circuits/src/type_conversion.ts index 7da7577a011..eb0672a417e 100644 --- a/yarn-project/noir-protocol-circuits/src/type_conversion.ts +++ b/yarn-project/noir-protocol-circuits/src/type_conversion.ts @@ -404,20 +404,6 @@ export function mapFunctionDataFromNoir(functionData: FunctionDataNoir): Functio ); } -/** - * Maps a tx request to a noir tx request. - * @param txRequest - The tx request. - * @returns The noir tx request. - */ -export function mapTxRequestFromNoir(txRequest: TxRequestNoir): TxRequest { - return new TxRequest( - mapAztecAddressFromNoir(txRequest.origin), - mapFunctionDataFromNoir(txRequest.function_data), - mapFieldFromNoir(txRequest.args_hash), - mapTxContextFromNoir(txRequest.tx_context), - ); -} - /** * Maps a tx request to a noir tx request. * @param txRequest - The tx request. @@ -1044,9 +1030,9 @@ export function mapPublicKernelCircuitPublicInputsToNoir( } /** - * Maps a previous kernel data to a noir previous kernel data. - * @param previousKernelData - The previous kernel data. - * @returns The noir previous kernel data. + * Maps a public kernel inner data to a noir public kernel data. + * @param publicKernelData - The public kernel inner data. + * @returns The noir public kernel data. */ export function mapPublicKernelDataToNoir(publicKernelData: PublicKernelData): PublicKernelDataNoir { return { @@ -1083,26 +1069,26 @@ export function mapPrivateKernelInnerCircuitPublicInputsToNoir( } /** - * Maps a previous kernel data to a noir previous kernel data. - * @param previousKernelData - The previous kernel data. - * @returns The noir previous kernel data. + * Maps a private kernel inner data to a noir private kernel inner data. + * @param privateKernelInnerData - The private kernel inner data. + * @returns The noir private kernel inner data. */ export function mapPrivateKernelInnerDataToNoir( - previousKernelData: PrivateKernelInnerData, + privateKernelInnerData: PrivateKernelInnerData, ): PrivateKernelInnerDataNoir { return { - public_inputs: mapPrivateKernelInnerCircuitPublicInputsToNoir(previousKernelData.publicInputs), + public_inputs: mapPrivateKernelInnerCircuitPublicInputsToNoir(privateKernelInnerData.publicInputs), proof: {}, vk: {}, - vk_index: mapFieldToNoir(new Fr(previousKernelData.vkIndex)), - vk_path: mapTuple(previousKernelData.vkPath, mapFieldToNoir), + vk_index: mapFieldToNoir(new Fr(privateKernelInnerData.vkIndex)), + vk_path: mapTuple(privateKernelInnerData.vkPath, mapFieldToNoir), }; } /** - * Maps combined accumulated data to noir combined accumulated data. - * @param finalAccumulatedData - The combined accumulated data. - * @returns The noir combined accumulated data. + * Maps final accumulated data to noir final accumulated data. + * @param finalAccumulatedData - The final accumulated data. + * @returns The noir final accumulated data. */ export function mapFinalAccumulatedDataToNoir(finalAccumulatedData: FinalAccumulatedData): FinalAccumulatedDataNoir { return { @@ -1144,16 +1130,16 @@ export function mapPrivateKernelTailCircuitPublicInputsToNoir( } /** - * Maps the inputs to the private kernel inner to the noir representation. - * @param privateKernelInputsInit - The inputs to the private kernel inner. + * Maps the private inputs to the private kernel inner to the noir representation. + * @param privateKernelInnerCircuitPrivateInputs - The private inputs to the private kernel inner. * @returns The noir representation of those inputs. */ export function mapPrivateKernelInnerCircuitPrivateInputsToNoir( - privateKernelInputsInit: PrivateKernelInnerCircuitPrivateInputs, + privateKernelInnerCircuitPrivateInputs: PrivateKernelInnerCircuitPrivateInputs, ): PrivateKernelInnerCircuitPrivateInputsNoir { return { - previous_kernel: mapPrivateKernelInnerDataToNoir(privateKernelInputsInit.previousKernel), - private_call: mapPrivateCallDataToNoir(privateKernelInputsInit.privateCall), + previous_kernel: mapPrivateKernelInnerDataToNoir(privateKernelInnerCircuitPrivateInputs.previousKernel), + private_call: mapPrivateCallDataToNoir(privateKernelInnerCircuitPrivateInputs.privateCall), }; } diff --git a/yarn-project/pxe/src/kernel_prover/proof_creator.ts b/yarn-project/pxe/src/kernel_prover/proof_creator.ts index 03746dcd5f4..de2f0aeddd4 100644 --- a/yarn-project/pxe/src/kernel_prover/proof_creator.ts +++ b/yarn-project/pxe/src/kernel_prover/proof_creator.ts @@ -77,10 +77,10 @@ export interface ProofCreator { /** * Creates a proof output based on the last inner kernel iteration kernel data for the final ordering iteration. * - * @param privateKernelInputsOrdering - The private input data structure for the final ordering iteration. + * @param privateKernelInputsTail - The private input data structure for the final ordering iteration. * @returns A Promise resolving to a ProofOutput object containing public inputs and the kernel proof. */ - createProofTail(privateKernelInputsOrdering: PrivateKernelTailCircuitPrivateInputs): Promise; + createProofTail(privateKernelInputsTail: PrivateKernelTailCircuitPrivateInputs): Promise; } /** diff --git a/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts index 9e7b83bb8a8..06878347113 100644 --- a/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/abstract_phase_manager.ts @@ -74,12 +74,12 @@ export abstract class AbstractPhaseManager { /** * * @param tx - the tx to be processed - * @param previousPublicKernelOutput - the output of the public kernel circuit for the previous phase + * @param publicKernelPublicInputs - the output of the public kernel circuit for the previous phase * @param previousPublicKernelProof - the proof of the public kernel circuit for the previous phase */ abstract handle( tx: Tx, - previousPublicKernelOutput?: PublicKernelCircuitPublicInputs, + publicKernelPublicInputs?: PublicKernelCircuitPublicInputs, previousPublicKernelProof?: Proof, ): Promise<{ /** @@ -99,25 +99,25 @@ export abstract class AbstractPhaseManager { protected getKernelOutputAndProof( tx: Tx, - previousPublicKernelOutput?: PublicKernelCircuitPublicInputs, + publicKernelPublicInput?: PublicKernelCircuitPublicInputs, previousPublicKernelProof?: Proof, ): { /** * the output of the public kernel circuit for this phase */ - publicKernelOutput: PublicKernelCircuitPublicInputs; + publicKernelPublicInput: PublicKernelCircuitPublicInputs; /** * the proof of the public kernel circuit for this phase */ publicKernelProof: Proof; } { - if (previousPublicKernelOutput && previousPublicKernelProof) { + if (publicKernelPublicInput && previousPublicKernelProof) { return { - publicKernelOutput: previousPublicKernelOutput, + publicKernelPublicInput: publicKernelPublicInput, publicKernelProof: previousPublicKernelProof, }; } else { - const publicKernelOutput = new PublicKernelCircuitPublicInputs( + const publicKernelPublicInput = new PublicKernelCircuitPublicInputs( tx.data.aggregationObject, tx.data.endNonRevertibleData, CombinedAccumulatedData.fromFinalAccumulatedData(tx.data.end), @@ -126,7 +126,7 @@ export abstract class AbstractPhaseManager { ); const publicKernelProof = previousPublicKernelProof || tx.proof; return { - publicKernelOutput, + publicKernelPublicInput, publicKernelProof, }; } diff --git a/yarn-project/sequencer-client/src/sequencer/application_logic_phase_manager.ts b/yarn-project/sequencer-client/src/sequencer/application_logic_phase_manager.ts index 33a09f7d18b..0d53e0dcf78 100644 --- a/yarn-project/sequencer-client/src/sequencer/application_logic_phase_manager.ts +++ b/yarn-project/sequencer-client/src/sequencer/application_logic_phase_manager.ts @@ -63,7 +63,7 @@ export class ApplicationLogicPhaseManager extends AbstractPhaseManager { this.log(`Executing enqueued public calls for tx ${await tx.getTxHash()}`); const [publicKernelOutput, publicKernelProof, newUnencryptedFunctionLogs] = await this.processEnqueuedPublicCalls( this.extractEnqueuedPublicCalls(tx), - outputAndProof.publicKernelOutput, + outputAndProof.publicKernelPublicInput, outputAndProof.publicKernelProof, ); tx.unencryptedLogs.addFunctionLogs(newUnencryptedFunctionLogs);