Avalanche Consensus - Does it Perform as Promised? Part 2
In the second part of the series we take a look at the most basic Snow protocol, called “Slush”. We outline how this protocol works, including the effects of various network and tuning parameters on its performance, and give a rough sketch of our approach to analyze this protocol.
Part 2: Slush
Let us go a bit further into detail. The simplest protocol that tackles the binary consensus problem is called Slush and works as follows. Each node continuously samples the opinion of
Here, we look at the slightly simpler binary consensus problem in which there are only two opinions, 0 and 1. We also assume that all nodes obtain their samples simultaneously in lock-step fashion, i.e., in synchronized rounds. It is however possible to reduce the more general consensus problem to its binary version and to weaken the assumption of synchronized rounds to a certain extent.
Three examples where the orange node samples a few others for different sample sizes
Slush is a robust, self-organizing mechanism that is likely to converge to a stable consensus. This means that it reaches a state where a large majority of nodes have the same opinion relatively quickly and is very likely to remain there. This holds even in the presence of a limited number of Byzantine nodes.
Assessment of Slush in the Avalanche Whitepaper
The Avalanche whitepaper makes specific claims about the performance of the Slush protocol, which corresponds to the number of “rounds” until almost all nodes have consensus, where a round corresponds to each node making one sample. In general, the aim is that the number of samples each node has to make until such a state of almost consensus is at most logarithmic in the number of nodes
This is rather fast, as the function
The whitepaper’s claim about the asymptotic behavior, that is, the behavior for large
Our Evaluation of the Performance of Slush
One concept that we found particularly useful in our analysis and is intuitive to explain is the expected progress that the system makes towards a consensus. It describes how fast the system is moving towards a consensus in one round. This progress essentially depends on how close we already are to such a consensus state as it affects the opinions that nodes are likely to see in their samples.
Assuming that
The value of
Plot of
What Can We Learn from the Expected Progress?
We can make a few immediate, interesting observations from the plots of
The latter is interesting in light of the suggestion of
In the perfectly balanced state (
However for
- We show that the number of rounds until it is very likely that almost all nodes have the same opinion can indeed be upper bounded by
rounds given that and is close to . This holds even if a limited number of nodes behave in Byzantine ways2. - We show that the speed-up that can be obtained from increasing the sample size is at most
in expectation (formally we say that Slush has a lower bound of , where is a bound from below).
What Our Results Mean for Snow Consensus Protocols
We interpret these results in the following way. First, Slush indeed converges fast even for large
Furthermore, we also show that the bounds for the running time above apply to Snowflake and Snowball, with an “asterisk”. More precisely, Snowflake and Snowball have an additional feature to finally decide an opinion and subsequently stop sampling. Roughly speaking, the analysis of running time holds for Snowflake and Snowball if that finalization does not take effect until the network comes close to a unanimous state. Furthermore, the finalization mechanics has significant effects, both intended and unintended and we will cover that in the final part.
Read more about Avalanche Consensus in part three of this blogpost.
-
is called big-O notation or asymptotic running time and hides constant factors that do not grow in n. This measure is commonly used in the analysis of the behavior of an algorithm as the input size (here the size of the network ) becomes large. ↩ -
Our analysis for the upper bound is a generalization of a similar analysis that has been conducted for special cases of Slush called the 3-Majority, 2-Choices and Median protocols, the survey by Becchetti, Clementi and Natale provides a useful summary. ↩