Sequence Diagram of DPoS Consensus
1. Nouns Defined
ondutyProducer: the current on-duty producer
normalProducer: the producer currently participating in consensus, but not on duty
proposal: a proposal generated for a block
acceptVote: the signature of consenting to the proposal
rejectVote: the signature of rejecting the proposal
startConsensus: When you receive the block, start consensus, start timing at that moment, and switch the view every 5 seconds
finishConsensus: end the consensus state and wait for the next block round
view: an ondutyProducer initiates a proposal until the next 5 seconds, which is seen as a view
changeView: During the consensus process, the view is switched every five seconds, and the next producer of the switching view becomes onduty - a proposal is initiated
2. Sequence Diagram
1. DPoS Consensus Confirmation Block
① Collect enough votes and confirm the block after starting the consensus
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->normalProducer1: acceptVote
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
normalProducer1-->>ondutyProducer: acceptVote
normalProducer1-->>normalProducer2: acceptVote
normalProducer1-->>normalProducer3: acceptVote
normalProducer2-->>ondutyProducer: acceptVote
normalProducer2-->>normalProducer1: acceptVote
normalProducer2-->>normalProducer3: acceptVote
normalProducer3-->>ondutyProducer: acceptVote
normalProducer3-->>normalProducer1: acceptVote
normalProducer3-->>normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: acceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
② Switch the view when you receive enough rejection votes after starting the consensus
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->normalProducer1: acceptVote
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
normalProducer1-->ondutyProducer: rejectVote
normalProducer1-->normalProducer2: rejectVote
normalProducer1-->normalProducer3: rejectVote
normalProducer2-->ondutyProducer: rejectVote
normalProducer2-->normalProducer1: rejectVote
normalProducer2-->normalProducer3: rejectVote
normalProducer3-->ondutyProducer: rejectVote
normalProducer3-->normalProducer1: rejectVote
normalProducer3-->normalProducer2: rejectVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: view1:rejectVotes>=1/3时,切换试图(changeView)
Note right of normalProducer1: 取收到的第一个block生成proposal,并广播
ondutyProducer->ondutyProducer: not onduty, viewOffset++
normalProducer1->normalProducer1: onduty, viewOffset++
normalProducer2->normalProducer2: viewOffset++
normalProducer3->normalProducer3: viewOffset++
normalProducer1->ondutyProducer: proposal
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->ondutyProducer: acceptVote
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
ondutyProducer-->normalProducer1: acceptVote
ondutyProducer-->normalProducer2: acceptVote
ondutyProducer-->normalProducer3: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
③ Switch the view if not enough votes are collected within five seconds after starting the consensus
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->normalProducer1: acceptVote
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
normalProducer1-->ondutyProducer: acceptVote
normalProducer1-->normalProducer2: acceptVote
normalProducer1-->normalProducer3: acceptVote
normalProducer2-->ondutyProducer: rejectVote
normalProducer2-->normalProducer1: rejectVote
normalProducer2-->normalProducer3: rejectVote
normalProducer3-->ondutyProducer: rejectVote
normalProducer3-->normalProducer1: rejectVote
normalProducer3-->normalProducer2: rejectVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: view1:5秒内未收集到大于2/3的vote,切换试图(changeView)
Note right of normalProducer1: 取收到的第一个block生成proposal,并广播
ondutyProducer->ondutyProducer: not onduty, viewOffset++
normalProducer1->normalProducer1: onduty, viewOffset++
normalProducer2->normalProducer2: viewOffset++
normalProducer2->normalProducer3: viewOffset++
normalProducer1->ondutyProducer: proposal
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->ondutyProducer: acceptVote
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
ondutyProducer-->normalProducer1: acceptVote
ondutyProducer-->normalProducer2: acceptVote
ondutyProducer-->normalProducer3: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer2: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
④ Confirm the block after multiple view switching
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->normalProducer1: acceptVote
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: view1:5秒内未收集到大于2/3的vote,切换试图(changeView)
Note right of normalProducer1: 取收到的第一个block生成proposal,并广播
ondutyProducer->ondutyProducer: not onduty, viewOffset++
normalProducer1->normalProducer1: onduty, viewOffset++
normalProducer2->normalProducer2: viewOffset++
normalProducer3->normalProducer3: viewOffset++
ondutyProducer->normalProducer1: proposal
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->normalProducer1: acceptVote
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: view2:5秒内未收集到大于2/3的vote,切换试图(changeView)
Note over ondutyProducer,normalProducer3: 多轮changeView
Note over ondutyProducer,normalProducer3: viewN(N<36)
Note right of normalProducer1: 取收到的第一个block生成proposal,并广播
ondutyProducer->ondutyProducer: not onduty, viewOffset++
normalProducer1->normalProducer1: onduty, viewOffset++
normalProducer2->normalProducer2: viewOffset++
normalProducer3->normalProducer3: viewOffset++
normalProducer1->ondutyProducer: proposal
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->ondutyProducer: acceptVote
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
ondutyProducer-->normalProducer1: acceptVote
ondutyProducer-->normalProducer2: acceptVote
ondutyProducer-->normalProducer3: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
2. Special case solution of DPoS consensus confirmation clock
① Before starting the consensus, proposal, vote and confirmedblock are received
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
normalProducer3->normalProducer3: 收集block
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: view0:startConsensus\n 认为自己onduty
normalProducer3->normalProducer2: proposal
normalProducer2-->normalProducer2: 认为producer3 onduty\n 记录pending状态的proposal
normalProducer3->normalProducer1: proposal
normalProducer1-->normalProducer1: 认为producer3 not onduty
normalProducer1-->normalProducer3: rejectVote
normalProducer3->ondutyProducer: proposal
ondutyProducer-->ondutyProducer: 不回复
normalProducer3->normalProducer2: accept/reject vote
normalProducer2-->normalProducer2: 不收集 不回复
normalProducer3->normalProducer1: accept/reject vote
normalProducer1-->normalProducer1: 不收集 不回复
normalProducer3->ondutyProducer: accept/reject vote
ondutyProducer-->ondutyProducer: 不收集 不回复
normalProducer3-->normalProducer3: 收到confirmedBlock\n改变onduty状态\np2p广播confirmedBlock
normalProducer3->normalProducer2: confirmedBlock
normalProducer2-->normalProducer2: 改变onduty状态
normalProducer3->normalProducer1: confirmedBlock
normalProducer1-->normalProducer1: 改变onduty状态
normalProducer3->ondutyProducer: confirmedBlock
ondutyProducer-->ondutyProducer: 改变onduty状态
② After starting the consensus, proposal, vote and confirmedblock initiated by on-duty producer are received
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
normalProducer3->normalProducer3: 收集block
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: view0:startConsensus\n 认为自己onduty
ondutyProducer->ondutyProducer: view0:startConsensus
normalProducer1->normalProducer1: view0:startConsensus
normalProducer2->normalProducer2: view0:startConsensus
normalProducer3->normalProducer2: proposal
normalProducer2-->normalProducer3: rejectVote
normalProducer3->normalProducer1: proposal
normalProducer1-->normalProducer3: rejectVote
normalProducer3->ondutyProducer: proposal
ondutyProducer-->ondutyProducer: 不回复
normalProducer3->normalProducer2: accept/reject vote
normalProducer2-->normalProducer2: 不收集 不回复
normalProducer3->normalProducer1: accept/reject vote
normalProducer1-->normalProducer1: 不收集 不回复
normalProducer3->ondutyProducer: accept/reject vote
ondutyProducer-->ondutyProducer: 不收集 不回复
normalProducer3-->normalProducer3: 收到confirmedBlock\n改变onduty状态\np2p广播confirmedBlock
normalProducer3->normalProducer2: confirmedBlock
normalProducer2-->normalProducer2: 切换onduty\n结束共识
normalProducer3->normalProducer1: confirmedBlock
normalProducer1-->normalProducer1: 切换onduty\n结束共识
normalProducer3->ondutyProducer: confirmedBlock
ondutyProducer-->ondutyProducer: 切换onduty\n结束共识
③ After starting the consensus, the corresponding block is not received when the proposal is received
participant ondutyProducer
participant normalProducer
ondutyProducer->ondutyProducer: 收集block
normalProducer->normalProducer: 收集block
ondutyProducer->ondutyProducer: view0:startConsensus
normalProducer->normalProducer: view0:startConsensus
ondutyProducer->normalProducer: proposal
normalProducer-->normalProducer: 未收到对应block\n记录为pendingProposal
normalProducer-->ondutyProducer: getblock
ondutyProducer-->normalProducer: block
normalProducer-->normalProducer: 查找pendingProposals\n有对应proposal则签名\n并在直连网络广播vote
normalProducer-->ondutyProducer: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer->normalProducer: 收集vote
Note over ondutyProducer,normalProducer: acceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
④ After starting the consensus, the corresponding proposal is not received when the vote is received
participant ondutyProducer
participant normalProducer
ondutyProducer->ondutyProducer: 收集block
normalProducer->normalProducer: 收集block
ondutyProducer->ondutyProducer: view0:startConsensus
normalProducer->normalProducer: view0:startConsensus
normalProducer->ondutyProducer: vote
ondutyProducer-->ondutyProducer: 未收到对应proposal\n记录为pendingVote
ondutyProducer-->normalProducer: getproposal
normalProducer-->ondutyProducer: proposal
ondutyProducer-->ondutyProducer: 查找pendingPr\n有对应proposal则签名\n并在直连网络广播vote
normalProducer-->ondutyProducer: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer->normalProducer: 收集vote
Note over ondutyProducer,normalProducer: acceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
3. Abnormal Switch of Producer
① One arbiter failed to successfully send the proposal and confirm the situation of the block for 1440 blocks (about 2 days)
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer-->ondutyProducer: 未成功发送proposal
Note over ondutyProducer,normalProducer3: view1:超过5秒未收集,切换试图(changeView)
Note right of normalProducer1: 取收到的第一个block生成proposal,并广播
ondutyProducer->ondutyProducer: not onduty, viewOffset++
normalProducer1->normalProducer1: onduty, viewOffset++
normalProducer2->normalProducer2: viewOffset++
normalProducer3->normalProducer3: viewOffset++
normalProducer1->ondutyProducer: proposal
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->ondutyProducer: acceptVote
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
ondutyProducer-->normalProducer1: acceptVote
ondutyProducer-->normalProducer2: acceptVote
ondutyProducer-->normalProducer3: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
Note over ondutyProducer,normalProducer3: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)\n 经过一轮出块,又到新的一轮\n view0:收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer-->ondutyProducer: 未成功发送proposal
Note over ondutyProducer,normalProducer3: ...\n同上过程经过1440块的高度\n ...
ondutyProducer-->ondutyProducer: 被置为inactive状态\n当前轮结束后不再参与共识\n收到active交易后可恢复
normalProducer1->normalProducer1: onduty
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->candidateProducer: proposal
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
normalProducer1->candidateProducer: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer2-->candidateProducer: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->normalProducer2: acceptVote
normalProducer3-->candidateProducer: acceptVote
candidateProducer-->normalProducer1: acceptVote
candidateProducer-->normalProducer2: acceptVote
candidateProducer-->normalProducer3: acceptVote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
candidateProducer->candidateProducer: 收集vote
Note over normalProducer1,candidateProducer: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
② One arbiter is illegal
When the arbiter is on duty, multiple proposals are issued in a single view:
participant ondutyProducer
participant normalProducer1
participant normalProducer2
participant normalProducer3
ondutyProducer->ondutyProducer: 收集block
normalProducer1->normalProducer1: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over ondutyProducer,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal(block1)
ondutyProducer->normalProducer2: proposal(block1)
ondutyProducer->normalProducer3: proposal(block1)
normalProducer1-->>ondutyProducer: acceptVote
normalProducer1-->>normalProducer2: acceptVote
normalProducer1-->>normalProducer3: acceptVote
ondutyProducer->normalProducer1: proposal(block2)
normalProducer1-->>ondutyProducer: 创建illegalProposal交易
normalProducer1-->>normalProducer2: 创建illegalProposal交易
normalProducer1-->>normalProducer3: 创建illegalProposal交易
ondutyProducer->normalProducer2: proposal(block2)
normalProducer2-->>ondutyProducer: 创建illegalProposal交易
normalProducer2-->>normalProducer1: 创建illegalProposal交易
normalProducer2-->>normalProducer3: 创建illegalProposal交易
ondutyProducer->normalProducer3: proposal(block2)
normalProducer3-->>ondutyProducer: 创建illegalProposal交易
normalProducer3-->>normalProducer1: 创建illegalProposal交易
normalProducer3-->>normalProducer2: 创建illegalProposal交易
ondutyProducer->ondutyProducer: 被置为illegal状态\n当前轮结束后不再参与共识
normalProducer1->normalProducer1: onduty
normalProducer1->normalProducer2: proposal
normalProducer1->normalProducer3: proposal
normalProducer1->candidateProducer: proposal
normalProducer1->normalProducer2: acceptVote
normalProducer1->normalProducer3: acceptVote
normalProducer1->candidateProducer: acceptVote
normalProducer2-->normalProducer1: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer2-->candidateProducer: acceptVote
normalProducer3-->normalProducer1: acceptVote
normalProducer3-->normalProducer2: acceptVote
normalProducer3-->candidateProducer: acceptVote
candidateProducer-->normalProducer1: acceptVote
candidateProducer-->normalProducer2: acceptVote
candidateProducer-->normalProducer3: acceptVote
normalProducer1->normalProducer1: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
candidateProducer->candidateProducer: 收集vote
Note over normalProducer1,candidateProducer: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
③ Send acceptVote and rejectVote to the proposal
participant normalProducer1
participant ondutyProducer
participant normalProducer2
participant normalProducer3
normalProducer1->normalProducer1: 收集block
ondutyProducer->ondutyProducer: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over normalProducer1,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal
normalProducer1-->>ondutyProducer: acceptVote
normalProducer1-->>ondutyProducer: rejectVote
ondutyProducer-->>normalProducer1: 创建illegalVote交易
ondutyProducer-->>normalProducer2: 创建illegalVote交易
ondutyProducer-->>normalProducer3: 创建illegalVote交易
normalProducer1-->>normalProducer2: acceptVote
normalProducer1-->>normalProducer2: rejectVote
normalProducer2-->>normalProducer1: 创建illegalVote交易
normalProducer2-->>ondutyProducer: 创建illegalVote交易
normalProducer2-->>normalProducer3: 创建illegalVote交易
normalProducer1-->>normalProducer3: acceptVote
normalProducer1-->>normalProducer3: rejectVote
normalProducer3-->>normalProducer1: 创建illegalVote交易
normalProducer3-->>ondutyProducer: 创建illegalVote交易
normalProducer3-->>normalProducer2: 创建illegalVote交易
normalProducer1->normalProducer1: 被置为illegal状态\n当前轮结束后不再参与共识
ondutyProducer->ondutyProducer: onduty
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->candidateProducer: proposal
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
ondutyProducer->candidateProducer: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer2-->candidateProducer: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
normalProducer3-->candidateProducer: acceptVote
candidateProducer-->ondutyProducer: acceptVote
candidateProducer-->normalProducer2: acceptVote
candidateProducer-->normalProducer3: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
candidateProducer->candidateProducer: 收集vote
Note over ondutyProducer,candidateProducer: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
④ A single view sends acceptVote to different proposals
participant normalProducer1
participant ondutyProducer
participant normalProducer2
participant normalProducer3
normalProducer1->normalProducer1: 收集block
ondutyProducer->ondutyProducer: 收集block
normalProducer2->normalProducer2: 收集block
normalProducer3->normalProducer3: 收集block
Note over normalProducer1,normalProducer3: view0:若收到block高度大于链高,开启共识并开始计时(startConsensus)
Note right of ondutyProducer: 取收到的第一个block生成proposal,并广播
ondutyProducer->normalProducer1: proposal(block1)
normalProducer1-->>ondutyProducer: acceptVote
normalProducer1-->>normalProducer2: acceptVote
normalProducer1-->>normalProducer3: acceptVote
ondutyProducer->normalProducer1: proposal(block2)
normalProducer1-->>ondutyProducer: acceptVote
ondutyProducer-->>normalProducer1: 创建illegalVote交易
ondutyProducer-->>normalProducer2: 创建illegalVote交易
ondutyProducer-->>normalProducer3: 创建illegalVote交易
normalProducer1-->>normalProducer2: acceptVote
normalProducer2-->>normalProducer1: 创建illegalVote交易
normalProducer2-->>ondutyProducer: 创建illegalVote交易
normalProducer2-->>normalProducer3: 创建illegalVote交易
normalProducer1-->>normalProducer3: acceptVote
normalProducer3-->>normalProducer1: 创建illegalVote交易
normalProducer3-->>ondutyProducer: 创建illegalVote交易
normalProducer3-->>normalProducer2: 创建illegalVote交易
normalProducer1->normalProducer1: 被置为illegal状态\n当前轮结束后不再参与共识
ondutyProducer->ondutyProducer: onduty
ondutyProducer->normalProducer2: proposal
ondutyProducer->normalProducer3: proposal
ondutyProducer->candidateProducer: proposal
ondutyProducer->normalProducer2: acceptVote
ondutyProducer->normalProducer3: acceptVote
ondutyProducer->candidateProducer: acceptVote
normalProducer2-->ondutyProducer: acceptVote
normalProducer2-->normalProducer3: acceptVote
normalProducer2-->candidateProducer: acceptVote
normalProducer3-->ondutyProducer: acceptVote
normalProducer3-->normalProducer2: acceptVote
normalProducer3-->candidateProducer: acceptVote
candidateProducer-->ondutyProducer: acceptVote
candidateProducer-->normalProducer2: acceptVote
candidateProducer-->normalProducer3: acceptVote
ondutyProducer->ondutyProducer: 收集vote
normalProducer2->normalProducer2: 收集vote
normalProducer3->normalProducer3: 收集vote
candidateProducer->candidateProducer: 收集vote
Note over ondutyProducer,candidateProducer: cceptVotes>2/3时,广播confirmedBlock并结束共识(finisheConsensus)
Last updated