fix(ic-cdk-timers): exponential backoff when cycles too low to schedule timer#709
Open
Rachit2323 wants to merge 5 commits intodfinity:mainfrom
Open
fix(ic-cdk-timers): exponential backoff when cycles too low to schedule timer#709Rachit2323 wants to merge 5 commits intodfinity:mainfrom
Rachit2323 wants to merge 5 commits intodfinity:mainfrom
Conversation
- StableIO::seek with SeekFrom::End/SeekFrom::Current used unchecked `as i64`/`as u64` casts that silently overflow for stable memories > ~9.2 PB or when seeking past i64/u64 boundaries, producing corrupt seek positions and potential silent data corruption. - StableIO::write computed `self.offset + buf.len() as u64` without overflow protection; now returns OutOfBounds on overflow. - global_timer instruction limit guard used `insn_count * 3` which overflows u64 if insn_count > u64::MAX / 3, causing the guard to under-count and the canister to exceed its instruction limit. - Removed stale TODO comment in ic-cdk-bindgen (type-selector config is already implemented); added cargo:warning when emit_bindgen returns unused types so users are notified via build output. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…le timer When liquid_cycles < cost, the timer was returned unchanged with its original timestamp (already in the past), causing ic0::global_timer_set to receive a past timestamp and fire canister_global_timer immediately every round. Fix: update timer.time = now + backoff before returning, with exponential backoff 5s -> 10s -> 20s -> 40s -> 60s capped. Backoff resets to 0 when the timer runs successfully. Fixes dfinity#706
|
Dear @Rachit2323, In order to potentially merge your code in this open-source repository and therefore proceed with your contribution, we need to have your approval on DFINITY's CLA. If you decide to agree with it, please visit this issue and read the instructions there. Once you have signed it, re-trigger the workflow on this PR to see if your code can be merged. — The DFINITY Foundation |
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.
Fixes #706