From 419561c7894db86e9a203fc367157aa07681e758 Mon Sep 17 00:00:00 2001 From: Matus Kysel Date: Thu, 28 Nov 2024 13:41:03 +0100 Subject: [PATCH] fix(queue): change msg types priorities --- protocol/v2/ssv/queue/message_prioritizer.go | 2 +- protocol/v2/ssv/queue/messages.go | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/protocol/v2/ssv/queue/message_prioritizer.go b/protocol/v2/ssv/queue/message_prioritizer.go index 73c3b839e9..bf36afbfcf 100644 --- a/protocol/v2/ssv/queue/message_prioritizer.go +++ b/protocol/v2/ssv/queue/message_prioritizer.go @@ -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 } diff --git a/protocol/v2/ssv/queue/messages.go b/protocol/v2/ssv/queue/messages.go index 240046378b..cf615fc220 100644 --- a/protocol/v2/ssv/queue/messages.go +++ b/protocol/v2/ssv/queue/messages.go @@ -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 -}