Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::avm2::simulation Namespace Reference

Namespaces

namespace  testonly
 

Classes

class  AddressDerivation
 
struct  AddressDerivationEvent
 
class  AddressDerivationInterface
 
class  Addressing
 
struct  AddressingEvent
 
struct  AddressingException
 
class  AddressingInterface
 
class  Alu
 
struct  AluEvent
 
class  AluException
 
class  AluInterface
 
struct  AppendLeafResult
 
class  BaseContext
 
class  Bitwise
 
struct  BitwiseEvent
 
class  BitwiseException
 
class  BitwiseInterface
 
struct  BytecodeDecompositionEvent
 
class  BytecodeHasher
 
struct  BytecodeHashingEvent
 
class  BytecodeHashingInterface
 
class  BytecodeManager
 
class  BytecodeManagerInterface
 
struct  BytecodeRetrievalError
 
struct  BytecodeRetrievalEvent
 
struct  CalldataEvent
 
class  CalldataHasher
 
class  CalldataHashingInterface
 
class  CalldataHashingProvider
 
class  CalldataHashingProviderInterface
 
class  CallStackMetadataCollector
 
class  CallStackMetadataCollectorInterface
 
class  CheckpointNotifiable
 Interface for a checkpoint notifiable. More...
 
class  ClassIdDerivation
 
struct  ClassIdDerivationEvent
 
class  ClassIdDerivationInterface
 
struct  ClassIdLeafValue
 
struct  CleanupEvent
 
struct  CollectGasFeeEvent
 
struct  ContextEvent
 
class  ContextInterface
 
class  ContextProvider
 
class  ContextProviderInterface
 
struct  ContextStackEvent
 
class  ContractDB
 
class  ContractDBInterface
 
class  ContractInstanceManager
 
class  ContractInstanceManagerInterface
 Core shared component for contract instance retrieval and validation. More...
 
struct  ContractInstanceNotFoundError
 
struct  ContractInstanceRetrievalEvent
 
class  DataCopy
 
struct  DataCopyEvent
 
struct  DataCopyException
 
class  DataCopyInterface
 
class  DebugLogger
 
class  DebugLoggerInterface
 
class  DeduplicatingEventEmitter
 
class  Ecc
 
struct  EccAddEvent
 
struct  EccAddMemoryEvent
 
struct  EccException
 
class  EccInterface
 
class  EmitUnencryptedLog
 
struct  EmitUnencryptedLogException
 
class  EmitUnencryptedLogInterface
 
struct  EmitUnencryptedLogWriteEvent
 
struct  EmptyPhaseEvent
 
class  EnqueuedCallContext
 
struct  EnqueuedCallEvent
 
struct  EnqueuedCallResult
 
class  EventEmitter
 
class  EventEmitterInterface
 
struct  EventsContainer
 
class  Execution
 
class  ExecutionComponentsProvider
 
class  ExecutionComponentsProviderInterface
 
struct  ExecutionEvent
 
class  ExecutionIdGetterInterface
 
class  ExecutionIdManager
 
class  ExecutionIdManagerInterface
 
class  ExecutionInterface
 
class  FieldGreaterThan
 
struct  FieldGreaterThanEvent
 
class  FieldGreaterThanInterface
 
struct  GasEvent
 
class  GasTracker
 
class  GasTrackerInterface
 
class  GetContractInstance
 
struct  GetContractInstanceEvent
 
struct  GetContractInstanceException
 
class  GetContractInstanceInterface
 
class  GreaterThan
 
struct  GreaterThanEvent
 
class  GreaterThanInterface
 
class  HighLevelMerkleDBInterface
 
class  HintedRawContractDB
 
class  HintedRawMerkleDB
 
class  HintingContractsDB
 
class  HintingRawDB
 
class  HybridExecution
 
class  IndexedMemoryTree
 
struct  InstrDeserializationError
 
struct  Instruction
 
struct  InstructionFetchingError
 
struct  InstructionFetchingEvent
 
class  InstructionInfoDB
 
class  InstructionInfoDBInterface
 
struct  InternalCallPtr
 
struct  InternalCallStackEvent
 
class  InternalCallStackException
 
class  InternalCallStackManager
 
class  InternalCallStackManagerInterface
 
class  InternalCallStackManagerProvider
 
class  InternalCallStackManagerProviderInterface
 
class  KeccakF1600
 
struct  KeccakF1600Event
 
struct  KeccakF1600Exception
 
