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

Sets up gadgets and instance managers to provide a context for fuzzing. NOTE: rudimentary set up for testing, should likely be merged with TestSimulator in fuzz_lib in future. More...

#include <context_helper.hpp>

Public Member Functions

 GadgetFuzzerContextHelper (AztecAddress contract_address=AztecAddress(0), bool is_static=false, uint32_t start_clk=0)
 
std::unique_ptr< simulation::ContextInterfacemake_enqueued_fuzzing_context (AztecAddress address=AztecAddress(0), AztecAddress msg_sender=AztecAddress(0), bool is_static=false, FF transaction_fee=FF(0), std::span< const FF > calldata={}, Gas gas_limit=GAS_LIMIT, Gas gas_used=GAS_USED_BY_PRIVATE, TransactionPhase phase=TransactionPhase::APP_LOGIC)
 
std::unique_ptr< simulation::ContextInterfacemake_nested_fuzzing_context (AztecAddress address, AztecAddress msg_sender, ContextInterface &parent_context, bool is_static=false, Gas gas_limit=GAS_LIMIT)
 

Public Attributes

DeduplicatingEventEmitter< RangeCheckEventrange_check_emitter
 
DeduplicatingEventEmitter< GreaterThanEventgreater_than_emitter
 
DeduplicatingEventEmitter< FieldGreaterThanEventfield_gt_emitter
 
EventEmitter< InternalCallStackEventinternal_call_stack_emitter
 
ExecutionIdManager execution_id_manager
 
RangeCheck range_check
 
FieldGreaterThan field_gt
 
GreaterThan greater_than
 
SideEffectTracker side_effect_tracker
 
MemoryProvider memory_provider
 
std::unique_ptr< simulation::ContextProvidercontext_provider
 

Private Member Functions

PureMerkleDB make_empty_merkle_db ()
 

Private Attributes

EventEmitter< MemoryEventmemory_emitter
 
EventEmitter< Poseidon2HashEventhash_event_emitter
 
EventEmitter< Poseidon2PermutationEventperm_event_emitter
 
EventEmitter< Poseidon2PermutationMemoryEventperm_mem_event_emitter
 
EventEmitter< UpdateCheckEventupdate_check_emitter
 
EventEmitter< MerkleCheckEventmerkle_check_emitter
 
EventEmitter< ContractInstanceRetrievalEventcontract_instance_retrieval_emitter
 
EventEmitter< WrittenPublicDataSlotsTreeCheckEventwritten_public_data_slots_tree_check_emitter
 
EventEmitter< BytecodeRetrievalEventbytecode_retrieval_emitter
 
EventEmitter< BytecodeHashingEventbytecode_hashing_emitter
 
EventEmitter< BytecodeDecompositionEventbytecode_decomposition_emitter
 
EventEmitter< RetrievedBytecodesTreeCheckEventretrieved_bytecodes_tree_check_emitter
 
EventEmitter< CalldataEventcalldata_event_emitter
 
DeduplicatingEventEmitter< InstructionFetchingEventinstruction_fetching_emitter
 
MerkleCheck merkle_check
 
Poseidon2 poseidon2
 
WrittenPublicDataSlotsTreeCheck written_public_data_slots_tree_check
 
RetrievedBytecodesTreeCheck retrieved_bytecodes_tree_check
 
std::unique_ptr< TxBytecodeManagertx_bytecode_manager
 
GlobalVariables global_variables
 
ExecutionHints hints
 

Detailed Description

Sets up gadgets and instance managers to provide a context for fuzzing. NOTE: rudimentary set up for testing, should likely be merged with TestSimulator in fuzz_lib in future.

TODO(MW): I just set the ones I needed to be accessed as public, with others in private and gadgets in the constructor - will clean this up

Parameters
contract_addressThe address to be configured in the context
is_staticWhether this call is static (defaults to false)
phaseThe phase (defaults to APP_LOGIC)
start_clkThe starting clk (defaults to 0)
Returns
A context interface to be passed to fuzzed gadgets

