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

Function defaultReceivePrecommit

test/maverick/consensus/misbehavior.go:352–374  ·  view source on GitHub ↗
(cs *State, vote *types.Vote)

Source from the content-addressed store, hash-verified

350}
351
352func defaultReceivePrecommit(cs *State, vote *types.Vote) {
353 height := cs.Height
354 precommits := cs.Votes.Precommits(vote.Round)
355 cs.Logger.Info("Added to precommit", "vote", vote, "precommits", precommits.StringShort())
356
357 blockID, ok := precommits.TwoThirdsMajority()
358 if ok {
359 // Executed as TwoThirdsMajority could be from a higher round
360 cs.enterNewRound(height, vote.Round)
361 cs.enterPrecommit(height, vote.Round)
362 if len(blockID.Hash) != 0 {
363 cs.enterCommit(height, vote.Round)
364 if cs.config.SkipTimeoutCommit && precommits.HasAll() {
365 cs.enterNewRound(cs.Height, 0)
366 }
367 } else {
368 cs.enterPrecommitWait(height, vote.Round)
369 }
370 } else if cs.Round <= vote.Round && precommits.HasTwoThirdsAny() {
371 cs.enterNewRound(height, vote.Round)
372 cs.enterPrecommitWait(height, vote.Round)
373 }
374}
375
376func defaultReceiveProposal(cs *State, proposal *types.Proposal) error {
377 // Already have one

Callers 1

addVoteMethod · 0.85

Calls 10

PrecommitsMethod · 0.80
TwoThirdsMajorityMethod · 0.80
HasAllMethod · 0.80
HasTwoThirdsAnyMethod · 0.80
InfoMethod · 0.65
StringShortMethod · 0.45
enterNewRoundMethod · 0.45
enterPrecommitMethod · 0.45
enterCommitMethod · 0.45
enterPrecommitWaitMethod · 0.45

Tested by

no test coverage detected