Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
constants.hpp File Reference
#include "barretenberg/common/log.hpp"
#include "barretenberg/vm2/common/avm_io.hpp"
#include "barretenberg/vm2/common/aztec_types.hpp"
#include "barretenberg/vm2/common/field.hpp"
#include <cstdlib>
#include <functional>

Go to the source code of this file.

Macros

#define fuzz_info(...)   fuzz_info_([&]() { return format(__VA_ARGS__); })
 

Typedefs

using EthAddress = FF
 
using AztecAddress = FF
 

Functions

void fuzz_info_ (std::function< std::string()> func)
 

Variables

const FF CHAIN_ID = 1
 
const FF VERSION = 1
 
const uint32_t BLOCK_NUMBER = 1
 
const FF SLOT_NUMBER = 1
 
const uint64_t TIMESTAMP = 1000000
 
const EthAddress COINBASE = EthAddress{ 0 }
 
const AztecAddress FEE_RECIPIENT = AztecAddress{ 0 }
 
constexpr uint128_t FEE_PER_DA_GAS = 1
 
constexpr uint128_t FEE_PER_L2_GAS = 1
 
const std::string TRANSACTION_HASH = "0xdeadbeef"
 
constexpr GasFees EFFECTIVE_GAS_FEES = GasFees{ .fee_per_da_gas = FEE_PER_DA_GAS, .fee_per_l2_gas = FEE_PER_L2_GAS }
 
const FF FIRST_NULLIFIER = FF("0x00000000000000000000000000000000000000000000000000000000deadbeef")
 
const std::vector< FFNON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS = { FIRST_NULLIFIER }
 
const std::vector< FFNON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES = {}
 
const std::vector< ScopedL2ToL1MessageNON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES = {}
 
const std::vector< FFREVERTIBLE_ACCUMULATED_DATA_NULLIFIERS = {}
 
const std::vector< FFREVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES = {}
 
const std::vector< ScopedL2ToL1MessageREVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES = {}
 
const std::vector< PublicCallRequestWithCalldataSETUP_ENQUEUED_CALLS = {}
 
const FF MSG_SENDER = 100
 
const std::optional< PublicCallRequestWithCalldataTEARDOWN_ENQUEUED_CALLS = std::nullopt
 
const Gas GAS_USED_BY_PRIVATE = Gas{ .l2_gas = 0, .da_gas = 0 }
 
const AztecAddress FEE_PAYER = AztecAddress{ 0 }
 
const FF CONTRACT_ADDRESS = 42
 
const FF TRANSACTION_FEE = 0
 
const bool IS_STATIC_CALL = false
 
const Gas GAS_LIMIT = Gas{ .l2_gas = 1000000, .da_gas = 1000000 }
 
const std::vector< uint8_t > ADD_8_BYTECODE
 
const std::vector< uint8_t > ZERO_DIVISION_BYTECODE
 
const std::vector< uint8_t > SSTORE_BYTECODE
 
const std::vector< std::vector< uint8_t > > PREDEFINED_FUNCTIONS
 

Macro Definition Documentation

◆ fuzz_info

#define fuzz_info (   ...)    fuzz_info_([&]() { return format(__VA_ARGS__); })

Definition at line 51 of file constants.hpp.

Typedef Documentation

◆ AztecAddress

using AztecAddress = FF

Definition at line 12 of file constants.hpp.

◆ EthAddress

using EthAddress = FF

Definition at line 11 of file constants.hpp.

Function Documentation

◆ fuzz_info_()

void fuzz_info_ ( std::function< std::string()>  func)
inline

Definition at line 43 of file constants.hpp.

Variable Documentation

◆ ADD_8_BYTECODE

const std::vector<uint8_t> ADD_8_BYTECODE
Initial value:
= { 39, 0, 0, 2, 1, 39, 0, 1, 2, 1, 0, 0, 0, 1,
2, 40, 0, 0, 5, 4, 0, 1, 59, 0, 0, 5, 0, 2 }

Definition at line 55 of file constants.hpp.

◆ BLOCK_NUMBER

const uint32_t BLOCK_NUMBER = 1

Definition at line 16 of file constants.hpp.

◆ CHAIN_ID

const FF CHAIN_ID = 1

Definition at line 14 of file constants.hpp.

◆ COINBASE

const EthAddress COINBASE = EthAddress{ 0 }

Definition at line 19 of file constants.hpp.

◆ CONTRACT_ADDRESS

const FF CONTRACT_ADDRESS = 42

Definition at line 37 of file constants.hpp.

◆ EFFECTIVE_GAS_FEES

constexpr GasFees EFFECTIVE_GAS_FEES = GasFees{ .fee_per_da_gas = FEE_PER_DA_GAS, .fee_per_l2_gas = FEE_PER_L2_GAS }
constexpr