class  KeccakF1600Interface
 
struct  KeccakF1600RoundData
 
class  L1ToL2MessageTreeCheck
 
struct  L1ToL2MessageTreeCheckEvent
 
class  L1ToL2MessageTreeCheckInterface
 
struct  LimbsComparisonWitness
 
class  LowLevelMerkleDBInterface
 
struct  MappedContractHints
 
struct  MappedMerkleHints
 
class  Memory
 
struct  MemoryEvent
 
class  MemoryInterface
 
class  MemoryProvider
 
class  MemoryProviderInterface
 
class  MemoryStore
 
class  MerkleCheck
 
struct  MerkleCheckEvent
 
class  MerkleCheckInterface
 
class  MerkleDB
 
class  MockAddressing
 
class  MockAlu
 
class  MockBitwise
 
class  MockBytecodeManager
 
class  MockCalldataHasher
 
class  MockCallStackMetadataCollector
 
class  MockClassIdDerivation
 
class  MockContext
 
class  MockContextProvider
 
class  MockContractDB
 
class  MockDataCopy
 
class  MockDebugLog
 
class  MockEcc
 
class  MockEmitUnencryptedLog
 
class  MockExecution
 
class  MockExecutionComponentsProvider
 
class  MockExecutionIdManager
 
class  MockFieldGreaterThan
 
class  MockGasTracker
 
class  MockGetContractInstance
 
class  MockGreaterThan
 
class  MockHighLevelMerkleDB
 
class  MockInternalCallStackManager
 
class  MockKeccakF1600
 
class  MockL1ToL2MessageTreeCheck
 
class  MockLowLevelMerkleDB
 
class  MockMemory
 
class  MockMerkleCheck
 
class  MockNoteHashTreeCheck
 
class  MockNullifierTreeCheck
 
class  MockPoseidon2
 
class  MockRangeCheck
 
class  MockRetrievedBytecodesTreeCheck
 
class  MockSha256
 
class  MockSideEffectTracker
 
class  MockToRadix
 
class  MockUpdateCheck
 
class  MockWrittenPublicDataSlotsTreeCheck
 
class  NestedContext
 
class  NoopCallStackMetadataCollector
 
class  NoopDebugLogger
 
class  NoopEventEmitter
 
class  NoopUpdateCheck
 
struct  NoteHashAppendData
 
struct  NoteHashSiloingData
 
class  NoteHashTreeCheck
 
class  NoteHashTreeCheckInterface
 
struct  NoteHashTreeReadWriteEvent
 
struct  NoteHashUniquenessData
 
struct  NullifierAppendData
 
class  NullifierCollisionException
 
struct  NullifierSiloingData
 
class  NullifierTreeCheck
 
class  NullifierTreeCheckInterface
 
struct  NullifierTreeReadWriteEvent
 
class  OneShotEventEmitter
 
class  OpcodeExecutionException
 
struct  OperandResolutionInfo
 
struct  OutOfGasException
 
struct  PadTreesEvent
 
struct  PhaseLengths
 
class  Poseidon2
 
struct  Poseidon2Exception
 
struct  Poseidon2HashEvent
 
class  Poseidon2Interface
 
struct  Poseidon2PermutationEvent
 
struct  Poseidon2PermutationMemoryEvent
 
struct  PrivateAppendTreeEvent
 
struct  PrivateEmitL2L1MessageEvent
 
class  PublicDataTreeCheck
 
class  PublicDataTreeCheckInterface
 
struct  PublicDataTreeReadWriteEvent
 
struct  PublicDataWriteData
 
class  PublicInputsBuilder
 
class  PureAddressing
 
class  PureAlu
 
class  PureBitwise
 
class  PureContractDB
 
class  PureExecutionComponentsProvider
 
class  PureGreaterThan
 
class  PureMemoryProvider
 
class  PureMerkleDB
 
class  PurePoseidon2
 
class  PureRawMerkleDB
 
class  PureToRadix
 
class  PureTxBytecodeManager
 
class  PureWrittenPublicDataSlotsTreeCheck
 
class  RangeCheck
 
struct  RangeCheckEvent
 
class  RangeCheckInterface
 
class  RegisterValidationException
 
struct  RetrievedBytecodeAppendData
 
class  RetrievedBytecodesInterface
 
class  RetrievedBytecodesTreeCheck
 
struct  RetrievedBytecodesTreeCheckEvent
 
class  RetrievedBytecodesTreeCheckInterface
 
