|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
#include <class_id_derivation.hpp>
Public Member Functions | |
| ClassIdDerivation (Poseidon2Interface &poseidon2, EventEmitterInterface< ClassIdDerivationEvent > &events) | |
| void | assert_derivation (const ContractClassWithCommitment &klass) override |
| Computes the contract class ID and emits a ClassIdDerivationEvent. Corresponds to the subtrace class_id_derivation.pil. | |
Public Member Functions inherited from bb::avm2::simulation::ClassIdDerivationInterface | |
| virtual | ~ClassIdDerivationInterface ()=default |
Private Attributes | |
| EventEmitterInterface< ClassIdDerivationEvent > & | events |
| Poseidon2Interface & | poseidon2 |
| unordered_flat_set< ContractClassId > | cached_derivations |
Definition at line 12 of file class_id_derivation.hpp.
|
inline |
Definition at line 14 of file class_id_derivation.hpp.
|
overridevirtual |
Computes the contract class ID and emits a ClassIdDerivationEvent. Corresponds to the subtrace class_id_derivation.pil.
If the class ID has already been derived, an event has already been emitted and we skip repeating the computation and emission. Otherwise, we call the poseidon trace to perform the hash defining the class ID, given as: Poseidon2(DOM_SEP__CONTRACT_CLASS_ID, artifact_hash, private_functions_root, public_bytecode_commitment) and we add the output to the local cache.
| Unexpected | exception if
|
| klass | The contract class. |
Implements bb::avm2::simulation::ClassIdDerivationInterface.
Definition at line 25 of file class_id_derivation.cpp.
|
private |
Definition at line 26 of file class_id_derivation.hpp.
|
private |
Definition at line 22 of file class_id_derivation.hpp.
|
private |
Definition at line 23 of file class_id_derivation.hpp.