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

chore: generate PIL constants from via constants gen #7258

Merged
merged 2 commits into from
Jul 2, 2024
Merged
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
46 changes: 0 additions & 46 deletions barretenberg/cpp/pil/avm/constants.pil

This file was deleted.

39 changes: 39 additions & 0 deletions barretenberg/cpp/pil/avm/constants_gen.pil
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// GENERATED FILE - DO NOT EDIT, RUN yarn remake-constants in circuits.js
namespace constants(256);
pol MAX_NEW_NOTE_HASHES_PER_CALL = 16;
pol MAX_NEW_NULLIFIERS_PER_CALL = 16;
pol MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 16;
pol MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 32;
pol MAX_PUBLIC_DATA_READS_PER_CALL = 32;
pol MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32;
pol MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32;
pol MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32;
pol MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL = 16;
pol MAX_UNENCRYPTED_LOGS_PER_CALL = 4;
pol SENDER_SELECTOR = 0;
pol ADDRESS_SELECTOR = 1;
pol STORAGE_ADDRESS_SELECTOR = 1;
pol FUNCTION_SELECTOR_SELECTOR = 2;
pol START_GLOBAL_VARIABLES = 29;
pol CHAIN_ID_SELECTOR = 29;
pol VERSION_SELECTOR = 30;
pol BLOCK_NUMBER_SELECTOR = 31;
pol TIMESTAMP_SELECTOR = 32;
pol COINBASE_SELECTOR = 33;
pol FEE_PER_DA_GAS_SELECTOR = 35;
pol FEE_PER_L2_GAS_SELECTOR = 36;
pol END_GLOBAL_VARIABLES = 37;
pol START_SIDE_EFFECT_COUNTER = 37;
pol TRANSACTION_FEE_SELECTOR = 40;
pol START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0;
pol START_NULLIFIER_EXISTS_OFFSET = 32;
pol START_NULLIFIER_NON_EXISTS_OFFSET = 64;
pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 96;
pol START_SSTORE_WRITE_OFFSET = 112;
pol START_SLOAD_WRITE_OFFSET = 144;
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 176;
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 192;
pol START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 208;
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 210;

2 changes: 2 additions & 0 deletions barretenberg/cpp/pil/avm/constants_misc.pil
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
namespace constants_misc(256);
pol INTERNAL_CALL_SPACE_ID = 255;
20 changes: 1 addition & 19 deletions barretenberg/cpp/pil/avm/kernel.pil
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include "main.pil";
include "constants.pil";
include "constants_gen.pil";

namespace kernel(256);
pol public kernel_inputs;
Expand All @@ -24,24 +24,6 @@ namespace kernel(256);
// Global side effect counter; incremented after each side effect is produced.
pol commit side_effect_counter;

// FIXED INDEXES
// Exists checks
pol START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0;
pol START_NULLIFIER_EXISTS_OFFSET = 32; // START_NOTE_HASH_EXISTS_WRITE_OFFSET + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL
pol START_NULLIFIER_NON_EXISTS_OFFSET = 64; // START_NULLIFIER_EXISTS_OFFSET + MAX_NULLIFIER_READ_REQUESTS_PER_CALL
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_SSTORE_WRITE_OFFSET = 112; // START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL
pol START_SLOAD_WRITE_OFFSET = 144; // START_SSTORE_WRITE_OFFSET + MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL

// Emit data
pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 176; // START_SLOAD_WRITE_OFFSET + MAX_PUBLIC_DATA_READS_PER_CALL
pol START_EMIT_NULLIFIER_WRITE_OFFSET = 192; // START_EMIT_NOTE_HASH_WRITE_OFFSET + MAX_NEW_NOTE_HASHES_PER_CALL
pol START_EMIT_L2_TO_l1_MSG = 208; // START_EMIT_NULLIFIER_WRITE_OFFSET + MAX_NEW_NULLIFIERS_PER_CALL
pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 210; // START_EMIT_L2_TO_L1_MSG + MAX_NEW_L2_TO_L1_MSGS_PER_CALL