struct  ScalarMulEvent
 
struct  ScalarMulIntermediateState
 
class  Sha256
 
struct  Sha256CompressionEvent
 
struct  Sha256CompressionException
 
class  Sha256Interface
 
class  SideEffectTracker
 
class  SideEffectTrackerInterface
 Interface for a side effect tracker. More...
 
class  SideEffectTrackingDB
 A high-level merkle db that tracks side effects. More...
 
class  Siloing
 
struct  SiloingEvent
 
class  SiloingInterface
 
struct  SlotAppendData
 
class  ToRadix
 
struct  ToRadixEvent
 
class  ToRadixException
 
class  ToRadixInterface
 
struct  ToRadixMemoryEvent
 
struct  TrackedSideEffects
 
struct  TreeCounters
 
class  TxBytecodeManager
 
class  TxBytecodeManagerInterface
 
struct  TxContext
 
struct  TxContextEvent
 
class  TxExecution
 
struct  TxExecutionResult
 
struct  TxPhaseEvent
 
struct  TxStartupEvent
 
struct  U128Decomposition
 
struct  U256Decomposition
 
class  UpdateCheck
 
struct  UpdateCheckEvent
 
class  UpdateCheckInterface
 
struct  WrittenPublicDataSlotLeafValue
 
class  WrittenPublicDataSlotsInterface
 
class  WrittenPublicDataSlotsTreeCheck
 
struct  WrittenPublicDataSlotsTreeCheckEvent
 
class  WrittenPublicDataSlotsTreeCheckInterface
 

Typedefs

using EmitUnencryptedLogEvent = std::variant< EmitUnencryptedLogWriteEvent, CheckPointEventType >
 
using KeccakF1600State = std::array< std::array< uint64_t, 5 >, 5 >
 
using KeccakF1600StateMemValues = std::array< std::array< MemoryValue, 5 >, 5 >
 
using NoteHashTreeCheckEvent = std::variant< NoteHashTreeReadWriteEvent, CheckPointEventType >
 
using NullifierTreeCheckEvent = std::variant< NullifierTreeReadWriteEvent, CheckPointEventType >
 
using PublicDataTreeCheckEvent = std::variant< PublicDataTreeReadWriteEvent, CheckPointEventType >
 
using TxPhaseEventType = std::variant< EnqueuedCallEvent, PrivateAppendTreeEvent, PrivateEmitL2L1MessageEvent, CollectGasFeeEvent, PadTreesEvent, CleanupEvent, EmptyPhaseEvent >
 
using TxEvent = std::variant< TxStartupEvent, TxPhaseEvent >
 
using RawPoseidon2 = crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
 
using Poseidon2 = crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
 
using PublicDataTreeLeafPreimage = IndexedLeaf< PublicDataLeafValue >
 
using CalldataProvider = std::function< std::vector< FF >(uint32_t max_size)>
 
using ReturnDataProvider = std::function< std::vector< FF >(uint32_t max_size)>
 
using InternalCallStackProvider = std::function< std::vector< PC >()>
 
using MerkleTreeId = ::bb::world_state::MerkleTreeId
 
using SiblingPath = ::bb::crypto::merkle_tree::fr_sibling_path
 
using index_t = ::bb::crypto::merkle_tree::index_t
 
using PublicDataLeafValue = ::bb::crypto::merkle_tree::PublicDataLeafValue
 
using NullifierLeafValue = ::bb::crypto::merkle_tree::NullifierLeafValue
 
template<typename LeafValueType >
using IndexedLeaf = ::bb::crypto::merkle_tree::IndexedLeaf< LeafValueType >
 
template<typename LeafValueType >
using SequentialInsertionResult = ::bb::world_state::SequentialInsertionResult< LeafValueType >
 
using poseidon2 = crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
 
using NullifierTreeLeafPreimage = crypto::merkle_tree::IndexedLeaf< crypto::merkle_tree::NullifierLeafValue >
 
using GetSiblingPathKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t >
 
using GetPreviousValueIndexKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, FF >
 
using GetLeafPreimageKey = std::tuple< AppendOnlyTreeSnapshot, index_t >
 
using GetLeafValueKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, index_t >
 
using SequentialInsertHintPublicDataTreeKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, PublicDataLeafValue >
 
using SequentialInsertHintNullifierTreeKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, NullifierLeafValue >
 
using AppendLeavesHintKey = std::tuple< AppendOnlyTreeSnapshot, MerkleTreeId, std::vector< FF > >
 
