Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Constitutional Committee Votes not counted #1838

Closed
Ryun1 opened this issue Aug 27, 2024 · 2 comments · Fixed by #1857
Closed

🐛 Constitutional Committee Votes not counted #1838

Ryun1 opened this issue Aug 27, 2024 · 2 comments · Fixed by #1857
Assignees
Labels
🐛 Bug Something isn't working 🗳️ Voting Pillar

Comments

@Ryun1
Copy link
Member

Ryun1 commented Aug 27, 2024

Area

Voting Pillar

Domain

dev-sanchogov.tools

Which wallet were you using?

No response

Context

  • The constitutional committee votes are not counted and shown to user correctly
  • ALSO the ada symbol shouldnt be used for CC votes
  • ALSO im not sure why the anchor isnt recognised as valid, it looks good to me

Steps to reproduce

Go to;
https://dev-sanchonet.govtool.byron.network/governance_actions/9b00035645799eabacd86aae4de01d3f95e6e128d0dce2b230f5e2971c6aa0b0#0

Actual behavior

  • Constitutional votes are shown as 0 for any option
    image

  • This is untrue, as via my local node;

    "actionId": {
      "govActionIx": 0,
      "txId": "9b00035645799eabacd86aae4de01d3f95e6e128d0dce2b230f5e2971c6aa0b0"
    },
    "committeeVotes": {
      "keyHash-5aa349227e4068c85c03400396bcea13c7fd57d0ec78c604bc768fc5": "VoteNo",
      "scriptHash-309279bfdee8ab0a9ea24e09f63c4a3d0206e920b8216642fc3c2095": "VoteYes",
      "scriptHash-3328f427d48b6790ba22cad47ed430111afd1d2159ce7a1260a1f8ef": "VoteYes",
      "scriptHash-49fa008218cd619afe6aa8a1a93303f242440722b314f36bda2c2e23": "VoteYes"
    },

Expected behavior

GovTool shows the correct constitutional committee vote tallies

@Ryun1 Ryun1 added the 🐛 Bug Something isn't working label Aug 27, 2024
@Ryun1
Copy link
Member Author

Ryun1 commented Aug 27, 2024

Unfortunately I cannot test SPO votes, as there is not any SPO votes on SanchoNet atm

@MSzalowski
Copy link
Contributor

For the provided proposal there are indeed votes from constitutional committee:

select * from voting_procedure where gov_action_proposal_id=244;
 id  | tx_id | index | gov_action_proposal_id |       voter_role        | drep_voter | pool_voter |  vote   | voting_anchor_id | committee_voter | invalid 
-----+-------+-------+------------------------+-------------------------+------------+------------+---------+------------------+-----------------+---------
 500 | 22367 |     0 |                    244 | DRep                    |          3 |            | Yes     |                  |                 |        
 510 | 22926 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |             1776 |             108 |        
 511 | 22948 |     0 |                    244 | DRep                    |         11 |            | Yes     |                  |                 |        
 512 | 22978 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |                  |              69 |        
 513 | 22991 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |                6 |               9 |        
 514 | 22992 |     0 |                    244 | DRep                    |         12 |            | Yes     |                  |                 |        
 515 | 22994 |     0 |                    244 | DRep                    |         15 |            | Yes     |                  |                 |        
 521 | 23237 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |             2050 |             137 |        
 525 | 23376 |     0 |                    244 | DRep                    |        168 |            | Yes     |                  |                 |        
 526 | 23377 |     0 |                    244 | DRep                    |         17 |            | Yes     |                  |                 |        
 528 | 23499 |     0 |                    244 | ConstitutionalCommittee |            |            | No      |                  |              69 |        
 529 | 23534 |     0 |                    244 | ConstitutionalCommittee |            |            | No      |                  |              69 |        
 530 | 23535 |     0 |                    244 | ConstitutionalCommittee |            |            | Abstain |                  |              69 |        
 531 | 23536 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |                  |              69 |        
 532 | 23552 |     0 |                    244 | ConstitutionalCommittee |            |            | Yes     |                  |             140 |      

But the amount in drep_distr table for such votes is missing:

WITH LatestDrepDistr AS (
SELECT *, ROW_NUMBER() OVER (PARTITION BY hash_id ORDER BY epoch_no DESC) as rn FROM drep_distr
)
SELECT committee_voter, amount FROM gov_action_proposal LEFT JOIN voting_procedure ON voting_procedure.gov_action_proposal_id = gov_action_proposal.id LEFT JOIN LatestDrepDistr ldd_cc ON ldd_cc.hash_id = voting_procedure.committee_voter AND ldd_cc.rn=1 WHERE gov_action_proposal.id=244;
 committee_voter | amount 
-----------------+--------
                 |       
             108 |       
                 |       
              69 |       
               9 |       
                 |       
                 |       
             137 |       
                 |       
                 |       
              69 |       
              69 |       
              69 |       
              69 |       
             140 |       
(15 rows)

@MSzalowski MSzalowski linked a pull request Aug 28, 2024 that will close this issue
5 tasks
MSzalowski added a commit that referenced this issue Aug 29, 2024
…mmittee-votes-not-counted

fix(#1838): fix counting CC and SPO votes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working 🗳️ Voting Pillar
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants