omnipaxos icon indicating copy to clipboard operation
omnipaxos copied to clipboard

read_decided_suffix unnecessary LogEntry wrapper

Open kevin-harrison opened this issue 1 year ago • 1 comments

Right now when a user calls Omnipaxos::read_decided_suffix() they receive a LogEntry struct which wraps an entry in order to show if the entry is decided or not. Seeing as it will always be decided this is unnecessary. We can simply return an Entry instead.

kevin-harrison avatar Jun 15 '23 10:06 kevin-harrison

On second thought this isn't possible, because read_decided_suffix() needs to return more than just an Entry type since it can return StopSign and Compacted types. Therefore, we need a enum such as LogEntry to wrap the possible return types. It is still awkward here for users to have to pattern match on LogEntry::Undecided(Entry). We could return a DecidedLogEntry enum which removes this awkwardness at the cost of most more complexity.

kevin-harrison avatar Jun 15 '23 14:06 kevin-harrison