Enter: any +2/3 precommits for next round.
(height int64, round int32)
| 1442 | |
| 1443 | // Enter: any +2/3 precommits for next round. |
| 1444 | func (cs *State) enterPrecommitWait(height int64, round int32) { |
| 1445 | logger := cs.Logger.With("height", height, "round", round) |
| 1446 | |
| 1447 | if cs.Height != height || round < cs.Round || (cs.Round == round && cs.TriggeredTimeoutPrecommit) { |
| 1448 | logger.Debug( |
| 1449 | "entering precommit wait step with invalid args", |
| 1450 | "triggered_timeout", cs.TriggeredTimeoutPrecommit, |
| 1451 | "current", log.NewLazySprintf("%v/%v", cs.Height, cs.Round), |
| 1452 | ) |
| 1453 | return |
| 1454 | } |
| 1455 | |
| 1456 | if !cs.Votes.Precommits(round).HasTwoThirdsAny() { |
| 1457 | panic(fmt.Sprintf( |
| 1458 | "entering precommit wait step (%v/%v), but precommits does not have any +2/3 votes", |
| 1459 | height, round, |
| 1460 | )) |
| 1461 | } |
| 1462 | |
| 1463 | logger.Debug("entering precommit wait step", "current", log.NewLazySprintf("%v/%v/%v", cs.Height, cs.Round, cs.Step)) |
| 1464 | |
| 1465 | defer func() { |
| 1466 | // Done enterPrecommitWait: |
| 1467 | cs.TriggeredTimeoutPrecommit = true |
| 1468 | cs.newStep() |
| 1469 | }() |
| 1470 | |
| 1471 | // wait for some more precommits; enterNewRound |
| 1472 | cs.scheduleTimeout(cs.config.Precommit(round), height, round, cstypes.RoundStepPrecommitWait) |
| 1473 | } |
| 1474 | |
| 1475 | // Enter: +2/3 precommits for block |
| 1476 | func (cs *State) enterCommit(height int64, commitRound int32) { |
no test coverage detected