Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tx_execution.hpp
Go to the documentation of this file.
1#pragma once
2
14
15namespace bb::avm2::simulation {
16
17// In charge of executing a transaction.
18class TxExecution final {
19 public:
36
37 void simulate(const Tx& tx);
38
39 private:
46
48
49 // This function can throw if there is a nullifier collision.
50 void insert_non_revertibles(const Tx& tx);
51 // This function can throw if there is a nullifier collision.
52 void insert_revertibles(const Tx& tx);
54 TransactionPhase phase,
55 const FF& transaction_fee,
56 bool success,
57 const Gas& start_gas,
58 const Gas& end_gas,
59 const TxContextEvent& state_before,
60 const TxContextEvent& state_after);
61 void pay_fee(const FF& fee_payer, const FF& fee, const uint128_t& fee_per_da_gas, const uint128_t& fee_per_l2_gas);
62
63 void emit_l2_to_l1_message(bool revertible, const ScopedL2ToL1Message& l2_to_l1_message);
64 void emit_nullifier(bool revertible, const FF& nullifier);
65 void emit_note_hash(bool revertible, const FF& note_hash);
66
67 void pad_trees();
68
69 void cleanup();
70
72};
73
74} // namespace bb::avm2::simulation
void emit_public_call_request(const PublicCallRequestWithCalldata &call, TransactionPhase phase, const FF &transaction_fee, bool success, const Gas &start_gas, const Gas &end_gas, const TxContextEvent &state_before, const TxContextEvent &state_after)
FieldGreaterThanInterface & field_gt
void emit_empty_phase(TransactionPhase phase)
void insert_non_revertibles(const Tx &tx)
HighLevelMerkleDBInterface & merkle_db
void pay_fee(const FF &fee_payer, const FF &fee, const uint128_t &fee_per_da_gas, const uint128_t &fee_per_l2_gas)
TxExecution(ExecutionInterface &call_execution, ContextProviderInterface &context_provider, HighLevelMerkleDBInterface &merkle_db, WrittenPublicDataSlotsTreeCheckInterface &written_public_data_slots_tree, RetrievedBytecodesTreeCheckInterface &retrieved_bytecodes_tree, FieldGreaterThanInterface &field_gt, Poseidon2Interface &poseidon2, EventEmitterInterface< TxEvent > &event_emitter)
EventEmitterInterface< TxEvent > & events
void emit_note_hash(bool revertible, const FF &note_hash)
ContextProviderInterface & context_provider
void emit_l2_to_l1_message(bool revertible, const ScopedL2ToL1Message &l2_to_l1_message)
ExecutionInterface & call_execution
EventEmitter< DataCopyEvent > event_emitter
AvmFlavorSettings::FF FF
Definition field.hpp:10
unsigned __int128 uint128_t
Definition serialize.hpp:44