Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
gas_tracker.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
barretenberg/vm2/common/aztec_types.hpp
"
4
#include "
barretenberg/vm2/simulation/events/gas_event.hpp
"
5
#include "
barretenberg/vm2/simulation/gadgets/context.hpp
"
6
#include "
barretenberg/vm2/simulation/gadgets/gt.hpp
"
7
#include "
barretenberg/vm2/simulation/interfaces/gas_tracker.hpp
"
8
#include "
barretenberg/vm2/simulation/lib/instruction_info.hpp
"
9
#include "
barretenberg/vm2/simulation/lib/serialization.hpp
"
10
11
namespace
bb::avm2::simulation
{
12
13
class
GasTracker
final :
public
GasTrackerInterface
{
14
public
:
15
GasTracker
(
GasEvent
&
gas_event
,
16
const
Instruction
&
instruction
,
17
const
InstructionInfoDBInterface
&
instruction_info_db
,
18
ContextInterface
&
context
,
19
GreaterThanInterface
&
greater_than
);
20
21
void
consume_gas
(
const
Gas
& dynamic_gas_factor = { 0, 0 })
override
;
22
Gas
compute_gas_limit_for_call
(
const
Gas
& allocated_gas)
override
;
23
24
private
:
25
ContextInterface
&
context
;
26
const
ExecInstructionSpec
&
spec
;
27
GreaterThanInterface
&
greater_than
;
28
GasEvent
&
gas_event
;
29
};
30
31
}
// namespace bb::avm2::simulation
aztec_types.hpp
bb::avm2::context
Definition
context.hpp:37
bb::avm2::simulation::ContextInterface
Definition
context.hpp:19
bb::avm2::simulation::GasTracker
Definition
gas_tracker.hpp:13
bb::avm2::simulation::GasTracker::compute_gas_limit_for_call
Gas compute_gas_limit_for_call(const Gas &allocated_gas) override
Definition
gas_tracker.cpp:114
bb::avm2::simulation::GasTracker::gas_event
GasEvent & gas_event
Definition
gas_tracker.hpp:28
bb::avm2::simulation::GasTracker::greater_than
GreaterThanInterface & greater_than
Definition
gas_tracker.hpp:27
bb::avm2::simulation::GasTracker::spec
const ExecInstructionSpec & spec
Definition
gas_tracker.hpp:26
bb::avm2::simulation::GasTracker::consume_gas
void consume_gas(const Gas &dynamic_gas_factor={ 0, 0 }) override
Definition
gas_tracker.cpp:54
bb::avm2::simulation::GasTracker::context
ContextInterface & context
Definition
gas_tracker.hpp:25
bb::avm2::simulation::GasTrackerInterface
Definition
gas_tracker.hpp:7
bb::avm2::simulation::GreaterThanInterface
Definition
gt.hpp:9
bb::avm2::simulation::InstructionInfoDBInterface
Definition
instruction_info.hpp:11
gas_event.hpp
instruction_info_db
InstructionInfoDB instruction_info_db
Definition
gas_tracker.test.cpp:30
instruction
Instruction instruction
Definition
gas_tracker.test.cpp:33
instruction_info.hpp
gas_tracker.hpp
bb::avm2::simulation
Definition
address_derivation_event.hpp:6
serialization.hpp
context.hpp
gt.hpp
bb::avm2::ExecInstructionSpec
Definition
instruction_spec.hpp:22
bb::avm2::Gas
Definition
aztec_types.hpp:175
bb::avm2::simulation::GasEvent
Definition
gas_event.hpp:22
bb::avm2::simulation::Instruction
Definition
serialization.hpp:30
src
barretenberg
vm2
simulation
gadgets
gas_tracker.hpp
Generated by
1.9.8