// TODO(https://github.com/AztecProtocol/aztec-packages/issues/6465): Must constrain write_offset counters to be less than side effect MAX
// Current write offsets for each opcode
pol commit note_hash_exist_write_offset;
Expand Down
23 changes: 12 additions & 11 deletions barretenberg/cpp/pil/avm/main.pil
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
include "mem.pil";
include "alu.pil";
include "binary.pil";
include "constants.pil";
include "constants_gen.pil";
include "constants_misc.pil";
include "kernel.pil";
include "fixed/gas.pil";
include "fixed/powers.pil";
Expand Down Expand Up @@ -506,7 +507,7 @@ namespace main(256);

//====== SPACE ID CONSTRAINTS ===============================================
#[SPACE_ID_INTERNAL]
(sel_op_internal_call + sel_op_internal_return) * (space_id - constants.INTERNAL_CALL_SPACE_ID) = 0;
(sel_op_internal_call + sel_op_internal_return) * (space_id - constants_misc.INTERNAL_CALL_SPACE_ID) = 0;

#[SPACE_ID_STANDARD_OPCODES]
OPCODE_SELECTORS * (call_ptr - space_id) = 0;
Expand Down Expand Up @@ -612,43 +613,43 @@ namespace main(256);
// OUTPUTS LOOKUPS
// Constrain the value of kernel_out_offset to be the correct offset for the operation being performed
#[NOTE_HASH_KERNEL_OUTPUT]
sel_op_note_hash_exists * (kernel.kernel_out_offset - (kernel.START_NOTE_HASH_EXISTS_WRITE_OFFSET + kernel.note_hash_exist_write_offset)) = 0;
sel_op_note_hash_exists * (kernel.kernel_out_offset - (constants.START_NOTE_HASH_EXISTS_WRITE_OFFSET + kernel.note_hash_exist_write_offset)) = 0;
sel_first * kernel.note_hash_exist_write_offset = 0;


#[EMIT_NOTE_HASH_KERNEL_OUTPUT]
sel_op_emit_note_hash * (kernel.kernel_out_offset - (kernel.START_EMIT_NOTE_HASH_WRITE_OFFSET + kernel.emit_note_hash_write_offset)) = 0;
sel_op_emit_note_hash * (kernel.kernel_out_offset - (constants.START_EMIT_NOTE_HASH_WRITE_OFFSET + kernel.emit_note_hash_write_offset)) = 0;
sel_first * kernel.emit_note_hash_write_offset = 0;

#[NULLIFIER_EXISTS_KERNEL_OUTPUT]
sel_op_nullifier_exists * (kernel.kernel_out_offset - ((ib * (kernel.START_NULLIFIER_EXISTS_OFFSET + kernel.nullifier_exists_write_offset)) + ((1 - ib) * (kernel.START_NULLIFIER_NON_EXISTS_OFFSET + kernel.nullifier_non_exists_write_offset)))) = 0;
sel_op_nullifier_exists * (kernel.kernel_out_offset - ((ib * (constants.START_NULLIFIER_EXISTS_OFFSET + kernel.nullifier_exists_write_offset)) + ((1 - ib) * (constants.START_NULLIFIER_NON_EXISTS_OFFSET + kernel.nullifier_non_exists_write_offset)))) = 0;
sel_first * kernel.nullifier_exists_write_offset = 0;
sel_first * kernel.nullifier_non_exists_write_offset = 0;

#[EMIT_NULLIFIER_KERNEL_OUTPUT]
sel_op_emit_nullifier * (kernel.kernel_out_offset - (kernel.START_EMIT_NULLIFIER_WRITE_OFFSET + kernel.emit_nullifier_write_offset)) = 0;
sel_op_emit_nullifier * (kernel.kernel_out_offset - (constants.START_EMIT_NULLIFIER_WRITE_OFFSET + kernel.emit_nullifier_write_offset)) = 0;
sel_first * kernel.emit_nullifier_write_offset = 0;

#[L1_TO_L2_MSG_EXISTS_KERNEL_OUTPUT]
sel_op_l1_to_l2_msg_exists * (kernel.kernel_out_offset - (kernel.START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + kernel.l1_to_l2_msg_exists_write_offset)) = 0;
sel_op_l1_to_l2_msg_exists * (kernel.kernel_out_offset - (constants.START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + kernel.l1_to_l2_msg_exists_write_offset)) = 0;
sel_first * kernel.l1_to_l2_msg_exists_write_offset = 0;

