Lost ICP trying to top-up-canister

I recently lost 0.36571336 ICP while trying to top-up a canister. The value apparently just desapeared. Will I eventually be refunded?

These kind of errors are unacceptable. Not enough balance should result in no transaction, rather than a failed stolen transaction.

I have also noticed that when I check my cycles balance it is slowly reducing even though no deploy was done. What does that mean? Where are these cycles going?

Below the steps I followed,

xyz@pc:~/app$ dfx ledger --network ic balance

0.30010000 ICP

xyz@pc:~/app$ dfx ledger --network ic top-up --amount 0.30010000

The Replica returned an error: code 5, message: “Canister trapped explicitly: Panicked at ‘You have tried to spend more than the balance of your account’, rosetta-api/ledger_canister/src/lib.rs:300:13”

xyz@pc:~/app$ dfx ledger --network ic top-up --amount 0.30000000

Transfer sent at BlockHeight:

The Replica returned an error: code 5, message: “Canister trapped explicitly: Panicked at ‘You tried to withdraw funds from empty account ’, rosetta-api/ledger_canister/src/lib.rs:296:25”

xyz@pc:~/app$ dfx ledger --network ic balance

0.00000000 ICP

xyz@pc:~/app$ dfx wallet --network ic balance

2184640807279 cycles.

xyz@pc:~/app$ dfx ledger --network ic balance

0.00000000 ICP

xyz@pc:~/app$ dfx wallet --network ic balance

2184640687533 cycles.

xyz@pc:~/app$ dfx ledger --network ic balance

0.00000000 ICP

xyz@pc:~/app$ dfx wallet --network ic balance

2184640622217 cycles.

xyz@pc:~/app$ dfx wallet --network ic balance

2184640279308 cycles.

xyz@pc:~/app$ dfx ledger --network ic balance

0.00000000 ICP

As per chat in discord, the issue is that there wasn’t enough to cover the fee for the notify transaction (which is where the minting occurs). The solution is to run:
dfx ledger --network ic notify <block height> <canister principal>
You can get the block height from the output on the command line when you tried to mint the cycles, or from looking up the tx on ic.rocks.

You can also top up from stoicwallet.com as well (shameless plug)

4 Likes

That’s right – topping up involves two calls to the ledger (a transfer and a notify) and you need to have the fees for those for top-up to succeed. If the transfer succeeds, but the notify fails you can call notify again (but you would need the fee for this call).

Regarding cycle consumption: canisters pay for their storage and a charge is levied every round and I think this is the behavior you see (notice that this is independent of whether there are calls to the canister or not).

2 Likes

Thanks for the help guys! Specially @stephenandrews who was really quick in addressing my doubt in discord.

Also thanks @bogwar for further explanation on cycles consumption. I’m still trying to figure out how long does a static website stays available tough, with around… U$5 (~2T cycles, today).

1 SDR = $1.439670 4 you should have at least 3T for $5.

1 Like

your wallet balance(as your cycles) is reducing from 2184640807279 to 2184640687533, what your action is just query. What is the disappeared cycles paying for? as said here:
https://www.reddit.com/r/dfinity/comments/nerppg/ama_we_are_manu_paul_and_diego_we_have_worked/h02mgkg?utm_source=share&utm_medium=web2x&context=3

Hi. Currently query calls are “free”. We do rate limit them though so over a period of time, there is only so many instructions that a given canister can consume to serve queries. We also have boundary nodes which restrict how many requests can hit a given node on the IC. This means two things:

  • There are no fees for processing queries at the moment.
  • It is possible that malicious users use up all your query budget for this time period and your honest users have to wait for the next time period to get their queries answered.
1 Like

During our tests we also noticed that on average cycles wallet uses ~170000 (170K) cycles per minute.

But we also discovered that after we created second canister and deployed it - wallet started to use ~1500000000 (1.5B) cycles per minute! This period lasted about an hour. Then again returned to ~170K

@bogwar @claudio please comment if you can

1 Like