Cycle burning mania!

The Graveyard Trespasser project is now open sourced and the token is blackholed. Review Github repo here - GitHub - xqft1/Graveyard-Trespasser

Question: I’m constantly monitoring the token cycle burns and they are burning at an insane rate!! 10’s of trillions a week just for one canister!! Anyone able to review the project on Github and tell me why it’s getting so hammered?

Cheers

Even though the canister is blackholed, I’m able to track existing cycles in the canister here - ICHouse - Dfinity ICP & Tokens Explorer

1 Like

Keen to see a reply on this for someone who knows…. Nuance is also chewing through cycles faster than we think is reasonable.

1 Like

With a brief skim, it looks like you are using heartbeat which are inherently expensive as they are tried to be executed every round. Even if the method doesn’t do much, the base-fee for inducting the heartbeat into the canister queue is 5M which might be the reason the canister is burning a lot of cycles. More reading here

Switching to a timers based approach with a higher interval should drop the cost significantly.

5 Likes

It’s blackholed so no updates. But thanks for the insight :slight_smile: lesson learned…

@vsekar here is the subnet page (that the token exists on) on the dashboard - https://dashboard.internetcomputer.org/network/subnets/qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe

indicates far fewer cycles are being burnt than im experiencing… what am i missing?

Not sure I fully appreciate how this work but checking your contract it seemed you burned about 3 billion cycles in 2 minutes.

11,667,091,153,567 − 11,663,871,057,680 = 3,220,095,887 cycles

At 3.50 USD per ICP
3,220,095,887 cycles ≈ 0.003220095887 ICP
0.003220095887 ICP × $3.50 ≈ $0.01127
Cost per minute: ≈ $0.00563 per minute

Over a day: $0.00563 × 1,440 ≈ $8.11 per day

Per month (30 days): ~$243

The subnet you referred to seems to be average current 130-150 million cycles burned per second
148,075,416 cycles/s × 60 = 8,884,524,960 cycles/min

https://dashboard.internetcomputer.org/network/subnets/qdvhd-os4o2-zzrdw-xrcv4-gljou-eztdp-bj326-e6jgr-tkhuc-ql6v2-yqe

(Happy to be corrected)

The number I reach per minute (with my crude approach), I think, points towards the subnet is burning perhaps an amount approximate to 2-3x your cycles.

The good news is that if price of ICP increases, cost of cycles decrease, vice versa.

2 Likes

@xqft1

As an unexpected result of parts of the code, I think (?) the app might now be a bit vulnerable to spam attacks from bots / scripts. A script calling your app would be inexpensive for the script, expensive for your application.

Although, perhaps I could be wrong about that

Would you allow me to test such thesis and increase the burn a bit?

ah… ok :confused: if anyone wants to donate cycles to top up the canister, i wouldnt say no :confused: im ICP poor - - - w5t77-riaaa-aaaaj-a2mda-cai

I would be delighted to take a look, I very rarely looked at Motoko code :man_mage:
It will be an interesting learning experience, even if I fail.

1 Like

@DeFiAdventures also, if you can find a way to protect token canisters that have already been blackholed, that would be awesome

I’ve never personally blackholed anything myself.

When looking at different DeFi design approaches, I haven’t found cases where blackholing seemed particularly suitable.

While it can help address certain decentralization and safety concerns, it also creates the opposite problem: you lose the ability to update the code or adapt to changes in the external systems you depend on.

The only viable alternative I can think of would be some form of governance mechanism, such as operating through the NNS :thinking: (“Rolling back the blockchain“)

decentralisation is the goal

1 Like

Yes.
But in some occasions, such as in this, it comes at disadvantage.

I wonder myself, thinking about better approaches to decentralizing apps, it’s not always as easy as ‘just launch it on the SNS‘.

The SNS is permissioned, and even if it was not, for DeFi you really wanna secure the users fund by even token distributions (not avoid hostile takeovers). Especially in this ecosystem :face_savoring_food:

I’m gonna walk the dog and get back to you later :dog_face:

1 Like

@xqft1
With two attempts I could not increase the burn of cycles materially from your wallet.
I think I will leave it at that, because I dont want to overdo things.

The application is by the way very cool!
I like how you used intercanister swaps with ICPSwap as part of your game engine.

@DeFiAdventures appreciate the kind words :slight_smile: hopefully the 10% fees can cover all these canister cycles

There seemed to be a decent margin when I had a look :slightly_smiling_face:

1 Like

+1 for switching to timers, I’m personally aware of thousands of $$$ of savings by making the switch. Blackholes can be migrated. Best of luck!

I sent you some cycles via icptopup.com :slight_smile:

3 Likes

woah. super generous of you mate. and that icptopup website is such a hot tip!! thank you

1 Like

Full disclosure, I’m a co-creator of the site, hahah. A few other notes for people who are curious about where their cycles are going:

This under-appreciated forum post from October seems to be the latest on cycles insights, which would provide much greater visibility into compute vs memory related burn, etc., or even function level granularity on cycles burn: Canister Insights – Richer Metrics for Developers

Also, for future, you could add your blackhole canisters to cycleops (before blackholing them) to get lots of observability metrics, like burn over time, memory usage, etc. Full disclosure again, I’m co-creator there, too. :slight_smile:

4 Likes

You reactivated after six months :nerd_face: :man_mage: to write your post?
That’s awfully nice of you :glowing_star: :santa_claus:

1 Like