#[EMIT_UNENCRYPTED_LOG_KERNEL_OUTPUT]
sel_op_emit_unencrypted_log * (kernel.kernel_out_offset - (kernel.START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + kernel.emit_unencrypted_log_write_offset)) = 0;
sel_op_emit_unencrypted_log * (kernel.kernel_out_offset - (constants.START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + kernel.emit_unencrypted_log_write_offset)) = 0;
sel_first * kernel.emit_unencrypted_log_write_offset = 0;

// TODO: Add the equivalent for GETCONTRACTINSTANCE?

#[EMIT_L2_TO_L1_MSGS_KERNEL_OUTPUT]
sel_op_emit_l2_to_l1_msg * (kernel.kernel_out_offset - (kernel.START_EMIT_L2_TO_l1_MSG + kernel.emit_l2_to_l1_msg_write_offset)) = 0;
sel_op_emit_l2_to_l1_msg * (kernel.kernel_out_offset - (constants.START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET + kernel.emit_l2_to_l1_msg_write_offset)) = 0;
sel_first * kernel.emit_l2_to_l1_msg_write_offset = 0;

#[SLOAD_KERNEL_OUTPUT]
sel_op_sload * (kernel.kernel_out_offset - (kernel.START_SLOAD_WRITE_OFFSET + kernel.sload_write_offset)) = 0;
sel_op_sload * (kernel.kernel_out_offset - (constants.START_SLOAD_WRITE_OFFSET + kernel.sload_write_offset)) = 0;
sel_first * kernel.sload_write_offset = 0;

#[SSTORE_KERNEL_OUTPUT]
sel_op_sstore * (kernel.kernel_out_offset - (kernel.START_SSTORE_WRITE_OFFSET + kernel.sstore_write_offset)) = 0;
sel_op_sstore * (kernel.kernel_out_offset - (constants.START_SSTORE_WRITE_OFFSET + kernel.sstore_write_offset)) = 0;
sel_first * kernel.sstore_write_offset = 0;

