
Editor's Note: This article comes fromBlockchain Camp (ID: blockchain_camp)Blockchain Camp (ID: blockchain_camp)
introduction
secondary title
Our Attestant is a non-custodial ETH 2.0 pledge service, which can not only provide higher security for customer funds, but also use advanced verification strategies to obtain higher returns than traditional verification infrastructure. One way to measure the benefits is to track the generation and uploading of attestations on the ETH 2.0 blockchain. This is a key metric because the earlier the attestation is chained, the higher the rewards. This article will introduce how Attestant calculates witness validity individually or comprehensively.
Testimony
text
image description
- Figure 1: Structure of Attestation Message -
The more interesting part is the chain head vote (chain head vote), that is, which block the verifier believes is the latest valid block on the chain when creating this attestation message. The structure of chain head voting is as follows:
image description
The slot (time slot) in the figure defines the position (height) of the chain head of the current blockchain that the verifier thinks, and the Hash (hash) defines the chain head block that the verifier thinks. Together, the two define a point on the blockchain. With enough votes, the network can reach consensus on the state of the blockchain.
Although the amount of data in a witness message is relatively small, but there are tens of thousands of validators, the amount of data will quickly add up. Since this data will be stored on the blockchain forever, it is very important to reduce the data volume. This is achieved through a process called "aggregation".
Aggregation is the testimony of multiple committees, chain head votes, and finality votes that are the same (Translator's Note: The same committee made the same chain head vote and finality voted attestation) into one aggregate attestation ( aggregate attestation ):
image description
Aggregated attestations differ from individual attestations in two ways. First, the former has multiple validators. Second, aggregate signatures are produced by merging the signatures of individual attestation messages. Aggregated attestations are storage efficient, but impose a communication and computational overhead (see below for details).
If we force every validator to aggregate all attestations, the amount of communication required to get every attestation message to every validator can quickly overload the network. Likewise, if aggregation is optional, validators will not waste their resources doing so. Therefore, the network selects a set of validators who are responsible for aggregation 1 . For the sake of profit, validators will perform their duties seriously, because the aggregate witness message containing more validators is more likely to be added to the blockchain, and the validators are more likely to be rewarded.
The validators who perform this aggregation process are called aggregators.
secondary title
ETH 2.0 uses the inclusion distance metric when calculating witness rewards for validators. Packing distance refers to the difference between the slot where the attestation message is generated and the slot where the attestation message is packed into a block. For example, the attestation message generated at slot s is packed into the block at slot s+1, and the packing distance is 1 at this time. If the attestation message is packed into the block at slot s+5, then the packing distance is 5.
In order to reflect the relative value of the attestation message, the witness reward obtained by the verifier will decrease with the increase of the packaging distance. Specifically, the witness reward will be multiplied by 1/d (d is the packaging distance).
image description
- Figure 4: There is a functional relationship between the attestation message and the packaging distance -
secondary title
The packaging process of the witness message
How are witnesses packaged on the ETH 2.0 blockchain? The process is as follows 2:
Each validator participating in the witness will use the relevant data of the chain state it owns to generate a witness message;
The attestation message will be broadcast to relevant aggregators through the ETH 2.0 network;
The aggregate witness message will be broadcast to all nodes through the ETH 2.0 network;
As long as the block proposer who has not seen the aggregate witness message on the chain can pack it into the block.
secondary title
Attestation generation delay
Validators may experience issues that cause delays in attestation generation. For example, validators have outdated data about the state of the chain, or validators take too long to generate and sign attestations. Whatever the reason, a lag at the attestation generation step has ripple effects on the rest of the process.
text
Attestation message broadcast delay
After the verifier generates the attestation message, it needs to broadcast the attestation message to the aggregator through the network. The nature of this process means that broadcasting is sooner rather than later, as this ensures that the attestation is received by validators in time to incorporate it into the aggregate attestation. Validators should be connected to enough peers to ensure that they can broadcast attestations to aggregators as quickly as possible.
Aggregated Attestation Generation Latency
Aggregators may delay the aggregation process of attestations. The most common reason is that the aggregator nodes are already overloaded producing attestations, but the speed of the aggregation algorithm can also cause huge delays if a large number of validators need to be aggregated.
Aggregated Attestation Broadcast Delay
Similar to attestation broadcast delay, aggregated attestation also needs to be broadcast in the network, so there is the same delay risk.
block generation failed
To get the attestation message on the chain, it must first be packaged into a block. However, block generation does not always succeed. There are two things that can cause block generation to fail: 1. The validator is offline; 2. The validator gets out of sync with other validators in the network, causing the block it generated to be rejected as containing invalid data. If the block generation fails, it is impossible to ensure that the attestation message is uploaded to the chain in the same slot, resulting in a packing distance greater than the optimal distance.
Since validators have no control over block generation 3 , we define the term "earliest inclusion slot". The earliest packaging slot refers to the first slot that generates a valid block after the attestation message is generated. The attestation message cannot be packaged into a non-existent block, so the efficiency of the witness cannot be measured based on the first slot after the attestation message is generated. This standard reflects these considerations, defining the "earliest packaging slot" as the first slot that produces a valid block after the attestation message is generated Impact).
malicious behavior
Nonetheless, it is still possible for a malicious actor to refuse to aggregate attestations, or to refuse to include attestations in blocks. The former risk can be mitigated by having multiple aggregators per validator group. In order to reduce the risk of the latter, there is a certain cost to not package the attestation message. However, the validators participating in the witness cannot force the block producer to package the attestation message, so if the benefits of not packaging the attestation message are higher than the cost, the validators participating in the witness are helpless.
Considering the block generation and packaging distance, the validity of the attestation message can be understood as how useful the attestation message is to the network. The formal definition of attestation validity is:
Block validity is presented as a percentage. The following table lists some examples:
Aggregated Attestation Validity
Summarize
The validity of a single attestation is interesting, but not very meaningful by itself. If we aggregate the validity of attestations generated by different validators at different slots, we can better understand the overall validity of the set of validators. Aggregate validity can be computed by simply taking the average of the validity of individual attestations, for example, the mean of the validity of a particular set of validators over a 7-day period.
Summarize
Notes:
When ETH 2.0 launches, thousands of nodes locate each other and start proposing and witnessing blocks. As with all immature networks, you need to experiment with how to make your nodes as efficient as possible. As mentioned above, attestation message validity is a major indicator used to track node validity. Validators looking to maximize rewards can use attestation validity to understand their overall performance.
Attestant tracks the validity of their attestations for our validators and aggregates data from client reports to provide clearer performance metrics. We’d love to share more metrics with you as we continue to expand our non-custodial ETH 2.0 staking services.
Notes: