#include <bytecode_manager.hpp>
|
| | TxBytecodeManager (ContractDBInterface &contract_db, HighLevelMerkleDBInterface &merkle_db, BytecodeHashingInterface &bytecode_hasher, RangeCheckInterface &range_check, ContractInstanceManagerInterface &contract_instance_manager, RetrievedBytecodesTreeCheckInterface &retrieved_bytecodes_tree_check, EventEmitterInterface< BytecodeRetrievalEvent > &retrieval_events, EventEmitterInterface< BytecodeDecompositionEvent > &decomposition_events, EventEmitterInterface< InstructionFetchingEvent > &fetching_events) |
| |
| BytecodeId | get_bytecode (const AztecAddress &address) override |
| | Retrieves and validates bytecode from the TxBytecodeManager's ContractDBInterface and emits a BytecodeRetrievalEvent. Corresponds to traces: bc_retrieval.pil bc_hashing.pil bc_decomposition.pil.
|
| |
| std::shared_ptr< std::vector< uint8_t > > | get_bytecode_data (const BytecodeId &bytecode_id) override |
| |
| Instruction | read_instruction (const BytecodeId &bytecode_id, PC pc) override |
| |
| Instruction | read_instruction (const BytecodeId &bytecode_id, std::shared_ptr< std::vector< uint8_t > > bytecode_ptr, PC pc) override |
| |
| virtual | ~TxBytecodeManagerInterface ()=default |
| |
Definition at line 26 of file bytecode_manager.hpp.
◆ TxBytecodeManager()
◆ get_bytecode()
Retrieves and validates bytecode from the TxBytecodeManager's ContractDBInterface and emits a BytecodeRetrievalEvent. Corresponds to traces: bc_retrieval.pil bc_hashing.pil bc_decomposition.pil.
If we have not yet processed the gathered bytecode instance, we emit a BytecodeHashingEvent and BytecodeDecompositionEvent. The decomposition trace stores the bytecode from the BytecodeDecompositionEvent as individual bytes to be referred to by instruction fetching. It enforces the bytecode size and representation as packed fields, which are used by the hashing trace to enforce the correctness of the bytecode id (=commitment).
- Exceptions
-
| BytecodeRetrievalError | if
- the contract at the given address is not deployed
- we have reached the limit of the number of bytecodes to retrieve for this tx
|
| Unexpected | exception if
- the contract class for the retrieved instance does not exist
- the bytecode commitment for the retrieved instance does not exist
- the bytecode commitment does not match the calculated hash (inside assert_public_bytecode_commitment()) Note: the deployer contract guarantees that if we have a deployed instance, its contract class and hence its bytecode commitment must exist. If the contract is not deployed, this is caught by the above BytecodeRetrievalError.
|
- Parameters
-
| address | The address of the contract instance to retrieve bytecode for. |
- Returns
- The id (=commitment) of the bytecode.
Implements bb::avm2::simulation::TxBytecodeManagerInterface.
Definition at line 41 of file bytecode_manager.cpp.
◆ get_bytecode_data()
| std::shared_ptr< std::vector< uint8_t > > bb::avm2::simulation::TxBytecodeManager::get_bytecode_data |
( |
const BytecodeId & |
bytecode_id | ) |
|
|
overridevirtual |
◆ read_instruction() [1/2]
◆ read_instruction() [2/2]
| Instruction bb::avm2::simulation::TxBytecodeManager::read_instruction |
( |
const BytecodeId & |
bytecode_id, |
|
|
std::shared_ptr< std::vector< uint8_t > > |
bytecode_ptr, |
|
|
PC |
pc |
|
) |
| |
|
overridevirtual |
◆ bytecode_hasher
◆ bytecodes
◆ contract_db
◆ contract_instance_manager
◆ decomposition_events
◆ fetching_events
◆ merkle_db
◆ range_check
◆ retrieval_events
◆ retrieved_bytecodes_tree_check
The documentation for this class was generated from the following files: