Skip to content

Keep pause guardian out of unpause and recovery #1168

Closed

Description

@greatest0fallt1me

Summary

The pause guardian may call pause and emergency_pause, while unpause and recover_from_emergency require the admin. No explicit negative test proves the guardian cannot lift either pause.

Why this matters

Guardians are lower-trust hot keys; if a refactor let them unpause, the circuit breaker could be bypassed by the very key it is meant to limit.

Scope

Add tests where the guardian pauses and then attempts unpause/recover_from_emergency and receives Unauthorized; also test clearing the guardian revokes its pause right.

Relevant code in CalloraOrg/Callora-Contracts:

  • contracts/revenue_pool/src/lib.rs
  • contracts/revenue_pool/tests/emergency_auth_snap.rs

Priority

Medium

Acceptance criteria

  • Guardian unpause fails with Unauthorized
  • Guardian recovery fails with Unauthorized
  • After clear_pause_guardian, guardian pause fails
  • Auth snapshot file records guardian-denied entrypoints

Validation

cargo test -p callora-revenue-pool guardian

Non-goals

  • Typo-only, formatting-only, or cosmetic changes.
  • Unrelated refactors, dependency upgrades, or broad rewrites.
  • Removing safeguards or weakening validation to make tests pass.

Contributor application

Before coding, describe the affected modules, proposed state/invariant changes, test strategy, compatibility considerations, and an estimate. Wait for assignment before starting implementation.

PR requirements

Use a feature branch and include Closes #<issue-number>. Address every criterion, map criteria to code and tests, explain security and failure-mode handling, and ensure CI passes.

Quality review

A maintainer will assess correctness, completeness, test depth, compatibility, observability, and adverse-case handling. A substantive implementation is required; merge or CI status alone does not guarantee reward eligibility.


Generated by Claude Code

