Skip to content

[Tracking] Evict issued-unconsumed OTKs when pool hits ceiling #68

Description

@chtnnh

Summary

Follow-up from review on #58 / #49 (not a merge blocker).

After #58 lands, issueOtks never re-shares OTKs already issued to a peer. The pool then pins at OTK_POOL_CEILING with issued-but-unconsumed keys. Once every row is issued, replenishment advertises zero OTKs until something is consumed or the 6h sweep fires — measured as 8,8,8,0,0,0 across unanswered sends to one peer.

Behaviour today

This is a graceful degradation, not silent loss: the peer's book empties, takeAgreementPublic falls through to the SPK, and mail still delivers. Per-message FS quietly downgrades to per-rotation FS for peers who do not reply (common on a lossy mesh: an OTK secret is only consumed when we open something sealed to it, so undelivered mail leaves keys pinned forever).

Proposed direction

When the ceiling is hit and there are no unissued OTKs left to hand out, evict the oldest issued-unconsumed OTKs (or otherwise reclaim pool slots) so replenishment can mint/assign fresh keys again — rather than starving the bundle at zero.

Out of scope

Do not fold this into #58 / #59 / #60; land those in order first (#59 → #58 → #60).

References

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions