Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update node weight #272

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion services/node_stake_update.proto
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ message NodeStake {
int64 reward_rate = 4;

/**
* Consensus weight of this node for the new staking period.
* Total stake (rewarded and not rewarded) of this node at the beginning of the new staking period.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's true only when min_stake <= stake_rewarded + stake_not_rewarded <= max_stake I believe. i.e. if the sum is less than min_stake, stake is 0; if the sum is more than max_stake, stake = max_stake

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah just discussed with Nick and the same field can be used as the consensus weight .

*/
int64 stake = 5;

Expand All @@ -127,4 +127,14 @@ message NodeStake {
* beginning of the new staking period.
*/
int64 stake_rewarded = 7;
/**
* The consensus weight of this node in the network.
* The network normalizes the weights of nodes above minStake so that the total sum of
* weight is approximately 500. Specifically, the weight of a node A with stake > minStake
* is computed using integer arithmetic as,
* A_weight = Math.max((# of whole hbars staked by A) * 500 / (total # of whole hbars staked), 1)
* so that every node above minStake has weight at least 1; but any node that has staked
* at least 1 out of every 250 whole hbars staked will have weight >= 2.
*/
int32 weight = 8;
}