Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
context_provider.cpp
Go to the documentation of this file.
2
5
6namespace bb::avm2::simulation {
7
9 AztecAddress msg_sender,
10 FF transaction_fee,
11 ContextInterface& parent_context,
12 MemoryAddress cd_offset_address,
13 uint32_t cd_size,
14 bool is_static,
15 Gas gas_limit,
16 SideEffectStates side_effect_states,
17 TransactionPhase phase)
18{
19 merkle_db.create_checkpoint(); // Fork DB just like in TS.
20 uint32_t context_id = next_context_id++;
22 context_id,
23 address,
24 msg_sender,
25 transaction_fee,
26 is_static,
27 gas_limit,
28 parent_context.get_globals(),
30 memory_provider.make_memory(context_id),
34 side_effect_states,
35 phase,
36 parent_context,
37 cd_offset_address,
38 cd_size);
39}
40
42 AztecAddress msg_sender,
43 FF transaction_fee,
45 bool is_static,
46 Gas gas_limit,
47 Gas gas_used,
48 SideEffectStates side_effect_states,
49 TransactionPhase phase)
50{
51
52 uint32_t context_id = next_context_id++;
53 cd_hash_provider.make_cd_hasher(context_id)->compute_calldata_hash(calldata);
54
56 context_id,
57 address,
58 msg_sender,
59 transaction_fee,
60 is_static,
61 gas_limit,
62 gas_used,
65 memory_provider.make_memory(context_id),
69 side_effect_states,
70 phase,
71 calldata);
72}
73
75{
76 return next_context_id;
77}
78
79} // namespace bb::avm2::simulation
virtual std::unique_ptr< CalldataHashingInterface > make_cd_hasher(uint32_t context_id)=0
virtual const GlobalVariables & get_globals() const =0
CalldataHashingProviderInterface & cd_hash_provider
WrittenPublicDataSlotsTreeCheckInterface & written_public_data_slots_tree
InternalCallStackManagerProviderInterface & internal_call_stack_manager_provider
std::unique_ptr< ContextInterface > make_nested_context(AztecAddress address, AztecAddress msg_sender, FF transaction_fee, ContextInterface &parent_context, MemoryAddress cd_offset_address, MemoryAddress cd_size_address, bool is_static, Gas gas_limit, SideEffectStates side_effect_states, TransactionPhase phase) override
MemoryProviderInterface & memory_provider
uint32_t get_next_context_id() const override
TxBytecodeManagerInterface & tx_bytecode_manager
std::unique_ptr< ContextInterface > make_enqueued_context(AztecAddress address, AztecAddress msg_sender, FF transaction_fee, std::span< const FF > calldata, bool is_static, Gas gas_limit, Gas gas_used, SideEffectStates side_effect_states, TransactionPhase phase) override
HighLevelMerkleDBInterface & merkle_db
virtual std::unique_ptr< InternalCallStackManagerInterface > make_internal_call_stack_manager(uint32_t context_id)=0
virtual std::unique_ptr< MemoryInterface > make_memory(uint32_t space_id)=0
uint32_t MemoryAddress
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13