This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Progress Metrics in DAG-based Consensus

Quan Nguyen FANTOM James Henderson FANTOM Egor Lysenko FANTOM
Abstract

Lachesis protocol [2] leverages a DAG of events to allow nodes to reach fast consensus of events. This work introduces DAG progress metrics to drive the nodes to emit new events more effectively. With these metrics, nodes can select event timing and can choose previous events as parents for their own new events. Our results show that our event timing and parent selection methods can help reaching consensus quicker and thus can reduce lower time to finality significantly.

Keywords event timing, parent selection, OPERA, directed-acyclic-graph, DAG progress, metrics, Lachesis, consensus protocol

1 Introduction

Lachesis protocol [2, 1] is a BFT consensus protocol that reduces communications overhead as events can be reused in the form of event DAG. Nodes participating in Lachesis consensus produce events asynchronously. Nodes generate event blocks to form a DAG of events, each of which contains transactions. Each event block has references to parent event blocks. For an event block ee and it’s parents epe_{p}, there is no restriction about the creator nodes of ee and that of epe_{p}. Each node computes Roots to find Atroposes in order to reach consensus on finalized event blocks.

Each node can generate new own event block and can choose which previous events as the parents for this new event. Throughout this paper, the terms ‘event block‘ and ‘event‘ are used interchangeably. Event generation involves two steps Event Timing and Parent Selection.

  • Event Timing: node can decide by itself when it can generate a new own event block.

  • Parent Selection: this is the process of select a suitable set of previous event blocks and use them as parents (aka. epe_{p}) for the new event.

For the network to perform efficiently, nodes need a set of criteria so as to produce a new event in an effective manner. If nodes produced too many events, it could increase communication overheads as peers will need to handle those events. At the same time, many of such events are possibly abundant in the sense that they do not necessarily contribute to reach a new root. Thus, it is important to know whether a node should emit a new event and whether they should choose certain events as the parents for this new event.

In this work, we introduce two new metrics, which measure the DAG progress of an event and can be used to optimize the way that a node emits a new event. The two metrics are Quorum Indexer (QI) metric and Root Knowledge (RK) metric. The metrics enable nodes to determine whether a proposed new event block will have a positive contribution towards reaching a new root.

Based on the two metrics, we have defined new criteria for event timing and parent selection for nodes. In event timing, node can decide itself whether creating a new event will be beneficial. Leveraging the metrics ensures that nodes attempt to create events only if they can produce substantial DAG progress toward finality. The metrics can also improve parent selection, in which nodes can select previous events as candidate parents for its new event, and thus it can improve the contribution of each event toward reaching finality.

We compare the two metrics in a set of experiments. Our experimental results show that RK metric outperformed QI metric. Our results also show that event timing and parent selection based on the RK metric have significantly reduced the node overheads (i.e. avoid generate excessive events and handle them) and time-to-finality (TTF). Efficiency is achieved as nodes will create events when they are able to make substantial DAG progress, reducing the computational time and resources used for processing and transmitting events.

2 DAG Progress Metrics

This section describes two new DAG progress metrics. These metrics are used in event timing and parent selection.

2.1 Quorum Indexer Metric

Quorum Indexer (QI) is a measure of DAG progress. QI metric is based on the sequence numbers of HighestBefore events.

Let vv be a node. For a local DAG of vv, we determine each highest (latest) event eie_{i} for each node ii. HighestBefore calculations are performed for each node vv as follows.

  • Median: Each node vv computes the highest events eie_{i} for each node ii in a local DAG of vv. For each eie_{i}, it then finds the sequence number of eie_{i} in the subgraph. Then it calculates the median sequence number weighted by the stake of each highest event creator’s stake. Intuitively, this gives an estimate of the median highest event created by ii in all nodes.

  • Current Self: A node vv finds the sequence number of highest event created by vv in the subgraph of its own.

  • New Self: A node pre-computes the sequence number of highest event created by vv that would be in the subgraph if it created such a new event.

