sequentech / meta

Sequent Public Roadmap
GNU Affero General Public License v3.0
0 stars 0 forks source link

✨ Tally: Move publishing Insert Ballots tasks into a separate task #523

Open Findeton opened 5 months ago

Findeton commented 5 months ago

Preflight checklist

Suggestion

Currently, the endpoint /update-tally-ceremony is publishing the insert_ballots tasks that manage inserting the ballots into the correct immudb board. This can be problematic because it publishes one task for each contest. If there are 100 contests and publishing one task fails, at the moment the system won't recover from it.

Possible Implementation

Add a new tally session status: inserting ballots. It should go after "connected". There should be a new task insert_tally_ballots that

Tasks

# Tasks
- [ ] Add a new tally session status: inserting ballots. It should go after "connected".
- [ ] Create a new task `insert_tally_ballots` that publishes the `insert_ballots` tasks. `insert_tally_ballots` should be derived from the tally session state in the database and triggered from `process_board`.
- [ ] `insert_tally_ballots`should update the tally session logs.
- [ ] The `insert_ballots` tasks should use the lock mechanism used in `execute_tally_session`.
- [ ] The `insert_ballots` tasks should identify whether the ballots have already been inserted into the immudb board, by looking into the board.
- [ ] `insert_ballots`should update the tally session logs.
# Master PRs
- [ ] PR 1
edulix commented 1 month ago

@Findeton shouldn't insert ballots be actually before connected? this way, trustees could know which ballots are being tallied when inserting their keys.