IntersectMBO / cardano-cli

This repository contains sources for the command-line interface (CLI) tool for interacting with the Cardano blockchain.
Apache License 2.0
39 stars 15 forks source link

[FR] - Include the amount of `actionDeposit` in the `query stake-address-info` #592

Open gitmachtl opened 8 months ago

gitmachtl commented 8 months ago

Because of this behavior (https://github.com/IntersectMBO/cardano-ledger/issues/4017), is it possible to add current governance action deposits as an extra value to the stake-address-info query?

It would avoid falling into the pit to retire a stakeaddress while an active governance proposal deposit is running.

Would it be possible to have a sum of all governance action deposits in the query output like:

[
    {
        "address": "stake_test1urqntq4wexjylnrdnp97qq79qkxxvrsa9lcnwr7ckjd6w0cr04y4p",
        "delegationDeposit": 2000000,
        "rewardAccountBalance": 4271752087,
        "stakeDelegation": "pool1rdaxrw3722f0x3nx4uam9u9c6dh9qqd2g83r2uyllf53qmmj5uu",
        "voteDelegation": "keyHash-8f4fefcf28017a57b41517a67d56ef4c0dc04181a11d35178dd53f4c",
        "actionDeposit": 1000000000
    }
]

Otherwise tools would need to always query twice to do a check if the stake-address hash is involved in any ongoing governance action deposits.

So similar with remaining rewards on a stake account, it would make it - at least via the used tools - impossible to retire a stakeaddress until also actions deposits were returned. To avoid loosing the deposit funds.

smelc commented 8 months ago

cc @CarlosLopezDeLara

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

gitmachtl commented 3 months ago

refresh

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 120 days.

smelc commented 3 weeks ago

@CarlosLopezDeLara> how one would obtain the value to put in actionDeposit? For example in terms of other existing queries/other commands?

CarlosLopezDeLara commented 3 weeks ago

@CarlosLopezDeLara> how one would obtain the value to put in actionDeposit? For example in terms of other existing queries/other commands?

@smelc it is:

cardano-cli query protocol-parameters | jq .govActionDeposit

smelc commented 3 weeks ago

@CarlosLopezDeLara> are you sure? If I understood @gitmachtl right, he wants the sum of deposits of governance actions done by the stake address being considered. It's not a static value.

gitmachtl commented 3 weeks ago

the idea was, that if you do a stake-address info query, you now get the information about a vote delegation. thats nice. but, in case of a stake-address deregistration and an open running action proposal linked to that stake address, it would be good to have those amounts summed up also in an entry of the stakeaddress-info. so you can easily check if there are still things "open", before you deregister/shutdown such a stake account.

otherwise, if you forget about an action and you deregister it, the 100kAda are going where? to the treasury?

we have mechanism on the chain that prevents us from shutting down a stake address if there is this a value in the rewards account. but if funds are locked up in a governance action, we don't have this safety mechanism.

same goes for an action proposal that is a treasury withdrawal to such a stake address. i guess it will not be a common thing that people forget about there used stake address in proposals, but still a bit strange that there is currently no safety guard. its one thing to loose 500ADA from a pool-deregistration if you retire the rewards address too fast, but loosing 100kAda or more via a treasury withdrawal is a whole different story imo.

so together with such a query, it would be nice to think about such a safety feature in the ledger itself. disabling a stakeaddress retirement if the address has rewards on it (like now), but in addition block the retirement if its used in an action proposal.

CarlosLopezDeLara commented 3 weeks ago

Apologies @smelc, I misunderstood the question.

To get the amount locked in action deposits one would need to query the gov-state and parse the active proposals.

Every proposal contains the fields: deposit return address and deposit

gitmachtl commented 3 weeks ago

Apologies @smelc, I misunderstood the question.

To get the amount locked in action deposits one would need to query the gov-state and parse the active proposals.

Every proposal contains the fields: deposit return address and deposit

i know, the question is, can we make it more convenient for people to do a global stake address info check also with that info.

and, can we introduce safety guards in the ledger?

smelc commented 3 weeks ago

and, can be introduce saftly guards in the ledger?

cc @lehins