using GetContractInstanceKey = std::tuple< uint32_t, AztecAddress >
 
using GetContractClassKey = std::tuple< uint32_t, ContractClassId >
 
using GetBytecodeCommitmentKey = std::tuple< uint32_t, ContractClassId >
 
using GetDebugFunctionNameKey = std::tuple< AztecAddress, FunctionSelector >
 
using RetrievedBytecodesTree = IndexedMemoryTree< ClassIdLeafValue, Poseidon2HashPolicy >
 
using RetrievedBytecodesTreeLeafPreimage = IndexedLeaf< ClassIdLeafValue >
 
using Operand = TaggedValue
 
using WrittenPublicDataSlotsTree = IndexedMemoryTree< WrittenPublicDataSlotLeafValue, Poseidon2HashPolicy >
 
using WrittenPublicDataSlotsTreeLeafPreimage = IndexedLeaf< WrittenPublicDataSlotLeafValue >
 
using LogFn = std::function< void(const std::string &)>
 
using Poseidon2Hash = crypto::Poseidon2< crypto::Poseidon2Bn254ScalarFieldParams >
 
using Poseidon2Perm = crypto::Poseidon2Permutation< crypto::Poseidon2Bn254ScalarFieldParams >
 

Enumerations

enum class  AddressingEventError { BASE_ADDRESS_INVALID , RELATIVE_COMPUTATION_OOB , INVALID_ADDRESS_AFTER_INDIRECTION }
 
enum class  AluOperation : uint8_t {
  ADD , SUB , MUL , DIV ,
  FDIV , EQ , LT , LTE ,
  NOT , SHL , SHR , TRUNCATE
}
 
enum  CheckPointEventType { CREATE_CHECKPOINT , COMMIT_CHECKPOINT , REVERT_CHECKPOINT }
 
enum class  DataCopyOperation : uint8_t { CD_COPY , RD_COPY }
 
enum class  ExecutionError : uint8_t {
  NONE , BYTECODE_RETRIEVAL , INSTRUCTION_FETCHING , ADDRESSING ,
  REGISTER_READ , GAS , OPCODE_EXECUTION
}
 
enum class  FieldGreaterOperation : uint8_t { GREATER_THAN , CANONICAL_DECOMPOSITION }
 
enum class  MemoryMode { READ , WRITE }
 
enum class  SiloingType { NULLIFIER }
 
enum class  OperandType : uint8_t {
  INDIRECT8 , INDIRECT16 , TAG , UINT8 ,
  UINT16 , UINT32 , UINT64 , UINT128 ,
  FF
}
 
enum class  InstrDeserializationEventError : uint8_t {
  PC_OUT_OF_RANGE , OPCODE_OUT_OF_RANGE , INSTRUCTION_OUT_OF_RANGE , TAG_OUT_OF_RANGE ,
  INVALID_EXECUTION_OPCODE
}
 

Functions

std::string to_string (AddressingEventError e)
 
CalldataProvider make_calldata_provider (const ContextInterface &context)
 
ReturnDataProvider make_return_data_provider (const ContextInterface &context, uint32_t rd_offset, uint32_t rd_size)
 
InternalCallStackProvider make_internal_call_stack_provider (const InternalCallStackManagerInterface &internal_call_stack_manager)
 
std::vector< FFencode_bytecode (std::span< const uint8_t > bytecode)
 
FF compute_public_bytecode_commitment (std::span< const uint8_t > bytecode)
 
FF compute_contract_class_id (const FF &artifact_hash, const FF &private_fn_root, const FF &public_bytecode_commitment)
 
FF hash_public_keys (const PublicKeys &public_keys)
 
FF compute_contract_address (const ContractInstance &contract_instance)
 
FF unconstrained_root_from_path (const FF &leaf_value, const uint64_t leaf_index, std::span< const FF > path)
 
FF unconstrained_compute_leaf_slot (const AztecAddress &contract_address, const FF &slot)
 
FF unconstrained_silo_nullifier (const AztecAddress &contract_address, const FF &nullifier)
 
FF unconstrained_silo_note_hash (const AztecAddress &contract_address, const FF &note_hash)
 
FF unconstrained_make_unique_note_hash (const FF &siloed_note_hash, const FF &first_nullifier, uint64_t note_hash_counter)
 
std::ostream & operator<< (std::ostream &os, const ClassIdLeafValue &v)
 
RetrievedBytecodesTree build_retrieved_bytecodes_tree ()
 