Activity

  1. changed the title [-]Keep leaderboard rank pages deterministic[/-] [+]Add focused test coverage for contracts/migrate/src/errors.rs[/+] on Sep 27, 2026
  2. changed the title [-]Add focused test coverage for contracts/migrate/src/errors.rs[/-] [+]Keep pause guardian out of unpause and recovery[/+] on Sep 27, 2026
  3. actvabdulrahman commented on Sep 29, 2026

    @actvabdulrahman
    Contributor

    @actvabdulrahman has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hello Maintainer,
    I have vast experience in solving GitHub issues. Please do well to assign me this to get it done for you
    Thank you.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @actvabdulrahman to this issue.

  4. AkpakaProsper commented on Sep 29, 2026

    @AkpakaProsper

    @AkpakaProsper has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Please assign

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @AkpakaProsper to this issue.

  5. emarkees commented on Sep 30, 2026

    @emarkees
    Contributor

    @emarkees has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    Hi, I would love to work on this issue pls assign

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @emarkees to this issue.

  6. Devadakene commented on Sep 30, 2026

    @Devadakene
    Contributor

    @Devadakene has applied to work on this issue as part of the Stellar Wave Program's 9th wave.

    I would like to work on this issue having worked on something similar issues in the past. Please assign

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Devadakene to this issue.

  7. Rodrigoue9 commented on Oct 3, 2026

    @Rodrigoue9

    Hi @maintainers! I'd like to work on this issue. Here is my proposed technical approach:

    Proposed Technical Approach:

    1. Contract Logic Implementation: Implement the required Soroban smart contract logic in Rust, ensuring strict validation, authorization checks (require_auth), and gas optimization.
    2. Storage Layout & State Management: Maintain safe data key patterns, TTL management, and prevent state inconsistency or unauthorized state mutations.
    3. Events & Error Encoding: Emit strongly typed contract events and return descriptive custom errors for all failure modes.
    4. Comprehensive Test Vectors: Implement Rust unit and integration tests using soroban-sdk::Env verifying both success and failure execution paths.

    Key Files:

    • contracts/**/src/lib.rs (contract entrypoints and interface implementations)
    • contracts/**/src/types.rs or storage.rs (types, data keys, and state)
    • contracts/**/src/test.rs (unit tests and integration vectors)

    Verification & Testing:

    • Run cargo test across all contract crates verifying 100% pass rate.
    • Run cargo clippy --all-targets -- -D warnings and cargo fmt --check.
    • Verify Soroban WASM build: soroban contract build.

    Relevant Track Record:

    I have successfully implemented and merged multiple production PRs across the Stellar ecosystem and Web3 open-source projects (e.g., Bitcoindefi/OpenAO #218, cybermax4200/stellar-did-credit #898 & #900, and FindMalek/sonaraem #416).

    Please feel free to assign this issue to me so I can proceed with the implementation. Thank you!

  8. Ranjeet2063 commented on Oct 7, 2026

    @Ranjeet2063

    Hi,

    I have experience with similar implementations and would like to take this on.

    Implementation approach:

    1. Audit storage layout and state invariants ensuring strict auth guards.
    2. Implement deterministic state transitions with safe checked arithmetic.
    3. Add hermetic unit and regression tests covering authorized, unauthorized, and boundary edge cases.
    4. Profile instruction and CPU/gas limits under Soroban host environment.

    Let me know if this aligns with the repository guidelines and assign when convenient.

  9. devprom6 commented on Oct 15, 2026

    @devprom6
    Contributor

    @devprom6 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'd like to take this issue. It covers an important part of the project, and I want to contribute something that fits the existing architecture and development standards and holds up over time.

    I've worked across backend and frontend development, APIs, databases, testing, DevOps, and blockchain-based applications. I'm comfortable reading an unfamiliar codebase, tracking an issue down to its root cause, and writing clean fixes with tests that guard against regressions.

    My plan is to start by reading the existing implementation and project conventions, then build the solution in small, focused steps. I'll test the changes, document them where needed, and keep the code simple so nothing existing breaks. I'll also respond quickly to review feedback so the PR is easy to merge.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @devprom6 to this issue.

  10. spartan124 commented on Oct 16, 2026

    @spartan124

    @spartan124 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I have solid experience writing and testing Soroban contracts in Rust, focusing on access control, negative testing, and authorization state invariants.
    Affected Modules: contracts/revenue_pool/src/lib.rs, contracts/revenue_pool/tests/emergency_auth_snap.rs
    Approach:

    1. Add explicit negative test cases verifying that calling unpause or recover_from_emergency with the pause guardian identity fails with Unauthorized.
    2. Add a test case verifying that after calling clear_pause_guardian, any subsequent pause attempt by that guardian fails.
    3. Update the auth snapshot test suite to capture and record guardian-denied entrypoints.
    4. Validate the full suite using cargo test -p callora-revenue-pool guardian.
      ETA: 1–2 hours

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @spartan124 to this issue.

  11. lienhoatienphung-svg commented on Oct 16, 2026

    @lienhoatienphung-svg

    Hi! I have implemented and verified this in #1381 with full unit test coverage and rustfmt compliance.

  12. Oluwanifemi18-ux commented on Oct 16, 2026

    @Oluwanifemi18-ux

    @Oluwanifemi18-ux has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    Hi Maintainer, I’ve carefully looked through the requirements and believe I can complete this task properly. I’d appreciate the opportunity to work on it.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @Oluwanifemi18-ux to this issue.

  13. cybermax4200 commented on Oct 18, 2026

    @cybermax4200
    Contributor

    @cybermax4200 has applied to work on this issue as part of the Stellar Wave Program's 10th wave.

    I'd like to take this issue. It covers an important part of the project, and I want to contribute something that fits the existing architecture and development standards and holds up over time.

    I've worked across backend and frontend development, APIs, databases, testing, DevOps, and blockchain-based applications. I'm comfortable reading an unfamiliar codebase, tracking an issue down to its root cause, and writing clean fixes with tests that guard against regressions.

    My plan is to start by reading the existing implementation and project conventions, then build the solution in small, focused steps. I'll test the changes, document them where needed, and keep the code simple so nothing existing breaks. I'll also respond quickly to review feedback so the PR is easy to merge.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @cybermax4200 to this issue.

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

    Stellar WaveStellar Wave Program issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions