MCPcopy Create free account
hub / github.com/DeAI-Artist/Linkis / enterPrecommitWait

Method enterPrecommitWait

consensus/state.go:1444–1473  ·  view source on GitHub ↗

Enter: any +2/3 precommits for next round.

(height int64, round int32)

Source from the content-addressed store, hash-verified

1442
1443// Enter: any +2/3 precommits for next round.
1444func (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
1476func (cs *State) enterCommit(height int64, commitRound int32) {

Callers 1

addVoteMethod · 0.95

Calls 8

newStepMethod · 0.95
scheduleTimeoutMethod · 0.95
NewLazySprintfFunction · 0.92
HasTwoThirdsAnyMethod · 0.80
PrecommitsMethod · 0.80
PrecommitMethod · 0.80
WithMethod · 0.65
DebugMethod · 0.65

Tested by

no test coverage detected