feat(governance): add counted flag to proposal votes - #469
Closed
slowbackspace wants to merge 1 commit into
Closed
Conversation
The votes endpoints return every vote-cast transaction ever submitted
for a proposal, but the ledger keeps only the latest vote per voter
(upsert semantics) and drops a DRep's votes when the DRep deregisters,
so the response can diverge significantly from the ledger's current
vote state (queryLedgerState/governanceProposals in Ogmios).
Add a required boolean "counted" to each vote entry of
/governance/proposals/{tx_hash}/{cert_index}/votes indicating whether
the vote is still counted in the ledger's vote tally, reconstructed at
the current chain tip: true only for the voter's latest vote on the
proposal, and for DRep voters only if no deregistration follows the
vote (re-registration does not restore dropped votes).
Named "counted" rather than "active" because "active" already
means registered/not-expired for DReps elsewhere in the API (and was
deprecated there in 0.1.72 for its ambiguity).
Fixes #466
Contributor
Author
|
Opened in the wrong repo by mistake — the backend PR lives in blockfrost-backend-ryo. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a boolean
countedto each entry of/governance/proposals/{tx_hash}/{cert_index}/votesindicating whether the vote is still counted in the ledger's current vote tally (#466). The endpoint returns every vote ever cast, but the ledger keeps only the latest vote per voter and drops a DRep's votes on deregistration, so results could diverge significantly from Ogmios'queryLedgerState/governanceProposals.Semantics
counted = trueiff:tx_id), andThe dereg check is an index-only scan on the existing
bf_idx_drep_registration_hash_depositindex, evaluated only for returned rows.Validation (mainnet db-sync)
9b62b3c6...#0, 453 votes): 99 flagged uncounted — 36 superseded re-votes + 63 latest votes of since-deregistered DReps; all 7 CC votes stay countedNotes
Fixes #466