Closed kderme closed 1 month ago
Votes are also removed when dreps are retired
Votes aren't really removed when DReps unregister, they are just not counted any more. That being said, if a DRep is to re-register, all of the votes will still be there and will be counted. Albeit a DRep in such situation will loose all of the delegation, but that is very different from clearing out all the votes.
actions are dropped
Votes are indeed dropped when proposal itself is removed for whatever reason.
Dammit, I take it back. I totally forgot that we implemented cleanup of votes for DReps when they unregister. I was the one who implemented it too #4452 :man_facepalming: :sweat_smile:
A new vote can replace an older one if the voter and the action is the same. For tools like DBSync it would be very useful to have a way to mark invalidated votes, using a new event, which can look like
GovReplacedVote (TxId c) [(Voter c, GovActionId c)]
Votes are also removed when dreps are retired and actions are dropped. However these cases are more straight forward for db-sync to handle without events.
Initial requests https://github.com/IntersectMBO/cardano-db-sync/issues/1798
Alternative attemps db-sync could query its db, to verify that a vote is replaced. However this replicates the logic and forces disk queries for every vote. Using the event queries are necessary only for replacing votes. Using the ledger state without an event would be also hard, since db-sync doesn't have the state before each transaction.