Skip to content

Commit 44a8321

Browse files
committed
Initial very rough draft for early pre-ELVES soft concensus
1 parent 91b3161 commit 44a8321

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

text/0000-pre-elves_soft.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# RFC-0000: Feature Name Here
2+
3+
| | |
4+
| --------------- | ------------------------------------------------------------------------------------------- |
5+
| **Start Date** | Date of initial proposal |
6+
| **Description** | Pre-ELVES soft concensus |
7+
| **Authors** | Jeff Burdges, Alistair Stewart |
8+
9+
## Summary
10+
11+
Availability (bitfield) votes gain a `preferred_fork` flag which expresses the validator's opinion upon relay chain equivocations and babe forks, while still sharing availability votes for all relay chain blocks. We make relay chain block production require a supermajority with `preferred_fork` set, so forks cannot advance if they split the honest validators, which creates an early soft concensus. We similarly defend ELVES from relay chain equivocation attacks and prevent redundent approvals across babe forks.
12+
13+
## Motivation
14+
15+
We've always known relay chain equivocations break the ELVES threat model. We originally envisioned ELVES having fallback pathways, but doing fallbacks requires dangerous subtle debugging. We support more assignment schemes in ELVES this way too, including one novel post-quantum one, and very low CPU usage schemes.
16+
17+
We expect this early soft concensus creates back pressure that improves performance under babe forks.
18+
19+
Alistair: TODO?
20+
21+
## Stakeholders
22+
23+
We modify the availability votes and restrict relay chain blocks, fork choice, and ELVES start conditions, so mostly the parachain
24+
25+
A sassafras RC like JAM has could avoid `preferred_fork` flag, because they have only equivocations not babe forks.
26+
27+
## Explanation
28+
29+
### Availability voting
30+
31+
At present, availability votes have a bitfield representing the cores, a `relay_parent`, and a signature. We process these on-chain in several steps: We first validate the signatures, zero any bits for cores included/enacted between the `relay_parent` and our predecessor, sum the set bits for each core, and finally include/enact the core if this exceeds 2/3rds of the validators.
32+
33+
Availability votes gain a `preferred_fork` flag, which honest validators set for exactly one `relay_parent` on their availability votes in a block production slot. We say a validator prefers a fork given by chain head `h` if it provides an availability vote with `relay_parent = h` and `preferred_fork` set.
34+
35+
Validators recieve a minor equivocations slash if they claim to set `preferred_fork` for two different `relay_parent`s in the same slot. In sassafras, this means preferred fork equivocations can only occur for relay chain equivocations, but under babe preferred fork equivocations could occur between primary and secondary blocks, or other primary blocks.
36+
37+
All validators still provide availability votes for all forks, because those non-preferred votes could still help enact candidates faster, but those non-preferred vote have `preferred_fork` zeroed.
38+
39+
Around this, validators could optionally provide an early availability vote that commits to their preferred fork, and then later provide a second availability votes stating the same preferred fork but a fuller bitfield, provided doing so somehow helps relay chain blcok producers.
40+
41+
### Fork choice
42+
43+
We require relay chain block producers build upon forks preferred by `2 f + 1` validators. In other words, a relay chain block with parent `p` must contain availability bitfield votes from `2 f + 1` validators with `relay_parent = p` and `preferred_fork` set. It follows our preferred fork votes override other fork choice priorities.
44+
45+
A relay chain block producer could lack this `2 f + 1` threshold for a prespective parent block `p`, in which case they must build upon the parent of `p` instead. We know availability votes simply being slow would cause this somtimes, in which case adding slightly more delay could save the relay chain slot Alternatively though, two distinct relay chain blocks in the same slot could each wind up prefered by `f+1` validators, in which case we must abandond the slot entirely.
46+
47+
It's critical that honest validators carefully time when they judge their preferences. In babe, this adds complexity: We always prefer a primary slot over a secondary slot, so the validators should delay preferring a secondary slot, giving the primary slot enough time. We prefer the primary slot with smallest VRF as well, so we need some delay even once we recieve a primary.
48+
49+
### Elves
50+
51+
We launch the approvals process aka (machine) elves for a relay chain block `p` once `2 f + 1` validators prefer that block, aka `2 f + 1` validators provide availability votes with `relay_parent = p` and `preferred_fork` set. We could optionally delay this further until we have some valid decendent of `p`.
52+
53+
## Concerns: Drawbacks, Testing, Security, and Privacy
54+
55+
Adds subtle timing constraints, which could entrench existing performanceg obstacles. We might explore variations that ignore wall clock time.
56+
57+
We've always known relay chain equivocations break the ELVES threat model. We originally envisioned ELVES having fallback pathways, but these were complex and demanded unused code paths, which cannot realistically be debugged. Although complex, the early soft concensus scheme feels less complex overall. We know timing sucks to optimise a distributed system, but at least doing so use everyday code paths.
58+
59+
## Performance, Ergonomics, and Compatibility
60+
61+
We expect early soft concensus introduce back pressure that radically alters performance. We no longer run approvals checks upon all forks. As primary slots occur once every other slot in expectation, one might expect a 30% reduction in CPU load, but this depends upon diverse factors.
62+
63+
We apply back pressure by dropping some whole relay chain blocks though, so this shall increase the expected parachain blocktime somewhat, but how much depens upon future optimisation work.
64+
65+
### Compatibility
66+
67+
Major upgrade
68+
69+
## Prior Art and References
70+
71+
...
72+
73+
## Unresolved Questions
74+
75+
Provide specific questions to discuss and address before the RFC is voted on by the Fellowship. This should include, for example, alternatives to aspects of the proposed design where the appropriate trade-off to make is unclear.
76+
77+
## Future Directions and Related Material
78+
79+
A sassafras RC like JAM could avoid `preferred_fork` flag, by only releasing availability votes for at most one sassafras equivocation.
80+
81+
### Thresahold randomness
82+
83+
We think threshold randomness could reduce the tranche zero approcha checker assigments by roughly 40%, meaning a fixed 15 vs the expected 25 in the elves paper (30 in production now).
84+
85+
We do know threshold VRF based schemes that address relay chain equivocations directly, by using as input the relay chain block hash. We have many more options with early soft concensus though. TODO In particular, we only know two post-quantum approaches to elves, and the bandwidth efficent one needs early soft concensus.
86+
87+
### Avoid wall clock time
88+
89+
Avoiding or minimizing wall clock time could provide an interesting development direction.
90+
91+
...
92+
93+
### Partial relay chain blocks
94+
95+
Above, we only discuss abandoning realy chain blocks which fail early soft concensus. We could alternatively treat them as partial blocks and build extension partial blocks that complete them, with elves probably using randomness from the final partial block.
96+

0 commit comments

Comments
 (0)