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++;
21 // Memory assumes that the space id is <= 16 bits.
22 assert(context_id <= std::numeric_limits<uint16_t>::max());
23 uint16_t space_id = static_cast<uint16_t>(context_id);
26 address,
27 msg_sender,
28 transaction_fee,
29 is_static,
30 gas_limit,
31 parent_context.get_globals(),
38 side_effect_states,
39 phase,
40 parent_context,
41 cd_offset_address,
42 cd_size);
43}
44
46 AztecAddress msg_sender,
47 FF transaction_fee,
49 bool is_static,
50 Gas gas_limit,
51 Gas gas_used,
52 SideEffectStates side_effect_states,
53 TransactionPhase phase)
54{
55
56 uint32_t context_id = next_context_id++;
57 // Memory assumes that the space id is <= 16 bits.
58 assert(context_id <= std::numeric_limits<uint16_t>::max());
59 uint16_t space_id = static_cast<uint16_t>(context_id);
60
62
65 address,
66 msg_sender,
67 transaction_fee,
68 is_static,
69 gas_limit,
70 gas_used,
78 side_effect_states,
79 phase,
80 calldata);
81}
82
84{
85 return next_context_id;
86}
87
88} // namespace bb::avm2::simulation
virtual std::unique_ptr< CalldataHashingInterface > make_calldata_hasher(uint32_t context_id)=0
virtual const GlobalVariables & get_globals() const =0
CalldataHashingProviderInterface & cd_hash_provider
WrittenPublicDataSlotsTreeCheckInterface & written_public_data_slots_tree
RetrievedBytecodesTreeCheckInterface & retrieved_bytecodes_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(uint16_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
uint32_t context_id