23 auto cost_in_kb = [&]() {
24 size_t total_size = 0;
28 return total_size / 1024;
30 vinfo(
"PureTxBytecodeManager held ",
32 " instructions in cache, totaling ~",
45 if (!maybe_instance.has_value()) {
68 assert(maybe_klass.has_value());
69 auto& klass = maybe_klass.value();
70 debug(
"Bytecode for ", address,
" successfully retrieved!");
73 BytecodeId bytecode_id = klass.public_bytecode_commitment;
93 std::shared_ptr<std::vector<uint8_t>> bytecode_ptr,
106 const auto& bytecode = *bytecode_ptr;
#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
Instruction read_instruction(const BytecodeId &bytecode_id, uint32_t pc) override
BytecodeId get_bytecode(const AztecAddress &address) override
ContractDBInterface & contract_db
unordered_flat_map< BytecodeId, std::shared_ptr< std::vector< uint8_t > > > bytecodes
unordered_flat_set< ContractClassId > retrieved_class_ids
std::tuple< void *, uint32_t > InstructionIdentifier
unordered_flat_map< InstructionIdentifier, Instruction > instruction_cache
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)
ContractClassId current_class_id