51 if (!maybe_instance.has_value()) {
56 .current_class_id =
FF(0),
57 .nullifier_root = tree_states.nullifier_tree.tree.root,
58 .public_data_tree_root = tree_states.public_data_tree.tree.root,
59 .retrieved_bytecodes_snapshot_before = before_snapshot,
60 .retrieved_bytecodes_snapshot_after = before_snapshot,
81 .nullifier_root = tree_states.nullifier_tree.tree.root,
82 .public_data_tree_root = tree_states.public_data_tree.tree.root,
83 .retrieved_bytecodes_snapshot_before = before_snapshot,
84 .retrieved_bytecodes_snapshot_after = before_snapshot,
85 .is_new_class = is_new_class,
105 BB_ASSERT(maybe_klass.has_value(),
"Contract class not found");
106 auto& klass = maybe_klass.value();
112 BB_ASSERT(maybe_bytecode_commitment.has_value(),
"Bytecode commitment not found");
113 BytecodeId bytecode_id = maybe_bytecode_commitment.value();
114 debug(
"Bytecode for ",
address,
" successfully retrieved!");
117 .bytecode_id = bytecode_id,
120 .contract_class = klass,
121 .nullifier_root = tree_states.nullifier_tree.tree.root,
122 .public_data_tree_root = tree_states.public_data_tree.tree.root,
123 .retrieved_bytecodes_snapshot_before = before_snapshot,
124 .retrieved_bytecodes_snapshot_after = snapshot_after,
125 .is_new_class = is_new_class,
138 bytecode_id, klass.packed_bytecode, bytecode_id);
157 std::shared_ptr<std::vector<uint8_t>> bytecode_ptr,
166 instr_fetching_event.
pc = pc;
168 const auto&
bytecode = *bytecode_ptr;
187 const auto bytecode_size =
bytecode.size();
188 const uint128_t pc_diff = bytecode_size > pc ? bytecode_size - pc - 1 : pc - bytecode_size;
195 if (instr_fetching_event.
error.has_value()) {
#define BB_ASSERT(expression,...)
std::shared_ptr< Napi::ThreadSafeFunction > instance
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
#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< FF > get_bytecode_commitment(const ContractClassId &class_id) const =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
virtual void insert(const FF &class_id)=0
virtual uint32_t size() const =0
virtual bool contains(const FF &class_id)=0
virtual AppendOnlyTreeSnapshot get_snapshot() const =0
HighLevelMerkleDBInterface & merkle_db
Instruction read_instruction(const BytecodeId &bytecode_id, PC pc) override
EventEmitterInterface< BytecodeDecompositionEvent > & decomposition_events
RetrievedBytecodesTreeCheckInterface & retrieved_bytecodes_tree_check
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
Retrieves and validates bytecode from the TxBytecodeManager's ContractDBInterface and emits a Bytecod...
AVM range check gadget for witness generation.
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...
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
InstrDeserializationEventError type
std::shared_ptr< std::vector< uint8_t > > bytecode
std::optional< InstrDeserializationEventError > error