akash-network / support

Akash Support and Issue Tracking
5 stars 4 forks source link

Feature request: add ability to query paused deployments #45

Open arno01 opened 2 years ago

arno01 commented 2 years ago

akash query deployment list is taking only active/closed --state.

I suggest adding paused state as well.

I'm currently able to get it manually with jq:

$ akash query deployment list --page 1 --limit 10000 --state active -o json | jq -r '.deployments[] | select(.groups[].state == "paused") | [ (.deployment | "block:"+.created_at, (.deployment_id | .owner, .dseq), .state), (.escrow_account | "escrowed:"+.balance.amount, "spent:"+.transferred.amount, .state), .groups[].group_spec.name, .groups[].state] | @csv' | column -s"," -t  |wc -l
112

Remove |wc -l to see the actual list of paused deployments.

There is 683.528593 AKT currently locked up as a collateral on these "paused" deployments:

$ akash query deployment list --page 1 --limit 10000 --state active -o json | jq -r '([.deployments[] | select(.groups[].state == "paused") | .escrow_account.balance.amount|tonumber] | add) / pow(10;6)'
683.528593

So having easy means to query that might help some folks unlocking their AKT's by closing their active but paused deployments.

To reproduce the "paused" deployment simply deploy it and then close it from the provider side using this command:

akash tx market bid close --chain-id akashnet-2 --owner <akash1...> --dseq 4371800 --gseq 1 --oseq 1 --from default --keyring-backend file --gas-prices="0.025uakt" --gas="auto" --gas-adjustment=1.3

And am also wondering if we could somehow deliver a message to people with these paused deployments so they can get their collateral back.

arno01 commented 2 years ago

I'm also curious whether it's possible to really close-close the deployment with the provider's key? Probably not.

Why?

I see the use-case behind that is when I want to migrate my provider, I would issue bid close to all active deployments. Users might not notice that and have their collateral stuck in those "paused" deployments.

troian commented 2 years ago

Deployment can be closed with the owner key only. The provider can only close the lease.

Tho with a new AuthZ there might be an option to delegate deployment close to another key but there is no planning if it gonna be implemented.

boz commented 2 years ago

Deployment objects are never in state paused, but deployment groups are. It looks like we can't query for a list of groups, tho. Couple things we could do:

  1. Add --group-state flag to query deployment list that filters deployment by the state of its groups.
  2. Add query deployment group list with a --state filter.

At some point we can do an upgrade that moves orphaned escrow funds to the original account or the community fund or something.

arno01 commented 2 years ago

At some point we can do an upgrade that moves orphaned escrow funds to the original account or the community fund or something.

That sounds like a great idea! Could also leverage the Governance vote :-)