Skip to content

⚡ Bolt: Index replay nonce expirations - #12253

Merged
dezren39 merged 1 commit into
mainfrom
queue/bolt-replay-guard-20922
Nov 22, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/bolt-replay-guard-20922

Conversation

@dezren39

@dezren39 dezren39 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

ReplayGuard::accept now expires replay entries from a min-heap and checks each key's allowance through a counter:

 on(accept)
-  scan all replay entries to prune expired nonces
-  scan all replay entries again to count this key's nonces
+  pop only expired heap entries
+  read this key's count in O(1)
   record nonce in map, expiry heap, and key counter

Adds a regression test that confirms an expired nonce refills its key's allowance. Refs #12249.

Evidence

  • Before: cargo test -p id-directory — 271 passed. For 4,096 accepts with no expirations, the old prune and per-key count each traversed the map on every accept: about 16,781,312 map-entry visits (two times 0 + ... + 4,095).
  • After: cargo test -p id-directory — 271 passed, including expired_replay_entries_refill_the_key_allowance. The new path uses a key counter lookup and heap insertion; insertion is O(log N), at most about 49,152 heap comparisons over those 4,096 accepts. These are operation-count estimates, not wall-clock benchmark results.
  • rustfmt --edition 2024 --check crates/id-directory/src/directory_auth.rs and git diff --check passed.
  • Clippy could not complete because existing artifacts in the shared and fresh target directories were compiled with Rust 1.99.0, conflicting with the current Rust 1.99.1 (E0514). Workspace-wide cargo fmt --all -- --check also reports unrelated existing formatting differences in id-sync and id-worlds.

Merge Danger

Door: Two-way; the change can be reverted without data migration.

Blast Radius: Narrow — in-memory replay protection for signed requests.


Show it working
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 21, 2026 14:25
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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 6 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 35cac35f-1188-4fb8-9151-45d6c43959ae
Commits

Reviewing files that changed from the base of the PR and between aca6c86 and 0bb19ca.

Files selected for processing: 2

  • .jules/bolt.md
  • pkgs/id/crates/id-directory/src/directory_auth.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-21T14:27:05.066714Z 0bb19ca PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@dezren39

Copy link
Copy Markdown
Member Author

@coderabbitai review

Requesting a fresh review: the 2026-11-21 auto-review hit the free OSS review limit (neutral), and the limit has since reset. This PR (Bolt replay-nonce expiration index, head 0bb19ca) has been waiting on a review signal; Codex review already completed with no findings.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@dezren39
dezren39 merged commit 0aec9f7 into main Nov 22, 2026
2 checks passed
@dezren39
dezren39 deleted the queue/bolt-replay-guard-20922 branch November 22, 2026 16:54
@dezren39 dezren39 added the audit:no-issue No spawning issue; judged on stated intent label Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit:no-issue No spawning issue; judged on stated intent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant