Scorum
Public Attributes | List of all members
scorum::witness::reserve_ratio_object Class Reference

#include <witness_objects.hpp>

Inheritance diagram for scorum::witness::reserve_ratio_object:
scorum::app::api_obj< scorum::witness::reserve_ratio_object > scorum::app::chain_properties_api_obj scorum::app::dynamic_global_property_api_obj

Public Attributes

id_type id
 
int32_t average_block_size = 0
 
int64_t current_reserve_ratio = 1
 
uint128_t max_virtual_bandwidth = 0
 

Detailed Description

Definition at line 45 of file witness_objects.hpp.

Member Data Documentation

◆ average_block_size

int32_t scorum::witness::reserve_ratio_object::average_block_size = 0

Average block size is updated every block to be:

average_block_size = (99 * average_block_size + new_block_size) / 100

This property is used to update the current_reserve_ratio to maintain approximately 50% or less utilization of network capacity.

Definition at line 60 of file witness_objects.hpp.

◆ current_reserve_ratio

int64_t scorum::witness::reserve_ratio_object::current_reserve_ratio = 1

Any time average_block_size <= 50% maximum_block_size this value grows by 1 until it reaches SCORUM_MAX_RESERVE_RATIO. Any time average_block_size is greater than 50% it falls by 1%. Upward adjustments happen once per round, downward adjustments happen every block.

Definition at line 68 of file witness_objects.hpp.

◆ id

id_type scorum::witness::reserve_ratio_object::id

Definition at line 50 of file witness_objects.hpp.

◆ max_virtual_bandwidth

uint128_t scorum::witness::reserve_ratio_object::max_virtual_bandwidth = 0

The maximum bandwidth the blockchain can support is:

max_bandwidth = maximum_block_size * SCORUM_BANDWIDTH_AVERAGE_WINDOW_SECONDS / SCORUM_BLOCK_INTERVAL

The maximum virtual bandwidth is:

max_bandwidth * current_reserve_ratio

Definition at line 79 of file witness_objects.hpp.


The documentation for this class was generated from the following file: