node icon indicating copy to clipboard operation
node copied to clipboard

[BUG] withdrawal TX occurs every 10m despite minimum-balance is back above the minimum-balance (10 AKT)

Open arno01 opened this issue 3 years ago • 4 comments

Yet to be confirmed but this is what I've been observing earlier today when setting mine to 24h instead of 24h0m0s.

Setting withdrawalperiod=24h via Helm (either in the values.yaml or on the cli via --set ..)

gets into the Pod as expected => OK

 root@node1:~# kubectl -n akash-services exec -ti $(kubectl -n akash-services get pods -l app=akash-provider --output jsonpath='{.items[0].metadata.name}') -- env | grep -E 'AKASH_WITH'
 AKASH_WITHDRAWAL_PERIOD=24h

However, what I've noticed is this:

 AKASH_WITHDRAWAL_PERIOD=24h     => withdrawal is happening every 10 minutes !
 AKASH_WITHDRAWAL_PERIOD=24h0m0s => withdrawal is happening every 24 hours as expected

Got drained quit a few of AKT's since yesterday..

 root@node1:~# echo "$(echo '"height","code","timestamp","tx","fee","type"'; kubectl -n akash-services logs $(kubectl -n akash-services get pods -l app=akash-provider --output jsonpath='{.items[0].metadata.name}') | grep 'txhash' | grep -Ewo '[0-9A-F]{64}\b' | uniq | while read TX; do akash query tx $TX -o json; done | jq -r '[ .height, .code, .timestamp, .txhash,  (.tx | (.auth_info.fee.amount[0].amount|tonumber / pow(10; 6)), (.body.messages[] | ."@type")) ] | @csv')" | column -t -s ","
 
 "height"   "code"  "timestamp"             "tx"                                                                "fee"     "type"
 ...
 ...
 ...
 "5788554"  0       "2022-05-08T09:12:26Z"  "84FAD9ED1EB18169338E77735A9B97781DA3F168CB966627F04CB6CDB2DF56F1"  0.003653  "/akash.market.v1beta2.MsgWithdrawLease"
 "5788554"  0       "2022-05-08T09:12:26Z"  "64B649D56B2CB6A5F0FC13B0B6FAE46A10BD232223EFB8DA9797D8CADC4D11F0"  0.003667  "/akash.market.v1beta2.MsgWithdrawLease"
 "5788654"  0       "2022-05-08T09:22:28Z"  "57C9175ACD66714262BD2E8E5BD0F2EA56F1C6E79F96198A67E1F5951950483F"  0.003653  "/akash.market.v1beta2.MsgWithdrawLease"
 "5788654"  0       "2022-05-08T09:22:28Z"  "7B887564D94916B1086F931AE443CE4F3439386AA7523F96338834D679394990"  0.003667  "/akash.market.v1beta2.MsgWithdrawLease"
 "5788754"  0       "2022-05-08T09:32:29Z"  "03357EA8119C85053FEE7F6F2F287BF4FE862174ED001E8CE3F05287C35CA171"  0.003653  "/akash.market.v1beta2.MsgWithdrawLease"
 "5788754"  0       "2022-05-08T09:32:29Z"  "81166BEF9C6406A5EF059B9484D518ED403022AC638EA0BCCF93224CEEB0CD5A"  0.003667  "/akash.market.v1beta2.MsgWithdrawLease"

so am now running helm-charts with --set withdrawalperiod=24h0m0s

just like suggested here:

 $ akash provider run --help |grep withdr
       --withdrawal-period duration                  period at which withdrawals are made from the escrow accounts (default 24h0m0s)

am not getting drained every 10 mins after that.

arno01 avatar May 08 '22 13:05 arno01

Have just launched it with 24h again and cannot see the same behavior.

I remember I've seen less than 10 AKT balance on my provider, so I think it has something to do with the minimum balance (10 AKT default) parameter -- most likely when the balance goes below that, it starts withdrawing the lease every 10 mins -- yet to be confirmed:

$ akash provider run --help |grep withdr
      --minimum-balance uint                        minimum account balance at which withdrawal is started (default 10000000)

arno01 avatar May 08 '22 18:05 arno01

Balance is ~49 AKT, though:

I[2022-05-12|14:58:13.939] balance below target amount, withdrawing now module=provider-service cmp=balance-checker
I[2022-05-12|15:08:13.940] balance below target amount, withdrawing now module=provider-service cmp=balance-checker
I[2022-05-12|15:18:13.941] balance below target amount, withdrawing now module=provider-service cmp=balance-checker
I[2022-05-12|15:28:13.941] balance below target amount, withdrawing now module=provider-service cmp=balance-checker

Confirmed to be a bug here https://github.com/ovrclk/akash/blob/da9659ebba788974cb37e60f0ecba2f5056acde9/provider/balance_checker.go#L135 https://github.com/ovrclk/akash/pull/1576/files#r871518811

arno01 avatar May 12 '22 15:05 arno01

Greetings, seems I encountered same issue on docker version

balance below target amount, withdrawing now module=provider-service cmp=balance-checke

https://github.com/orgs/ovrclk/packages/container/akash/22445711?tag=0.16.4-rc2

may I know it is fixed on 0.16.4-rc2? or is my config issue..?

Tried both but seems still try to withdraw every 10mins when my provider is below 10atk (values.yml using in helm deploy)

#withdrawalperiod: "24h0m0s"
withdrawalperiod: "60m0s"

root@akash-provider-6bfcc8cb5b-d4zg5:/# env|grep -i with 
AKASH_WITHDRAWAL_PERIOD=60m0s
root@akash-provider-6bfcc8cb5b-d4zg5:/# akash version
v0.16.4-rc2

sadfroghk avatar May 30 '22 12:05 sadfroghk

@troian Is this resolved now?

tidrolpolelsef avatar Jul 12 '22 17:07 tidrolpolelsef