-
Notifications
You must be signed in to change notification settings - Fork 234
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 executor): kernel outputs & execution hints in executor #6769
Changes from all commits
1ba1882
f955016
6da5d10
c813a44
f59cb2e
33c9c01
494f966
fe02298
69a0ce0
18fef35
81d1ff5
e9c3acd
aca948c
c4816e7
390ec2d
c529842
dd72cf8
c258dd4
36060f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,30 +25,37 @@ namespace avm_kernel(256); | |
pol commit side_effect_counter; | ||
|
||
// FIXED INDEXES | ||
// Exists checks | ||
pol START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; | ||
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 4; | ||
pol START_NULLIFIER_EXISTS_OFFSET = 8; | ||
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 12; | ||
pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 16; | ||
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 20; | ||
pol START_EMIT_L2_TO_l1_MSG = 24; | ||
pol START_NULLIFIER_EXISTS_OFFSET = 32; // START_NOTE_HASH_EXISTS_WRITE_OFFSET + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL TODO: exists and non exists | ||
pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 96; // START_NULLIFIER_EXISTS_OFFET + (MAX_NULLIFIER_READ_REQUESTS_PER_CALL + MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL) | ||
|
||
// Public storage requests | ||
pol START_SLOAD_WRITE_OFFSET = 112; // START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL | ||
pol START_SSTORE_WRITE_OFFSET = 144; // START_SSTORE_WRITE_OFFSET + MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL | ||
|
||
// Emit data | ||
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 160; // START_SLOAD_WRITE_OFFSET + MAX_PUBLIC_DATA_READS_PER_CALL | ||
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 176; // START_EMIT_NOTE_HASH_WRITE_OFFSET + MAX_NEW_NOTE_HASHES_PER_CALL | ||
pol START_EMIT_L2_TO_l1_MSG = 192; // START_EMIT_NULLIFIER_WRITE_OFFSET + MAX_NEW_NULLIFIERS_PER_CALL | ||
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 194; // START_EMIT_L2_TO_L1_MSG + MAX_NEW_L2_TO_L1_MSGS_PER_CALL | ||
Comment on lines
+28
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these hand-set or code-generated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right now hand set, but they mirror values in cpp, so you just hover over the value in the LSP and copy it over, our pil does not compile time evaluate constants yet |
||
|
||
pol START_SLOAD_WRITE_OFFSET = 28; | ||
pol START_SSTORE_WRITE_OFFSET = 32; | ||
|
||
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6465): Must constrain write_offset counters to be less than side effect MAX | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just reordered |
||
// Current write offsets for each opcode | ||
pol commit note_hash_exist_write_offset; | ||
pol commit emit_note_hash_write_offset; | ||
pol commit nullifier_exists_write_offset; | ||
pol commit emit_nullifier_write_offset; | ||
pol commit l1_to_l2_msg_exists_write_offset; | ||
pol commit emit_unencrypted_log_write_offset; | ||
pol commit emit_l2_to_l1_msg_write_offset; | ||
|
||
pol commit sload_write_offset; | ||
pol commit sstore_write_offset; | ||
|
||
pol commit emit_note_hash_write_offset; | ||
pol commit emit_nullifier_write_offset; | ||
pol commit emit_unencrypted_log_write_offset; | ||
pol commit emit_l2_to_l1_msg_write_offset; | ||
|
||
|
||
pol NOT_LAST = (1 - avm_main.last); | ||
|
||
// Constraints to increase the offsets when the opcodes are found | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adjusted these values to line up with the true offsets when using the real PER_CALL limits, previously they were just small ranges as an MVP
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you now autogen these from TS?