Repository navigation
fix(id): #5644 bound retained one-time state in HostedBindingService - #6319
Conversation
|
Caution Review failedThe pull request is closed.
Warning Some tools did not complete. Review the errors below.
|
Codex Review SummaryThis 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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2fa9106cce
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| iroh_id: &IrohId, | ||
| ) -> Result<Challenge, CeremonyError> { | ||
| let now = self.now(); | ||
| self.prune_expired_one_time_state(now); |
There was a problem hiding this comment.
Apply the issuance limit before sweeping global state
When the service holds many live challenges or pairing codes, every request_challenge call now scans all three one-time maps before checking the caller's issuance limit. A caller that has already exhausted its 30 challenges per hour can therefore trigger unlimited full-map sweeps through requests that return RateLimited, introducing work proportional to global state on the rejection path. Move the sweep after the rate-limit check, as create_pairing_code already does, so rejected requests cannot repeatedly trigger this cleanup.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Codex Review: Didn't find any major issues. Hooray!
Reviewed commit: f534266ad8
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…(Codex P2, PR #6319)
Implements issue #5644 (task 10601): bounded retention for the one-time ceremony maps in
pkgs/id/src/hosted_binding.rs.expires_at(HashMap<String, u64>instead of a lifetimeHashSet). Replay is still rejected through the whole validity window; past it the marker is pruned on access (replay_blocked) or by sweep, and a late presentation reportsUnknownChallengeinstead ofChallengeReplay— the post-expiry error-semantics change the issue's audit note (b) prescribed.prune_expired_one_time_state) removes expired unconsumed challenges, expired unexchanged pairing codes, and expired consumed markers. It runs from the rate-limited minting paths:request_challenge, andcreate_pairing_code(before the collision loop, so an expired code stops reserving its six-digit value, per audit note (a)).request_challenge/create_pairing_codetable rows updated to match.UnknownChallenge; expired unconsumed challenge is swept by the next request; expired pairing code is swept and stops reserving its value.Existing expiry semantics elsewhere are unchanged (
submit_proof/verify_challenge_proofexpiry stays state-free per §3.4/#4868; exchange of a not-yet-swept expired code still returnsChallengeExpired).Closes #5644.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.