@@ -3,18 +3,20 @@ title: 38/CONSENSUS-CLARO
33name : Claro Consensus Protocol
44status : raw
55category : Standards Track
6- editor : Corey Petty \< corey@status.im\>
6+ editor : Corey Petty < corey@status.im>
77created : 01-JUL-2022
8- revised : \< 2022-08-26 Fri 13:11Z\>
9- uri : \< https://rdf.logos.co/protocol/Claro/1/0/0#\< 2022-08-26%20Fri$2013:11Z\>
8+ revised : < 2022-08-26 Fri 13:11Z>
9+ uri : < https://rdf.logos.co/protocol/Claro/1/0/0#< 2022-08-26%20Fri$2013:11Z>
1010contributors :
1111 - Álvaro Castro-Castilla
1212 - Mark Evenson
1313---
1414- Status: raw
1515- Category: Standards Track
16- - Editor: Corey Petty \< corey@status.im \>
17- - Contributors::
16+ - Editor: Corey Petty < ; corey@status.im > ;
17+ - Contributors:
18+ - Álvaro Castro-Castilla
19+ - Mark Evenson
1820
1921
2022## Abstract
@@ -132,7 +134,7 @@ The node has a semantics and serialization of the proposal, of which
132134it sets an initial opinion:
133135
134136 opinion
135- \< -- initial opinion on truth of the proposal
137+ < -- initial opinion on truth of the proposal
136138 as one of: {NO, NONE, YES}
137139
138140The proposal proceeds in asynchronous rounds, in which each node
@@ -154,53 +156,53 @@ The node initializes the following integer ratios as constants:
154156
155157#
156158confidence_threshold
157- \ <-- 1
159+ <-- 1
158160
159161# constant look ahead for number of rounds we expect to finalize a
160162# decision. Could be set dependent on number of nodes
161163# visible in the current gossip graph.
162164look_ahead
163- \ <-- 19
165+ <-- 19
164166
165167# the confidence weighting parameter (aka alpha_1)
166168certainty
167- \ <-- 4 / 5
169+ <-- 4 / 5
168170doubt ;; the lack of confidence weighting parameter (aka alpha_2)
169- \ <-- 2 / 5
171+ <-- 2 / 5
170172
171173k_multiplier ;; neighbor threshold multiplier
172- \ <-- 2
174+ <-- 2
173175
174176;;; maximal threshold multiplier, i.e. we will never exceed
175177;;; questioning k_initial * k_multiplier ^ max_k_multiplier_power peers
176178max_k_multiplier_power
177- \ <-- 4
179+ <-- 4
178180
179181;;; Initial number of nodes queried in a round
180182k_initial
181- \ <-- 7
183+ <-- 7
182184
183185;;; maximum query rounds before termination
184186max_rounds ;; placeholder for simulation work, no justification yet
185- \ <-- 100
187+ <-- 100
186188```
187189
188190The following variables are needed to keep the state of Claro:
189191
190192```
191193;; current number of nodes to attempt to query in a round
192194k
193- \ <-- k_original
195+ <-- k_original
194196
195197;; total number of votes examined over all rounds
196198total_votes
197- \ <-- 0
199+ <-- 0
198200;; total number of YES (i.e. positive) votes for the truth of the proposal
199201total_positive
200- \ <-- 0
202+ <-- 0
201203;; the current query round, an integer starting from zero
202204round
203- \ <-- 0
205+ <-- 0
204206```
205207
206208
@@ -252,9 +254,9 @@ When the query finishes, the node now initializes the following two
252254values:
253255
254256 new_votes
255- \< -- |total vote replies received in this round to the current query|
257+ < -- |total vote replies received in this round to the current query|
256258 positive_votes
257- \< -- |YES votes received from the query|
259+ < -- |YES votes received from the query|
258260
259261### Phase Two: Computation
260262When the query returns, three ratios are used later on to compute the
@@ -291,15 +293,15 @@ in the query round through the following algorithm:
291293 total_positive
292294 +== positive_votes
293295 confidence
294- \< -- total_votes / (total_votes + look_ahead)
296+ < -- total_votes / (total_votes + look_ahead)
295297 total_evidence
296- \< -- total_positive / total_votes
298+ < -- total_positive / total_votes
297299 new_evidence
298- \< -- positive_votes / new_votes
300+ < -- positive_votes / new_votes
299301 evidence
300- \< -- new_evidence * ( 1 - confidence ) + total_evidence * confidence
302+ < -- new_evidence * ( 1 - confidence ) + total_evidence * confidence
301303 alpha
302- \< -- doubt * ( 1 - confidence ) + certainty * confidence
304+ < -- doubt * ( 1 - confidence ) + certainty * confidence
303305
304306### Phase Three: Computation
305307In order to eliminate the need for a step function (a conditional in
@@ -352,13 +354,13 @@ examining the relationship between the evidence accumulated for a
352354proposal with the confidence encoded in the ` alpha ` parameter:
353355
354356 IF
355- evidence \> alpha
357+ evidence > alpha
356358 THEN
357- opinion \< -- YES
359+ opinion < -- YES
358360 ELSE IF
359- evidence \< 1 - alpha
361+ evidence < 1 - alpha
360362 THEN
361- opinion \< -- NO
363+ opinion < -- NO
362364
363365If the opinion of the node is ` NONE ` after evaluating the relation
364366between ` evidence ` and ` alpha ` , adjust the number of uniform randomly
@@ -369,9 +371,9 @@ up to the limit of `k_max_multiplier_power` query size increases.
369371 WHEN
370372 opinion is NONE
371373 AND
372- k \< k_original * k_multiplier ^ max_k_multiplier_power
374+ k & lt ; k_original * k_multiplier ^ max_k_multiplier_power
373375 THEN
374- k \< -- k * k_multiplier
376+ k & lt ; -- k * k_multiplier
375377
376378### Decision
377379The next step is a simple one: change our opinion if the threshold
@@ -384,9 +386,9 @@ directly related to the number of total votes received.
384386Decision
385387$$
386388\begin{array}{cl}
387- evidence \> \alpha & \implies \text{opinion YES} \newline
388- evidence \< 1 - \alpha & \implies \text{opinion NO} \newline
389- if\ \text{confidence} \> c_{target} & THEN \ \text{finalize decision} \newline
389+ evidence > \alpha & \implies \text{opinion YES} \newline
390+ evidence < 1 - \alpha & \implies \text{opinion NO} \newline
391+ if\ \text{confidence} > c_{target} & THEN \ \text{finalize decision} \newline
390392\end{array}
391393$$
392394
@@ -398,11 +400,11 @@ opinion is response to further queries from other nodes on the
398400network.
399401
400402 IF
401- confidence \> confidence_threshold
403+ confidence > confidence_threshold
402404 OR
403- round \> max_rounds
405+ round > max_rounds
404406 THEN
405- finalized \< -- T
407+ finalized < -- T
406408 QUERY LOOP TERMINATES
407409 ELSE
408410 round +== 1
@@ -474,11 +476,11 @@ the validity of the following statements expressed in Notation3 (aka
474476
475477
476478``` n3
477- @prefix rdf: \ <http://www.w3.org/1999/02/22-rdf-syntax-ns#\ > .
478- @prefix rdfs: \ <http://www.w3.org/2000/01/rdf-schema#\ > .
479- @prefix xsd: \ <http://www.w3.org/2001/XMLSchema#\ > .
479+ @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
480+ @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
481+ @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
480482
481- @prefix Claro \ <https://rdf.logos.co/protocol/Claro#\ > .
483+ @prefix Claro <https://rdf.logos.co/protocol/Claro#> .
482484
483485Claro:query
484486 :holds (
@@ -605,36 +607,36 @@ they should be of stable interest no matter if Claro isn't.
605607
606608## Informative References
607609
608- 0 . [ Logos] ( \< https://logos.co/\> )
610+ 0 . [ Logos] ( & lt ; https://logos.co/& gt ; )
609611
6106121 . [ On BFT Consensus Evolution: From Monolithic to
611- DAG] ( \< https://dahliamalkhi.github.io/posts/2022/06/dag-bft/\> )
613+ DAG] ( & lt ; https://dahliamalkhi.github.io/posts/2022/06/dag-bft/& gt ; )
612614
613- 2 . [ snow-ipfs] ( \< https://ipfs.io/ipfs/QmUy4jh5mGNZvLkjies1RWM4YuvJh5o2FYopNPVYwrRVGV\> )
615+ 2 . [ snow-ipfs] ( & lt ; https://ipfs.io/ipfs/QmUy4jh5mGNZvLkjies1RWM4YuvJh5o2FYopNPVYwrRVGV& gt ; )
614616
615- 3 . [ snow* ] ( \< https://www.avalabs.org/whitepapers\> ) The Snow family of
617+ 3 . [ snow* ] ( & lt ; https://www.avalabs.org/whitepapers& gt ; ) The Snow family of
616618 algorithms
617619
618- 4 . [ Move] ( \< https://cloud.google.com/composer/docs/how-to/using/writing-dags\> )
620+ 4 . [ Move] ( & lt ; https://cloud.google.com/composer/docs/how-to/using/writing-dags& gt ; )
619621 Move: a Language for Writing DAG Abstractions
620622
621- 5 . [ rdf] ( \< http://www.w3.org/1999/02/22-rdf-syntax-ns#\> )
623+ 5 . [ rdf] ( & lt ; http://www.w3.org/1999/02/22-rdf-syntax-ns#& gt ; )
622624
623- 6 . [ rdfs] ( \< http://www.w3.org/2000/01/rdf-schema#\> )
625+ 6 . [ rdfs] ( & lt ; http://www.w3.org/2000/01/rdf-schema#& gt ; )
624626
625- 7 . [ xsd] ( \< http://www.w3.org/2001/XMLSchema#\> )
627+ 7 . [ xsd] ( & lt ; http://www.w3.org/2001/XMLSchema#& gt ; )
626628
627- 8 . [ n3-w3c-notes] ( \< https://www.w3.org/TeamSubmission/n3/\> )
629+ 8 . [ n3-w3c-notes] ( & lt ; https://www.w3.org/TeamSubmission/n3/& gt ; )
628630
629- 9 . [ ntp] ( \< https://www.ntp.org/downloads.html\> )
631+ 9 . [ ntp] ( & lt ; https://www.ntp.org/downloads.html& gt ; )
630632
631633## Normative References
632634
633- 0 . [ Claro] ( \< https://rdf.logos.co/protocol/Claro/1/0/0/raw\> )
635+ 0 . [ Claro] ( & lt ; https://rdf.logos.co/protocol/Claro/1/0/0/raw& gt ; )
634636
635- 1 . [ n3] ( \< https://www.w3.org/DesignIssues/Notation3.html\> )
637+ 1 . [ n3] ( & lt ; https://www.w3.org/DesignIssues/Notation3.html& gt ; )
636638
637- 2 . [ json-ld] ( \< https://json-ld.org/\> )
639+ 2 . [ json-ld] ( & lt ; https://json-ld.org/& gt ; )
638640
639641## Copyright
640642
0 commit comments