Instruction deserialize_instruction (std::span< const uint8_t > bytecode, size_t pos)
 Parsing of an instruction in the supplied bytecode at byte position pos. This checks that the WireOpCode value is in the defined range and extracts the operands for each WireOpCode based on the specification from OPCODE_WIRE_FORMAT.
 
bool check_tag (const Instruction &instruction)
 Check whether the instruction must have a tag operand and whether the operand value is in the value tag range. This is specified by OPCODE_WIRE_FORMAT. If the instruction does not have a valid wire opcode or the relevant tag operand is missing, we return false. However, we do not fully validate the instruction.
 
std::array< uint32_t, 8 > sha256_block (const std::array< uint32_t, 8 > &h_init, const std::array< uint32_t, 16 > &input)
 
constexpr uint32_t ror (uint32_t val, uint32_t shift)
 
U256Decomposition decompose_256 (const uint256_t &x)
 
U128Decomposition decompose_128 (const uint128_t &x)
 
 BENCHMARK (BM_WrittenSlotsTreeStack) -> Arg(1000) ->Arg(3000) ->Arg(6000) ->Arg(9000) ->Unit(benchmark::kMicrosecond)
 
std::ostream & operator<< (std::ostream &os, const WrittenPublicDataSlotLeafValue &v)
 
WrittenPublicDataSlotsTree build_public_data_slots_tree ()
 

Variables

constexpr std::array< std::array< uint8_t, 5 >, 5 > keccak_rotation_len
 
constexpr std::array< std::array< uint8_t, 5 >, 5 > keccak_pi_rho_x_coords
 
constexpr std::array< uint64_t, 24 > keccak_round_constants
 
const std::vector< OperandTypethree_operand_format8
 
const std::vector< OperandTypethree_operand_format16
 
const std::vector< OperandTypekernel_input_operand_format = { OperandType::INDIRECT8, OperandType::UINT16 }
 
const std::vector< OperandTypeexternal_call_format
 
constexpr uint32_t round_constants [64]
 

Typedef Documentation

◆ AppendLeavesHintKey

Definition at line 21 of file db_types.hpp.

◆ CalldataProvider

using bb::avm2::simulation::CalldataProvider = typedef std::function<std::vector<FF>(uint32_t max_size)>

Definition at line 11 of file call_stack_metadata_collector.hpp.

◆ EmitUnencryptedLogEvent

◆ GetBytecodeCommitmentKey

using bb::avm2::simulation::GetBytecodeCommitmentKey = typedef std::tuple<uint32_t, ContractClassId>

Definition at line 24 of file db_types.hpp.

◆ GetContractClassKey

using bb::avm2::simulation::GetContractClassKey = typedef std::tuple<uint32_t, ContractClassId>

Definition at line 23 of file db_types.hpp.

◆ GetContractInstanceKey

using bb::avm2::simulation::GetContractInstanceKey = typedef std::tuple<uint32_t, AztecAddress>

Definition at line 22 of file db_types.hpp.

◆ GetDebugFunctionNameKey

Definition at line 25 of file db_types.hpp.

◆ GetLeafPreimageKey

Definition at line 17 of file db_types.hpp.

◆ GetLeafValueKey

Definition at line 18 of file db_types.hpp.

◆ GetPreviousValueIndexKey

Definition at line 16 of file db_types.hpp.

◆ GetSiblingPathKey

Definition at line 15 of file db_types.hpp.

◆ index_t

Definition at line 37 of file db.hpp.

◆ IndexedLeaf

Definition at line 40 of file db.hpp.

◆ InternalCallStackProvider

using bb::avm2::simulation::InternalCallStackProvider = typedef std::function<std::vector<PC>()>

Definition at line 13 of file call_stack_metadata_collector.hpp.

◆ KeccakF1600State

using bb::avm2::simulation::KeccakF1600State = typedef std::array<std::array<uint64_t, 5>, 5>

Definition at line 19 of file keccakf1600_event.hpp.

◆ KeccakF1600StateMemValues

using bb::avm2::simulation::KeccakF1600StateMemValues = typedef std::array<std::array<MemoryValue, 5>, 5>

Definition at line 20 of file keccakf1600_event.hpp.

◆ LogFn

using bb::avm2::simulation::LogFn = typedef std::function<void(const std::string&)>

Definition at line 22 of file debug_log.hpp.

◆ MerkleTreeId

Definition at line 35 of file db.hpp.

