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

feat: avm unconstrained external call #6846

Merged
merged 23 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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
4 changes: 3 additions & 1 deletion barretenberg/cpp/pil/avm/avm_main.pil
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ namespace avm_main(256);
pol commit sel_internal_return;
pol commit sel_jump;
pol commit sel_jumpi;
pol commit sel_external_call;

// Halt program execution
pol commit sel_halt;
Expand Down Expand Up @@ -276,6 +277,7 @@ namespace avm_main(256);
sel_jump * (1 - sel_jump) = 0;
sel_jumpi * (1 - sel_jumpi) = 0;
sel_halt * (1 - sel_halt) = 0;
sel_external_call * (1 - sel_external_call) = 0;

// Might be removed if derived from opcode based on a lookup of constants
sel_mov * ( 1 - sel_mov) = 0;
Expand Down Expand Up @@ -413,7 +415,7 @@ namespace avm_main(256);

//===== CONTROL_FLOW_CONSISTENCY ============================================
pol INTERNAL_CALL_STACK_SELECTORS = (first + sel_internal_call + sel_internal_return + sel_halt);
pol ALL_CTRL_FLOW_SEL = sel_jump + sel_jumpi + sel_internal_call + sel_internal_return;
pol ALL_CTRL_FLOW_SEL = sel_jump + sel_jumpi + sel_internal_call + sel_internal_return + sel_external_call;

pol ALL_BINARY_SEL = sel_op_and + sel_op_or + sel_op_xor;
pol ALL_GADGET_SEL = sel_op_radix_le + sel_op_sha256 + sel_op_poseidon2 + sel_op_keccak + sel_op_pedersen;
Expand Down
11 changes: 11 additions & 0 deletions barretenberg/cpp/pil/avm/constants.pil
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,14 @@ namespace constants(256);
// Other AVM specific constants
pol INTERNAL_CALL_SPACE_ID = 255;

// Lengths of kernel output vectors
// Read requests
pol MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32;
pol MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32;
pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 32;
pol MAX_PUBLIC_DATA_READS_PER_CALL = 16;

// Emitting Data
pol MAX_NEW_NOTE_HASHES_PER_CALL = 16;
pol MAX_NEW_NULLIIFIERS_PER_CALL = 16;
pol MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
Loading
Loading