Lava PoC2 + protocol upgrade hard fork solution

In order to successfully introduce the new PoC2 + standard, it is necessary to appropriately transform the full node at the consensus level, which is also called a fork. This article introduces the fork scheme proposed by Lava's core developer team. Forks generally have two forms, one is a hard fork and the other is a soft fork. This solution is based on the decentralization of the blockchain and the spirit of community autonomy, and proposes a hard fork scheme activated by miners' voting. Activate soft fork).

What is a hard fork?

If software / hardware rules change and such rule changes are not forward compatible. In the blockchain, the nodes using the old version and the nodes using the new version are separated and cannot be recognized, which is called a hard fork.

Examples in reality:

Apple has used the Lightning connector on the iPhone 5 to replace the previous 30-pin Dock connector. Phones before iPhone 5 cannot use the new interface, and new phones after iPhone 5 cannot use the old interface.

What is a soft fork?

Soft forks are generally forward compatible, and can be said to be compatible in the future. The popular explanation is: the old version of the software / hardware can use the data generated by the new version of the software / hardware. It can be understood on the blockchain that the old node can verify and accept the blocks from the new node.

Examples in reality:

· Stereo FM radio is forward compatible, it can be played by old mono radio, but without stereo effect; it can also be played by new stereo radio, with stereo effect.

A soft fork can also be backward compatible in special cases, that is, a new version of software / hardware, and data generated by an old version of software / hardware can be used. It can be understood on the blockchain that new nodes can also verify and accept blocks from old nodes.

Examples in reality:

· Intel's x86 instruction set CPU is backward compatible. The new CPU can still run the software of the old CPU. This is because Intel wants to ensure that the instruction set of the old version of the CPU is also retained in the new version. This strategy of only adding and not deleting ensures that we do not need to change the matching software when changing CPUs.

Technical aspects involved in the fork

In the fork solution for Lava PoC2 +, the following points need to be changed at the consensus level:

1. A LAVA miner address field needs to be added to the block header. This block header comes with an address for verification. Burst has used it, and its address is the PID in the block header. Therefore, the method of replacing the previous PID with the LAVA exclusive address in LAVA is also a continuation of this idea.

2. A series of interfaces related to mining, including: Miner request information, verification after Miner submits information, and full node ingot verification.

3. The verification process when the full node synchronizes other blocks.

4. Block verification process during disk read after full node restart.

5. Binding relational database upgrade.

Analysis of detailed bifurcation schemes

Forward-compatible soft fork

Exclude this option first. Although this solution is the first choice for soft fork of the blockchain, because the fields in the block header need to be modified, it cannot meet the premise that the old node can receive the block from the new node.

2. Backwards compatible soft fork

The actual effect of this solution is shown in Figure 1 below. According to the major premise of backward compatibility, since the new node can receive and verify the old

Blocks from nodes, but old nodes cannot receive blocks from new nodes. Therefore, when the new node gradually exceeds the old node's computing power to reach 51%, the two chains are forked. Although this guarantees the effect of bifurcation, there are also corresponding problems (as shown in Figure 2). In the initial network, because the computing power of the old node is dominant (51% ~ 100%), the block generation of the new node is always impossible. Received by the old node, so there will be a large waste of computing power of the new node. Assume that at some point the new node forks another chain and forks the old chain. After a period of time, the computing power and length of the old chain will gradually exceed that of the new chain. The backward compatibility of the new node causes the new chain to be covered by the old chain. The computing power of each new chain is wasted.


Figure 1. New node has more than 51% hashrate


Figure 2. The new node has less than 51% hashrate and returns to the old chain

3. Traditional hard fork

The actual effect of the traditional hard fork method is shown in Figure 3 below. Traditional hard fork refers to the fork directly by updating the software. The updated software and the original version of the software cannot recognize each other, so two independent blockchains are formed. If the traditional hard fork does not get the consent of the participants in the ecology, it will easily lead to the division of the ecology and should be carefully considered.


Figure 3. Traditional hard fork

4. A hard fork scheme on the chain activated by computing power

Lava proposes a hard fork scheme activated by miners' votes. The actual effect of this scheme is shown in Figure 4.

This scheme divides the hard fork into two phases:

The first stage: miner voting activation and locking before the fork;

The second stage: fork is activated after the lockout period ends. WechatIMG244

Figure 4. A hard fork scheme on the chain dominated by computing power

The benefits of this program are:

First, it solves the problem of wasted computing power that may exist on a new node at the beginning of the fork in the backward-compatible soft fork solution described above.

Second, the traditional hard fork may lead to ecological fragmentation due to the two blockchains being isolated and self-contained. This is because if some ecological participants do not agree with the fork, but are forced to obey the opinions of another participant and have to obey, it will easily cause dissatisfaction and controversy. After the hard fork, there may even be two chains that develop independently, such as the case of Ethereum (ETH) and Ethereum Classic (ETC).

Computing power activates the first part of the hard fork: voting and locking

The miner chooses to mint the block with the new full node software version. The new full node will still maintain the old consensus rule, which is the PoC2 standard, and recognize the old node without the updated software. The new full-node software version only changes the version number in the version of the block header to indicate the voting opinions of the block producer (the update itself is a vote without additional action). After a period of time, the full node will automatically count the amount of blocks generated by the new node in the "voting" phase. When the number reaches a certain threshold, the next phase can be started-locking.

In the locking phase, the new and old nodes still use the POC2 consensus rule for ingots. When the locking phase ends, they enter the second part of the hard fork and formally activate the hard fork. The significance of the lock-up phase is to provide a transition time before consensus switching, so that users can gradually migrate files on the hard disk from POC2 format to POC2 + (that is, give time to "re-P disk") for the upcoming new chain Continue mining on the Internet.

Computing power activates hard forks Part 2: Formal activation of forks

After entering the activation phase, the hard fork officially takes effect, and the old and new chains coexist. The old chain still uses the POC2 consensus, and the new chain, that is, the new node will use the POC2 + consensus for casting, verification, synchronization and other processes. This also means that from this moment on, new nodes must use LAVA's proprietary P disk format, otherwise they will not be able to produce blocks.


Lava project official website:

HyperPlotter PoC2 + upgrade P disk software download link :

For more information and cooperation, please contact: