Skip to content

feat: use the monotonic consumed cycles of deleted canisters - #11782

Merged
mraszyk merged 1 commit into
masterfrom
mraszyk/deleted-canisters-monotonic-consumed-cycles
Oct 8, 2026
Merged

mraszyk merged 1 commit into
masterfrom
mraszyk/deleted-canisters-monotonic-consumed-cycles

Conversation

@mraszyk

@mraszyk mraszyk commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

On canister deletion, CanisterManager::delete_canister now adds the canister's CanisterMetrics::consumed_cycles_monotonic (instead of the consumed_cycles gauge) to SubnetMetrics::consumed_cycles_by_deleted_canisters. This matches the per-use-case consumption, which is already taken from the monotonic map (#11776).

The monotonic total has been backfilled for all canisters (#11490). A stopped canister has no outstanding prepayments, so its gauge equals its monotonic counterpart.

🤖 Generated with Claude Code

On canister deletion, `CanisterManager::delete_canister` now adds the
canister's `CanisterMetrics::consumed_cycles_monotonic` (instead of the
`consumed_cycles` gauge) to `SubnetMetrics::consumed_cycles_by_deleted_canisters`,
in line with the per-use-case consumption that is already taken from the
monotonic map (#11776).

The monotonic total has been backfilled for all canisters (#11490). A
stopped canister has no outstanding prepayments, so for it the gauge equals
its monotonic counterpart.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted change is consistent with existing monotonic accounting and stopped-canister invariants.

0 open findings

What changed in this PR

Updates canister deletion accounting to use monotonic consumed cycles, aligning it with per-use-case metrics.

Changes:

  • Uses consumed_cycles_monotonic() when transferring deleted-canister consumption to subnet metrics.
File Description
rs/​execution_environment/​src/​canister_manager.rs Switches deleted-canister cycle accounting to the monotonic total.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mraszyk
mraszyk marked this pull request as ready for review October 8, 2026 06:18
@mraszyk
mraszyk requested a review from a team as a code owner October 8, 2026 06:18
@zeropath-ai

zeropath-ai Bot commented Oct 8, 2026

Copy link
Copy Markdown

✅ No security or compliance issues detected. Reviewed everything up to 174235a.

Security Overview
Detected Code Changes
Change Type Relevant files
Bug Fix ► rs/execution_environment/src/canister_manager.rs
     consumed_cycles() replaced with consumed_cycles_monotonic() in canister_metrics() call

@mraszyk
mraszyk added this pull request to the merge queue Oct 8, 2026
Merged via the queue into master with commit d631361 Oct 8, 2026
44 checks passed
@mraszyk
mraszyk deleted the mraszyk/deleted-canisters-monotonic-consumed-cycles branch October 8, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants