# Cycle cost to pass cycles

**URL:** <https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695>\
**Category:** Language Support\
**Created:** [November 19, 2022, 3:54pm UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695 "2022-11-19T15:54:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [November 19, 2022, 3:54pm UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/1 "2022-11-19T15:54:14Z")

</div>

Is there a significant cycle cost to pass cycles to another canister?

Or put another way, would it be better to pass cycles with every call, or to do one top up call? How much of a difference in cycles would this be?

---

<div class="post-metadata">

**Author:** ![berestovskyy](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/berestovskyy/32/3989_2.png) [@berestovskyy](https://forum.dfinity.org/u/berestovskyy)\
**Post date:** [November 21, 2022, 11:03am UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/2 "2022-11-21T11:03:17Z")

</div>

Short answer: there are no additional costs, you can send cycles with every single call for free.

Long one: if canister A calls canister B, the cost of the. call is 590K cycles to execute the update on canister B side and 590K to execute response on canister A side + number of instructions executed.

Adding cycles to the call has no provisions or whatever, and it’s guaranteed to be either fully or partially accepted by canister B, or returned back to canister A.

Links:

1. [Computation and Storage Costs on IC](https://internetcomputer.org/docs/current/developer-docs/deploy/computation-and-storage-costs/)
2. [Example Cycles Flow](https://wiki.internetcomputer.org/wiki/Comparing_Canister_Cycles_vs_Performance_Counter) between canister A and B

---

<div class="post-metadata">

**Author:** ![justmythoughts](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/justmythoughts/32/5226_2.png) [@justmythoughts](https://forum.dfinity.org/u/justmythoughts)\
**Post date:** [November 21, 2022, 12:54pm UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/3 "2022-11-21T12:54:02Z")

</div>

> [@berestovskyy](#):
>
> Long one: if canister A calls canister B, the cost of the. call is 590K cycles to execute the update on canister B side and 590K to execute response on canister A side + number of instructions executed.

What about the 260K for the Xnet call? (from [https://internetcomputer.org/docs/current/developer-docs/deploy/computation-and-storage-costs/](https://internetcomputer.org/docs/current/developer-docs/deploy/computation-and-storage-costs/))

---

<div class="post-metadata">

**Author:** ![berestovskyy](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/berestovskyy/32/3989_2.png) [@berestovskyy](https://forum.dfinity.org/u/berestovskyy)\
**Post date:** [November 21, 2022, 1:09pm UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/4 "2022-11-21T13:09:31Z")

</div>

Sure, for cross-net calls there are additional charges per call and per byte. But anyway, there are no additional charges for adding cycles to each such a call.

---

<div class="post-metadata">

**Author:** ![Iceypee](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/iceypee/32/5362_2.png) [@Iceypee](https://forum.dfinity.org/u/Iceypee)\
**Post date:** [July 8, 2024, 12:46am UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/5 "2024-07-08T00:46:06Z")

</div>

Are you saying this library here is free to call add cycles by a calling canister?

How about accept? That single call is free?

 ![image](https://us1.discourse-cdn.com/flex023/uploads/dfn/original/3X/3/7/37b80c7f0222224fd9d8e94f6b8cdd03199864cc.png)

Now one more thing. If I call a canister without cycles and it was suppose to run out of cycles lets say three lines of code down the call. If i call accept cycles two lines up will i be safe?

> Ie.  
> without cycles send  
> func something(){  
> do something1()  
> do something 2()  
> //runs out of cycles here  
> do something 3()  
> }

And if i do it again with

> func something(){  
> do something1()  
> experimentalCycles.Accept(enough for full call)  
> do something 2()  
> //Am i safe here or do the cycles get processed after?  
> do something 3()  
> }

How about for this case where the call wouldn’t even have gone through. Would calling accept on the first line save it??  
Ie.  
without cycles send

> //out of cycles error would here occured ran out before even getting into something somehow  
> func somethingagain( ){  
> do something1()  
> do something 2()  
> do something 3()  
> }

> func somethingagain(){  
> //am i safe here?  
> experimentalCycles.Accept(enough for full call)  
> do something1()  
> do something 2()  
> do something 3()  
> }

---

<div class="post-metadata">

**Author:** ![skilesare](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/skilesare/32/5609_2.png) [@skilesare](https://forum.dfinity.org/u/skilesare)\
**Post date:** [July 8, 2024, 2:13am UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/6 "2024-07-08T02:13:24Z")

</div>

Accepting the cycles doesn’t do anything to change the instruction limit of a single call. It just lets you accept the cycles and add them to your over-all cycle balance.

---

<div class="post-metadata">

**Author:** ![berestovskyy](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/berestovskyy/32/3989_2.png) [@berestovskyy](https://forum.dfinity.org/u/berestovskyy)\
**Post date:** [July 8, 2024, 7:38am UTC](https://forum.dfinity.org/t/cycle-cost-to-pass-cycles/16695/7 "2024-07-08T07:38:44Z")

</div>

> [@Iceypee](#):
>
> Are you saying this library here is free to call add cycles by a calling canister?  
> How about accept? That single call is free?

Technically, there is a small fee associated with the execution, i.e. the calling canister has to add the cycles. This adds a slight overhead for both the calling and the called canister.

I agree with Austin’s point regarding the one more thing, assuming there’s a single message execution, i.e. there are no nested calls in `do something N()` functions.

If there are nested calls, accepting the cycles earlier might make a difference.
