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 TransactionPhase phase)
17{
18 merkle_db.create_checkpoint(); // Fork DB just like in TS.
19 uint32_t context_id = next_context_id++;
20 // Memory assumes that the space id is <= 16 bits.
21 assert(context_id <= std::numeric_limits<uint16_t>::max());
22 uint16_t space_id = static_cast<uint16_t>(context_id);
25 address,
26 msg_sender,
27 transaction_fee,
28 is_static,
29 gas_limit,
30 parent_context.get_globals(),
38 phase,
39 parent_context,
40 cd_offset_address,
41 cd_size);
42}
43
45 AztecAddress msg_sender,
46 FF transaction_fee,
48 bool is_static,
49 Gas gas_limit,
50 Gas gas_used,
51 TransactionPhase phase)
52{
53
54 uint32_t context_id = next_context_id++;
55 // Memory assumes that the space id is <= 16 bits.
56 assert(context_id <= std::numeric_limits<uint16_t>::max());
57 uint16_t space_id = static_cast<uint16_t>(context_id);
58
60
63 address,
64 msg_sender,
65 transaction_fee,
66 is_static,
67 gas_limit,
68 gas_used,
77 phase,
78 calldata);
79}
80
82{
83 return next_context_id;
84}
85
86} // 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
SideEffectTrackerInterface & side_effect_tracker
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, TransactionPhase phase) override
MemoryProviderInterface & memory_provider
uint32_t get_next_context_id() const override
TxBytecodeManagerInterface & tx_bytecode_manager
HighLevelMerkleDBInterface & merkle_db
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, TransactionPhase phase) override
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