Definition at line 42 of file context_helper.hpp.

Constructor & Destructor Documentation

◆ GadgetFuzzerContextHelper()

bb::avm2::fuzzing::GadgetFuzzerContextHelper::GadgetFuzzerContextHelper ( AztecAddress  contract_address = AztecAddress(0),
bool  is_static = false,
uint32_t  start_clk = 0 
)

Definition at line 19 of file context_helper.cpp.

Member Function Documentation

◆ make_empty_merkle_db()

PureMerkleDB bb::avm2::fuzzing::GadgetFuzzerContextHelper::make_empty_merkle_db ( )
private

Definition at line 141 of file context_helper.cpp.

◆ make_enqueued_fuzzing_context()

std::unique_ptr< ContextInterface > bb::avm2::fuzzing::GadgetFuzzerContextHelper::make_enqueued_fuzzing_context ( AztecAddress  address = AztecAddress(0),
AztecAddress  msg_sender = AztecAddress(0),
bool  is_static = false,
FF  transaction_fee = FF(0),
std::span< const FF calldata = {},
Gas  gas_limit = GAS_LIMIT,
Gas  gas_used = GAS_USED_BY_PRIVATE,
TransactionPhase  phase = TransactionPhase::APP_LOGIC 
)

Definition at line 76 of file context_helper.cpp.

◆ make_nested_fuzzing_context()

std::unique_ptr< ContextInterface > bb::avm2::fuzzing::GadgetFuzzerContextHelper::make_nested_fuzzing_context ( AztecAddress  address,
AztecAddress  msg_sender,
ContextInterface parent_context,
bool  is_static = false,
Gas  gas_limit = GAS_LIMIT 
)

Definition at line 109 of file context_helper.cpp.

Member Data Documentation

◆ bytecode_decomposition_emitter

EventEmitter<BytecodeDecompositionEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::bytecode_decomposition_emitter
private

Definition at line 93 of file context_helper.hpp.

◆ bytecode_hashing_emitter

EventEmitter<BytecodeHashingEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::bytecode_hashing_emitter
private

Definition at line 92 of file context_helper.hpp.

◆ bytecode_retrieval_emitter

EventEmitter<BytecodeRetrievalEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::bytecode_retrieval_emitter
private

Definition at line 91 of file context_helper.hpp.

◆ calldata_event_emitter

EventEmitter<CalldataEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::calldata_event_emitter
private

Definition at line 95 of file context_helper.hpp.

◆ context_provider

std::unique_ptr<simulation::ContextProvider> bb::avm2::fuzzing::GadgetFuzzerContextHelper::context_provider

Definition at line 63 of file context_helper.hpp.

◆ contract_instance_retrieval_emitter

EventEmitter<ContractInstanceRetrievalEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::contract_instance_retrieval_emitter
private

Definition at line 89 of file context_helper.hpp.

◆ execution_id_manager

ExecutionIdManager bb::avm2::fuzzing::GadgetFuzzerContextHelper::execution_id_manager

Definition at line 54 of file context_helper.hpp.

◆ field_gt

FieldGreaterThan bb::avm2::fuzzing::GadgetFuzzerContextHelper::field_gt

Definition at line 56 of file context_helper.hpp.

◆ field_gt_emitter

DeduplicatingEventEmitter<FieldGreaterThanEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::field_gt_emitter

Definition at line 50 of file context_helper.hpp.

◆ global_variables

GlobalVariables bb::avm2::fuzzing::GadgetFuzzerContextHelper::global_variables
private

Definition at line 106 of file context_helper.hpp.

◆ greater_than

GreaterThan bb::avm2::fuzzing::GadgetFuzzerContextHelper::greater_than

Definition at line 57 of file context_helper.hpp.

◆ greater_than_emitter

DeduplicatingEventEmitter<GreaterThanEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::greater_than_emitter

