Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
context_provider.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <memory>
4#include <span>
5
13
14namespace bb::avm2::simulation {
15
17 public:
18 virtual ~ContextProviderInterface() = default;
19
21 AztecAddress msg_sender,
22 FF transaction_fee,
23 ContextInterface& parent_context,
24 MemoryAddress cd_offset_address,
25 uint32_t cd_size,
26 bool is_static,
27 Gas gas_limit,
28 SideEffectStates side_effect_states,
29 TransactionPhase phase) = 0;
30
32 AztecAddress msg_sender,
33 FF transaction_fee,
35 bool is_static,
36 Gas gas_limit,
37 Gas gas_used,
38 SideEffectStates side_effect_states,
39 TransactionPhase phase) = 0;
40
41 // This can be removed if we use clk for the context id
42 virtual uint32_t get_next_context_id() const = 0;
43};
44
46 public:
63 AztecAddress msg_sender,
64 FF transaction_fee,
65 ContextInterface& parent_context,
66 MemoryAddress cd_offset_address,
67 MemoryAddress cd_size_address,
68 bool is_static,
69 Gas gas_limit,
70 SideEffectStates side_effect_states,
71 TransactionPhase phase) override;
73 AztecAddress msg_sender,
74 FF transaction_fee,
76 bool is_static,
77 Gas gas_limit,
78 Gas gas_used,
79 SideEffectStates side_effect_states,
80 TransactionPhase phase) override;
81 uint32_t get_next_context_id() const override;
82
83 private:
84 uint32_t next_context_id = 1; // 0 is reserved to denote the parent of a top level context
85
93};
94
95} // namespace bb::avm2::simulation
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
ContextProvider(TxBytecodeManagerInterface &tx_bytecode_manager, MemoryProviderInterface &memory_provider, CalldataHashingProviderInterface &cd_hash_provider, InternalCallStackManagerProviderInterface &internal_call_stack_manager_provider, HighLevelMerkleDBInterface &merkle_db, WrittenPublicDataSlotsTreeCheckInterface &written_public_data_slots_tree, const GlobalVariables &global_variables)
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< 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)=0
virtual uint32_t get_next_context_id() const =0
virtual std::unique_ptr< ContextInterface > make_nested_context(AztecAddress address, AztecAddress msg_sender, FF transaction_fee, ContextInterface &parent_context, MemoryAddress cd_offset_address, uint32_t cd_size, bool is_static, Gas gas_limit, SideEffectStates side_effect_states, TransactionPhase phase)=0
uint32_t MemoryAddress
AvmFlavorSettings::FF FF
Definition field.hpp:10
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13