IntersectMBO / ouroboros-consensus

Implementation of a Consensus Layer for the Ouroboros family of protocols
https://ouroboros-consensus.cardano.intersectmbo.org
Apache License 2.0
31 stars 22 forks source link

Delete `Ord` instance for `Point` #712

Open edsko opened 4 years ago

edsko commented 4 years ago

Points are not totally ordered, and so the Ord instance is misleading (and has been the cause of various bugs). For the case where we store Points in a Map or Set, we should introduce something like

newtype WithArtificialOrdering a = WithArtificialOrdering { 
      unArtificialOrdering :: a 
    }

instance Ord (WithArtificialOrdering (Point blk)) where 
  ..
edsko commented 4 years ago

Although this is technical debt, marking this as medium priority because this Ord instance has been the cause of plenty of bugs.

edsko commented 4 years ago

The same goes for RealPoint.