Skip to content

Justitia Consensus Algorithms Testing

walterBishop edited this page Dec 21, 2018 · 9 revisions

Justitia

Justitia is constructed on high performance and flexibility which encapsulates changes in a variety of ways and new technology, which enabling pluggable modular design pattern.

Justitia Consensus Algorithms

More recent consensus algorithms, whether HashGraph, Casper, Tendermint, or DPOS BFT all adopt long-established principles of Paxos and related consensus algorithms. Under these models it is possible to reach unambiguous finality under all network conditions so long as more than 2/3 of participants are honest.

Obviously, we adopt DPOS BFT as our basic consensus algorithm. while in our consensus algorithm which is pluggable, you can make strategies based on different scenarios by configuration. Justitia consensus algorithms can be simply divided into three parts, which are participates, role and consensus. Participates delimiting the scope of consensus, role assigning roles for participates and consensus launching and reaching consensus.

Functional Testing

Lest's test the justitia from functional perspective.

Normal Scenarios Testing

In this scenario, you need just starting system and sending transactions by our scripts as README.md described. For example, you have four nodes which is A, B, C and D, so you can run justitia with the following command at the same time or with random order:

$ go run main.go

then you can send transactions and observe running statues by our browser.

Abnormal Scenario Testing

In this scenario, we assume you system is running healthly and test from node service failures and recovery operations.

shut down one node

You can choose to shut down any node's justitia service through ctrl + c or kill the process by its pid.

stop slave node

If you choose to shut down the node which is not master, it will not affect our system.

stop master node

First, you can find master's id by our browser, shut down master's justitia service, then you can find block height ceases to grow immediately. we design our system stop producing block when master crashed in 30s, while after that system will recover whenever master recover or still crashed.

shut down multiple nodes

Under BFT models it is possible to reach unambiguous finality under all network conditions so long as more than 2/3 of participants are honest, so if you guarantee that the number of remaining nodes is not less than 2/3,it will not affect our system. while if nodes which choose to shut down contains current master, it will going like above.

recover node service

If you choose to recover node service which has shut down log time ago, firstly block height will be synchronized. it will participate in consensus once ending the synchronization.

In special case, if you stop master service and recover it in 30s, it will continue to be the master, and then producing block, without affecting running of the system.