I recently deleted my cycles wallet canister and several canisters controlled by it on mainnet. The deletion output confirmed a successful withdrawal (e.g., “Successfully withdrew 19487897969873 cycles”), but my cycles ledger balance shows 0.
When you delete a canister, its cycles likely go to the wallet canister. But you’ve deleted the wallet canister. Sounds like an edge case - likely a bug.
Could be an edge case. I had to add my principal as a controller to the wasm canisters as my wallet canister had run out of cycles. Not sure if that would be an issue or not but I deleted the canisters and the cycles were returned to the wallet successfully. I then stopped and deleted the wallet expecting the cycles to be returned to the ledger but no luck. Thanks for the response.
that’s what I am talking about, when you delete the canister, withdraws cycles to wallet canister by default but, you deleted the wallet canister, before you delete the canister either you had to migrate cycles to cycles ledger or you had to specify to which canister you would like to withdraw.
oh wait, now I understand why this might me edge case, when I say those, I was thinking about past years but now when I think about it maybe they updated dfx for delete function to withdraw and deposit them to cycles ledger by default. if this is true, the conflict might be something like this; since you had both cycles wallet and cycles ledger maybe when you run delete maybe dfx first reads your local json file to find canister ID and sends the cycles there. I’m mean new versions may cycles ledger aware but as fallback to wallet check. so perhabs since there was cycles wallet in your local config, dfx sent the cycles to your wallet canister ID instead ledger, even when you delete it. in short I might be wrong in my previous messages because I assumed that delete option doesn’t withdraw to cycles ledger but they might just didn’t update the docs.
Thanks. I am no expert but I know dfx deletes the network canister ids in the local dir when the network canister is deleted. Not sure what else it does. I am actually trying to migrate to icp-cli as it seems a bit more straight forward concerning cycles management. However it would be good to know how I messed up lol.
yeah but when you were trying to delete wallet canister, that wallet canister was still exist lol so probably dfx first read the wallet canister ID and did not fallback to migrate cycles ledger automatically since there was wallet canister there.
that sounds like a bug then. All I know is this from terminal: Successfully withdrew 19487897969873 cycles. Deleting canister lc52s-fyaaa-aaaan-qeida-cai, with canister_id lc52s-fyaaa-aaaan-qeida-cai
@uwxsgs is pretty much right with their assumptions. There is no automated way to switch between cycles wallet and cycles ledger. The manual steps listed here are the only way.
What happened is that first dfx checks if a wallet is configured. Since there is one, it will withdraw cycles to said wallet, and then delete the target canister. Since the wallet is the target, this essentially performed --non-withdrawal. The cycles are gone
That makes sense now. I forgot to make the deposit call after deleting the network canisters. Presumably then the wallet would have the cycles from the deleted canisters and I would be able to make the “deposit” call without it telling me that the wallet was out of cycles.