Validator (SV)

The Guidance for A Validator

1.A brief introduction to a Validator

A validator is an essential role in StaFi network who is responsible for important tasks including block production and transaction confirmation. A validator needs to maintain a high communication response capability to ensure seamless operation of StaFi network. In addition, it is necessary for them to establish a good reputation in the community in order to attract more nominators who nominate their FIS to improve the security of the system.

In order to establish and maintain a good reputation, validators need to pledge their FIS as a collatoral. When a validator does evil, such as double signing, it will be slashed and that FIS will also be deducted. When a validator obey the rules of the system, they will be rewarded in the form of transaction fees when they are packaging transactions, and the commission during nomination. In StaFi network, validators can set their own charging standard, ranging from 0-100%.

Based on network affordability and security considerations, validator seats will be gradually opened after the mainnet goes live, starting from 60 to 80. There are currently 120 validators and more seats will be opened in the future.

2.Classification and the role of validators in Stafi network

In StaFi network, validators are divided into two types: SV (StaFi Validator) and SSV (StaFi Sepcail Validator):

A SV validates consensus, be responsible for block production and transaction confirmation. This part mainly talks about SV.

A SSV is a special validator who is responsible for managing multi-signature accounts and verifying the on-chain role of the original chain. A SSV operates Staking Tokens in the multi-signature account through multi-signature. The role of a SSV is expounded in Staking Contract section

3.To become a Validator in StaFi

1) FIS balance

As long as you are in hold of FIS (used to pay for the configuration operation fee), you are able to become a validator of the StaFi network. However, the elected validators need to obtain a certain number of FIS nominations, and the system will select validators according to the ranking of FIS balances.

2) System requirements

A validator usually deploys nodes on cloud servers. You can choose your preferred VPS service provider and operating system. We recommend Ubuntu 18.04.

Hardware requirements:

StaFi will provide a basic configuration for reference, which guarantees that all blocks can be processed in time. If the hardware is inferior to that, there will be malfunctions.

Basic configuration:

  • System: Linux or Macos, Ubuntu 18.04 is recommended

  • CPU: at least 2 cores, Intel Core

  • Memory: at least 8G

  • Hard disk: at least 200G, regularly evaluated

Recommended configuration:

  • System: Linux or Macos, Ubuntu18.04

  • CPU: 4 cores, Intel Core

  • Memory: 8G

  • Hard Disk: 500G

4.To deploy validator settings

Please follow this guide to deploy as a validator

5.Validator election mechanism

Note: 1 epoch=1 hour, 6 epoch=1 era

1) The election process

In an era, the StaFi network will lock the data in the last 15 minutes of the fifth epoch. Then, the nominators will not be able to nominate. When the sixth epoch begins, the system will rank the validators’ nominated FIS and select top validators for the next era. Those who successfully nominated to selected validators will be rewarded in the next era.

2) Withdrawal

Withdrawal refers to the behavior of removing a validator from the incumbent ones in the next NPoS cycle.

Withdrawal means to withdraw from the incumbent validators and no longer produce blocks or confirm transactions. Those who nominated them will not be rewarded.

There are two cases of withdrawal:

Voluntary withdrawal by the validator. For example, there is some problems with the validator's server hosting provider, so the validator may choose to withdraw to avoid being slashed. When the request is submitted, it will take effect in the next epoch and the validator will become inactive then. However, the FIS nominated for the validator is still there.

When the validator does some actions that harm the operation of the system, they will be ‘expeled’ as a punishment. It will take effect immediately in the current epoch. The FIS nominated to the validator will be automatically distributed to other validators.

6.Validator reward distribution mechanism

In StaFi network, the system records the rewards of each validator in an epoch cycle, and issues rewards in an Era cycle. A validator can claim rewards when an Era ends.

When a validator claims the rewards, part of them will be distributed to their nominator(s) according to the protocol by the ratio set in advance.

Note: If the reward is not claimed within 84 Era (21 days), it will be destroyed. So please do not forget to claim!

Suppose the collective reward for validators is 10 FIS. If a validator set commission validator_payment = 40%, it will receive 4 FIS and the remaining 6 FIS will be distributed to nominators by the amount of FIS they used to nominate. If the validator itself pledged FIS, it will also get a portion from that 6 FIS. That can be understood as the validator nominated itself. The reward can be sent to the Stash account or Controller. A validator can choose to continue to pledge their rewards back or not.

7.Slash Mechanism

1) Offline/not responding

If the validator does not produce any block or send an online signal in an Era, then it will be regarded as offline/not responding. When there are certain number of offline/unresponsive nodes, the system will begin to confiscate part of the pledged FIS in the verification pool of the bad-behaving validator in order to ensure the normal operation of the network. Some of the FIS in that pool are from nominators.

StaFi currently sets the following formula:

min((3*(k-(n/10+1)))/n, 1)*0.07

n is the number of validators, k is the number of offline validators. Please note that when k-(n / 10 + 1) <0, the penalty amount is 0. Suppose there are 100 validators,

Assuming n=100,

When k=1~11, the ratio of slash is 0;

When k=12, the ratio of slash is 0.03 * 0.07 = 0.0021

When k=21, the ratio of slash is 0.3 * 0.07 = 0.021

When k=31, the ratio of slash is 0.6 * 0.07 = 0.042

When k=41, the ratio of slash is 0.9 * 0.07 = 0.063

When k=51, the ratio of slash is 1*0.07=0.07

In general, the minimum ratio of slash is 0 and the maximum is 7%. When less than 10% of all nodes are offline, a node will not be slashed if it is offline or unresponsive. When 1/3 of the nodes are offline at the same time, slash ratio is close to 5%.

2) Double signature

In the block-production stage (Babe consensus) and voting stage (Grandpa consensus), voting on different chains in a single round, or generating two new blocks at the same height will be deemed evil to protect systemic security. The formula is as follows:

min((3k/n)^2, 1)

nis the number of validators, and k is the number of validators who abusively or invalidly vote in an Era.

Assuming n=100

When k=1, the ratio of slash is 0.03 * 0.03 = 0.0009

When k=10, the ratio of slash is 0.09

When k=21, the ratio of slash is 0.3969

When k=31, the ratio of slash is 0.81

When k=41, the ratio of slash is 1

When k=51, the ratio of slash is 1

In general, the penalty for double signature is much more serious than offline. The largest slash ratio is 1, which means that the validator may be fined all of their stake.

Validators can run their nodes on multiple computers to ensure that they can still perform verification work if one of their nodes fails. It should be noted that if those terminals do not coordinate well, double-signature may happen accidentally.

If validators are found any kind of bad behavior, they will be removed from the incumbent validator list thus losing their rewards for the current period. They will be immediately deemed inactive and will lose their nominators. They need to reapply to become candidate validators and obtain nominators again.

A nominator can nominate multiple validators, but may also be slashed because of the improper behavior of any validator nominated. Before slash, staking FIS could be reused in every epoch. If a nominator uses a certain amount of FIS to nominate a validator for some epochs, that amount will all be deducted if that validator misbehaved.

When a validator is found multiple bad behaviors, we will implement the highest slash amount instead of the sum to save some room for principal of that validator. A Validator who is found to have bad behavior will be withdrawn to prevent vindictive attacks or deliberate harm by other validators who are punished.

If you are interested in being a validator in StaFi, let's get tarted.