Original title: "Beacon Chain Validators: Redundancy Risks and Failover"
Original Source: Ethereum Enthusiast
Verifier and verifier client
Verifier is a concept related to the beacon chain, a verifier is the beacon chain consensus process a participant. Verifiers are identified by public keys, and each verifier will be assigned the task of verifying the beacon chain at different times. If you successfully complete these tasks, you will be rewarded; on the contrary, if you neglect your duties, you will not only not be rewarded, but will also be severely punished. In Phase 0, these accusations are limited to proposing blocks and submitting attestations on the beacon chain.
Verifiers need to use a software called Verifier Client (VC) to perform their duties 1. All beacon chain client teams use VC as one of their client packages.
Needless to say, verifiers want their clients to be online at all times in order to get the most benefit and avoid all penalties. A common way to achieve high availability is to set up redundancy and failover mechanisms. This article explains the dangers of redundancy to validators and proposes a reasonable failover for VCs in the beacon chain.
Types of losses/penalties
Validators face three types of losses, severe The degree is arranged from small to large as follows:
- Reward Frustration: When a validator fails to perform when assigned to a task, the TA cannot receive the reward corresponding to the task. The validator's equity (principal) will not decrease, but just loses a chance to get the reward.
- Slack work penalty: If a verifier does not send a witness message, and the beacon chain cannot finalize the block at that time 2, then the verifier's rights and interests will be greatly reduced A small amount (of course, the relevant rewards will not be obtained).
- Penalty penalty: If a verifier sends a witness message that violates the Casper FFG rules, the verifier will be punished immediately - the verifier's rights and interests A certain ratio will be reduced 3, and the validator will be kicked out and can no longer participate in the consensus (and therefore will not be eligible for future rewards). Moreover, because the beacon chain cannot transfer and retrieve the pledged ETH, all the remaining money of the verifier will be locked on the beacon chain and cannot be used (until the beacon chain enables related functions).
The verifier who sent the witness message will be punished for slowing down, and the witness who sent the message will also lose, but the loss is smaller than the former; however, the author mainly discusses the loss related to the verifier being offline in this article, so it is also Extenuating circumstances.)The first two types of loss are likely to be encountered by a validator whose VC is offline, but the third type is only if the VC is not set correctly (or the beacon chain encounters a clear attack) verifiers will encounter. When it comes to failover and redundancy measures, the most important thing should be to do everything possible to avoid slashing, and then to improve online time to reduce the probability of reward failure and slowdown punishment.
Dangers of Redundant VC Facilities
p>Some stakers may think that running redundant VCs is insurance against a VC going offline. But in fact, redundant VC facilities are not safe, and it is very likely that validators will be slashed in the end! Look at a practical example:
- Redundant VC leads to slashing!
This validator runs two client instances C1 and C2, both with online VC. Unstable network conditions (peer node/link issues, message delivery delays, network partitions, etc.), resulting in two client instances not agreeing on which fork is the main chain, C1 and C2 Take B1 and B2 as the current top checkpoint respectively (note that it is the top checkpoint, not the top block, and the inconsistency of the top checkpoint can occur without any malicious behavior). When it is the validator's turn to perform its validator tasks, the two client instances each send a voting message targeting the checkpoint they have identified as the main chain checkpoint. The result is that the target checkpoints of the two attestations are different (but both are at the same height). This is double voting, which violates the rules of Casper FFG and will result in the validator being slashed.
VC's failover protocol
Note: When I say "failover", I mean manually or automatically restarting a new VC instance after a VC is stopped. However, I do not recommend using an automated failover mechanism, because if implemented poorly, it will Will cause you to have two VCs hanging on the line! The main point of the previous section is that validators should only have one live VC instance deployed at any time. However, VCs always make mistakes, how to deal with this risk? Stakers should define their own failover protocol (determining what uses should restart a new validator client instance) in advance to deal with this situation. Before developing a secure and reliable failover protocol, let's first look at a security feature built into validator clients: slashing protection.
- Forfeiture Protection Mechanism-
Punishment protection mechanism: All VC software developed by the Beacon Chain client team has a penalty protection mechanism as a response to accidents Fail-safe for events. According to the slashing rules, only pairs of attestation messages will result in slashing, only need to check this pair of messages to judge the result. Then, VC can store all the messages and blocks signed by itself in the local slash protection database . When signing any new attestation message/block, VC only needs to check whether the new message conflicts with the old message in the database (whether it will form a slashed message pair), and only sign the new message that does not conflict. Therefore, VC needs three mechanisms to ensure correct and safe operation:
- A fully synchronized beacon chain node (BN) to obtain information about the beacon chain
- The verifier signs the private key to actually sign the message
- Secure the protection database in time, as a fail-safe device
ul>A good failover protocol must take into account the failure of either mechanism. The first two are easy to guarantee - a redundant BN can be maintained for new VC connections, and the signing key can also be copied from the backup folder as a read-only file. But the last item - up-to-date slash-protected data - is not easy to back up and keep available! There are many possible errors that can lead to complete database loss: file system corruption, hard disk failure, hardware loss due to force majeure, etc. Data backup and availability is a multi-billion dollar problem, and there are many solutions, such as block-by-block/file-by-file monitoring of backups, RAID availability, etc. However, we have a little trick that can be used to rebuild a lost slash-protected database! The database can be reconstructed in a minified format, and the full history of all signed messages is not required. Utilities for this rebuild method can be found in the adiasg/eth3-slashing-protection-rebuild repository. Note: SD cards are not reliable storage devices, so stakers running VC on a Raspberry Pi are especially vulnerable to losing their slash-protected databases!
My suggested failover solution
p>A simple but useful solution is to maintain a redundant BN and ensure that redundant validator keys are easily obtained.
- Initial VC setup and multi-scenario failover protocol-
In this setup, various errors are distributed correspondingly Solution:
- BN error ——then migrate to redundant BN
- Verifier key file lost ——key backed up from cold storage Copied from file
- Confiscation protected database loss - rebuild the database, or restore from live backup
Key split validator
(i.e.: the correct way to implement a resilient validator facility) Optimal resiliency infrastructure requires key-splitting techniques - that's another article. More information can be found in this presentation video: https://youtu.be/awBX1SrXOhk< /a>. Note 1: The difference between the two concepts of authenticator and verifier client can also be found in Jim McDonald's blogNote 2: In the current specification, If there are no finalized checkpoints for more than 4 periods, a sabotage penalty occurs. Note 3: In the parameter setting of the current specification, this ratio is equal to 1/128 of the effective balance of the verifier. If the effective balance of the verifier is 32 ETH, the specific amount is 0.25 ETH.
Original source a>
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia