Repository navigation
fix(id): restore Committed-arm sequence succession uses checked_add (#8370) - #8380
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 33 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
state: parked Task 14804 (issue #8370): fix opened as PR #8380 (branch queue/14804-8370-checked-add, +53/-1). The restore Committed-arm succession predicate now uses checked_add, with regression test restore_committed_sequence_does_not_wrap_at_u64_max. Local verification on the laptop on this head: |
Summary
Fixes #8370 (gap found by the #4001 closing audit, design #4000 decision 2).
WorldCore::restore_inner'sJournalEntry::Committedarm inpkgs/id/src/world/core.rswas the remaining succession predicate usingsaturating_add: atcore.sequence == u64::MAXthe saturated successor equals the current sequence, so a committed event with sequenceMAXpassed the "advance by one" check without advancing — and repeatedMAXevents would each pass it again during replay.core.sequence.checked_add(1) == Some(event.sequence), the shape the checkpoint-part predicate in the same file already uses.restore_committed_sequence_does_not_wrap_at_u64_max(world/tests.rs), mirroringrestore_checkpoint_sequence_does_not_wrap_at_u64_max: after a checkpoint atu64::MAX, a committed event with sequenceMAXis refused with the "journal sequence jumps" error.Verification
cargo test --lib -- restore_inpkgs/idon the laptop, on this head: 41 passed, 0 failed (lib) — including the new test and the existing checkpoint boundary test.Task 14804, lane code-g.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.