StartCommitProcessPhase() begins the COMMIT-PROCESS phase after the COMMIT phase timeout COMMIT-PROCESS PHASE: - Replica reviews the message from the Leader by validating the justification (+2/3 multi-sig) proving that +2/3rds of Replicas are locked on the Proposal - Replica clears Byzantine Evidenc
()
| 496 | // - Replica gossips the Quorum Certificate message to Peers |
| 497 | // - If Leader, send the Proposal (reward) Transaction |
| 498 | func (b *BFT) StartCommitProcessPhase() { |
| 499 | b.log.Info(b.View.ToString()) |
| 500 | msg := b.GetProposal() |
| 501 | if msg == nil { |
| 502 | b.log.Warn("no valid message received from Proposer") |
| 503 | b.RoundInterrupt() |
| 504 | return |
| 505 | } |
| 506 | // validate proposer and proposal against local variables |
| 507 | if interrupt := b.CheckProposerAndProposal(msg); interrupt { |
| 508 | b.RoundInterrupt() |
| 509 | return |
| 510 | } |
| 511 | msg.Qc.Block, msg.Qc.Results = b.Block, b.Results |
| 512 | // preset the Byzantine Evidence for the next height |
| 513 | b.ByzantineEvidence = &ByzantineEvidence{ |
| 514 | DSE: b.GetLocalDSE(), |
| 515 | } |
| 516 | // non-blocking |
| 517 | go func() { |
| 518 | // send the block to self for committing |
| 519 | b.SelfSendBlock(msg.Qc, msg.Timestamp) |
| 520 | // wait to allow for CommitProcess to finish |
| 521 | <-time.After(time.Duration(b.Config.CommitTimeoutMS) * time.Millisecond) |
| 522 | // gossip committed block message to peers |
| 523 | b.GossipBlock(msg.Qc, b.PublicKey, msg.Timestamp) |
| 524 | }() |
| 525 | } |
| 526 | |
| 527 | // RoundInterrupt() begins the ROUND-INTERRUPT phase after any phase errors |
| 528 | // ROUND-INTERRUPT: |