◆ NoteHashTreeCheckEvent

◆ NullifierLeafValue

◆ NullifierTreeCheckEvent

◆ NullifierTreeLeafPreimage

◆ Operand

Definition at line 30 of file serialization.hpp.

◆ Poseidon2

◆ poseidon2

◆ Poseidon2Hash

◆ Poseidon2Perm

◆ PublicDataLeafValue

◆ PublicDataTreeCheckEvent

◆ PublicDataTreeLeafPreimage

◆ RawPoseidon2

◆ RetrievedBytecodesTree

◆ RetrievedBytecodesTreeLeafPreimage

◆ ReturnDataProvider

using bb::avm2::simulation::ReturnDataProvider = typedef std::function<std::vector<FF>(uint32_t max_size)>

Definition at line 12 of file call_stack_metadata_collector.hpp.

◆ SequentialInsertHintNullifierTreeKey

◆ SequentialInsertHintPublicDataTreeKey

◆ SequentialInsertionResult

◆ SiblingPath

◆ TxEvent

◆ TxPhaseEventType

◆ WrittenPublicDataSlotsTree

◆ WrittenPublicDataSlotsTreeLeafPreimage

Enumeration Type Documentation

◆ AddressingEventError

Enumerator
BASE_ADDRESS_INVALID 
RELATIVE_COMPUTATION_OOB 
INVALID_ADDRESS_AFTER_INDIRECTION 

Definition at line 14 of file addressing_event.hpp.

◆ AluOperation

enum class bb::avm2::simulation::AluOperation : uint8_t
strong
Enumerator
ADD 
SUB 
MUL 
DIV 
FDIV 
EQ 
LT 
LTE 
NOT 
SHL 
SHR 
TRUNCATE 

Definition at line 9 of file alu_event.hpp.

◆ CheckPointEventType

Enumerator
CREATE_CHECKPOINT 
COMMIT_CHECKPOINT 
REVERT_CHECKPOINT 

Definition at line 7 of file checkpoint_event_type.hpp.

◆ DataCopyOperation

enum class bb::avm2::simulation::DataCopyOperation : uint8_t
strong
Enumerator
CD_COPY 
RD_COPY 

Definition at line 18 of file data_copy_events.hpp.

◆ ExecutionError

enum class bb::avm2::simulation::ExecutionError : uint8_t
strong
Enumerator
NONE 
BYTECODE_RETRIEVAL 
INSTRUCTION_FETCHING 
ADDRESSING 
REGISTER_READ 
GAS 
OPCODE_EXECUTION 

Definition at line 16 of file execution_event.hpp.

◆ FieldGreaterOperation

enum class bb::avm2::simulation::FieldGreaterOperation : uint8_t
strong
Enumerator
GREATER_THAN 
CANONICAL_DECOMPOSITION 

Definition at line 9 of file field_gt_event.hpp.

◆ InstrDeserializationEventError

Enumerator
PC_OUT_OF_RANGE 
OPCODE_OUT_OF_RANGE 
INSTRUCTION_OUT_OF_RANGE 
TAG_OUT_OF_RANGE 
INVALID_EXECUTION_OPCODE 

Definition at line 52 of file serialization.hpp.

◆ MemoryMode

Enumerator
READ 
WRITE 

Definition at line 9 of file memory_event.hpp.

◆ OperandType

enum class bb::avm2::simulation::OperandType : uint8_t
strong
Enumerator
INDIRECT8 
INDIRECT16 
TAG 
UINT8 
UINT16 
UINT32 
UINT64 
UINT128 
FF 

Definition at line 21 of file serialization.hpp.

◆ SiloingType

Enumerator
NULLIFIER 

Definition at line 7 of file siloing_event.hpp.

Function Documentation

◆ BENCHMARK()

bb::avm2::simulation::BENCHMARK ( BM_WrittenSlotsTreeStack  ) -> Arg(1000) ->Arg(3000) ->Arg(6000) ->Arg(9000) ->Unit(benchmark::kMicrosecond)

◆ build_public_data_slots_tree()

WrittenPublicDataSlotsTree bb::avm2::simulation::build_public_data_slots_tree ( )

Definition at line 58 of file written_slots_tree.cpp.

◆ build_retrieved_bytecodes_tree()

RetrievedBytecodesTree bb::avm2::simulation::build_retrieved_bytecodes_tree ( )

Definition at line 58 of file retrieved_bytecodes_tree.cpp.

◆ check_tag()

