10namespace sysio {
namespace chain {
12 class deep_mind_handler;
14 namespace resource_limits {
18 static_assert(std::is_integral<T>::value,
"ratios must have integral types");
65 :_db(db),_get_deep_mind_logger(get_deep_mind_logger)
bool is_unlimited_cpu(const account_name &account) const
uint64_t get_virtual_block_cpu_limit() const
void get_account_limits(const account_name &account, int64_t &ram_bytes, int64_t &net_weight, int64_t &cpu_weight) const
void initialize_database()
uint64_t get_total_cpu_weight() const
uint64_t get_block_net_limit() const
std::pair< account_resource_limit, bool > get_account_cpu_limit_ex(const account_name &name, uint32_t greylist_limit=config::maximum_elastic_resource_multiplier) const
void initialize_account(const account_name &account)
void read_from_snapshot(const snapshot_reader_ptr &snapshot)
bool set_account_limits(const account_name &account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight)
set_account_limits returns true if new ram_bytes limit is more restrictive than the previously set on...
void set_block_parameters(const elastic_limit_parameters &cpu_limit_parameters, const elastic_limit_parameters &net_limit_parameters)
std::pair< int64_t, bool > get_account_cpu_limit(const account_name &name, uint32_t greylist_limit=config::maximum_elastic_resource_multiplier) const
uint64_t get_block_cpu_limit() const
void process_block_usage(uint32_t block_num)
std::pair< int64_t, bool > get_account_net_limit(const account_name &name, uint32_t greylist_limit=config::maximum_elastic_resource_multiplier) const
void add_to_snapshot(const snapshot_writer_ptr &snapshot) const
void add_pending_ram_usage(const account_name account, int64_t ram_delta)
void process_account_limit_updates()
void update_account_usage(const flat_set< account_name > &accounts, uint32_t ordinal)
void add_transaction_usage(const flat_set< account_name > &accounts, uint64_t cpu_usage, uint64_t net_usage, uint32_t ordinal)
int64_t get_account_ram_usage(const account_name &name) const
uint64_t get_virtual_block_net_limit() const
void verify_account_ram_usage(const account_name accunt) const
uint64_t get_total_net_weight() const
std::pair< account_resource_limit, bool > get_account_net_limit_ex(const account_name &name, uint32_t greylist_limit=config::maximum_elastic_resource_multiplier) const
resource_limits_manager(chainbase::database &db, std::function< deep_mind_handler *()> get_deep_mind_logger)
std::shared_ptr< snapshot_writer > snapshot_writer_ptr
std::shared_ptr< snapshot_reader > snapshot_reader_ptr
#define T(meth, val, expected)
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
unsigned __int64 uint64_t
Immutable except for fc::from_variant.
int64_t used
quantity used in current window
friend bool operator!=(const elastic_limit_parameters &lhs, const elastic_limit_parameters &rhs)
friend bool operator==(const elastic_limit_parameters &lhs, const elastic_limit_parameters &rhs)
friend bool operator==(const ratio &lhs, const ratio &rhs)
friend bool operator!=(const ratio &lhs, const ratio &rhs)