PIP-4: Consensus Rule Change: 0.6.1

Proposal Edit – April 14th, 2021

0.6.0 has been replaced by 0.6.1, which fixes a critical bug that was discovered during the testnet upgrade rehearsal. Refer to this announcement for details on the hotfix.

Attributes

Summary

Pocket Network Inc. is releasing a consensus rule change with the 0.6.1 release. The release contains several bug fixes as well as scalability features.

Abstract

This Pocket Core release (0.6.1) offers a higher level of security (2 mission critical patches in the merkle tree) plus provides a higher level of network stability through the removal/patching of events, in addition to a change in the encoding algorithm (Amino to Google’s Protobuf).

Motivation

There are two major security issues in the merkle tree proof/claim implementation as well as an exploitable prediction attack due to a misimplementation at the block hash generation. The current encoding scheme is both ‘custom’ and unsupported across most all programming languages which hinders ecosystem growth and future development. Lastly, PUP-4 is somewhat addressed in this release.

Specification

  • Convert all consensus level amino encoding (including but not limited to the internal storage codecs) to protobuf encoding while maintaining as many legacy structures as possible

  • Introduce Previous Block Validator Voting structure into the block hash used for session and proposer selection algorithms.

  • Use the index of the leafs of the plasma core merkle tree as part of the parent hash to lock in the values using the Claim merkle root

  • Ensure consensus level events are not concatenated in the pocket core module by initializing in the transaction handler

  • Change ABCIValidatorUpdate to ABCIValidatorZeroUpdate for separation of service and validation

Rationale

The bug fixes in the merkle tree result in an increased level of network stability. Applications and node runners will experience an even higher degree of reliability through the new found network security.

Through the addition of Protobuf encoding, client-side tooling such as SDK development and improvements just got a lot easier, which will make expanding our potential app user bases easier and an all around better development experience while using Pocket Network.

In addition a bug identified in event-handling has now been fixed, which creates smaller block sizes and should enable faster txs and overall better service.

We have successfully separated servicing and validation, which allows us to have more nodes overall and more scalability - no longer capped to 5000(technically). That said, PUP4 will likely still try to limit nodes to 5000 due to the lack of jailing available to servicers which may lead to service degradation.

Protobuf encoding will also lower transaction latency a tad because of less resource demand on nodes.

Viability

An extensive number of tests, functional, integration, unit, load, and simulation were completed leading up to this upgrade. These can be found in the release notes.

Implementation

The implementation of 0.6.0 is near complete. A few pending tests, the agreement of an Upgrade height, and the approval of this proposal, will result in a complete implementation.

0.6.1 has been released. Once ≥67% of validator power has updated to this version, this proposal will be edited to specify an upgrade height and voting will commence. Voting will last 7 days and pass with a 50% majority. If the vote passes, the Foundation will activate the upgrade at the specified height using the pocket gov upgrade transaction.

Audit

There was no external audit, refer to Viability.

Copyright

Copyright and related rights waived via CC0.