Difference between revisions of "IC consensus layer"

From Internet Computer Wiki
Jump to: navigation, search
Line 36: Line 36:
 
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].
 
the IC consensus protocol is based in a [[wikipedia:blockchain|blockchain]].
 
As the protocol progresses, a tree of blocks is grown,
 
As the protocol progresses, a tree of blocks is grown,
starting from a special ``genesis block'' that is the root of the tree.
+
starting from a special <i>genesis block</i> that is the root of the tree.
 
Each non-genesis block in the tree contains (among other things)
 
Each non-genesis block in the tree contains (among other things)
a {\em payload}, consisting of a sequence of commands,
+
a <i>payload</i>, consisting of a sequence of transaction requests,
 
and a hash of the block's parent in the tree.  
 
and a hash of the block's parent in the tree.  
The honest parties have a consistent view of this tree:
+
The honest replicas have a consistent view of this tree:
while each party may have a different, partial view
+
while each replica may have a different, partial view
of this tree, all the parties have a view of the {\em same} tree.
+
of this tree, all the replicas have a view of the <i>same</i> tree.
 
In addition, as the protocol progresses,
 
In addition, as the protocol progresses,
there is always a path of {\em committed} blocks in this tree.
+
there is always a path of <i>finalized</i> blocks in this tree.
Again, the honest parties have a consistent view of this path:
+
Again, the honest replicas have a consistent view of this path:
while each party may have a different, partial view
+
while each replica may have a different, partial view
of this path, all the parties have a view of the {\em same} path.
+
of this path, all the parties have a view of the <i>same</i> path.
The commands in the payloads of the blocks along this
+
The transaction requests in the payloads of the blocks along this
path are the commands that are output by each party.
+
path are the ordered transaction requests will be processed by the [[IC execution layer|execution layer]]
 +
of the Internet Computer.

Revision as of 15:51, 7 October 2021

The job consensus layer of the IC is to order transaction requests so that all replicas in a subnet will process transaction requests in the same order. There are many protocols in the literature for this problem. The IC uses a new consensus protocol, which is described here at a high level. For more details, see the paper https://eprint.iacr.org/2021/1330 (in particular, Protocol ICC1 in that paper).

Any secure consensus protocol should guarantee two properties, which (roughly stated) are:

  • safety: all replicas in fact agree on the same ordering of transaction requests, and
  • liveness: all replicas should make steady progress.

The IC consensus protocol is design to be

  • extremely simple, and
  • robust (performance degrades gracefully when some replicas are malicious).

As discussed in the introduction, we assume

  • a subnet of [math]\displaystyle{ n }[/math] replicas, and
  • at most [math]\displaystyle{ f \lt n/3 }[/math] of the replicas are faulty.

Faulty replicas may exhibit arbitrary, malicious (i.e., Byzantine) behavior.

We assume that communication is asynchronous, with no a priori bound on the delay of messages sent between replicas. In fact, the scheduling of message delivery may be completely under adversarial control. The IC consensus protocol guarantees safety under this very weak communication assumption. However, to guarantee liveness, we need to assume a form of partial synchrony, which (roughly stated) says that there exists a bound [math]\displaystyle{ \Delta }[/math] such that from time to time, messages will be delivered within time [math]\displaystyle{ \Delta }[/math]. The bound [math]\displaystyle{ \Delta }[/math] does not have to be known in advance (the protocol can adapt itself to an unknown [math]\displaystyle{ \Delta }[/math] value). Regardless of whether we are assuming an asynchronous or partially synchronous network, we assume that every message sent from one honest party to another will eventually be delivered.

Like a number of consensus protocols, the IC consensus protocol is based in a blockchain. As the protocol progresses, a tree of blocks is grown, starting from a special genesis block that is the root of the tree. Each non-genesis block in the tree contains (among other things) a payload, consisting of a sequence of transaction requests, and a hash of the block's parent in the tree. The honest replicas have a consistent view of this tree: while each replica may have a different, partial view of this tree, all the replicas have a view of the same tree. In addition, as the protocol progresses, there is always a path of finalized blocks in this tree. Again, the honest replicas have a consistent view of this path: while each replica may have a different, partial view of this path, all the parties have a view of the same path. The transaction requests in the payloads of the blocks along this path are the ordered transaction requests will be processed by the execution layer of the Internet Computer.