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

update typings to merge related changes in circuits #187

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion circuits
Submodule circuits updated 33 files
+1 −1 cpp/barretenberg
+3 −1 cpp/cmake/barretenberg.cmake
+1 −0 cpp/dockerfiles/Dockerfile.wasm-linux-clang
+10 −9 cpp/src/aztec3/circuits/abis/c_bind.cpp
+24 −11 cpp/src/aztec3/circuits/abis/rollup/base/base_or_merge_rollup_public_inputs.hpp
+4 −0 cpp/src/aztec3/circuits/abis/rollup/base/base_rollup_inputs.hpp
+0 −59 cpp/src/aztec3/circuits/abis/rollup/base/previous_rollup_data.hpp
+0 −104 cpp/src/aztec3/circuits/abis/rollup/merge/merge_rollup_public_inputs.hpp
+7 −7 cpp/src/aztec3/circuits/abis/rollup/merge/previous_rollup_data.hpp
+1 −1 cpp/src/aztec3/circuits/abis/rollup/root/root_rollup_inputs.hpp
+1 −1 cpp/src/aztec3/circuits/apps/test_apps/basic_contract_deployment/basic_contract_deployment.cpp
+1 −1 cpp/src/aztec3/circuits/apps/test_apps/escrow/deposit.cpp
+1 −1 cpp/src/aztec3/circuits/apps/test_apps/escrow/transfer.cpp
+1 −1 cpp/src/aztec3/circuits/apps/test_apps/escrow/withdraw.cpp
+1 −1 cpp/src/aztec3/circuits/apps/test_apps/private_to_private_function_call/function_2_1.cpp
+50 −20 cpp/src/aztec3/circuits/kernel/private/.test.cpp
+9 −7 cpp/src/aztec3/circuits/kernel/private/native_private_kernel_circuit.cpp
+12 −7 cpp/src/aztec3/circuits/kernel/private/private_kernel_circuit.cpp
+35 −40 cpp/src/aztec3/circuits/rollup/base/.test.cpp
+8 −24 cpp/src/aztec3/circuits/rollup/base/c_bind.cpp
+2 −3 cpp/src/aztec3/circuits/rollup/base/init.hpp
+10 −8 cpp/src/aztec3/circuits/rollup/base/native_base_rollup_circuit.cpp
+2 −2 cpp/src/aztec3/circuits/rollup/base/native_base_rollup_circuit.hpp
+1 −23 cpp/src/aztec3/circuits/rollup/base/utils.cpp
+0 −2 cpp/src/aztec3/circuits/rollup/base/utils.hpp
+170 −0 cpp/src/aztec3/circuits/rollup/merge/.test.cpp
+3 −2 cpp/src/aztec3/circuits/rollup/merge/init.hpp
+124 −12 cpp/src/aztec3/circuits/rollup/merge/native_merge_rollup_circuit.cpp
+7 −1 cpp/src/aztec3/circuits/rollup/merge/native_merge_rollup_circuit.hpp
+72 −0 cpp/src/aztec3/circuits/rollup/merge/utils.cpp
+17 −0 cpp/src/aztec3/circuits/rollup/merge/utils.hpp
+89 −68 cpp/src/aztec3/circuits/rollup/root/.test.cpp
+20 −77 cpp/src/aztec3/circuits/rollup/root/native_root_rollup_circuit.cpp
6 changes: 3 additions & 3 deletions yarn-project/circuits.js/src/rollup/rollup_wasm_wrapper.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { BaseRollupInputs, BaseRollupPublicInputs, RootRollupInputs, RootRollupPublicInputs } from '../index.js';
import { BaseRollupInputs, BaseOrMergeRollupPublicInputs, RootRollupInputs, RootRollupPublicInputs } from '../index.js';
import { uint8ArrayToNum } from '../utils/serialize.js';
import { CircuitsWasm } from '../wasm/circuits_wasm.js';

