diff --git a/core/src/banking_stage/immutable_deserialized_packet.rs b/core/src/banking_stage/immutable_deserialized_packet.rs index a83244171e775d..b03f3d5d64d4e8 100644 --- a/core/src/banking_stage/immutable_deserialized_packet.rs +++ b/core/src/banking_stage/immutable_deserialized_packet.rs @@ -39,7 +39,7 @@ pub enum DeserializedPacketError { FailedFilter(#[from] PacketFilterFailure), } -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug, Eq)] pub struct ImmutableDeserializedPacket { original_packet: Packet, transaction: SanitizedVersionedTransaction, @@ -132,6 +132,13 @@ impl ImmutableDeserializedPacket { } } +// PartialEq MUST be consistent with PartialOrd and Ord +impl PartialEq for ImmutableDeserializedPacket { + fn eq(&self, other: &Self) -> bool { + self.compute_unit_price() == other.compute_unit_price() + } +} + impl PartialOrd for ImmutableDeserializedPacket { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other))