state.token.staking_node_info.proto Maven / Gradle / Ivy
The newest version!
syntax = "proto3";
package proto;
/*-
*
* Hedera Network Services Protobuf
*
* Copyright (C) 2018 - 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import "state/common.proto";
import "basic_types.proto";
option java_package = "com.hederahashgraph.api.proto.java";
// <<>> This comment is special code for setting PBJ Compiler java package
option java_multiple_files = true;
/**
* Representation of a Hedera Token Service staking info entity in the network Merkle tree.
*
* As with all network entities, staking info is per node and has a unique entity number represented as shard.realm.X.
*/
message StakingNodeInfo {
/**
* The unique entity number of the node. The shard and realm numbers are implied, based on the network
* this entity came from.
*/
int64 node_number = 1;
/**
* The minimum stake on this node that is required for this node to have a non-zero weight to
* participate in the network consensus.
*/
int64 min_stake = 2;
/**
* The maximum stake on this node that is considered to calculate its weight to participate in the network consensus.
*/
int64 max_stake = 3;
/**
* The sum of balances of all accounts staked to this node who have opted to receive rewards.
*/
int64 stake_to_reward = 4;
/**
* The sum of balances of all accounts staked to this node who have opted to decline rewards.
*/
int64 stake_to_not_reward = 5;
/**
* The snapshot of stake_to_reward value at the beginning of the current staking period.
* This is needed for calculating rewards for current staking period without considering changes to
* stake_to_reward in the current staking period. It is reset at the beginning of every period.
*/
int64 stake_reward_start = 6;
/**
* Tracks how much stake from stakeRewardStart will have unclaimed rewards due to accounts changing their staking
* metadata in a way that disqualifies them for the current period; It is reset at the beginning of every period
*/
int64 unclaimed_stake_reward_start = 7;
/**
* The total amount of effective hbar staked to this node. This is sum of stake_to_reward and stake_to_not_reward.
* If the sum is greater than max_stake, then the effective stake is max_stake.
* If the sum is less than min_stake, then the effective stake is 0.
*/
int64 stake = 8;
/**
* An running sum of reward rates per hbar for the last 365+1 staking periods. The first element is the
* is the reward up to and including the last full period that finished before the present. Second element is
* the reward up to and including the period before that
*/
repeated int64 reward_sum_history = 9;
/**
* The consensus weight of this node in the network. This is computed based on the stake of this node
* at midnight UTC of the current day. If the stake of this node is less than minStake, then the weight is 0.
* Sum of all weights of nodes in the network should be less than 500.
* If the stake of this node A is greater than minStake, then the weight of this node A is calculated as:
* (node A stake * 500/ total stake of all nodes)
*/
int32 weight = 10;
/**
* The total staking rewards in tinybars that COULD be collected by all accounts staking to the current node after the end
* of this staking period; assuming that no account "renounces" its rewards by, for example, setting declineReward=true.
* When the current node is deleted, this amount will be subtracted from the total pending rewards of all accounts staking
* to all nodes in the network in NetworkStakingRewards.
*/
int64 pending_rewards = 11;
/**
* True if this node has been deleted from network.
*/
bool deleted = 12;
}