52 if (!maybe_instance.has_value()) {
57 .current_class_id =
FF(0),
58 .nullifier_tree_root = tree_states.nullifier_tree.tree.root,
59 .public_data_tree_root = tree_states.public_data_tree.tree.root,
60 .retrieved_bytecodes_snapshot_before = before_snapshot,
61 .retrieved_bytecodes_snapshot_after = before_snapshot,
76 if (is_new_class && retrieved_bytecodes_count >= MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS) {
82 .nullifier_tree_root = tree_states.nullifier_tree.tree.root,
83 .public_data_tree_root = tree_states.public_data_tree.tree.root,
84 .retrieved_bytecodes_snapshot_before = before_snapshot,
85 .retrieved_bytecodes_snapshot_after = before_snapshot,
86 .is_new_class = is_new_class,
106 BB_ASSERT(maybe_klass.has_value(),
"Contract class not found");
107 auto& klass = maybe_klass.value();
113 BB_ASSERT(maybe_bytecode_commitment.has_value(),
"Bytecode commitment not found");
114 BytecodeId bytecode_id = maybe_bytecode_commitment.value();
115 debug(
"Bytecode for ",
address,
" successfully retrieved!");
118 .bytecode_id = bytecode_id,
121 .contract_class = klass,
122 .nullifier_tree_root = tree_states.nullifier_tree.tree.root,
123 .public_data_tree_root = tree_states.public_data_tree.tree.root,
124 .retrieved_bytecodes_snapshot_before = before_snapshot,
125 .retrieved_bytecodes_snapshot_after = snapshot_after,
126 .is_new_class = is_new_class,
193 std::shared_ptr<std::vector<uint8_t>> bytecode_ptr,
198 const auto&
bytecode = *bytecode_ptr;
215 deserialization_error = error;
220 const auto bytecode_size =
bytecode.size();
221 const uint128_t pc_diff = bytecode_size > pc ? bytecode_size - pc - 1 : pc - bytecode_size;
223 range_check.assert_range(pc_diff, AVM_PC_SIZE_IN_BITS);
231 .error = deserialization_error.has_value() ?
std::make_optional(deserialization_error->type)
235 if (deserialization_error.has_value()) {
236 std::string error_msg =
format(
"Instruction fetching error");
237 if (deserialization_error.value().message.has_value()) {
238 error_msg =
format(error_msg,
": ", deserialization_error.value().message.value());