bool bb::avm2::simulation::check_tag ( const Instruction instruction)

Check whether the instruction must have a tag operand and whether the operand value is in the value tag range. This is specified by OPCODE_WIRE_FORMAT. If the instruction does not have a valid wire opcode or the relevant tag operand is missing, we return false. However, we do not fully validate the instruction.

Parameters
instructionThe instruction to be checked upon.
Returns
Boolean telling whether instruction complies with the tag specification.

Definition at line 430 of file serialization.cpp.

◆ compute_contract_address()

FF bb::avm2::simulation::compute_contract_address ( const ContractInstance contract_instance)

Definition at line 68 of file contract_crypto.cpp.

◆ compute_contract_class_id()

FF bb::avm2::simulation::compute_contract_class_id ( const FF artifact_hash,
const FF private_fn_root,
const FF public_bytecode_commitment 
)

Definition at line 48 of file contract_crypto.cpp.

◆ compute_public_bytecode_commitment()

FF bb::avm2::simulation::compute_public_bytecode_commitment ( std::span< const uint8_t >  bytecode)

Definition at line 40 of file contract_crypto.cpp.

◆ decompose_128()

U128Decomposition bb::avm2::simulation::decompose_128 ( const uint128_t x)

Definition at line 13 of file uint_decomposition.cpp.

◆ decompose_256()

U256Decomposition bb::avm2::simulation::decompose_256 ( const uint256_t x)

Definition at line 6 of file uint_decomposition.cpp.

◆ deserialize_instruction()

Instruction bb::avm2::simulation::deserialize_instruction ( std::span< const uint8_t >  bytecode,
size_t  pos 
)

Parsing of an instruction in the supplied bytecode at byte position pos. This checks that the WireOpCode value is in the defined range and extracts the operands for each WireOpCode based on the specification from OPCODE_WIRE_FORMAT.

Parameters
bytecodeThe bytecode to be parsed as a vector of bytes/uint8_t
posBytecode position
Exceptions
runtime_errorexception when the bytecode is invalid or pos is out-of-range
Returns
The instruction

Definition at line 232 of file serialization.cpp.

◆ encode_bytecode()

std::vector< FF > bb::avm2::simulation::encode_bytecode ( std::span< const uint8_t >  bytecode)

Definition at line 11 of file contract_crypto.cpp.

◆ hash_public_keys()

FF bb::avm2::simulation::hash_public_keys ( const PublicKeys public_keys)

Definition at line 54 of file contract_crypto.cpp.

◆ make_calldata_provider()

CalldataProvider bb::avm2::simulation::make_calldata_provider ( const ContextInterface context)

Definition at line 123 of file call_stack_metadata_collector.cpp.

◆ make_internal_call_stack_provider()

InternalCallStackProvider bb::avm2::simulation::make_internal_call_stack_provider ( const InternalCallStackManagerInterface internal_call_stack_manager)

Definition at line 177 of file call_stack_metadata_collector.cpp.

◆ make_return_data_provider()

ReturnDataProvider bb::avm2::simulation::make_return_data_provider ( const ContextInterface context,
uint32_t  rd_offset,
uint32_t  rd_size 
)

Definition at line 149 of file call_stack_metadata_collector.cpp.

◆ operator<<() [1/2]

std::ostream & bb::avm2::simulation::operator<< ( std::ostream &  os,
const ClassIdLeafValue v 
)

Definition at line 17 of file retrieved_bytecodes_tree.cpp.

◆ operator<<() [2/2]

std::ostream & bb::avm2::simulation::operator<< ( std::ostream &  os,
const WrittenPublicDataSlotLeafValue v 
)

Definition at line 17 of file written_slots_tree.cpp.

◆ ror()

constexpr uint32_t bb::avm2::simulation::ror ( uint32_t  val,
uint32_t  shift 
)
constexpr

Definition at line 11 of file sha256_compression.hpp.

◆ sha256_block()

std::array< uint32_t, 8 > bb::avm2::simulation::sha256_block ( const std::array< uint32_t, 8 > &  h_init,
const std::array< uint32_t, 16 > &  input 
)

Fill first 16 words with the message schedule

Extend the input data into the remaining 48 words

Initialize round variables with previous block output

Apply SHA-256 compression function to the message schedule

Add into previous block output and return

Definition at line 23 of file sha256_compression.cpp.

◆ to_string()

std::string bb::avm2::simulation::to_string ( AddressingEventError  e)
inline

