Skip to content

Commit 123f581

Browse files
committed
SIMD-0218: Intermediate vote credits
1 parent 2071e4f commit 123f581

File tree

1 file changed

+116
-0
lines changed

1 file changed

+116
-0
lines changed
+116
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
---
2+
simd: '0218'
3+
title: Intermediate vote credits
4+
authors:
5+
- Ashwin Sekar
6+
category: Standard
7+
type: Core
8+
status: Review
9+
created: 2025-01-04
10+
feature: (fill in with feature tracking issues once accepted)
11+
extends: SIMD-0033 Timely Vote Credits
12+
---
13+
14+
## Summary
15+
16+
This feature aims to build upon the effort of timely vote credits in order
17+
to improve the vote credit algorithm.
18+
19+
Credits are awarded for a block voted on by a validator that ultimately gets
20+
finalized. For consensus purposes a vote for a block is implicitely a vote for
21+
all its ancestor blocks as well. We propose a mechanism in which all intermediate
22+
blocks between the previous root and the new root on a fork are awarded credits.
23+
24+
## Motivation
25+
26+
Although improved via TVC, the credit accounting algorithm is still far from perfect
27+
in measuring the contribution of validators to consensus. There still exist
28+
gaps whereby validators can gained increased credits through modifications that
29+
do not have any consensus benefits. Running unaudited code poses a risk to the network.
30+
31+
Since there is no consensus benefits to these modifications, by aligning the credit
32+
algorithm to more accurately reflect consensus contriubtion, we hope to reduce the
33+
potential danger of these modifications.
34+
35+
Similarly, honest validators are not fully rewarded for all of their contributions.
36+
This SIMD aims to make a step in reducing the gap and making the credit algorithm
37+
more representative of consensus contributions.
38+
39+
## New Terminology
40+
41+
N/A
42+
43+
## Detailed Design
44+
45+
Validators earn credits based on the latency of their votes on blocks that
46+
eventually get rooted. Occasionally validators will have gaps in voting due to
47+
forking, safety checks or other factors outside of their control.
48+
49+
Consider this example where a validator missed out on voting for blocks 103 and
50+
104 as it was momentarily tricked by a minor fork occuring. It otherwise submitted
51+
latency 2 votes:
52+
53+
```
54+
[100] - [101] - [103] - [104] - [105]
55+
v 2 v 2 v 2
56+
\ - [102]
57+
v
58+
```
59+
60+
Assuming this top fork gets finalized, the validator will receive 3 * 16 = 48 credits.
61+
Although the validator did not vote on 103 or 104, its timely vote on 105 conveyed
62+
its vote on these intermediate blocks implicitely. Thus we propose that the
63+
intermediate blocks should be considered as having been voted on in the block in
64+
which the vote for 105 landed for the purpose of accounting:
65+
66+
```
67+
[100] - [101] - [103] - [104] - [105]
68+
v 2 v 2 i 4 i 3 v 2
69+
\ - [102]
70+
v
71+
```
72+
73+
With this accounting, the validator earns 77 credits.
74+
As the vote for 105 landed in 107, we treat any intermediate block as also having
75+
a vote landed in 107. In fact this is the approach many "backfill" mods take,
76+
by stuffing all missed slots in the first vote after a gap.
77+
78+
This backfilling is an unecessary transmission of information which also increases
79+
lockout with no basis. Instead we modify the credit algorithm to recognize the vote
80+
after a gap as a vote for the intermediate ancestors as well.
81+
82+
Note that this does not remove the competitive advantage of being a high performing
83+
validator. If for example the same validator did not vote on the minor fork:
84+
85+
```
86+
[100] - [101] - [103] - [104] - [105]
87+
v 2 v 2 v 2 v 2 v 2
88+
\ - [102]
89+
90+
```
91+
92+
It would earn 80 credits.
93+
94+
More formally when the feature flag `enable_ivc` is activated the vote program must:
95+
96+
* Collect all ancestors `A` between the previous root and the new root as reported
97+
via the `SlotHashes` sysvar when rooting a lockout `r` with latency `l`
98+
* Assign each ancestor `a` in `A` latency of `l + (r - a)`
99+
* Then award credits for each slot in `A` and `r` using the scheme in SIMD-0033
100+
101+
## Alternatives Considered
102+
103+
N/A
104+
105+
## Impact
106+
107+
This proposal will more fairly assign credits to consensus contributions and remove
108+
the unfair advantage of modifications that do not contribute any consensus value.
109+
110+
## Security Considerations
111+
112+
N/A
113+
114+
## Backwards Compatibility
115+
116+
The feature is not backwards compatible

0 commit comments

Comments
 (0)