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:
35
36 void simulate(const Tx& tx);
37
38 private:
45
47
48 // This function can throw if there is a nullifier collision.
49 void insert_non_revertibles(const Tx& tx);
50 // This function can throw if there is a nullifier collision.
51 void insert_revertibles(const Tx& tx);
53 TransactionPhase phase,
54 const FF& transaction_fee,
55 bool success,
56 const Gas& start_gas,
57 const Gas& end_gas,
58 const TxContextEvent& state_before,
59 const TxContextEvent& state_after);
60 void pay_fee(const FF& fee_payer, const FF& fee, const uint128_t& fee_per_da_gas, const uint128_t& fee_per_l2_gas);
61
62 void emit_l2_to_l1_message(bool revertible, const ScopedL2ToL1Message& l2_to_l1_message);
63 void emit_nullifier(bool revertible, const FF& nullifier);
64 void emit_note_hash(bool revertible, const FF& note_hash);
65
66 void pad_trees();
67
68 void cleanup();
69};
70
71} // 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
TxExecution(ExecutionInterface &call_execution, ContextProviderInterface &context_provider, HighLevelMerkleDBInterface &merkle_db, WrittenPublicDataSlotsTreeCheckInterface &written_public_data_slots_tree, FieldGreaterThanInterface &field_gt, Poseidon2Interface &poseidon2, EventEmitterInterface< TxEvent > &event_emitter)
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)
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