The above three sub-metrics for node vv are combined into a single QI metric of DAG progress produced by a new event. To do so, the three metrics are compared and transformed using a piecewise linear function into a metric in the range [0,wi/W][0,w_{i}/W], where wiw_{i} is the stake of node vv and WW is the total stake of all nodes.

The QI metric h(e)h^{(e)} is defined as summation across all nodes ii to give a final metric of DAG progress for a new event ee. The metric is in the range [0,1], with 0 indicating little DAG progress, and 1 indicating significant DAG progress.

2.2 Root Knowledge Metric

Progress in Lachesis consensus is achieved via the production of new roots and frames. Root Knowledge (RK) metric is a more effective metric as it is built on the knowledge of previous roots.

An event ee is a root when in ee’s subgraph quorum roots of the previous frame forkless-cause ee. This means that within ee’s subgraph quorum roots of the previous frame are each in the subgraph of events created by quorum nodes, potentially with different sets of quorum nodes for each previous root. Further, there can be no forks detected for any of the nodes involved in confirming the forkless-cause condition.

2.2.1 Notations

The progress of an event ee toward meeting the required conditions for the next root can be described via a root knowledge matrix 𝐊(e)\mathbf{K}^{(e)} (or simply 𝐊\mathbf{K}).

We write knowledge of previous roots among nn nodes in an event ee’s subgraph as an n×nn\times n matrix 𝐊\mathbf{K}, with entries

