How the nodes working in Aptos network?

--

The Aptos network consists of three node types: validator node, validator fullnode and public fullnode. To participate in consensus, you are required to run both a validator node and a validator fullnode, and stake.

Also learn how to run a public fullnode on a local network and connect to either a testnet or a devnet. This section describes everything you need to stake and participate in consensus and governance. See also the external resources offered by your fellow node operators.

Validation on the Aptos blockchain​

Throughout the duration of an epoch, the following flow of events occurs several times (thousands of times):

  • A validator leader is selected by a deterministic formula based on the validator reputation determined by validator’s performance (including whether the validator has voted in the past or not) and stake. This leader selection is not done by voting.
  • The selected leader sends a proposal containing the collected quorum votes of the previous proposal and the leader’s proposed order of transactions for the new block.
  • All the validators from the validator set will vote on the leader’s proposal for the new block. Once consensus is reached, the block can be finalized. Hence, the actual list of votes to achieve consensus is a subset of all the validators in the validator set. This leader validator is rewarded. Rewards are given only to the leader validator, not to the voter validators.
  • The above flow repeats with the selection of another validator leader and repeating the steps for the next new block. Rewards are given at the end of the epoch.

Validator state and stake state​

States are defined for a validator and the stake.

  • Validator state: A validator can be in any one of these four states. Moreover, the validator can go from inactive (not tracked in the validator set anywhere) state to any one of the other three states:
  • inactive
  • pending_active.
  • active.
  • pending_inactive.
  • Stake state: A validator in pending_inactive or active state, can have their stake in either of these four states:
  • inactive.
  • pending_active.
  • active.
  • pending_inactive.
  • These stake states are applicable for the existing validators in the validator set adding or removing their stake.

Validator states

  1. If a validator’s stake drops below the required minimum, that validator will be moved from active state directly to the inactive state during an epoch change. This happens only during an epoch change.
  2. Aptos governance can also directly remove validators from the active set. Note that governance proposals will always trigger an epoch change.

Stake state​

The state of stake has more granularity than that of the validator; additional stake can be added and a portion of stake removed from an active validator.

Validator rules​

The below rules is applicable during the changes of state:

  • Voting power can change (increase or decrease) only on epoch boundary.
  • A validator’s consensus key and the validator and validator fullnode network addresses can change only on epoch boundary.
  • Pending inactive stake cannot be moved into inactive (and thus withdrawable) until before lockup expires.
  • No validators in the active validator set can have their stake below the minimum required stake.

Validator flow

  1. Owner initializes the stake pool with aptos stake create-staking-contract.
  2. When the owner is ready to deposit the stake (or have funds assigned by a staking service in exchange for ownership capability), owner calls aptos stake add-stake.
  3. When the validator node is ready, the operator can call aptos node join-validator-set to join the active validator set. Changes will be effective in the next epoch.
  4. Validator validates (proposes blocks as a leader-validator) and gains rewards. The stake will automatically be locked up for a fixed duration (set by governance) and automatically renewed at expiration.
  5. At any point, if the operator wants to update the consensus key or validator network addresses, they can call aptos node update-consensus-key or aptos node update-validator-network-addresses. Similar to changes to stake, the changes to consensus key or validator network addresses are only effective in the next epoch.
  6. Validator can request to unlock their stake at any time. However, their stake will only become withdrawable when their current lockup expires. This can be at most as long as the fixed lockup duration.
  7. After exiting, the validator can either explicitly leave the validator set by calling aptos node leave-validator-set or if their stake drops below the min required, they would get removed at the end of the epoch.
  8. Validator can always rejoin the validator set by going through steps 2–3 again.

An owner can always switch operators by calling aptos stake set-operator.

An owner can always switch designated voter by calling aptos stake set-delegated-voter.

Joining the validator set​

Participating as a validator node on the Aptos network works like this:

  1. Operator runs a validator node and configures the on-chain validator network addresses and rotates the consensus key.
  2. Owner deposits her Aptos coins funds as stake, or have funds assigned by a staking service. The stake must be at least the minimum amount required.
  3. The validator node cannot sync until the stake pool becomes active.
  4. Operator validates and gains rewards.
  5. The staked pool is automatically be locked up for a fixed duration (set by the Aptos governance) and will be automatically renewed at expiration. You cannot withdraw any of your staked amount until your lockup period expires. See stake.move#L728.
  6. Operator must wait until the new epoch starts before their validator becomes active.

Minimum and maximum stake​

You must stake the required minimum amount to join the validator set. Moreover, you can only stake up to the maximum stake amount. The current required minimum for staking is 1M APT tokens and the maximum is 50M APT tokens.

If at any time after joining the validator set, your current staked amount exceeds the maximum allowed stake (for example as the rewards are added to your staked amount), then your voting power and the rewards will be calculated only using the maximum allowed stake amount, and not your current staked amount.

The owner can withdraw part of the stake and leave their balance below the required minimum. In such case, their stake pool will be removed from the validator set when the next epoch starts.

Automatic lockup duration

When you join the validator set, your stake will automatically be locked up for a fixed duration that is set by the Aptos governance.

Automatic lockup renewal​

When your lockup period expires, it will be automatically renewed, so that you can continue to validate and receive the rewards.

Unlocking your stake​

You can request to unlock your stake at any time. However, your stake will only become withdrawable when your current lockup expires. This can be at most as long as the fixed lockup duration. You will continue earning rewards on your stake until it becomes withdrawable.

The principal amount is updated when any of the following actions occur:

  1. Operator requests commission unlock
  2. Staker (owner) withdraws funds
  3. Staker (owner) switches operators

When the staker unlocks stake, this also triggers a commission unlock. The full commission amount for any staking rewards earned is unlocked. This is not proportional to the unlock stake amount. Commission is distributed to the operator after the lockup ends when request commission is called a second time or when staker withdraws (distributes) the unlocked stake.

Help The Author

cosmos1xzgkwn04tlkt2kxgxe5844wl4yen2yv07e2e35

--

--

CRYPTO GUERRA 👨‍💻

Articles About investments in focus on crypto. using methods like Ghaham Method or Peter Lynch Valuation. For me You are the most important !!! follow me !!