// When we encounter a state writing opcode
Expand Down
20 changes: 10 additions & 10 deletions barretenberg/cpp/src/barretenberg/vm/avm_trace/avm_execution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,15 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
// We copy each type of the kernel outputs into their respective columns, each has differeing lengths / data
// For NOTEHASHEXISTS
for (size_t i = 0; i < MAX_NOTE_HASH_READ_REQUESTS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_NOTE_HASH_EXISTS_WRITE_OFFSET + i;
size_t dest_offset = START_NOTE_HASH_EXISTS_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_NOTE_HASH_EXISTS_OFFSET + (i * READ_REQUEST_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
ko_side_effect[dest_offset] = public_inputs_vec[pcpi_offset + 1];
}
// For NULLIFIEREXISTS
for (size_t i = 0; i < MAX_NULLIFIER_READ_REQUESTS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_NULLIFIER_EXISTS_OFFSET + i;
size_t dest_offset = START_NULLIFIER_EXISTS_OFFSET + i;
size_t pcpi_offset = PCPI_NULLIFIER_EXISTS_OFFSET + (i * READ_REQUEST_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
Expand All @@ -182,7 +182,7 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
}
// For NULLIFIEREXISTS - non existent
for (size_t i = 0; i < MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_NULLIFIER_NON_EXISTS_OFFSET + i;
size_t dest_offset = START_NULLIFIER_NON_EXISTS_OFFSET + i;
size_t pcpi_offset = PCPI_NULLIFIER_NON_EXISTS_OFFSET + (i * READ_REQUEST_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
Expand All @@ -191,15 +191,15 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
}
// For L1TOL2MSGEXISTS
for (size_t i = 0; i < MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + i;
size_t dest_offset = START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_L1_TO_L2_MSG_READ_REQUESTS_OFFSET + (i * READ_REQUEST_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
ko_side_effect[dest_offset] = public_inputs_vec[pcpi_offset + 1];
}
// For SSTORE
for (size_t i = 0; i < MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_SSTORE_WRITE_OFFSET + i;
size_t dest_offset = START_SSTORE_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_PUBLIC_DATA_UPDATE_OFFSET + (i * CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH);

// slot, value, side effect
Expand All @@ -209,7 +209,7 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
}
// For SLOAD
for (size_t i = 0; i < MAX_PUBLIC_DATA_READS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_SLOAD_WRITE_OFFSET + i;
size_t dest_offset = START_SLOAD_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_PUBLIC_DATA_READ_OFFSET + (i * CONTRACT_STORAGE_READ_LENGTH);

// slot, value, side effect
Expand All @@ -219,23 +219,23 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
}
// For EMITNOTEHASH
for (size_t i = 0; i < MAX_NEW_NOTE_HASHES_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_EMIT_NOTE_HASH_WRITE_OFFSET + i;
size_t dest_offset = START_EMIT_NOTE_HASH_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_NEW_NOTE_HASHES_OFFSET + (i * NOTE_HASH_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
ko_side_effect[dest_offset] = public_inputs_vec[pcpi_offset + 1];
}
// For EMITNULLIFIER
for (size_t i = 0; i < MAX_NEW_NULLIFIERS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_EMIT_NULLIFIER_WRITE_OFFSET + i;
size_t dest_offset = START_EMIT_NULLIFIER_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_NEW_NULLIFIERS_OFFSET + (i * NULLIFIER_LENGTH);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
ko_side_effect[dest_offset] = public_inputs_vec[pcpi_offset + 1];
}
// For EMITL2TOL1MSG
for (size_t i = 0; i < MAX_NEW_L2_TO_L1_MSGS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_L2_TO_L1_MSG_WRITE_OFFSET + i;
size_t dest_offset = START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_NEW_L2_TO_L1_MSGS_OFFSET + (i * L2_TO_L1_MESSAGE_LENGTH);

// Note: unorthadox order
Expand All @@ -245,7 +245,7 @@ VmPublicInputs Execution::convert_public_inputs(std::vector<FF> const& public_in
}
// For EMITUNENCRYPTEDLOG
for (size_t i = 0; i < MAX_UNENCRYPTED_LOGS_PER_CALL; i++) {
size_t dest_offset = AvmKernelTraceBuilder::START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + i;
size_t dest_offset = START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET + i;
size_t pcpi_offset = PCPI_NEW_UNENCRYPTED_LOGS_OFFSET + (i * 2);

ko_values[dest_offset] = public_inputs_vec[pcpi_offset];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ void AvmKernelTraceBuilder::op_emit_l2_to_l1_msg(uint32_t clk,
const FF& l2_to_l1_msg,
const FF& recipient)
{
uint32_t offset = START_L2_TO_L1_MSG_WRITE_OFFSET + emit_l2_to_l1_msg_offset;
uint32_t offset = START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET + emit_l2_to_l1_msg_offset;
perform_kernel_output_lookup(offset, side_effect_counter, l2_to_l1_msg, recipient);
emit_l2_to_l1_msg_offset++;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,6 @@
#include <unordered_map>
#include <vector>

inline const uint32_t SENDER_SELECTOR = 0;
// address doesn't actually exist in PublicCircuitPublicInputs, but storageAddress does
// so we just make a address & storageAddress an alias of each other for now
inline const uint32_t ADDRESS_SELECTOR = 1;
inline const uint32_t STORAGE_ADDRESS_SELECTOR = ADDRESS_SELECTOR;
inline const uint32_t FUNCTION_SELECTOR_SELECTOR = 2;

inline const uint32_t START_GLOBAL_VARIABLES = CALL_CONTEXT_LENGTH + HEADER_LENGTH;

inline const uint32_t CHAIN_ID_SELECTOR = START_GLOBAL_VARIABLES;
inline const uint32_t VERSION_SELECTOR = START_GLOBAL_VARIABLES + 1;
inline const uint32_t BLOCK_NUMBER_SELECTOR = START_GLOBAL_VARIABLES + 2;
inline const uint32_t TIMESTAMP_SELECTOR = START_GLOBAL_VARIABLES + 3;
inline const uint32_t COINBASE_SELECTOR = START_GLOBAL_VARIABLES + 4;
inline const uint32_t FEE_PER_DA_GAS_SELECTOR = START_GLOBAL_VARIABLES + 6;
inline const uint32_t FEE_PER_L2_GAS_SELECTOR = START_GLOBAL_VARIABLES + 7;

inline const uint32_t END_GLOBAL_VARIABLES = START_GLOBAL_VARIABLES + GLOBAL_VARIABLES_LENGTH;
inline const uint32_t START_SIDE_EFFECT_COUNTER = END_GLOBAL_VARIABLES;

inline const uint32_t TRANSACTION_FEE_SELECTOR = KERNEL_INPUTS_LENGTH - 1;

namespace bb::avm_trace {

class AvmKernelTraceBuilder {
Expand Down Expand Up @@ -99,28 +77,6 @@ class AvmKernelTraceBuilder {
void op_emit_unencrypted_log(uint32_t clk, uint32_t side_effect_counter, const FF& log_hash);
void op_emit_l2_to_l1_msg(uint32_t clk, uint32_t side_effect_counter, const FF& l2_to_l1_msg, const FF& recipient);

// TODO: Move into constants.hpp?
static const uint32_t START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0;
static const uint32_t START_NULLIFIER_EXISTS_OFFSET =
START_NOTE_HASH_EXISTS_WRITE_OFFSET + MAX_NOTE_HASH_READ_REQUESTS_PER_CALL;
static const uint32_t START_NULLIFIER_NON_EXISTS_OFFSET =
START_NULLIFIER_EXISTS_OFFSET + MAX_NULLIFIER_READ_REQUESTS_PER_CALL;
static const uint32_t START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET =
START_NULLIFIER_NON_EXISTS_OFFSET + MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL;

static const uint32_t START_SSTORE_WRITE_OFFSET =
START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET + MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL;
static const uint32_t START_SLOAD_WRITE_OFFSET =
START_SSTORE_WRITE_OFFSET + MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL;

static const uint32_t START_EMIT_NOTE_HASH_WRITE_OFFSET = START_SLOAD_WRITE_OFFSET + MAX_PUBLIC_DATA_READS_PER_CALL;
static const uint32_t START_EMIT_NULLIFIER_WRITE_OFFSET =
START_EMIT_NOTE_HASH_WRITE_OFFSET + MAX_NEW_NOTE_HASHES_PER_CALL;
static const uint32_t START_L2_TO_L1_MSG_WRITE_OFFSET =
START_EMIT_NULLIFIER_WRITE_OFFSET + MAX_NEW_NULLIFIERS_PER_CALL;
static const uint32_t START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET =
START_L2_TO_L1_MSG_WRITE_OFFSET + MAX_NEW_L2_TO_L1_MSGS_PER_CALL;

private:
std::vector<KernelTraceEntry> kernel_trace;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,28 @@
#define HEADER_LENGTH 23
#define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 578
#define PUBLIC_CONTEXT_INPUTS_LENGTH 41
#define SENDER_SELECTOR 0
#define ADDRESS_SELECTOR 1
#define STORAGE_ADDRESS_SELECTOR 1
#define FUNCTION_SELECTOR_SELECTOR 2
#define START_GLOBAL_VARIABLES 29
#define CHAIN_ID_SELECTOR 29
#define VERSION_SELECTOR 30
#define BLOCK_NUMBER_SELECTOR 31
#define TIMESTAMP_SELECTOR 32
#define COINBASE_SELECTOR 33
#define FEE_PER_DA_GAS_SELECTOR 35
#define FEE_PER_L2_GAS_SELECTOR 36
#define END_GLOBAL_VARIABLES 37
#define START_SIDE_EFFECT_COUNTER 37
#define TRANSACTION_FEE_SELECTOR 40
#define START_NOTE_HASH_EXISTS_WRITE_OFFSET 0
#define START_NULLIFIER_EXISTS_OFFSET 32
#define START_NULLIFIER_NON_EXISTS_OFFSET 64
#define START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET 96
#define START_SSTORE_WRITE_OFFSET 112
#define START_SLOAD_WRITE_OFFSET 144
#define START_EMIT_NOTE_HASH_WRITE_OFFSET 176
#define START_EMIT_NULLIFIER_WRITE_OFFSET 192
#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 208
#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 210
Loading
Loading