popstellar icon indicating copy to clipboard operation
popstellar copied to clipboard

Inconsistent usage of lao_id and election_id

Open lhmerino opened this issue 3 years ago • 2 comments

https://github.com/dedis/student_21_pop/blob/f09a88c3074cf2415215b77e1908845b5e981129/protocol/query/method/message/data/dataElectionSetup.json#L15

The LAO ID on this line is not required given that the creation of an election is sent to the lao channel. LAO ID shall still be included in election id hash.

lhmerino avatar Apr 28 '21 22:04 lhmerino

That's right, I guess its also not needed in the cast_vote and end?

Here is an overview of the fields in the different messages (based on the google doc):

object action id lao id name version created_at start_time end_time questions votes registered_votes
election setup X X X X X X X X
election cast_vote X (called election) X X X
election end X (called election) X X
election result X (only id and result)

Other points:

  • For consistency sake having the election id just called id instead of election in all election objects would be better, right? Since we know it belongs to an election based on the object
  • Does the election result not need an election id in order to match it?

Adalsteinnjons avatar May 05 '21 15:05 Adalsteinnjons

Renaming the id or election fields to election_id might make things clearer and more consistent.

From a functionality angle, cast_vote and end don't need to refer to a specific election_id because they're sent on a channel which already embeds the notion of election_id. However, from a security angle, embedding the election_id in them ensures that the messages cannot be reused in a separate election started at the same time. For the same reason, I would embed election_id in the result as well.

pierluca avatar May 26 '21 12:05 pierluca