Repository navigation
feat: use the monotonic consumed cycles of deleted canisters - #11782
Merged
mraszyk merged 1 commit intoOct 8, 2026
Merged
Conversation
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]>
Contributor
There was a problem hiding this comment.
🟢 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.
|
✅ No security or compliance issues detected. Reviewed everything up to 174235a. Security Overview
Detected Code Changes
|
eichhorl
approved these changes
Oct 8, 2026
mraszyk
deleted the
mraszyk/deleted-canisters-monotonic-consumed-cycles
branch
October 8, 2026 07:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On canister deletion,
CanisterManager::delete_canisternow adds the canister'sCanisterMetrics::consumed_cycles_monotonic(instead of theconsumed_cyclesgauge) toSubnetMetrics::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