𝐊ij(e)={1,if the subgraph of node i contains a root created by node j and no forks are observed for i or j.0,otherwise.\mathbf{K}^{(e)}_{ij}=\begin{cases}1,&\text{if the subgraph of node $i$ contains a root created by node $j$ and no forks are observed for $i$ or $j$.}\\ 0,&\text{otherwise.}\end{cases} (1)

Let k(e)k^{(e)} be the sum of all elements in matrix 𝐊(e)\mathbf{K}^{(e)}. The metric k(e)k^{(e)} is in the range [0,1][0,1].

k(e)=1n2ij𝐊ij(e).k^{(e)}=\frac{1}{n^{2}}\sum_{i}\sum_{j}\mathbf{K}^{(e)}_{ij}. (2)

where the numerator is a count of the number of nodes observing each known root in the subgraph. The denominator n2n^{2} normalises k(e)k^{(e)} to the range [0,1], where k(e)=1k^{(e)}=1 if all nodes know all roots.

We define the progress of an event ee as a scalar metric of DAG progress, k(e)k^{(e)}. This scalar metric will enable a comparison the progress of two events. Figures 1(a) and 1(b) show 𝐊\mathbf{K} and kk examples for simple DAGs.

Refer to caption
(a) Root knowledge of event ee on the left is k(e)k^{(e)}= 1/9.
Refer to caption
(b) Root knowledge of event ee on the left is k(e)k^{(e)}= 5/9.
Figure 1: Examples of root knowledge matrix 𝐊(e)\mathbf{K}^{(e)} and root knowledge metric k(e)k^{(e)}. The network consists of three nodes which index the matrix

A new root will typically be produced before k(e)k^{(e)} because producing a new root only requires quorum prior roots to forkless cause the new root.

2.2.2 Pseudo-code

The rootProgress function in calculates the root knowledge k(e)k^{(e)} of an input event ee. The function rootProgress does not explicitly construct the n×nn\times n matrix 𝐊(e)\mathbf{K}^{(e)} in memory. Instead, k(e)k^{(e)} can be calculated by looping over the indexes of 𝐊(e)\mathbf{K}^{(e)} without storing the matrix’s elements in memory. The implementation uses function ForklessCauseProgress to calculate each column of 𝐊(e)\mathbf{K}^{(e)}.

Algorithm 1 rootProgress k(e)k^{(e)} calculation
function rootProgress(ee)
     R \leftarrow roots in ee’s subgraph
     s \leftarrow 0
     for r in range(R) do
         cc = ForklessCauseProgress(e, r)
         ss = ss + sum(cc)      
return s

In Alg. 1, ForklessCauseProgress returns a column of 𝐊(e)\mathbf{K}^{(e)}, corresponding to the number of nodes that have an event whose subgraph contains root, without forks.

3 Parent Selection and Event Timing

Based on the metrics, a node can rank candidate events for its new event. For each QI metric and RK metric, a parent selection method is defined to rank candidate parents into a sorted list. Parents are selected from the list if they provide the greatest progress toward producing the next root.

Based on the two metrics, we also define two different event timing strategies. We define new event timing metrics tt for a node vv based on DAG progress metric (e.g., either QI metric h(e)h^{(e)} or RK metric k(e)k^{(e)}).

We describe the timing metric tt based on RK metric k(e)k^{(e)} in more details as follows. The timing metric tt can be defined base on QI metric h(e)h^{(e)} in a similar way.

Let vv be a node, and let eve_{v} be the latest event of vv. Within node vv’s local DAG, for a node ii, let eie_{i} be the latest event of ii. The new metric tt counts the number of nodes ii, whose highest event has metric k(ei)k^{(e_{i})} that exceeds that of eve_{v}. t=iH(k(ei)k(ev))sit=\sum_{i}H(k^{(e_{i})}-k^{(e_{v})})s_{i}, where sis_{i} is the stake of node ii and H(x)H(x) is the step function. H(x)H(x)= 1 if x>0x>0; 0, otherwise.

The event timing metric is used to order nodes and is a direct measure of the progress a node has made toward producing a new root and progressing toward the next frame. Nodes emit an event when they fall below a threshold level in an ordering of nodes, and new emission is to help increase their DAG progress metric.

4 Simulation Results

Figures 2(a), 2(b), and 2(c) compare the performance in simulation between parent selection and event timing methods using QI metric and RK metric.

Refer to caption
(a) Comparing ’Frames produced Per Event’
Refer to caption
(b) Comparing ’Frames produced Per Second’
Refer to caption
(c) Comparing ’Frame Rate’
Figure 2: Comparing mean Frame Rate between RK metric and QI metric parent selection and event timing. Larger is better.

The experiments were made on a simulation of a network consisting of 30 nodes, with the stake of each node randomly sampled. A dataset of real world internet latencies between cities is used to model latencies between pairs of nodes. It randomly allocated each node to a city in the dataset. Each of the 100 simulations shown are simulations of 100 seconds of network activity.

On average, the new RK metric is more efficient, producing each frame using fewer events compared to the QI metric. The new RK metric produces more frames per second on average compared to QI metric, and thus, the new methods will lower TTF.

Figure 3 compares frame rate. The experiments were made with a simulation of 40 nodes, each event has 3 parents. Latency was set around 100ms.

Refer to caption
Figure 3: Comparison of frame rate for different combination of event timing and parent selection

5 Conclusion

In this work, we introduce two new metrics to measure the DAG progress of a new event. By comparing between different possible new event blocks it can generate, a node can determine which new event block is the most effective to be made in order to progress toward achieving a new root.

Based on the metrics, we presented new methods for event timing and parent selection. These methods will give several advantages. First, they can reduce the number of generated events and can avoid generating many excessive events and hence can reduce communication overheads. Second, using these methods, it can achieve faster finality as it can compute roots and Atroposes quicker. Third, it can reduce events per frame and increase frame rate, as more events are generated only if they help achieve roots quicker. As such, it improves the number of frames per second (frame rate).

6 Reference

  • [1] Q. Nguyen, A. Cronje, M. Kong, A. Kampa, and G. Samman. Stairdag: Cross-dag validation for scalable BFT consensus. CoRR, abs/1908.11810, 2019.
  • [2] Q. H. Nguyen, A. Cronje, M. Kong, E. Lysenko, and A. Guzev. Lachesis: Scalable asynchronous BFT on DAG streams. CoRR, abs/2108.01900, 2021.