Definition at line 23 of file addressing_event.hpp.

◆ unconstrained_compute_leaf_slot()

FF bb::avm2::simulation::unconstrained_compute_leaf_slot ( const AztecAddress contract_address,
const FF slot 
)

Definition at line 26 of file merkle.cpp.

◆ unconstrained_make_unique_note_hash()

FF bb::avm2::simulation::unconstrained_make_unique_note_hash ( const FF siloed_note_hash,
const FF first_nullifier,
uint64_t  note_hash_counter 
)

Definition at line 41 of file merkle.cpp.

◆ unconstrained_root_from_path()

FF bb::avm2::simulation::unconstrained_root_from_path ( const FF leaf_value,
const uint64_t  leaf_index,
std::span< const FF path 
)

Definition at line 12 of file merkle.cpp.

◆ unconstrained_silo_note_hash()

FF bb::avm2::simulation::unconstrained_silo_note_hash ( const AztecAddress contract_address,
const FF note_hash 
)

Definition at line 36 of file merkle.cpp.

◆ unconstrained_silo_nullifier()

FF bb::avm2::simulation::unconstrained_silo_nullifier ( const AztecAddress contract_address,
const FF nullifier 
)

Definition at line 31 of file merkle.cpp.

Variable Documentation

◆ external_call_format

const std::vector<OperandType> bb::avm2::simulation::external_call_format
Initial value:
= { OperandType::INDIRECT16,
OperandType::UINT16,
OperandType::UINT16,
OperandType::UINT16,
OperandType::UINT16,
OperandType::UINT16 }

Definition at line 50 of file serialization.cpp.

◆ keccak_pi_rho_x_coords

constexpr std::array<std::array<uint8_t, 5>, 5> bb::avm2::simulation::keccak_pi_rho_x_coords
constexpr
Initial value:
= { {
{ 0, 3, 1, 4, 2 },
{ 1, 4, 2, 0, 3 },
{ 2, 0, 3, 1, 4 },
{ 3, 1, 4, 2, 0 },
{ 4, 2, 0, 3, 1 },
} }

Definition at line 31 of file keccakf1600.hpp.

◆ keccak_rotation_len

constexpr std::array<std::array<uint8_t, 5>, 5> bb::avm2::simulation::keccak_rotation_len
constexpr
Initial value:
= { {
{ 0, 36, 3, 41, 18 },
{ 1, 44, 10, 45, 2 },
{ 62, 6, 43, 15, 61 },
{ 28, 55, 25, 21, 56 },
{ 27, 20, 39, 8, 14 },
} }

Definition at line 20 of file keccakf1600.hpp.

◆ keccak_round_constants

constexpr std::array<uint64_t, 24> bb::avm2::simulation::keccak_round_constants
constexpr
Initial value:
= { {
0x0000000000000001, 0x0000000000008082, 0x800000000000808a, 0x8000000080008000, 0x000000000000808b,
0x0000000080000001, 0x8000000080008081, 0x8000000000008009, 0x000000000000008a, 0x0000000000000088,
0x0000000080008009, 0x000000008000000a, 0x000000008000808b, 0x800000000000008b, 0x8000000000008089,
0x8000000000008003, 0x8000000000008002, 0x8000000000000080, 0x000000000000800a, 0x800000008000000a,
0x8000000080008081, 0x8000000000008080, 0x0000000080000001, 0x8000000080008008,
} }

Definition at line 41 of file keccakf1600.hpp.

◆ kernel_input_operand_format

const std::vector<OperandType> bb::avm2::simulation::kernel_input_operand_format = { OperandType::INDIRECT8, OperandType::UINT16 }

Definition at line 48 of file serialization.cpp.

◆ round_constants

constexpr uint32_t bb::avm2::simulation::round_constants[64]
constexpr
Initial value:
= {
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
}

Definition at line 11 of file sha256_compression.cpp.

◆ three_operand_format16

const std::vector<OperandType> bb::avm2::simulation::three_operand_format16
Initial value:
= {
OperandType::INDIRECT8,
OperandType::UINT16,
OperandType::UINT16,
OperandType::UINT16,
}

Definition at line 42 of file serialization.cpp.

◆ three_operand_format8

const std::vector<OperandType> bb::avm2::simulation::three_operand_format8
Initial value:
= {
OperandType::INDIRECT8,
OperandType::UINT8,
OperandType::UINT8,
OperandType::UINT8,
}

Definition at line 36 of file serialization.cpp.