Definition at line 24 of file constants.hpp.

◆ FEE_PAYER

const AztecAddress FEE_PAYER = AztecAddress{ 0 }

Definition at line 36 of file constants.hpp.

◆ FEE_PER_DA_GAS

constexpr uint128_t FEE_PER_DA_GAS = 1
constexpr

Definition at line 21 of file constants.hpp.

◆ FEE_PER_L2_GAS

constexpr uint128_t FEE_PER_L2_GAS = 1
constexpr

Definition at line 22 of file constants.hpp.

◆ FEE_RECIPIENT

const AztecAddress FEE_RECIPIENT = AztecAddress{ 0 }

Definition at line 20 of file constants.hpp.

◆ FIRST_NULLIFIER

const FF FIRST_NULLIFIER = FF("0x00000000000000000000000000000000000000000000000000000000deadbeef")

Definition at line 25 of file constants.hpp.

◆ GAS_LIMIT

const Gas GAS_LIMIT = Gas{ .l2_gas = 1000000, .da_gas = 1000000 }

Definition at line 40 of file constants.hpp.

◆ GAS_USED_BY_PRIVATE

const Gas GAS_USED_BY_PRIVATE = Gas{ .l2_gas = 0, .da_gas = 0 }

Definition at line 35 of file constants.hpp.

◆ IS_STATIC_CALL

const bool IS_STATIC_CALL = false

Definition at line 39 of file constants.hpp.

◆ MSG_SENDER

const FF MSG_SENDER = 100

Definition at line 33 of file constants.hpp.

◆ NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES

const std::vector<ScopedL2ToL1Message> NON_REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES = {}

Definition at line 28 of file constants.hpp.

◆ NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES

const std::vector<FF> NON_REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES = {}

Definition at line 27 of file constants.hpp.

◆ NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS

const std::vector<FF> NON_REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS = { FIRST_NULLIFIER }

Definition at line 26 of file constants.hpp.

◆ PREDEFINED_FUNCTIONS

const std::vector<std::vector<uint8_t> > PREDEFINED_FUNCTIONS
Initial value:
const std::vector< uint8_t > ZERO_DIVISION_BYTECODE
Definition constants.hpp:59
const std::vector< uint8_t > ADD_8_BYTECODE
Definition constants.hpp:55
const std::vector< uint8_t > SSTORE_BYTECODE
Definition constants.hpp:63

Definition at line 67 of file constants.hpp.

◆ REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES

const std::vector<ScopedL2ToL1Message> REVERTIBLE_ACCUMULATED_DATA_L2_TO_L1_MESSAGES = {}

Definition at line 31 of file constants.hpp.

◆ REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES

const std::vector<FF> REVERTIBLE_ACCUMULATED_DATA_NOTE_HASHES = {}

Definition at line 30 of file constants.hpp.

◆ REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS

const std::vector<FF> REVERTIBLE_ACCUMULATED_DATA_NULLIFIERS = {}

Definition at line 29 of file constants.hpp.

◆ SETUP_ENQUEUED_CALLS

const std::vector<PublicCallRequestWithCalldata> SETUP_ENQUEUED_CALLS = {}

Definition at line 32 of file constants.hpp.

◆ SLOT_NUMBER

const FF SLOT_NUMBER = 1

Definition at line 17 of file constants.hpp.

◆ SSTORE_BYTECODE

const std::vector<uint8_t> SSTORE_BYTECODE
Initial value:
= { 39, 0, 10, 0, 200, 44, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
48, 0, 0, 10, 0, 10, 40, 0, 0, 5, 4, 0, 1, 59, 0, 0, 5, 0, 10 }

Definition at line 63 of file constants.hpp.

◆ TEARDOWN_ENQUEUED_CALLS

const std::optional<PublicCallRequestWithCalldata> TEARDOWN_ENQUEUED_CALLS = std::nullopt

Definition at line 34 of file constants.hpp.

◆ TIMESTAMP

const uint64_t TIMESTAMP = 1000000

Definition at line 18 of file constants.hpp.

◆ TRANSACTION_FEE

const FF TRANSACTION_FEE = 0

Definition at line 38 of file constants.hpp.

◆ TRANSACTION_HASH

const std::string TRANSACTION_HASH = "0xdeadbeef"

Definition at line 23 of file constants.hpp.

◆ VERSION

const FF VERSION = 1

Definition at line 15 of file constants.hpp.

◆ ZERO_DIVISION_BYTECODE

const std::vector<uint8_t> ZERO_DIVISION_BYTECODE
Initial value:
= { 39, 0, 0, 2, 0, 6, 0, 0, 0, 2, 40, 0,
0, 5, 4, 0, 1, 59, 0, 0, 5, 0, 0 }

Definition at line 59 of file constants.hpp.