RChain enables vertical and horizontal bi-directional expansion.

Darryl Neudorf
RChain-China
Published in
4 min readNov 14, 2020

Rholang Chinese Community 10/19

English Translation from Dimworm’s Chinese article originally published Oct 10

Vertical scaling refers to the fact that by increasing the hardware computing resources of each node, the processing power of the blockchain can be increased accordingly.

Horizontal scaling refers to the fact that by increasing the number of nodes, the processing power of the blockchain can be increased accordingly.

For blockchain that supports smart contracts, vertical scaling is a difficult thing, take Ethernet as an example, EVM can only virtualize 1 core of the CPU to use, resulting in a big waste of node hardware resources.EVM can only support sequential computing, not concurrent computing, so Ethernet does not have the ability to scale vertically.

Horizontal scaling is a frequently discussed blockchain scaling solution, and the main technical solution is fragmentation. Generally speaking, the growth in the number of nodes within the same sharding can only bring higher security and not increased processing power. Not only can it not be higher, on the contrary, more nodes will only make the blockchain slower. But RChain breaks that curse.

On October 15, Greg announced on Twitter that RChain verified scalability in both vertical and horizontal directions. This has quite a bit of significance for the blockchain industry.

Greg posted a DAG diagram of 10 nodes and issued blocks and validation. He then explained.

Greg says: RChain enables bi-directional scaling in a way that other blockchains can’t and aren’t even planned for in their development technology roadmaps.

At Thursday’s Community Debrief, Nutzipper demonstrated the results of his validation. He ran up 10 Rnode nodes on a 96-core cpu server at Google cloud and was able to run all 96 cores full when those nodes started working.

Rholang, RChain’s proprietary smart contract language designed for concurrency, is the key to RChain’s ability to scale vertically. And CBC-Casper is the key to RChain’s ability to scale horizontally.

I’ll simplify the whole process with an example: a node has 20 CPUs, one of which is used to get out blocks, in which case the

When there are only two nodes, each node has one CPU for out-blocks, one CPU for verifying its own out-blocks, and one CPU for verifying other nodes’ out-blocks, so there will be three CPUs working, but there will be 17 CPUs idle.

As the number of nodes increases from 2 to 20, the number of CPUs per node used for validation increases. The number of CPUs used for out-blocking the entire blockchain is also increasing. So the overall processing power can be increased accordingly. Since verification can be done concurrently, adding more nodes allows all nodes to make full use of their computing resources.

In the above figure, the horizontal coordinate shows the increase in the number of nodes and the vertical coordinate shows the number of CPUs used per node.

When the number of nodes increases from 20 to 30, the processing power cannot be increased accordingly because all the computational resources of a single node are already fully utilized. For a single node, there are no more resources to devote to the verification work. At this point, in order to further increase the processing power, a fragmentation scheme is needed.

RChain实现了垂直和水平双向扩容

愁虫 Rholang中文社区 10/19

垂直扩容是指通过增加每个节点的硬件计算资源,区块链的处理能力能够相应地增加。

水平扩容是指通过增加节点的数量,区块链的处理能力能够相应地增加。

对于支持智能合约的区块链来说,垂直扩容是件困难的事情,以以太坊为例,EVM只能虚拟出CPU的1核来使用,导致节点硬件资源的很大浪费。EVM只能支持顺序计算,不能支持并发计算,所以以太坊并不具备垂直扩容的能力。

水平扩容是经常讨论的区块链扩容方案,主要技术方案是分片。一般意义上讲同一分片内的节点数量增长只能带来更高的安全性,并不能提高处理能力。不但不能更高,相反,更多节点只能让区块链更慢。但是RChain打破了这个魔咒。

10月15日,Greg在Twitter上宣布RChain验证了在垂直和水平两个方向上都实现了可扩展性。这对于区块链行业来说有着相当大的意义。

Greg贴了一张10个节点并发出块和验证的DAG图。随后他解释说:

Greg说:RChain实现了双向扩容,而其它区块链无法实现,甚至在它们的开发技术路线图中也没有相应的规划。

在本周四的社区Debrief上,Nutzipper 演示了他的验证结果。他在Google cloud的一台96核cpu的服务器上,跑起10个Rnode节点,当这些节点开始工作时,能够把所有96核全部跑满。

Rholang是RChain专有的智能合约语言,专为并发而设计。Rholang是RChain实现垂直方向扩容的关键。而CBC-Casper是RChain实现水平扩容的关键。

我举个例子简化整个过程:一个节点有20个CPU,其中一个CPU是用来出块,这种情况下,

当只有两个节点时,每个节点有一个CPU用于出块、一个CPU用于验证自己的出块、一个CPU用于验证其它节点的出块,所以会有三个CPU在工作,但是会有17个CPU处于闲置状态。

当节点从2个增加到20个时,每个节点用于验证的CPU会增加。整个区块链用于出块的CPU也在增加。所以整体处理能力能够相应地增加。因为验证工作可以并发进行,增加更多节点能够让所有节点充分利用自己的计算资源。

上图中,横坐标表示节点数的增长,纵坐标表示每个节点的CPU的使用数量。

当节点数量从20个增加到30个时,处理能力就不能相应增加了,因为单个节点所有的计算资源都已经用满了。对单个节点来说,没有更多资源能够投入到验证工作中了。这时候为了进一步提高处理能力就需要采用分片的方案了。

--

--