Skip to content

Commit

Permalink
Merge cc1d7ad into 753cdf8
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanks12 authored Sep 24, 2024
2 parents 753cdf8 + cc1d7ad commit 2caf555
Show file tree
Hide file tree
Showing 12 changed files with 378 additions and 482 deletions.
120 changes: 61 additions & 59 deletions barretenberg/cpp/src/barretenberg/vm/avm/trace/fixed_gas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,76 +18,78 @@ constexpr auto make_cost(uint16_t l2_base, uint16_t da_base, uint16_t l2_dyn, ui
}

const std::unordered_map<OpCode, FixedGasTable::GasRow> GAS_COST_TABLE = {
{ OpCode::ADD_8, make_cost(AVM_ADD_BASE_L2_GAS, 0, AVM_ADD_DYN_L2_GAS, 0) },
{ OpCode::ADD_16, make_cost(AVM_ADD_BASE_L2_GAS, 0, AVM_ADD_DYN_L2_GAS, 0) },
{ OpCode::SUB_8, make_cost(AVM_SUB_BASE_L2_GAS, 0, AVM_SUB_DYN_L2_GAS, 0) },
{ OpCode::SUB_16, make_cost(AVM_SUB_BASE_L2_GAS, 0, AVM_SUB_DYN_L2_GAS, 0) },
{ OpCode::MUL_8, make_cost(AVM_MUL_BASE_L2_GAS, 0, AVM_MUL_DYN_L2_GAS, 0) },
{ OpCode::MUL_16, make_cost(AVM_MUL_BASE_L2_GAS, 0, AVM_MUL_DYN_L2_GAS, 0) },
{ OpCode::DIV_8, make_cost(AVM_DIV_BASE_L2_GAS, 0, AVM_DIV_DYN_L2_GAS, 0) },
{ OpCode::DIV_16, make_cost(AVM_DIV_BASE_L2_GAS, 0, AVM_DIV_DYN_L2_GAS, 0) },
{ OpCode::FDIV_8, make_cost(AVM_FDIV_BASE_L2_GAS, 0, AVM_FDIV_DYN_L2_GAS, 0) },
{ OpCode::FDIV_16, make_cost(AVM_FDIV_BASE_L2_GAS, 0, AVM_FDIV_DYN_L2_GAS, 0) },
{ OpCode::EQ_8, make_cost(AVM_EQ_BASE_L2_GAS, 0, AVM_EQ_DYN_L2_GAS, 0) },
{ OpCode::EQ_16, make_cost(AVM_EQ_BASE_L2_GAS, 0, AVM_EQ_DYN_L2_GAS, 0) },
{ OpCode::LT_8, make_cost(AVM_LT_BASE_L2_GAS, 0, AVM_LT_DYN_L2_GAS, 0) },
{ OpCode::LT_16, make_cost(AVM_LT_BASE_L2_GAS, 0, AVM_LT_DYN_L2_GAS, 0) },
{ OpCode::LTE_8, make_cost(AVM_LTE_BASE_L2_GAS, 0, AVM_LTE_DYN_L2_GAS, 0) },
{ OpCode::LTE_16, make_cost(AVM_LTE_BASE_L2_GAS, 0, AVM_LTE_DYN_L2_GAS, 0) },
{ OpCode::AND_8, make_cost(AVM_AND_BASE_L2_GAS, 0, AVM_AND_DYN_L2_GAS, 0) },
{ OpCode::AND_16, make_cost(AVM_AND_BASE_L2_GAS, 0, AVM_AND_DYN_L2_GAS, 0) },
{ OpCode::OR_8, make_cost(AVM_OR_BASE_L2_GAS, 0, AVM_OR_DYN_L2_GAS, 0) },
{ OpCode::OR_16, make_cost(AVM_OR_BASE_L2_GAS, 0, AVM_OR_DYN_L2_GAS, 0) },
{ OpCode::XOR_8, make_cost(AVM_XOR_BASE_L2_GAS, 0, AVM_XOR_DYN_L2_GAS, 0) },
{ OpCode::XOR_16, make_cost(AVM_XOR_BASE_L2_GAS, 0, AVM_XOR_DYN_L2_GAS, 0) },
{ OpCode::NOT_8, make_cost(AVM_NOT_BASE_L2_GAS, 0, AVM_NOT_DYN_L2_GAS, 0) },
{ OpCode::NOT_16, make_cost(AVM_NOT_BASE_L2_GAS, 0, AVM_NOT_DYN_L2_GAS, 0) },
{ OpCode::SHL_8, make_cost(AVM_SHL_BASE_L2_GAS, 0, AVM_SHL_DYN_L2_GAS, 0) },
{ OpCode::SHL_16, make_cost(AVM_SHL_BASE_L2_GAS, 0, AVM_SHL_DYN_L2_GAS, 0) },
{ OpCode::SHR_8, make_cost(AVM_SHR_BASE_L2_GAS, 0, AVM_SHR_DYN_L2_GAS, 0) },
{ OpCode::SHR_16, make_cost(AVM_SHR_BASE_L2_GAS, 0, AVM_SHR_DYN_L2_GAS, 0) },
{ OpCode::CAST_8, make_cost(AVM_CAST_BASE_L2_GAS, 0, AVM_CAST_DYN_L2_GAS, 0) },
{ OpCode::CAST_16, make_cost(AVM_CAST_BASE_L2_GAS, 0, AVM_CAST_DYN_L2_GAS, 0) },
{ OpCode::ADD_8, make_cost(AVM_ADD_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::ADD_16, make_cost(AVM_ADD_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SUB_8, make_cost(AVM_SUB_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SUB_16, make_cost(AVM_SUB_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::MUL_8, make_cost(AVM_MUL_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::MUL_16, make_cost(AVM_MUL_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::DIV_8, make_cost(AVM_DIV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::DIV_16, make_cost(AVM_DIV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::FDIV_8, make_cost(AVM_FDIV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::FDIV_16, make_cost(AVM_FDIV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::EQ_8, make_cost(AVM_EQ_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::EQ_16, make_cost(AVM_EQ_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::LT_8, make_cost(AVM_LT_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::LT_16, make_cost(AVM_LT_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::LTE_8, make_cost(AVM_LTE_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::LTE_16, make_cost(AVM_LTE_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::AND_8, make_cost(AVM_AND_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::AND_16, make_cost(AVM_AND_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::OR_8, make_cost(AVM_OR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::OR_16, make_cost(AVM_OR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::XOR_8, make_cost(AVM_XOR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::XOR_16, make_cost(AVM_XOR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::NOT_8, make_cost(AVM_NOT_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::NOT_16, make_cost(AVM_NOT_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SHL_8, make_cost(AVM_SHL_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SHL_16, make_cost(AVM_SHL_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SHR_8, make_cost(AVM_SHR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SHR_16, make_cost(AVM_SHR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::CAST_8, make_cost(AVM_CAST_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::CAST_16, make_cost(AVM_CAST_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::GETENVVAR_16, make_cost(AVM_GETENVVAR_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::CALLDATACOPY, make_cost(AVM_CALLDATACOPY_BASE_L2_GAS, 0, AVM_CALLDATACOPY_DYN_L2_GAS, 0) },
{ OpCode::JUMP_16, make_cost(AVM_JUMP_BASE_L2_GAS, 0, AVM_JUMP_DYN_L2_GAS, 0) },
{ OpCode::JUMPI_16, make_cost(AVM_JUMPI_BASE_L2_GAS, 0, AVM_JUMPI_DYN_L2_GAS, 0) },
{ OpCode::INTERNALCALL, make_cost(AVM_INTERNALCALL_BASE_L2_GAS, 0, AVM_INTERNALCALL_DYN_L2_GAS, 0) },
{ OpCode::INTERNALRETURN, make_cost(AVM_INTERNALRETURN_BASE_L2_GAS, 0, AVM_INTERNALRETURN_DYN_L2_GAS, 0) },
{ OpCode::SET_8, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::SET_16, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::SET_32, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::SET_64, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::SET_128, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::SET_FF, make_cost(AVM_SET_BASE_L2_GAS, 0, AVM_SET_DYN_L2_GAS, 0) },
{ OpCode::MOV_8, make_cost(AVM_MOV_BASE_L2_GAS, 0, AVM_MOV_DYN_L2_GAS, 0) },
{ OpCode::MOV_16, make_cost(AVM_MOV_BASE_L2_GAS, 0, AVM_MOV_DYN_L2_GAS, 0) },
{ OpCode::CMOV, make_cost(AVM_CMOV_BASE_L2_GAS, 0, AVM_CMOV_DYN_L2_GAS, 0) },
{ OpCode::SLOAD, make_cost(AVM_SLOAD_BASE_L2_GAS, 0, AVM_SLOAD_DYN_L2_GAS, 0) },
{ OpCode::SSTORE, make_cost(AVM_SSTORE_BASE_L2_GAS, 0, AVM_SSTORE_DYN_L2_GAS, 0) },
{ OpCode::NOTEHASHEXISTS, make_cost(AVM_NOTEHASHEXISTS_BASE_L2_GAS, 0, AVM_NOTEHASHEXISTS_DYN_L2_GAS, 0) },
{ OpCode::EMITNOTEHASH, make_cost(AVM_EMITNOTEHASH_BASE_L2_GAS, 0, AVM_EMITNOTEHASH_DYN_L2_GAS, 0) },
{ OpCode::NULLIFIEREXISTS, make_cost(AVM_NULLIFIEREXISTS_BASE_L2_GAS, 0, AVM_NULLIFIEREXISTS_DYN_L2_GAS, 0) },
{ OpCode::EMITNULLIFIER, make_cost(AVM_EMITNULLIFIER_BASE_L2_GAS, 0, AVM_EMITNULLIFIER_DYN_L2_GAS, 0) },
{ OpCode::L1TOL2MSGEXISTS, make_cost(AVM_L1TOL2MSGEXISTS_BASE_L2_GAS, 0, AVM_L1TOL2MSGEXISTS_DYN_L2_GAS, 0) },
{ OpCode::GETCONTRACTINSTANCE,
make_cost(AVM_GETCONTRACTINSTANCE_BASE_L2_GAS, 0, AVM_GETCONTRACTINSTANCE_DYN_L2_GAS, 0) },
{ OpCode::JUMP_16, make_cost(AVM_JUMP_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::JUMPI_16, make_cost(AVM_JUMPI_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::INTERNALCALL, make_cost(AVM_INTERNALCALL_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::INTERNALRETURN, make_cost(AVM_INTERNALRETURN_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_8, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_16, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_32, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_64, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_128, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SET_FF, make_cost(AVM_SET_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::MOV_8, make_cost(AVM_MOV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::MOV_16, make_cost(AVM_MOV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::CMOV, make_cost(AVM_CMOV_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SLOAD, make_cost(AVM_SLOAD_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SSTORE, make_cost(AVM_SSTORE_BASE_L2_GAS, AVM_SSTORE_BASE_DA_GAS, 0, 0) },
{ OpCode::NOTEHASHEXISTS, make_cost(AVM_NOTEHASHEXISTS_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::EMITNOTEHASH, make_cost(AVM_EMITNOTEHASH_BASE_L2_GAS, AVM_EMITNOTEHASH_BASE_DA_GAS, 0, 0) },
{ OpCode::NULLIFIEREXISTS, make_cost(AVM_NULLIFIEREXISTS_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::EMITNULLIFIER, make_cost(AVM_EMITNULLIFIER_BASE_L2_GAS, AVM_EMITNULLIFIER_BASE_DA_GAS, 0, 0) },
{ OpCode::L1TOL2MSGEXISTS, make_cost(AVM_L1TOL2MSGEXISTS_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::GETCONTRACTINSTANCE, make_cost(AVM_GETCONTRACTINSTANCE_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::EMITUNENCRYPTEDLOG,
make_cost(AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS, 0, AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS, 0) },
{ OpCode::SENDL2TOL1MSG, make_cost(AVM_SENDL2TOL1MSG_BASE_L2_GAS, 0, AVM_SENDL2TOL1MSG_DYN_L2_GAS, 0) },
make_cost(AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS,
0,
AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS,
AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS) },
{ OpCode::SENDL2TOL1MSG, make_cost(AVM_SENDL2TOL1MSG_BASE_L2_GAS, AVM_SENDL2TOL1MSG_BASE_DA_GAS, 0, 0) },
{ OpCode::CALL, make_cost(AVM_CALL_BASE_L2_GAS, 0, AVM_CALL_DYN_L2_GAS, 0) },
{ OpCode::STATICCALL, make_cost(AVM_STATICCALL_BASE_L2_GAS, 0, AVM_STATICCALL_DYN_L2_GAS, 0) },
{ OpCode::DELEGATECALL, make_cost(AVM_DELEGATECALL_BASE_L2_GAS, 0, AVM_DELEGATECALL_DYN_L2_GAS, 0) },
{ OpCode::RETURN, make_cost(AVM_RETURN_BASE_L2_GAS, 0, AVM_RETURN_DYN_L2_GAS, 0) },
{ OpCode::REVERT_8, make_cost(AVM_REVERT_BASE_L2_GAS, 0, AVM_REVERT_DYN_L2_GAS, 0) },
{ OpCode::REVERT_16, make_cost(AVM_REVERT_BASE_L2_GAS, 0, AVM_REVERT_DYN_L2_GAS, 0) },
{ OpCode::DEBUGLOG, make_cost(AVM_DEBUGLOG_BASE_L2_GAS, 0, AVM_DEBUGLOG_DYN_L2_GAS, 0) },
{ OpCode::DEBUGLOG, make_cost(AVM_DEBUGLOG_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::KECCAK, make_cost(AVM_KECCAK_BASE_L2_GAS, 0, AVM_KECCAK_DYN_L2_GAS, 0) },
{ OpCode::POSEIDON2, make_cost(AVM_POSEIDON2_BASE_L2_GAS, 0, AVM_POSEIDON2_DYN_L2_GAS, 0) },
{ OpCode::SHA256COMPRESSION, make_cost(AVM_SHA256COMPRESSION_BASE_L2_GAS, 0, AVM_SHA256COMPRESSION_DYN_L2_GAS, 0) },
{ OpCode::KECCAKF1600, make_cost(AVM_KECCAKF1600_BASE_L2_GAS, 0, AVM_KECCAKF1600_DYN_L2_GAS, 0) },
{ OpCode::POSEIDON2, make_cost(AVM_POSEIDON2_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::SHA256COMPRESSION, make_cost(AVM_SHA256COMPRESSION_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::KECCAKF1600, make_cost(AVM_KECCAKF1600_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::PEDERSEN, make_cost(AVM_PEDERSEN_BASE_L2_GAS, 0, AVM_PEDERSEN_DYN_L2_GAS, 0) },
{ OpCode::ECADD, make_cost(AVM_ECADD_BASE_L2_GAS, 0, AVM_ECADD_DYN_L2_GAS, 0) },
{ OpCode::ECADD, make_cost(AVM_ECADD_BASE_L2_GAS, 0, 0, 0) },
{ OpCode::MSM, make_cost(AVM_MSM_BASE_L2_GAS, 0, AVM_MSM_DYN_L2_GAS, 0) },
{ OpCode::PEDERSENCOMMITMENT,
make_cost(AVM_PEDERSENCOMMITMENT_BASE_L2_GAS, 0, AVM_PEDERSENCOMMITMENT_DYN_L2_GAS, 0) },
Expand Down
21 changes: 13 additions & 8 deletions barretenberg/cpp/src/barretenberg/vm/avm/trace/trace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2923,13 +2923,13 @@ void AvmTraceBuilder::op_keccak(uint8_t indirect,
auto [resolved_output_offset, resolved_input_offset, resolved_input_size_offset] =
unpack_indirects<3>(indirect, { output_offset, input_offset, input_size_offset });

// Constrain gas cost
gas_trace_builder.constrain_gas(clk, OpCode::KECCAK);

// Read the input length first
auto input_length_read = constrained_read_from_memory(
call_ptr, clk, resolved_input_size_offset, AvmMemoryTag::U32, AvmMemoryTag::U0, IntermRegister::IB);

// Constrain gas cost
gas_trace_builder.constrain_gas(clk, OpCode::KECCAK, static_cast<uint32_t>(input_length_read.val));

// Store the clock time that we will use to line up the gadget later
auto keccak_op_clk = clk;
main_trace.push_back(Row{
Expand Down Expand Up @@ -3123,7 +3123,8 @@ void AvmTraceBuilder::op_pedersen_hash(uint8_t indirect,
auto gen_ctx_read = unconstrained_read_from_memory(resolved_gen_ctx_offset);

// Constrain gas cost
gas_trace_builder.constrain_gas(clk, OpCode::PEDERSEN);
// TODO(dbanks12): need tag check u32 here on input size
gas_trace_builder.constrain_gas(clk, OpCode::PEDERSEN, static_cast<uint32_t>(input_size_read));

// We read the input and output addresses in one row as they should contain FF elements
main_trace.push_back(Row{
Expand All @@ -3141,8 +3142,8 @@ void AvmTraceBuilder::op_pedersen_hash(uint8_t indirect,
});

std::vector<FF> inputs;
read_slice_from_memory<FF>(resolved_input_offset, uint32_t(input_size_read), inputs);
FF output = pedersen_trace_builder.pedersen_hash(inputs, uint32_t(gen_ctx_read), clk);
read_slice_from_memory<FF>(resolved_input_offset, static_cast<uint32_t>(input_size_read), inputs);
FF output = pedersen_trace_builder.pedersen_hash(inputs, static_cast<uint32_t>(gen_ctx_read), clk);
write_slice_to_memory(resolved_output_offset, AvmMemoryTag::FF, std::vector<FF>{ output });
}

Expand Down Expand Up @@ -3285,7 +3286,9 @@ void AvmTraceBuilder::op_variable_msm(uint8_t indirect,
.main_tag_err = FF(0),
});

gas_trace_builder.constrain_gas(clk, OpCode::MSM);
// TODO(dbanks12): length needs to fit into u32 here or it will certainly
// run out of gas. Casting/truncating here is not secure.
gas_trace_builder.constrain_gas(clk, OpCode::MSM, static_cast<uint32_t>(points_length));

// Write the result back to memory [x, y, inf] with tags [FF, FF, U8]
AddressWithMode output_offset_direct =
Expand Down Expand Up @@ -3323,7 +3326,9 @@ void AvmTraceBuilder::op_pedersen_commit(uint8_t indirect,
.main_tag_err = FF(0),
});

gas_trace_builder.constrain_gas(clk, OpCode::PEDERSENCOMMITMENT);
// TODO(dbanks12): length needs to fit into u32 here or it will certainly
// run out of gas. Casting/truncating here is not secure.
gas_trace_builder.constrain_gas(clk, OpCode::PEDERSENCOMMITMENT, static_cast<uint32_t>(input_length_read));

// Write the result back to memory [x, y, inf] with tags [FF, FF, U8]
AddressWithMode output_offset_direct =
Expand Down
167 changes: 67 additions & 100 deletions barretenberg/cpp/src/barretenberg/vm/aztec_constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,104 +68,71 @@
#define START_EMIT_NULLIFIER_WRITE_OFFSET 144
#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 160
#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 162
#define AVM_DEFAULT_BASE_GAS_L2 100
#define AVM_DEFAULT_DYN_GAS_L2 0
#define AVM_ADD_BASE_L2_GAS 320
#define AVM_SUB_BASE_L2_GAS 320
#define AVM_MUL_BASE_L2_GAS 330
#define AVM_DIV_BASE_L2_GAS 430
#define AVM_FDIV_BASE_L2_GAS 320
#define AVM_EQ_BASE_L2_GAS 320
#define AVM_LT_BASE_L2_GAS 640
#define AVM_LTE_BASE_L2_GAS 640
#define AVM_AND_BASE_L2_GAS 330
#define AVM_OR_BASE_L2_GAS 330
#define AVM_XOR_BASE_L2_GAS 320
#define AVM_NOT_BASE_L2_GAS 270
#define AVM_SHL_BASE_L2_GAS 320
#define AVM_SHR_BASE_L2_GAS 320
#define AVM_CAST_BASE_L2_GAS 300
#define AVM_GETENVVAR_BASE_L2_GAS 200
#define AVM_CALLDATACOPY_BASE_L2_GAS 290
#define AVM_JUMP_BASE_L2_GAS 120
#define AVM_JUMPI_BASE_L2_GAS 180
#define AVM_INTERNALCALL_BASE_L2_GAS 180
#define AVM_INTERNALRETURN_BASE_L2_GAS 180
#define AVM_SET_BASE_L2_GAS 180
#define AVM_MOV_BASE_L2_GAS 230
#define AVM_CMOV_BASE_L2_GAS 340
#define AVM_SLOAD_BASE_L2_GAS 180
#define AVM_SSTORE_BASE_L2_GAS 180
#define AVM_NOTEHASHEXISTS_BASE_L2_GAS 260
#define AVM_EMITNOTEHASH_BASE_L2_GAS 260
#define AVM_NULLIFIEREXISTS_BASE_L2_GAS 260
#define AVM_EMITNULLIFIER_BASE_L2_GAS 260
#define AVM_L1TOL2MSGEXISTS_BASE_L2_GAS 260
#define AVM_GETCONTRACTINSTANCE_BASE_L2_GAS 480
#define AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS 180
#define AVM_SENDL2TOL1MSG_BASE_L2_GAS 260
#define AVM_CALL_BASE_L2_GAS 450
#define AVM_STATICCALL_BASE_L2_GAS 450
#define AVM_DELEGATECALL_BASE_L2_GAS 0
#define AVM_RETURN_BASE_L2_GAS 140
#define AVM_REVERT_BASE_L2_GAS 140
#define AVM_DEBUGLOG_BASE_L2_GAS 100
#define AVM_ADD_BASE_L2_GAS 32
#define AVM_SUB_BASE_L2_GAS 32
#define AVM_MUL_BASE_L2_GAS 33
#define AVM_DIV_BASE_L2_GAS 43
#define AVM_FDIV_BASE_L2_GAS 32
#define AVM_EQ_BASE_L2_GAS 32
#define AVM_LT_BASE_L2_GAS 64
#define AVM_LTE_BASE_L2_GAS 64
#define AVM_AND_BASE_L2_GAS 33
#define AVM_OR_BASE_L2_GAS 33
#define AVM_XOR_BASE_L2_GAS 33
#define AVM_NOT_BASE_L2_GAS 27
#define AVM_SHL_BASE_L2_GAS 32
#define AVM_SHR_BASE_L2_GAS 32
#define AVM_CAST_BASE_L2_GAS 30
#define AVM_GETENVVAR_BASE_L2_GAS 20
#define AVM_CALLDATACOPY_BASE_L2_GAS 29
#define AVM_JUMP_BASE_L2_GAS 12
#define AVM_JUMPI_BASE_L2_GAS 18
#define AVM_INTERNALCALL_BASE_L2_GAS 18
#define AVM_INTERNALRETURN_BASE_L2_GAS 18
#define AVM_SET_BASE_L2_GAS 18
#define AVM_MOV_BASE_L2_GAS 23
#define AVM_CMOV_BASE_L2_GAS 34
#define AVM_SLOAD_BASE_L2_GAS 1218
#define AVM_SSTORE_BASE_L2_GAS 2642
#define AVM_NOTEHASHEXISTS_BASE_L2_GAS 986
#define AVM_EMITNOTEHASH_BASE_L2_GAS 2330
#define AVM_NULLIFIEREXISTS_BASE_L2_GAS 1226
#define AVM_EMITNULLIFIER_BASE_L2_GAS 2650
#define AVM_L1TOL2MSGEXISTS_BASE_L2_GAS 506
#define AVM_GETCONTRACTINSTANCE_BASE_L2_GAS 1248
#define AVM_EMITUNENCRYPTEDLOG_BASE_L2_GAS 18
#define AVM_SENDL2TOL1MSG_BASE_L2_GAS 226
#define AVM_CALL_BASE_L2_GAS 2445
#define AVM_STATICCALL_BASE_L2_GAS 2445
#define AVM_DELEGATECALL_BASE_L2_GAS 2445
#define AVM_RETURN_BASE_L2_GAS 28
#define AVM_REVERT_BASE_L2_GAS 28
#define AVM_DEBUGLOG_BASE_L2_GAS 10
#define AVM_KECCAK_BASE_L2_GAS 3000
#define AVM_POSEIDON2_BASE_L2_GAS 670
#define AVM_SHA256_BASE_L2_GAS 3000
#define AVM_PEDERSEN_BASE_L2_GAS 3000
#define AVM_ECADD_BASE_L2_GAS 900
#define AVM_MSM_BASE_L2_GAS 900
#define AVM_PEDERSENCOMMITMENT_BASE_L2_GAS 3000
#define AVM_TORADIXLE_BASE_L2_GAS 200
#define AVM_SHA256COMPRESSION_BASE_L2_GAS 3000
#define AVM_KECCAKF1600_BASE_L2_GAS 3000
#define AVM_ADD_DYN_L2_GAS 0
#define AVM_SUB_DYN_L2_GAS 0
#define AVM_MUL_DYN_L2_GAS 0
#define AVM_DIV_DYN_L2_GAS 0
#define AVM_FDIV_DYN_L2_GAS 0
#define AVM_EQ_DYN_L2_GAS 0
#define AVM_LT_DYN_L2_GAS 0
#define AVM_LTE_DYN_L2_GAS 0
#define AVM_AND_DYN_L2_GAS 0
#define AVM_OR_DYN_L2_GAS 0
#define AVM_XOR_DYN_L2_GAS 0
#define AVM_NOT_DYN_L2_GAS 0
#define AVM_SHL_DYN_L2_GAS 0
#define AVM_SHR_DYN_L2_GAS 0
#define AVM_CAST_DYN_L2_GAS 0
#define AVM_CALLDATACOPY_DYN_L2_GAS 50
#define AVM_JUMP_DYN_L2_GAS 0
#define AVM_JUMPI_DYN_L2_GAS 0
#define AVM_INTERNALCALL_DYN_L2_GAS 0
#define AVM_INTERNALRETURN_DYN_L2_GAS 0
#define AVM_SET_DYN_L2_GAS 0
#define AVM_MOV_DYN_L2_GAS 0
#define AVM_CMOV_DYN_L2_GAS 0
#define AVM_SLOAD_DYN_L2_GAS 180
#define AVM_SSTORE_DYN_L2_GAS 180
#define AVM_NOTEHASHEXISTS_DYN_L2_GAS 0
#define AVM_EMITNOTEHASH_DYN_L2_GAS 0
#define AVM_NULLIFIEREXISTS_DYN_L2_GAS 0
#define AVM_EMITNULLIFIER_DYN_L2_GAS 0
#define AVM_L1TOL2MSGEXISTS_DYN_L2_GAS 0
#define AVM_GETCONTRACTINSTANCE_DYN_L2_GAS 0
#define AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS 180
#define AVM_SENDL2TOL1MSG_DYN_L2_GAS 0
#define AVM_CALL_DYN_L2_GAS 50
#define AVM_STATICCALL_DYN_L2_GAS 50
#define AVM_DELEGATECALL_DYN_L2_GAS 50
#define AVM_RETURN_DYN_L2_GAS 50
#define AVM_REVERT_DYN_L2_GAS 50
#define AVM_DEBUGLOG_DYN_L2_GAS 0
#define AVM_KECCAK_DYN_L2_GAS 0
#define AVM_POSEIDON2_DYN_L2_GAS 0
#define AVM_SHA256_DYN_L2_GAS 0
#define AVM_PEDERSEN_DYN_L2_GAS 0
#define AVM_ECADD_DYN_L2_GAS 0
#define AVM_MSM_DYN_L2_GAS 0
#define AVM_PEDERSENCOMMITMENT_DYN_L2_GAS 0
#define AVM_TORADIXLE_DYN_L2_GAS 200
#define AVM_SHA256COMPRESSION_DYN_L2_GAS 0
#define AVM_KECCAKF1600_DYN_L2_GAS 0
#define AVM_POSEIDON2_BASE_L2_GAS 78
#define AVM_SHA256_BASE_L2_GAS 2610
#define AVM_PEDERSEN_BASE_L2_GAS 1000
#define AVM_ECADD_BASE_L2_GAS 62
#define AVM_MSM_BASE_L2_GAS 1000
#define AVM_PEDERSENCOMMITMENT_BASE_L2_GAS 1000
#define AVM_TORADIXLE_BASE_L2_GAS 46
#define AVM_SHA256COMPRESSION_BASE_L2_GAS 261
#define AVM_KECCAKF1600_BASE_L2_GAS 300
#define AVM_CALLDATACOPY_DYN_L2_GAS 6
#define AVM_EMITUNENCRYPTEDLOG_DYN_L2_GAS 146
#define AVM_CALL_DYN_L2_GAS 4
#define AVM_STATICCALL_DYN_L2_GAS 4
#define AVM_DELEGATECALL_DYN_L2_GAS 4
#define AVM_RETURN_DYN_L2_GAS 6
#define AVM_REVERT_DYN_L2_GAS 6
#define AVM_KECCAK_DYN_L2_GAS 100
#define AVM_SHA256_DYN_L2_GAS 100
#define AVM_PEDERSEN_DYN_L2_GAS 100
#define AVM_PEDERSENCOMMITMENT_DYN_L2_GAS 100
#define AVM_MSM_DYN_L2_GAS 100
#define AVM_TORADIXLE_DYN_L2_GAS 20
#define AVM_SSTORE_BASE_DA_GAS 512
#define AVM_EMITNOTEHASH_BASE_DA_GAS 512
#define AVM_EMITNULLIFIER_BASE_DA_GAS 512
#define AVM_SENDL2TOL1MSG_BASE_DA_GAS 512
#define AVM_EMITUNENCRYPTEDLOG_DYN_DA_GAS 512
Loading

0 comments on commit 2caf555

Please sign in to comment.