Skip to content

Commit

Permalink
fix(queue): change msg types priorities (#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
MatusKysel authored Dec 3, 2024
1 parent 9c772e4 commit 9c7bb18
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion protocol/v2/ssv/queue/message_prioritizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func (p *committeePrioritizer) Prior(a, b *SSVMessage) bool {
return scoreA > scoreB
}

scoreA, scoreB = scoreCommitteeConsensusType(a), scoreCommitteeConsensusType(b)
scoreA, scoreB = scoreConsensusType(a), scoreConsensusType(b)
if scoreA != scoreB {
return scoreA > scoreB
}
Expand Down
18 changes: 0 additions & 18 deletions protocol/v2/ssv/queue/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,3 @@ func scoreCommitteeMessageSubtype(state *State, m *SSVMessage, relativeHeight in
}
return 0
}

// scoreCommitteeConsensusType returns an integer score for the type of committee consensus message.
// When given a non-consensus message, scoreConsensusType returns 0.
func scoreCommitteeConsensusType(m *SSVMessage) int {
if qbftMsg, ok := m.Body.(*specqbft.Message); ok {
switch qbftMsg.MsgType {
case specqbft.CommitMsgType:
return 4
case specqbft.RoundChangeMsgType:
return 3
case specqbft.ProposalMsgType:
return 2
case specqbft.PrepareMsgType:
return 1
}
}
return 0
}

0 comments on commit 9c7bb18

Please sign in to comment.