Skip to content

Commit

Permalink
fix: Remove deprecated assert (#1528)
Browse files Browse the repository at this point in the history
This assert checks that there are no cases where the cycles balance of a
canister can be reduced during execution. However, since this assert
[was introduced about 2 years
ago](1d4692f),
new legitimate cases have been added, like when the storage reservation
mechanism kicks in or the canister calls `cycles_burn` API, that can
reduce the canister's cycle balance. The assert is therefore deprecated
and should be removed.

It replicates the
[change](5d1beac)
that has already been patched on all IC subnets as part of the security
hotfix that was performed over the last couple of days.
  • Loading branch information
dsarlis authored Sep 18, 2024
1 parent 41f6ce3 commit d373ce9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions rs/execution_environment/src/execution/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,12 +452,6 @@ impl ResponseHelper {
round.counters.charging_from_balance_error,
);

if let Some(state_changes) = &canister_state_changes {
let requested = state_changes.system_state_changes.removed_cycles();
// A cleanup callback cannot accept and send cycles.
assert_eq!(requested.get(), 0);
}

apply_canister_state_changes(
canister_state_changes,
self.canister.execution_state.as_mut().unwrap(),
Expand Down

0 comments on commit d373ce9

Please sign in to comment.