28 .nullifier_root = tree_states.nullifierTree.tree.root,
29 .public_data_tree_root = tree_states.publicDataTree.tree.root,
30 .retrieved_bytecodes_snapshot_before = before_snapshot,
31 .retrieved_bytecodes_snapshot_after = before_snapshot,
36 if (!maybe_instance.has_value()) {
69 assert(maybe_klass.has_value());
70 auto& klass = maybe_klass.value();
72 debug(
"Bytecode for ", address,
" successfully retrieved!");
75 BytecodeId bytecode_id = klass.public_bytecode_commitment;
87 bytecode_id, klass.packed_bytecode, klass.public_bytecode_commitment);
107 std::shared_ptr<std::vector<uint8_t>> bytecode_ptr,
116 instr_fetching_event.
pc = pc;
118 const auto& bytecode = *bytecode_ptr;
129 instr_fetching_event.
error = error;
134 const auto bytecode_size = bytecode.size();
135 const uint128_t pc_diff = bytecode_size > pc ? bytecode_size - pc - 1 : pc - bytecode_size;
142 if (instr_fetching_event.
error.has_value()) {
#define MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS
#define AVM_PC_SIZE_IN_BITS
#define BB_BENCH_NAME(name)
virtual void assert_public_bytecode_commitment(const BytecodeId &bytecode_id, const std::vector< uint8_t > &bytecode, const FF &public_bytecode_commitment)=0
virtual std::optional< ContractClass > get_contract_class(const ContractClassId &class_id) const =0
virtual std::optional< ContractInstance > get_contract_instance(const FF &contract_address)=0
Retrieve and validate a contract instance.
virtual TreeStates get_tree_state() const =0
HighLevelMerkleDBInterface & merkle_db
EventEmitterInterface< BytecodeDecompositionEvent > & decomposition_events
EventEmitterInterface< BytecodeRetrievalEvent > & retrieval_events
EventEmitterInterface< InstructionFetchingEvent > & fetching_events
unordered_flat_map< BytecodeId, std::shared_ptr< std::vector< uint8_t > > > bytecodes
std::shared_ptr< std::vector< uint8_t > > get_bytecode_data(const BytecodeId &bytecode_id) override
ContractDBInterface & contract_db
BytecodeHashingInterface & bytecode_hasher
ContractInstanceManagerInterface & contract_instance_manager
BytecodeId get_bytecode(const AztecAddress &address) override
Instruction read_instruction(const BytecodeId &bytecode_id, uint32_t pc) override
bool check_tag(const Instruction &instruction)
Check whether the instruction must have a tag operand and whether the operand value is in the value t...
InstrDeserializationError
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 WireOpC...
std::string field_to_string(const FF &ff)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::string to_string(bb::avm2::ValueTag tag)
unsigned __int128 uint128_t
ContractClassId current_class_id
AppendOnlyTreeSnapshot retrieved_bytecodes_snapshot_after
ContractClass contract_class
ContractClassId current_class_id
bool instance_not_found_error
std::optional< InstrDeserializationError > error
std::shared_ptr< std::vector< uint8_t > > bytecode