Skip to content

Commit

Permalink
update pil constants
Browse files Browse the repository at this point in the history
  • Loading branch information
just-mitch committed May 17, 2024
1 parent ded0cf6 commit b3b50cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
22 changes: 11 additions & 11 deletions barretenberg/cpp/pil/avm/constants.pil
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ namespace constants(256);
pol PORTAL_SELECTOR = 2;

// NOTE: constant expression evaluation does not seem to be supported yet in pil
// pol START_GLOBAL_VARIABLES = CALL_CONTEXT_LENGTH + HEADER_LENGTH = 6 + 22 = 28
// pol START_GLOBAL_VARIABLES = CALL_CONTEXT_LENGTH + HEADER_LENGTH = 6 + 23 = 29

// Global Variables
pol CHAIN_ID_SELECTOR = 28;
pol VERSION_SELECTOR = 29;
pol BLOCK_NUMBER_SELECTOR = 30;
pol TIMESTAMP_SELECTOR = 31;
pol COINBASE_SELECTOR = 32;
pol CHAIN_ID_SELECTOR = 29;
pol VERSION_SELECTOR = 30;
pol BLOCK_NUMBER_SELECTOR = 31;
pol TIMESTAMP_SELECTOR = 32;
pol COINBASE_SELECTOR = 33;

pol END_GLOBAL_VARIABLES = 28 + 8; // We only use the first 5 of 8 global variables for now
pol END_GLOBAL_VARIABLES = 29 + 8; // We only use the first 5 of 8 global variables for now

pol START_SIDE_EFFECT_COUNTER = 36;
pol START_SIDE_EFFECT_COUNTER = 37;

// Gas
pol FEE_PER_DA_GAS_SELECTOR = 37;
pol FEE_PER_L2_GAS_SELECTOR = 38;
pol FEE_PER_DA_GAS_SELECTOR = 38;
pol FEE_PER_L2_GAS_SELECTOR = 39;

pol TRANSACTION_FEE_SELECTOR = 39;
pol TRANSACTION_FEE_SELECTOR = 40;

Original file line number Diff line number Diff line change
Expand Up @@ -915,63 +915,63 @@ template <typename FF_> class avm_mainImpl {
{
Avm_DECLARE_VIEWS(83);

auto tmp = (avm_main_sel_op_fee_per_da_gas * (avm_kernel_kernel_sel - FF(37)));
auto tmp = (avm_main_sel_op_fee_per_da_gas * (avm_kernel_kernel_sel - FF(38)));
tmp *= scaling_factor;
std::get<83>(evals) += tmp;
}
// Contribution 84
{
Avm_DECLARE_VIEWS(84);

auto tmp = (avm_main_sel_op_fee_per_l2_gas * (avm_kernel_kernel_sel - FF(38)));
auto tmp = (avm_main_sel_op_fee_per_l2_gas * (avm_kernel_kernel_sel - FF(39)));
tmp *= scaling_factor;
std::get<84>(evals) += tmp;
}
// Contribution 85
{
Avm_DECLARE_VIEWS(85);

auto tmp = (avm_main_sel_op_transaction_fee * (avm_kernel_kernel_sel - FF(39)));
auto tmp = (avm_main_sel_op_transaction_fee * (avm_kernel_kernel_sel - FF(40)));
tmp *= scaling_factor;
std::get<85>(evals) += tmp;
}
// Contribution 86
{
Avm_DECLARE_VIEWS(86);

auto tmp = (avm_main_sel_op_chain_id * (avm_kernel_kernel_sel - FF(28)));
auto tmp = (avm_main_sel_op_chain_id * (avm_kernel_kernel_sel - FF(29)));
tmp *= scaling_factor;
std::get<86>(evals) += tmp;
}
// Contribution 87
{
Avm_DECLARE_VIEWS(87);

auto tmp = (avm_main_sel_op_version * (avm_kernel_kernel_sel - FF(29)));
auto tmp = (avm_main_sel_op_version * (avm_kernel_kernel_sel - FF(30)));
tmp *= scaling_factor;
std::get<87>(evals) += tmp;
}
// Contribution 88
{
Avm_DECLARE_VIEWS(88);

auto tmp = (avm_main_sel_op_block_number * (avm_kernel_kernel_sel - FF(30)));
auto tmp = (avm_main_sel_op_block_number * (avm_kernel_kernel_sel - FF(31)));
tmp *= scaling_factor;
std::get<88>(evals) += tmp;
}
// Contribution 89
{
Avm_DECLARE_VIEWS(89);

auto tmp = (avm_main_sel_op_coinbase * (avm_kernel_kernel_sel - FF(32)));
auto tmp = (avm_main_sel_op_coinbase * (avm_kernel_kernel_sel - FF(33)));
tmp *= scaling_factor;
std::get<89>(evals) += tmp;
}
// Contribution 90
{
Avm_DECLARE_VIEWS(90);

auto tmp = (avm_main_sel_op_timestamp * (avm_kernel_kernel_sel - FF(31)));
auto tmp = (avm_main_sel_op_timestamp * (avm_kernel_kernel_sel - FF(32)));
tmp *= scaling_factor;
std::get<90>(evals) += tmp;
}
Expand Down

0 comments on commit b3b50cf

Please sign in to comment.