Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(queue): change msg types priorities [main] #1891

Merged
merged 1 commit into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
y0sher marked this conversation as resolved.
Show resolved Hide resolved
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
}