IntersectMBO / govtool

🔩 GovTool and utilities monorepo.
https://gov.tools
Apache License 2.0
14 stars 9 forks source link

🐛 Internal Server Error on Previewing Some Treasury Withdrawal Proposals #1911

Closed kneerose closed 6 days ago

kneerose commented 2 months ago

Area

Other

Domain

dev-sanchogov.tools

Which wallet were you using?

No response

Context

Some treasury proposals are not viewable, and the same governance action ID appears multiple times. Navigating to the details page for these actions results in an error page.

Steps to reproduce

  1. Connect your wallet.
  2. Register as a dRep.
  3. Navigate to the governance actions.
  4. Paste d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d#0 into the search bar.
  5. Click on any listed governance action to view details.
  6. Observe the page.

https://www.loom.com/share/ee4e5fb86ad445d79321a3652af85aba?sid=188ca0a3-8388-4dbb-ae17-0d4f8e027461

Actual behavior

The details page for the treasury governance action with ID d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d#0 results in an internal server error. The JSON response contains multiple entries with the same ID:

  {
            "id": "247",
            "txHash": "d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d",
            "index": 0,
            "type": "TreasuryWithdrawals",
            "details": {
                "Amount": 50000000,
                "Reward Address": "stake_test1uq827mlrnza02v3fac4mngcfecjjfyngvf0vh3hy2zrae4sz0mj79"
            },
            "expiryDate": "2024-09-07T06:58:57.62332Z",
            "expiryEpochNo": 450,
            "createdDate": "2024-08-23T05:00:11Z",
            "createdEpochNo": 435,
            "url": "http://bit.ly/3QFMhii?index=0",
            "metadataHash": "1111111111111111111111111111111111111111111111111111111111111112",
            "protocolParams": null,
            "title": null,
            "abstract": null,
            "motivation": null,
            "rationale": null,
            "dRepYesVotes": 0,
            "dRepNoVotes": 702323928897,
            "dRepAbstainVotes": 4504163250230,
            "poolYesVotes": 0,
            "poolNoVotes": 0,
            "poolAbstainVotes": 0,
            "ccYesVotes": 0,
            "ccNoVotes": 0,
            "ccAbstainVotes": 0,
            "prevGovActionIndex": null,
            "prevGovActionTxHash": null
        },
        {
            "id": "247",
            "txHash": "d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d",
            "index": 0,
            "type": "TreasuryWithdrawals",
            "details": {
                "Amount": 40000000,
                "Reward Address": "stake_test1uz55q6nl8072h37l3ukq6ja7cxezhhpths65x8uvd9477fcmgle3c"
            },
            "expiryDate": "2024-09-07T06:58:57.62332Z",
            "expiryEpochNo": 450,
            "createdDate": "2024-08-23T05:00:11Z",
            "createdEpochNo": 435,
            "url": "http://bit.ly/3QFMhii?index=0",
            "metadataHash": "1111111111111111111111111111111111111111111111111111111111111112",
            "protocolParams": null,
            "title": null,
            "abstract": null,
            "motivation": null,
            "rationale": null,
            "dRepYesVotes": 0,
            "dRepNoVotes": 702323928897,
            "dRepAbstainVotes": 4504163250230,
            "poolYesVotes": 0,
            "poolNoVotes": 0,
            "poolAbstainVotes": 0,
            "ccYesVotes": 0,
            "ccNoVotes": 0,
            "ccAbstainVotes": 0,
            "prevGovActionIndex": null,
            "prevGovActionTxHash": null
        },
        {
            "id": "247",
            "txHash": "d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d",
            "index": 0,
            "type": "TreasuryWithdrawals",
            "details": {
                "Amount": 50000000,
                "Reward Address": "stake_test1uzjqvaxvpl3fu7w2795hm74qyvn397ygy7x27yw8zd3x58gnnuce6"
            },
            "expiryDate": "2024-09-07T06:58:57.62332Z",
            "expiryEpochNo": 450,
            "createdDate": "2024-08-23T05:00:11Z",
            "createdEpochNo": 435,
            "url": "http://bit.ly/3QFMhii?index=0",
            "metadataHash": "1111111111111111111111111111111111111111111111111111111111111112",
            "protocolParams": null,
            "title": null,
            "abstract": null,
            "motivation": null,
            "rationale": null,
            "dRepYesVotes": 0,
            "dRepNoVotes": 702323928897,
            "dRepAbstainVotes": 4504163250230,
            "poolYesVotes": 0,
            "poolNoVotes": 0,
            "poolAbstainVotes": 0,
            "ccYesVotes": 0,
            "ccNoVotes": 0,
            "ccAbstainVotes": 0,
            "prevGovActionIndex": null,
            "prevGovActionTxHash": null
        }

Navigating to the details page leads to the following error page:

image

Expected behavior

The governance action details page should correctly display all listed governance actions without errors.

bosko-m commented 2 months ago

This shouldnt be considered P0 for bootstrapping phase.

jdyczka commented 2 months ago

Actually, we cannot display those details, because we cannot get the data from the server. The response we get is Multiple proposal found for id: d7c0940e3f1279f2648eb849b38f9410ed620c452342ff59d79eb3ce92b1d64d#0. This should never happen.

So I'd say the solution would be to delete duplicate GAs. The question is how were they added and is it possible to add multiple GA with the same id through GovTool

Ryun1 commented 2 months ago

TxHash#TxIndex SHOULD be unique and should be caught at insert time into DBSync

bosko-m commented 6 days ago

So this is a DBSync issue.