Definition at line 49 of file context_helper.hpp.

◆ hash_event_emitter

EventEmitter<Poseidon2HashEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::hash_event_emitter
private

Definition at line 84 of file context_helper.hpp.

◆ hints

ExecutionHints bb::avm2::fuzzing::GadgetFuzzerContextHelper::hints
private

Definition at line 107 of file context_helper.hpp.

◆ instruction_fetching_emitter

DeduplicatingEventEmitter<InstructionFetchingEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::instruction_fetching_emitter
private

Definition at line 96 of file context_helper.hpp.

◆ internal_call_stack_emitter

EventEmitter<InternalCallStackEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::internal_call_stack_emitter

Definition at line 51 of file context_helper.hpp.

◆ memory_emitter

EventEmitter<MemoryEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::memory_emitter
private

Definition at line 83 of file context_helper.hpp.

◆ memory_provider

MemoryProvider bb::avm2::fuzzing::GadgetFuzzerContextHelper::memory_provider

Definition at line 61 of file context_helper.hpp.

◆ merkle_check

MerkleCheck bb::avm2::fuzzing::GadgetFuzzerContextHelper::merkle_check
private

Definition at line 99 of file context_helper.hpp.

◆ merkle_check_emitter

EventEmitter<MerkleCheckEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::merkle_check_emitter
private

Definition at line 88 of file context_helper.hpp.

◆ perm_event_emitter

EventEmitter<Poseidon2PermutationEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::perm_event_emitter
private

Definition at line 85 of file context_helper.hpp.

◆ perm_mem_event_emitter

EventEmitter<Poseidon2PermutationMemoryEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::perm_mem_event_emitter
private

Definition at line 86 of file context_helper.hpp.

◆ poseidon2

Poseidon2 bb::avm2::fuzzing::GadgetFuzzerContextHelper::poseidon2
private

Definition at line 100 of file context_helper.hpp.

◆ range_check

RangeCheck bb::avm2::fuzzing::GadgetFuzzerContextHelper::range_check

Definition at line 55 of file context_helper.hpp.

◆ range_check_emitter

DeduplicatingEventEmitter<RangeCheckEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::range_check_emitter

Definition at line 48 of file context_helper.hpp.

◆ retrieved_bytecodes_tree_check

RetrievedBytecodesTreeCheck bb::avm2::fuzzing::GadgetFuzzerContextHelper::retrieved_bytecodes_tree_check
private

Definition at line 102 of file context_helper.hpp.

◆ retrieved_bytecodes_tree_check_emitter

EventEmitter<RetrievedBytecodesTreeCheckEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::retrieved_bytecodes_tree_check_emitter
private

Definition at line 94 of file context_helper.hpp.

◆ side_effect_tracker

SideEffectTracker bb::avm2::fuzzing::GadgetFuzzerContextHelper::side_effect_tracker

Definition at line 59 of file context_helper.hpp.

◆ tx_bytecode_manager

std::unique_ptr<TxBytecodeManager> bb::avm2::fuzzing::GadgetFuzzerContextHelper::tx_bytecode_manager
private

Definition at line 103 of file context_helper.hpp.

◆ update_check_emitter

EventEmitter<UpdateCheckEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::update_check_emitter
private

Definition at line 87 of file context_helper.hpp.

◆ written_public_data_slots_tree_check

WrittenPublicDataSlotsTreeCheck bb::avm2::fuzzing::GadgetFuzzerContextHelper::written_public_data_slots_tree_check
private

Definition at line 101 of file context_helper.hpp.

◆ written_public_data_slots_tree_check_emitter

EventEmitter<WrittenPublicDataSlotsTreeCheckEvent> bb::avm2::fuzzing::GadgetFuzzerContextHelper::written_public_data_slots_tree_check_emitter
private

Definition at line 90 of file context_helper.hpp.


The documentation for this class was generated from the following files: