-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Cap ingress induction debit for cleanup callback (#1777)
This fixes an edge case where in a cleanup callback that has produced some cycles balance change and when there's an accumulated ingress induction debit (due to ingress messages inducted while the cleanup callback was running DTS), the canister's balance might end up with an amount that wouldn't respect the canister's freezing threshold. Typically, for other message executions, the DTS execution would fail if there were concurrent cycles changes that could not be applied. The cleanup callback is a bit different and failing it is not a good option; canisters depend on it running successfully to perform critical tasks (such as releasing locks or reverting state changes in case something goes wrong). Therefore, we should ensure that the cleanup callback can still complete successfully. The solution (which the PR implements) is to cap the ingress induction debit by the amount removed from the cycles balance during execution. This way we can ensure completion of the cleanup callback at the expense of some cycles debit that is applied partially in some cases.
- Loading branch information
Showing
3 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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