Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Types | Public Member Functions | List of all members
golos::chain::vote_evaluator< Major, Hardfork, Release > Class Template Reference

#include <steem_evaluator.hpp>

Inheritance diagram for golos::chain::vote_evaluator< Major, Hardfork, Release >:
golos::chain::evaluator< vote_evaluator< Major, Hardfork, Release >, Major, Hardfork, Release > golos::chain::generic_evaluator< golos::protocol::operation >

Public Types

typedef protocol::vote_operation< Major, Hardfork, Release > operation_type
 
- Public Types inherited from golos::chain::evaluator< vote_evaluator< Major, Hardfork, Release >, Major, Hardfork, Release >
typedef golos::protocol::operation operation_sv_type
 

Public Member Functions

 vote_evaluator (database &db)
 
void do_apply (const protocol::vote_operation< Major, Hardfork, Release > &o)
 
- Public Member Functions inherited from golos::chain::evaluator< vote_evaluator< Major, Hardfork, Release >, Major, Hardfork, Release >
 evaluator (database &d)
 
virtual void apply (const golos::protocol::operation &o) final override
 
virtual int get_type () const override
 
databaseget_database ()
 

Additional Inherited Members

- Protected Attributes inherited from golos::chain::evaluator< vote_evaluator< Major, Hardfork, Release >, Major, Hardfork, Release >
databasedb
 

Detailed Description

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
class golos::chain::vote_evaluator< Major, Hardfork, Release >

Definition at line 88 of file steem_evaluator.hpp.

Member Typedef Documentation

◆ operation_type

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
typedef protocol::vote_operation<Major, Hardfork, Release> golos::chain::vote_evaluator< Major, Hardfork, Release >::operation_type

Definition at line 90 of file steem_evaluator.hpp.

Constructor & Destructor Documentation

◆ vote_evaluator()

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
golos::chain::vote_evaluator< Major, Hardfork, Release >::vote_evaluator ( database db)
inline

Definition at line 92 of file steem_evaluator.hpp.

Member Function Documentation

◆ do_apply()

template<uint8_t Major, uint8_t Hardfork, uint16_t Release>
void golos::chain::vote_evaluator< Major, Hardfork, Release >::do_apply ( const protocol::vote_operation< Major, Hardfork, Release > &  o)

this is the rshares voting for or against the post

if the current net_rshares is less than 0, the post is getting 0 rewards so it is not factored into total rshares^2

calculate rshares2 value

this verifies uniqueness of voter

cv.weight / c.total_vote_weight ==> % of rshares increase that is accounted for by the vote

W(R) = B * R / ( R + 2S ) W(R) is bounded above by B. B is fixed at 2^64 - 1, so all weights fit in a 64 bit integer.

The equation for an individual vote is: W(R_N) - W(R_N-1), which is the delta increase of proportional weight

c.total_vote_weight = W(R_1) - W(R_0) + W(R_2) - W(R_1) + ... W(R_N) - W(R_N-1) = W(R_N) - W(R_0)

Since W(R_0) = 0, c.total_vote_weight is also bounded above by B and will always fit in a 64 bit integer.

start enforcing this prior to the hardfork

discount weight by time

this is the rshares voting for or against the post

if the current net_rshares is less than 0, the post is getting 0 rewards so it is not factored into total rshares^2

TODO: figure out how to handle remove a vote (rshares == 0 )

calculate rshares2 value

Definition at line 627 of file steem_evaluator.cpp.


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