19 auto cost_in_kb = [&]() {
20 size_t total_size = 0;
24 return total_size / 1024;
26 vinfo(
"PureTxBytecodeManager held ",
28 " instructions in cache, totaling ~",
58 if (!maybe_instance.has_value()) {
94 BB_ASSERT(maybe_klass.has_value(),
"Contract class not found");
95 auto& klass = maybe_klass.value();
96 debug(
"Bytecode for ",
address,
" successfully retrieved!");
145 std::shared_ptr<std::vector<uint8_t>> bytecode_ptr,
158 const auto&
bytecode = *bytecode_ptr;
164 std::string error_msg =
format(
"Instruction fetching error at pc ", pc);
165 if (error.
message.has_value()) {
173 std::string error_msg =
format(
"Instruction fetching error at pc ", pc,
": Tag check failed");
#define BB_ASSERT(expression,...)
#define BB_ASSERT_DEBUG(expression,...)
std::shared_ptr< Napi::ThreadSafeFunction > instance
std::shared_ptr< Napi::ThreadSafeFunction > bytecode
#define MAX_PUBLIC_CALLS_TO_UNIQUE_CONTRACT_CLASS_IDS
#define BB_BENCH_NAME(name)
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.
ContractInstanceManagerInterface & contract_instance_manager
std::shared_ptr< std::vector< uint8_t > > get_bytecode_data(const BytecodeId &bytecode_id) override
~PureTxBytecodeManager() override
BytecodeId get_bytecode(const AztecAddress &address) override
Retrieves and validates bytecode from the PureTxBytecodeManager's ContractDBInterface.
ContractDBInterface & contract_db
unordered_flat_map< BytecodeId, std::shared_ptr< std::vector< uint8_t > > > bytecodes
Instruction read_instruction(const BytecodeId &bytecode_id, PC pc) override
Reads and deserializes the instruction given by the pair [ bytecode_id, pc ]. Corresponds to instr_fe...
std::tuple< void *, PC > InstructionIdentifier
unordered_flat_set< ContractClassId > retrieved_class_ids
unordered_flat_map< InstructionIdentifier, Instruction > instruction_cache
std::string format(Args... args)
AVM range check gadget for witness generation.
bool check_tag(const Instruction &instruction)
Checks whether the tag operand of an instruction is a valid MemoryTag. Called by bytecode managers du...
Instruction deserialize_instruction(std::span< const uint8_t > bytecode, size_t pos)
Attempts to deserialize the instruction at position pos in bytecode. Called by bytecode managers duri...
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)
std::optional< std::string > message