Skip to content

docs: document two-step governance admin rotation flow and timelock#806

Open
iwayemi5 wants to merge 2 commits into
rinafcode:mainfrom
iwayemi5:main
Open

docs: document two-step governance admin rotation flow and timelock#806
iwayemi5 wants to merge 2 commits into
rinafcode:mainfrom
iwayemi5:main

Conversation

@iwayemi5

Copy link
Copy Markdown

Summary

This PR adds a comprehensive runbook documenting the governance admin rotation process for the escrow contract. It explains the complete two-step flow, authorization requirements, timelock behavior, pending state inspection, emitted events, and includes a CLI-style walkthrough to help contributors and operators safely perform admin rotations.

Closes #746

Changes

  • Added "docs/escrow/admin-rotation.md" documenting the end-to-end governance admin rotation process.
  • Documented the complete rotation lifecycle:
    • Current governance admin calls "propose_governance_admin".
    • Proposal enters a pending state.
    • Wait for "ADMIN_ROTATION_MIN_DELAY_LEDGERS" (approximately two days).
    • Proposed governance admin completes the rotation via "accept_governance_admin".
  • Documented authorization requirements for both operations:
    • "propose_governance_admin" requires current governance admin authorization.
    • "accept_governance_admin" requires proposed governance admin authorization.
  • Explained the "TimelockNotElapsed" error, including when it is returned and how to resolve it.
  • Documented how to inspect pending proposals with "get_pending_governance_admin", including interpretation of the anchor ledger and remaining timelock.
  • Included documentation for the emitted:
    • "admin/proposed"
    • "admin/accepted"
      event payloads.
  • Added a CLI-style example demonstrating the complete proposal → wait → acceptance workflow.
  • Added NatSpec-style ("///") documentation comments in "contracts/escrow/src/governance.rs" linking to the runbook.
  • Cross-referenced the timelock tests in "contracts/escrow/src/test/admin_auth_helper.rs".

Security Considerations

  • Documents the two-step transfer model to prevent accidental or unauthorized governance changes.
  • Clarifies that governance ownership is not transferred immediately after proposal.
  • Emphasizes that each stage requires authorization from a different actor.
  • Explains the mandatory timelock before ownership can be accepted.

Validation

Verified that the documentation reflects the implementation in "contracts/escrow/src/governance.rs".

Executed:

  • ✅ "cargo fmt --all -- --check"
  • ✅ "cargo build"
  • ✅ "cargo test"

@RUKAYAT-CODER

Copy link
Copy Markdown
Contributor

Great job so far

There’s just one blocker — the workflow is failing. Could you take a look and fix it so all checks pass?

Happy to review again once that’s done.
You can pull from the main first before pushing. The workflow should pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Tech-debt] tsconfig.json excludes 99 source files from type-checking — critical paths unchecked

2 participants