Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/concepts/chain-key-cryptography.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ The following master keys are deployed at the time of writing. The Network Nervo

Test keys are available for development and run on smaller subnets with lower signing costs. They should not be used for anything of value. Production keys run on high-replication subnets (34+ nodes) for stronger security guarantees. Each key is also reshared to a backup subnet for availability: if the signing subnet fails, the backup can take over without generating a new key.

For signing costs, see [Cycles costs](../references/cycles-costs.md).
For signing costs, see [Cycle costs](../references/cycle-costs.md).

## Supported chains

Expand Down
2 changes: 1 addition & 1 deletion docs/concepts/cycles.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ The tradeoff is that developers must forecast and fund usage upfront rather than
- [Cycles Management](../guides/canister-management/cycles-management.md): how to check balances, top up canisters, and set freezing thresholds
- [Calls with attached cycles](../guides/canister-calls/inter-canister-calls.md#calls-with-attached-cycles): attach cycles to an inter-canister call and use the proxy canister pattern for the CLI
- [Cycles ledger reference](../references/system-canisters.md#cycles-ledger): canister IDs, interface specification, and CMC integration
- [Cycles Costs Reference](../references/cycles-costs.md): exact cost tables for all operations
- [Cycle costs](../references/cycle-costs.md): exact cost tables for all operations
- [Canisters](./canisters.md): canisters as the paying entity for compute and storage

<!-- Upstream: informed by dfinity/portal docs/building-apps/essentials/gas-cost.mdx, docs/building-apps/getting-started/tokens-and-cycles.mdx; learn hub staging: canister-smart-contracts/cycles.md, canister-smart-contracts/cycles-ledger.md -->
4 changes: 2 additions & 2 deletions docs/concepts/https-outcalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ The cost depends on two factors:

If you omit `max_response_bytes`, the system assumes the maximum of 2 MB and charges accordingly: roughly 21.5 billion cycles on a 13-node subnet. Always set this to a reasonable upper bound for your expected response to avoid overpaying. Unused cycles are refunded.

For exact pricing formulas, see the [cycles costs reference](../references/cycles-costs.md).
For exact pricing formulas, see the [cycles costs reference](../references/cycle-costs.md).

## Limitations

Expand Down Expand Up @@ -110,5 +110,5 @@ One extension is under consideration that may affect architecture decisions:

- [HTTPS outcalls guide](../guides/backends/https-outcalls.md): practical how-to with code examples in Motoko and Rust
- [Chain Fusion: Ethereum integration](../guides/chain-fusion/ethereum.md): uses HTTPS outcalls via the EVM RPC canister
- [Cycles costs reference](../references/cycles-costs.md): detailed pricing formulas
- [Cycles costs reference](../references/cycle-costs.md): detailed pricing formulas
<!-- Upstream: informed by dfinity/portal docs/references/https-outcalls-how-it-works.mdx -->
4 changes: 2 additions & 2 deletions docs/guides/backends/https-outcalls.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ For reference, on a 13-node subnet:
- Per request byte: 5,200 cycles
- Per `max_response_bytes` byte: 10,400 cycles

See [Cycles costs](../../references/cycles-costs.md#https-outcalls) for the full pricing table.
See [Cycles costs](../../references/cycle-costs.md#https-outcalls) for the full pricing table.

## Limitations and pitfalls

Expand All @@ -166,6 +166,6 @@ Use the "Full example in ICP Ninja" links above to deploy and test directly in t
- [Management canister reference](../../references/management-canister.md#http_request): full `http_request` parameter reference including all fields
- [Exchange Rate Canister (XRC)](https://github.com/dfinity/exchange-rate-canister): a production service powered by HTTPS outcalls that fetches digital asset and fiat exchange rates
- [Chain Fusion: Ethereum](../chain-fusion/ethereum.md): the EVM RPC canister uses HTTPS outcalls under the hood
- [Cycles costs](../../references/cycles-costs.md#https-outcalls): outcall pricing details
- [Cycles costs](../../references/cycle-costs.md#https-outcalls): outcall pricing details

{/* Upstream: informed by dfinity/portal docs/building-apps/network-features/using-http/https-outcalls/; dfinity/examples send_http_get, send_http_post */}
4 changes: 2 additions & 2 deletions docs/guides/backends/timers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Timer tasks are added to the canister's input queue. If the canister or subnet i

The canister output queue is limited to 500 messages. This caps how many timers can fire in a single round. The CDK also enforces internal rate limits (250 concurrent timer calls globally, 5 per interval timer).

See [Cycles and costs](../../references/cycles-costs.md#cost-table) for current pricing.
See [Cycles and costs](../../references/cycle-costs.md#cost-table) for current pricing.

## Heartbeats (legacy)

Expand Down Expand Up @@ -279,6 +279,6 @@ For a complete working example with cycle tracking and multiple timers:

- [Canister lifecycle](../canister-management/lifecycle.md#what-happens-during-an-upgrade): init, pre/post-upgrade hooks
- [Timers (concept)](../../concepts/timers.md): how the IC protocol timer works
- [Cycles and costs](../../references/cycles-costs.md#cost-table): current pricing
- [Cycles and costs](../../references/cycle-costs.md#cost-table): current pricing

{/* Upstream: informed by dfinity/portal docs/building-apps/network-features/periodic-tasks-timers.mdx, docs/building-apps/network-features/time-and-timestamps.mdx, dfinity/cdk-rs ic-cdk-timers/src/lib.rs, and caffeinelabs/motoko-core src/Timer.mo */}
4 changes: 2 additions & 2 deletions docs/guides/canister-management/cycles-management.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ icp cycles balance -n ic
# Output: ~5T cycles
```

**Budget guidance:** Plan for 1–2T cycles per canister as a starting balance. A simple backend canister with moderate traffic costs roughly 0.1–0.5T cycles per month, though this varies with storage and call volume. See the [cycles costs reference](../../references/cycles-costs.md#cost-table) for per-operation pricing.
**Budget guidance:** Plan for 1–2T cycles per canister as a starting balance. A simple backend canister with moderate traffic costs roughly 0.1–0.5T cycles per month, though this varies with storage and call volume. See the [cycles costs reference](../../references/cycle-costs.md#cost-table) for per-operation pricing.

## Checking canister cycle balances

Expand Down Expand Up @@ -370,7 +370,7 @@ icp canister top-up backend --amount 1T -n ic

- [Canister settings](settings.md): Freezing threshold, memory allocation, compute allocation
- [Canister lifecycle](lifecycle.md): Create, install, upgrade, and delete canisters
- [Cycles costs reference](../../references/cycles-costs.md#cost-table): Exact cost tables per operation
- [Cycles costs reference](../../references/cycle-costs.md#cost-table): Exact cost tables per operation
- [Cycles](../../concepts/cycles.md): Why canisters pay for execution and how the cycles ledger works
- [Cycles ledger reference](../../references/system-canisters.md#cycles-ledger): Canister IDs and interface specification
- [Calls with attached cycles](../canister-calls/inter-canister-calls.md#calls-with-attached-cycles): attach cycles to an inter-canister call and accept them in the callee
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/canister-management/optimization.md
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ Most production canisters benefit from combining several techniques:
## Next steps

- [Large Wasm](large-wasm.md): when binary size exceeds the upload limit
- [Cycles costs](../../references/cycles-costs.md): how Wasm size and instruction count map to cycle charges
- [Cycles costs](../../references/cycle-costs.md): how Wasm size and instruction count map to cycle charges
- [Canister lifecycle](lifecycle.md): how optimized builds integrate with the icp-cli deploy workflow

<!-- Upstream: informed by dfinity/portal — docs/building-apps/advanced/optimize/rust.mdx; docs/building-apps/advanced/optimize/motoko.mdx -->
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/canister-management/settings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ settings:

A value of `50` means the canister gets 50% of an execution core and is scheduled at least every other round. A value of `100` means the canister runs every round.

Compute allocation incurs a rental fee based on time and allocation percentage, regardless of whether the canister actually executes. This increases idle [cycle](../../concepts/cycles.md) consumption. See [cycles costs](../../references/cycles-costs.md#compute-allocation) for pricing details.
Compute allocation incurs a rental fee based on time and allocation percentage, regardless of whether the canister actually executes. This increases idle [cycle](../../concepts/cycles.md) consumption. See [cycles costs](../../references/cycle-costs.md#compute-allocation) for pricing details.

### Memory allocation

Expand All @@ -90,7 +90,7 @@ Supported suffixes: `kb` (1,000), `kib` (1,024), `mb` (1,000,000), `mib` (1,048,

When set, the canister draws new Wasm and stable memory from the pre-allocated pool. If usage exceeds the allocation, additional memory is allocated on demand and may fail if the subnet is at capacity.

Like compute allocation, memory allocation incurs a rental fee based on time and allocated amount, regardless of actual usage. See [cycles costs](../../references/cycles-costs.md#storage-reservation) for pricing.
Like compute allocation, memory allocation incurs a rental fee based on time and allocated amount, regardless of actual usage. See [cycles costs](../../references/cycle-costs.md#storage-reservation) for pricing.

### Freezing threshold

Expand Down Expand Up @@ -454,7 +454,7 @@ How you configure controllers depends on the trust model for your canister:

- [Canister lifecycle](lifecycle.md): Create, deploy, upgrade, stop, and delete canisters.
- [Cycles management](cycles-management.md): Monitor and top up cycle balances.
- [Cycles costs reference](../../references/cycles-costs.md#compute-allocation): Pricing for compute and memory allocation.
- [Cycles costs reference](../../references/cycle-costs.md#compute-allocation): Pricing for compute and memory allocation.
- [Management canister reference](../../references/management-canister.md): Full interface specification.

{/* Upstream: informed by dfinity/portal (docs/building-apps/canister-management/settings.mdx, docs/building-apps/canister-management/control.mdx, docs/references/_attachments/ic.did (snapshot_visibility field); dfinity/icp-cli) docs/reference/canister-settings.md, docs/reference/cli.md; dfinity/icskills: skills/cycles-management/SKILL.md */}
4 changes: 2 additions & 2 deletions docs/guides/canister-management/subnet-selection.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ Subnets enforce a storage reservation policy above 750 GiB of total utilization.

If you expect your canister to use significant storage, check the current utilization of candidate subnets on the [ICP Dashboard](https://dashboard.internetcomputer.org/subnets) before deploying. Choosing a subnet with available headroom avoids unexpected reservation costs as your canister grows.

For details on storage costs and the reservation formula, see [Cycles costs](../../references/cycles-costs.md#storage-reservation).
For details on storage costs and the reservation formula, see [Cycles costs](../../references/cycle-costs.md#storage-reservation).

## Troubleshooting

Expand All @@ -152,7 +152,7 @@ Note that any canister ID change means losing access to any threshold signature

## Next steps

- [Cycles costs](../../references/cycles-costs.md#replication-factors): Cost tables and the subnet multiplier formula
- [Cycles costs](../../references/cycle-costs.md#replication-factors): Cost tables and the subnet multiplier formula
- [Subnet types reference](../../references/subnet-types.md): Full reference for all subnet types with node counts and properties
- [Canister snapshots](snapshots.md#example-transferring-state-between-canisters): Download/upload workflow for transferring state to another canister
- [Canister migration](canister-migration.md): Complete workflow for moving a canister to a different subnet, with or without preserving the canister ID
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/security/dos-prevention.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In a shared resource environment like the Internet Computer, multiple canisters
To mitigate the "noisy neighbor" issue, manage your canister's resource allocation effectively:
* **Memory allocation**: Memory can be reserved per canister by setting `memory_allocation`, ensuring that your canister can always allocate memory up to the requested `memory_allocation` and preventing other canisters from using up the subnet's available memory. Note that memory availability is not guaranteed beyond the memory allocation and thus monitoring actual memory usage against this value is important to avoid availability issues.
* **Compute reservation**: Similar to memory, computing power can also be reserved by setting `compute_allocation` to a value between 0 and 100, which denotes the percentage of one CPU core to be reserved for this canister. A value of 50 means that every 2 rounds, the canister will be scheduled to execute a message. This guarantees the minimal progress your canister can make, which protects against noisy neighbors. Both allocations are reserving resources for your canister on the subnet, which prevents the other canisters from using them. Hence, they come at a cost. Memory allocation is charged as if all that memory would be allocated. Compute allocation is currently charged at 10M cycles per percentage point.
Learn more about managing memory and compute resources in the [cycles costs reference](../../references/cycles-costs.md).
Learn more about managing memory and compute resources in the [cycles costs reference](../../references/cycle-costs.md).
* **Subnet and canister distribution**: Implement a smart canister deployment strategy by monitoring the load on subnets. You can choose to deploy new canisters on less busy subnets or adopt a multi-canister architecture that balances the load across subnets. Be mindful to minimize inter-subnet communication for canisters that frequently interact with each other. Additionally, avoid deploying to known high-traffic subnets where possible, though keep in mind that resource usage can change unexpectedly with new apps.

:::note
Expand All @@ -41,7 +41,7 @@ When the subnet grows above 750GiB, then the new reservation mechanism activates

### Security concern

Some calls (update or query) might be expensive in terms of the memory or cycles they consume. For example, any function using chain-key signing or HTTPS outcalls is relatively expensive. See the [cycles costs reference](../../references/cycles-costs.md) for pricing details and a full list of expensive call types.
Some calls (update or query) might be expensive in terms of the memory or cycles they consume. For example, any function using chain-key signing or HTTPS outcalls is relatively expensive. See the [cycles costs reference](../../references/cycle-costs.md) for pricing details and a full list of expensive call types.

An attacker will target expensive calls to drain the cycles balance or available memory quickly.

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/security/https-outcalls.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ See the [HTTPS outcalls guide](../backends/https-outcalls.md) for more details.

### Security concern

The [pricing](../../references/cycles-costs.md#https-outcalls) of HTTPS outcalls is determined by the size of the HTTP request and the maximal response size, among other variables. Thus, if big requests are made, this could quickly drain the canister's cycles balance. This can be risky in scenarios where HTTPS outcalls are triggered by user actions (rather than a heartbeat or timer invocation).
The [pricing](../../references/cycle-costs.md#https-outcalls) of HTTPS outcalls is determined by the size of the HTTP request and the maximal response size, among other variables. Thus, if big requests are made, this could quickly drain the canister's cycles balance. This can be risky in scenarios where HTTPS outcalls are triggered by user actions (rather than a heartbeat or timer invocation).

### Recommendation

Expand All @@ -80,7 +80,7 @@ When making an HTTPS outcall, it is possible (and highly recommended) to define

Finally, be aware that users may incur cycles costs for HTTPS outcalls in case these calls can be triggered by user actions.

See the [cycles costs reference](../../references/cycles-costs.md) for pricing details.
See the [cycles costs reference](../../references/cycle-costs.md) for pricing details.

## Perform input validation in HTTPS outcalls

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Cycles costs"
title: "Cycle costs"
description: "Exact cycle costs for compute, storage, HTTPS outcalls, signing, and canister operations"
sidebar:
order: 8
Expand Down Expand Up @@ -102,27 +102,6 @@ When a canister grows its memory (via `memory.grow`, `ic0.stable_grow()`, or Was

Reserved cycles are non-transferable. Controllers can disable reservation by setting `reserved_cycles_limit = 0`, but opted-out canisters cannot allocate new memory when subnet usage exceeds 750 GiB.

## Resource limits

| Limit | Value |
|-------|-------|
| Instructions per update call / heartbeat / timer | 40 billion |
| Instructions per query call | 5 billion |
| Instructions per canister install / upgrade | 300 billion |
| Instructions per `inspect_message` | 200 million |
| Max ingress message payload | 2 MiB |
| Max cross-subnet inter-canister message payload | 2 MiB |
| Max same-subnet inter-canister request payload | 10 MiB |
| Max response size (replicated execution) | 2 MiB |
| Max response size (query) | 3 MiB |
| Wasm heap memory per canister | 4 GiB (wasm32) / 6 GiB (wasm64) |
| Wasm stable memory per canister | 500 GiB |
| Subnet capacity (total memory) | 2 TiB |
| Wasm module total size | 100 MiB |
| Wasm code section size | 10 MiB |

<!-- Needs human verification: A dedicated canister resource limits page does not yet exist in this site. The table above is adapted from dfinity/portal docs/building-apps/canister-management/resource-limits.mdx. Add a link here once that page is created. -->

## Special features

Certain ICP features have additional cycle costs beyond the base execution and messaging fees:
Expand All @@ -139,5 +118,6 @@ Certain ICP features have additional cycle costs beyond the base execution and m
- [Cycles management](../guides/canister-management/cycles-management.md): Topping up and monitoring canister balances
- [Cycles](../concepts/cycles.md): Why canisters (not users) pay for execution
- [Subnet types](subnet-types.md): Cost multipliers per subnet type
- [Resource limits](resource-limits.md): Instruction limits, memory caps, and message size constraints

<!-- Upstream: informed by dfinity/portal docs/building-apps/essentials/gas-cost.mdx, docs/references/cycles-cost-formulas.mdx, docs/building-apps/canister-management/resource-limits.mdx -->
<!-- Upstream: informed by dfinity/portal docs/building-apps/essentials/gas-cost.mdx, docs/references/cycles-cost-formulas.mdx -->
Loading
Loading