Scorum
Variables
Virtual Time Scheduling

How the witness was scheduled the last time it was scheduled. More...

Variables

fc::uint128 scorum::chain::witness_object::virtual_last_update
 
fc::uint128 scorum::chain::witness_object::virtual_position
 
fc::uint128 scorum::chain::witness_object::virtual_scheduled_time = fc::uint128::max_value()
 

Detailed Description

How the witness was scheduled the last time it was scheduled.

These fields are used for the witness scheduling algorithm which uses virtual time to ensure that all witnesses are given proportional time for producing blocks.

Votes is used to determine speed. The virtual_scheduled_time is the expected time at which this witness should complete a virtual lap which is defined as the position equal to 1000 times MAXVOTES.

virtual_scheduled_time = virtual_last_update + (1000*MAXVOTES - virtual_position) / votes

Every time the number of votes changes the virtual_position and virtual_scheduled_time must update. There is a global current virtual_scheduled_time which gets updated every time a witness is scheduled. To update the virtual_position the following math is performed.

virtual_position = virtual_position + votes * (virtual_current_time - virtual_last_update) virtual_last_update = virtual_current_time votes += delta_vote virtual_scheduled_time = virtual_last_update + (1000*MAXVOTES - virtual_position) / votes

Variable Documentation

◆ virtual_last_update

fc::uint128 scorum::chain::witness_object::virtual_last_update

Definition at line 85 of file witness_objects.hpp.

◆ virtual_position

fc::uint128 scorum::chain::witness_object::virtual_position

Definition at line 86 of file witness_objects.hpp.

◆ virtual_scheduled_time

fc::uint128 scorum::chain::witness_object::virtual_scheduled_time = fc::uint128::max_value()

Definition at line 87 of file witness_objects.hpp.