Skip to content

Commit

Permalink
Remove unused parameter from test
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Jan 23, 2025
1 parent 58f812d commit 2fcdf47
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,4 @@
{
"previous_kernel": {
"vk_index": "0x0000000000000000000000000000000000000000000000000000000000000000",
"vk_path": [
"0x2dfa37092c9cca237d7e0084a19c1df04ce87aeb55e6b21ed0af3ec3d9251922",
"0x03325592c83286ae329c189ebf786a670f3e725ee33f2d3f1b896d42cff8bc2d",
"0x16a08888ccd11c969022000b4dfec40345b611dfec379c79ebacdd8bfc4faed6",
"0x2c8b742477af94eb3d371b8aeef0f9a8d930466cfe240ca1b7c504b0b4492d22",
"0x126bb13ce4b07681f511f3a23d88cb7cfe082a76730abd5b4be5c4da3b5c51fb",
"0x050dc6390aace9c6e873b762c65e7d6a21e78e64e5ad6cc7c8fd5e69315ab5fe"
]
},
"previous_kernel_public_inputs": {
"end": {
"private_call_stack": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ pub global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: u32 = 8;
pub global VK_TREE_HEIGHT: u32 = 6;

unconstrained fn main(
previous_kernel: PrivateKernelDataWithoutPublicInputs,
previous_kernel_public_inputs: PrivateKernelCircuitPublicInputs,
) -> pub PrivateKernelCircuitPublicInputs {
let private_inputs =
PrivateKernelInnerCircuitPrivateInputs::new(previous_kernel, previous_kernel_public_inputs);
PrivateKernelInnerCircuitPrivateInputs::new(previous_kernel_public_inputs);
private_inputs.execute()
}

Expand All @@ -18,13 +17,6 @@ pub struct PrivateKernelCircuitPublicInputs {

pub struct PrivateKernelData {
pub public_inputs: PrivateKernelCircuitPublicInputs,
pub vk_index: u32,
pub vk_path: [Field; VK_TREE_HEIGHT],
}

pub struct PrivateKernelDataWithoutPublicInputs {
vk_index: u32,
vk_path: [Field; VK_TREE_HEIGHT],
}

pub struct PrivateAccumulatedData {
Expand All @@ -38,15 +30,6 @@ pub struct PrivateCallRequest {
pub end_side_effect_counter: u32,
}

impl PrivateKernelDataWithoutPublicInputs {
pub fn to_private_kernel_data(
self,
public_inputs: PrivateKernelCircuitPublicInputs,
) -> PrivateKernelData {
PrivateKernelData { public_inputs, vk_index: self.vk_index, vk_path: self.vk_path }
}
}

pub struct PrivateKernelCircuitPublicInputsComposer {
pub public_inputs: PrivateKernelCircuitPublicInputsBuilder,
}
Expand Down Expand Up @@ -102,16 +85,17 @@ pub struct PrivateKernelInnerCircuitPrivateInputs {

impl PrivateKernelInnerCircuitPrivateInputs {
pub fn new(
previous_kernel: PrivateKernelDataWithoutPublicInputs,
previous_kernel_public_inputs: PrivateKernelCircuitPublicInputs,
public_inputs: PrivateKernelCircuitPublicInputs,
) -> Self {
Self {
previous_kernel: previous_kernel.to_private_kernel_data(previous_kernel_public_inputs),
previous_kernel: PrivateKernelData {
public_inputs,
}
}
}

unconstrained fn generate_output(self) -> PrivateKernelCircuitPublicInputs {
// XXX: Declaring this `let mut composer = ` makes the circuit pass.
// XXX: Declaring `let mut composer = ` would make the circuit pass.
PrivateKernelCircuitPublicInputsComposer::new_from_previous_kernel(
self.previous_kernel.public_inputs,
)
Expand All @@ -120,7 +104,7 @@ impl PrivateKernelInnerCircuitPrivateInputs {
}

pub fn execute(self) -> PrivateKernelCircuitPublicInputs {
// XXX: Running both this and the bottom assertion that makes the circuit pass.
// XXX: Running both this and the bottom assertion would make the circuit pass.
// assert(!is_empty(self.previous_kernel.public_inputs.end.private_call_stack[0]), "not empty before");

/// Safety:
Expand Down

0 comments on commit 2fcdf47

Please sign in to comment.