hyperledger / indy-plenum

Plenum Byzantine Fault Tolerant Protocol
https://wiki.hyperledger.org/display/indy
Apache License 2.0
215 stars 370 forks source link

Incorrect ViewChange messages consensus calculating #1506

Open Toktar opened 3 years ago

Toktar commented 3 years ago

The simulation test for ViewChange sometimes fails https://github.com/hyperledger/indy-plenum/blob/c10090d8f7f3ffcae84f7d8f6df3e30517000270/plenum/test/consensus/view_change/test_sim_view_change.py#L65 because of problem with getting a checkpoint on the phase of collecting ViewChange messages in the method calc_checkpoint(). It receives a list of ViewChange messages like a parameter. If it's a 4 node pool and the list contains the follow ViewChange messages

Then we don't have a strong consensus of 3 (n-f=4-1) checkpoins with the same checkpoint end. It means, that the node can't finish a view change.

Expected problem: Low probability one or more nodes may not finish View Change and after a short period just start a new one. With an incredibly low probability a pool can freeze with endless view changes. But it can be fixed by POOL_RESTARTtransaction.

We don’t think we have a big chance to face this case. But we need to remember about it and fix.

WadeBarnes commented 3 years ago

When addressing this issue, please ensure any workarounds such as this are addressed; https://github.com/hyperledger/indy-plenum/blob/705582e2657433a7d907f0d390fd885b11554736/plenum/test/consensus/view_change/test_sim_view_change.py#L90-L92