Description
propose_admin_rotation and accept_admin_rotation form a two-step flow but no expiry analogous to ISSUER_TRANSFER_EXPIRY_SECS constrains how long a pending admin rotation can sit. A long-pending rotation is a latent compromise risk. Add a configurable expiry and a test asserting acceptance past the window returns a typed error.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/lib.rs (propose_admin_rotation, accept_admin_rotation, cancel_admin_rotation, NoAdminRotationPending)
- Reuse the per-offering-expiry pattern with an
ADMIN_ROTATION_EXPIRY_SECS default
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/admin-rotation-expiry
- Implement changes
- Store proposal timestamp alongside the pending admin
- Reject
accept_admin_rotation past expiry
- Add boundary test at exact expiry and one-past
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Cancel before expiry, accept at expiry, accept one-past expiry, re-propose after expiry
- Include test output and security notes
Example commit message
feat: enforce admin-rotation expiry window
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
propose_admin_rotationandaccept_admin_rotationform a two-step flow but no expiry analogous toISSUER_TRANSFER_EXPIRY_SECSconstrains how long a pending admin rotation can sit. A long-pending rotation is a latent compromise risk. Add a configurable expiry and a test asserting acceptance past the window returns a typed error.Requirements and context
src/lib.rs(propose_admin_rotation,accept_admin_rotation,cancel_admin_rotation,NoAdminRotationPending)ADMIN_ROTATION_EXPIRY_SECSdefaultSuggested execution
git checkout -b feat/admin-rotation-expiryaccept_admin_rotationpast expiryTest and commit
cargo test --allExample commit message
feat: enforce admin-rotation expiry windowGuidelines