export class RollupWasmWrapper {
constructor(private wasm: CircuitsWasm) {}

public simulateBaseRollup(baseRollupInputs: BaseRollupInputs): Promise<BaseRollupPublicInputs> {
return this.callWasm('base_rollup__sim', baseRollupInputs, BaseRollupPublicInputs);
public simulateBaseRollup(baseRollupInputs: BaseRollupInputs): Promise<BaseOrMergeRollupPublicInputs> {
return this.callWasm('base_rollup__sim', baseRollupInputs, BaseOrMergeRollupPublicInputs);
}

public simulateRootRollup(rootRollupInputs: RootRollupInputs): Promise<RootRollupPublicInputs> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`structs/base_rollup serializes and prints BaseOrMergeRollupPublicInputs 1`] = `
"rollup_type:
0
rollup_subtree_height:
0x100
end_aggregation_object:
P0: { 0x200, 0x201 }
P1: { 0x300, 0x301 }
public_inputs: [
0x202
0x203
0x204
0x205
]
proof_witness_indices: [ 518 519 520 521 522 523 ]
has_data: 0

constants:
start_tree_of_historic_private_data_tree_roots_snapshot:
root: 0x300
next_available_leaf_index: 768

start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x400
next_available_leaf_index: 1024

tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
root: 0x500
next_available_leaf_index: 1280

private_kernel_vk_tree_root: 0x601
public_kernel_vk_tree_root: 0x602
base_rollup_vk_hash: 0x603
merge_rollup_vk_hash: 0x604

start_private_data_tree_snapshot:
root: 0x400
next_available_leaf_index: 1024

end_private_data_tree_snapshot:
root: 0x400
next_available_leaf_index: 1024

start_nullifier_tree_snapshot:
root: 0x600
next_available_leaf_index: 1536

end_nullifier_tree_snapshots:
root: 0x700
next_available_leaf_index: 1792

start_contract_tree_snapshot:
root: 0x800
next_available_leaf_index: 2048

end_contract_tree_snapshot:
root: 0x900
next_available_leaf_index: 2304

calldata_hash: [ 0x1001 0x1002 ]
"
`;

exports[`structs/base_rollup serializes and prints BaseRollupInputs 1`] = `
"kernel_data:
[ public_inputs: end:
Expand Down Expand Up @@ -241,10 +304,18 @@ key.recursive_proof_public_input_indices: [ 190 191 192 193 194 ]
vk_index: 42
vk_path: [ 0x1000 0x1001 0x1002 ]
]
start_private_data_tree_snapshot:
root: 0x100
next_available_leaf_index: 256

start_nullifier_tree_snapshot:
root: 0x200
next_available_leaf_index: 512

start_contract_tree_snapshot:
root: 0x300
next_available_leaf_index: 768

low_nullifier_leaf_preimages:
[ leaf_value: 0x1000
next_value: 0x1100
Expand Down Expand Up @@ -327,62 +398,3 @@ merge_rollup_vk_hash: 0x404

"
`;

exports[`structs/base_rollup serializes and prints BaseRollupPublicInputs 1`] = `
"end_aggregation_object:
P0: { 0x100, 0x101 }
P1: { 0x200, 0x201 }
public_inputs: [
0x102
0x103
0x104
0x105
]
proof_witness_indices: [ 262 263 264 265 266 267 ]
has_data: 0

constants:
start_tree_of_historic_private_data_tree_roots_snapshot:
root: 0x200
next_available_leaf_index: 512

start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x300
next_available_leaf_index: 768

tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
root: 0x400
next_available_leaf_index: 1024

private_kernel_vk_tree_root: 0x501
public_kernel_vk_tree_root: 0x502
base_rollup_vk_hash: 0x503
merge_rollup_vk_hash: 0x504

start_private_data_tree_snapshot:
root: 0x300
next_available_leaf_index: 768

end_private_data_tree_snapshot:
root: 0x300
next_available_leaf_index: 768

start_nullifier_tree_snapshot:
root: 0x500
next_available_leaf_index: 1280

end_nullifier_tree_snapshots:
root: 0x600
next_available_leaf_index: 1536

start_contract_tree_snapshot:
root: 0x700
next_available_leaf_index: 1792

end_contract_tree_snapshot:
root: 0x800
next_available_leaf_index: 2048

calldata_hash: [ 0x901 0x902 ]
"
`;
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`structs/root_rollup serializes a RootRollupInput and prints it 1`] = `
"previous_rollup_data: [ merge_rollup_public_inputs: end_aggregation_object:
P0: { 0x100, 0x101 }
P1: { 0x200, 0x201 }
"previous_rollup_data: [ base_or_merge_rollup_public_inputs: rollup_type:
0
rollup_subtree_height:
0x100
end_aggregation_object:
P0: { 0x200, 0x201 }
P1: { 0x300, 0x301 }
public_inputs: [
0x102
0x103
0x104
0x105
0x202
0x203
0x204
0x205
]
proof_witness_indices: [ 106 107 108 109 10a 10b ]
proof_witness_indices: [ 206 207 208 209 20a 20b ]
has_data: 0

constants:
start_tree_of_historic_private_data_tree_roots_snapshot:
root: 0x200
next_available_leaf_index: 200

start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x300
root: 0x300
next_available_leaf_index: 300

tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x400
next_available_leaf_index: 400

private_kernel_vk_tree_root: 0x501
public_kernel_vk_tree_root: 0x502
base_rollup_vk_hash: 0x503
merge_rollup_vk_hash: 0x504
tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
root: 0x500
next_available_leaf_index: 500

private_kernel_vk_tree_root: 0x601
public_kernel_vk_tree_root: 0x602
base_rollup_vk_hash: 0x603
merge_rollup_vk_hash: 0x604

start_private_data_tree_snapshot:
root: 0x300
next_available_leaf_index: 300
root: 0x400
next_available_leaf_index: 400

end_private_data_tree_snapshot:
root: 0x300
next_available_leaf_index: 300
root: 0x400
next_available_leaf_index: 400

start_nullifier_tree_snapshot:
root: 0x500
next_available_leaf_index: 500

end_nullifier_tree_snapshots:
root: 0x600
next_available_leaf_index: 600

start_contract_tree_snapshot:
end_nullifier_tree_snapshots:
root: 0x700
next_available_leaf_index: 700

end_contract_tree_snapshot:
start_contract_tree_snapshot:
root: 0x800
next_available_leaf_index: 800

calldata_hash: [ 0x901 0x902 ]
end_contract_tree_snapshot:
root: 0x900
next_available_leaf_index: 900

calldata_hash: [ 0x1001 0x1002 ]

proof: [ 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 ]
vk: key.composer_type: 0
Expand All @@ -71,61 +75,65 @@ vk_index: 110
vk_sibling_path: leaf_index: 120
sibling_path: [ 0x120 0x121 0x122 0x123 0x124 0x125 0x126 0x127 ]

merge_rollup_public_inputs: end_aggregation_object:
P0: { 0x1100, 0x1101 }
P1: { 0x1200, 0x1201 }
base_or_merge_rollup_public_inputs: rollup_type:
0
rollup_subtree_height:
0x1100
end_aggregation_object:
P0: { 0x1200, 0x1201 }
P1: { 0x1300, 0x1301 }
public_inputs: [
0x1102
0x1103
0x1104
0x1105
0x1202
0x1203
0x1204
0x1205
]
proof_witness_indices: [ 1106 1107 1108 1109 110a 110b ]
proof_witness_indices: [ 1206 1207 1208 1209 120a 120b ]
has_data: 0

constants:
start_tree_of_historic_private_data_tree_roots_snapshot:
root: 0x1200
next_available_leaf_index: 1200

start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x1300
root: 0x1300
next_available_leaf_index: 1300

tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
start_tree_of_historic_contract_tree_roots_snapshot:
root: 0x1400
next_available_leaf_index: 1400

private_kernel_vk_tree_root: 0x1501
public_kernel_vk_tree_root: 0x1502
base_rollup_vk_hash: 0x1503
merge_rollup_vk_hash: 0x1504
tree_of_historic_l1_to_l2_msg_tree_roots_snapshot:
root: 0x1500
next_available_leaf_index: 1500

private_kernel_vk_tree_root: 0x1601
public_kernel_vk_tree_root: 0x1602
base_rollup_vk_hash: 0x1603
merge_rollup_vk_hash: 0x1604

start_private_data_tree_snapshot:
root: 0x1300
next_available_leaf_index: 1300
root: 0x1400
next_available_leaf_index: 1400

end_private_data_tree_snapshot:
root: 0x1300
next_available_leaf_index: 1300
root: 0x1400
next_available_leaf_index: 1400

start_nullifier_tree_snapshot:
root: 0x1500
next_available_leaf_index: 1500

end_nullifier_tree_snapshots:
root: 0x1600
next_available_leaf_index: 1600

start_contract_tree_snapshot:
end_nullifier_tree_snapshots:
root: 0x1700
next_available_leaf_index: 1700

end_contract_tree_snapshot:
start_contract_tree_snapshot:
root: 0x1800
next_available_leaf_index: 1800

calldata_hash: [ 0x1901 0x1902 ]
end_contract_tree_snapshot:
root: 0x1900
next_available_leaf_index: 1900

calldata_hash: [ 0x2001 0x2002 ]

proof: [ 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 ]
vk: key.composer_type: 0
Expand Down
Loading