Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback consensus through lower num of signatures #2327

Merged

Conversation

SebastianMarian
Copy link
Contributor

@SebastianMarian SebastianMarian commented Sep 28, 2020

Acceptance of a temporary lower threshold for number of signatures needed in metachain consensus (ex. 1/2 + 1 (~51%) instead 2/3 + 1 (~67%) ) will be done only if:

  1. there is a stuck situation (> 50 rounds without a new block created)

  2. block which can not be created is the start of epoch meta block

How to be tested ?

  1. Start a normal testnet with 7 nodes in each shard. In metachain consensus will be achieved if there are 2/3+1 (67%) signatures collected from the whole consensus group which is also 7 (equal with number of eligible nodes). So we need at least 5 signatures for each proposed block.
  2. After a while, just before an epoch to be changed, we should close 3 nodes from metachain just to be sure that the consensus will not be achieved anymore. With only 4 nodes nothing new will be produced. The tricky part will come after 50 rounds without any new block produced and when the time for a new epoch will be reached. In this situation the fallback mechanism will be activated and the new threshold of 1/2 + 1 (51%) will be applied. This means that 4 signatures from the total of 7, will be enough now for a proposed block to be accepted. (only if the proposed block will be start of epoch meta block and there are more than 50 rounds without a new block created)
  3. We can test then a fast replay for the whole blockchain to check also if the start of epoch meta blocks with lower threshold of signatures will be accepted by the nodes which are syncing, either if they are shard nodes or meta nodes.

…of-signatures

# Conflicts:
#	consensus/interface.go
#	consensus/mock/consensusDataContainerMock.go
#	consensus/mock/mockTestInitializer.go
#	consensus/spos/consensusCore.go
#	consensus/spos/consensusCoreValidator.go
#	consensus/spos/consensusCore_test.go
#	consensus/spos/errors.go
#	consensus/spos/interface.go
#	node/node.go
@SebastianMarian SebastianMarian self-assigned this Oct 1, 2020
@SebastianMarian SebastianMarian added the type:feature New feature or request label Oct 1, 2020
@SebastianMarian SebastianMarian marked this pull request as ready for review October 1, 2020 19:51
@iulianpascalau iulianpascalau self-requested a review October 5, 2020 07:17
iulianpascalau
iulianpascalau previously approved these changes Oct 5, 2020
process/headerCheck/headerSignatureVerify.go Show resolved Hide resolved
iulianpascalau
iulianpascalau previously approved these changes Oct 5, 2020
@AdoAdoAdo AdoAdoAdo self-requested a review October 5, 2020 09:17
node/node.go Outdated
@@ -151,8 +151,9 @@ type Node struct {
mutQueryHandlers syncGo.RWMutex
queryHandlers map[string]debug.QueryHandler

heartbeatHandler *componentHandler.HeartbeatHandler
peerHonestyHandler consensus.PeerHonestyHandler
heartbeatHandler *componentHandler.HeartbeatHandler
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you use an interface here instead?
it will be easier for me when merging with soft restart feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@LucianMincu LucianMincu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🪑 💯

@LucianMincu LucianMincu merged commit 860f15b into development Oct 7, 2020
@LucianMincu LucianMincu deleted the Fallback-consensus-through-lower-num-of-signatures branch October 7, 2020 19:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants