Skip to content

fix: document execute_recovery permissionless executor policy and add timing tests - #653

Open
Aj-Kayvee wants to merge 1 commit into
Betta-Pay:mainfrom
Aj-Kayvee:fix/recovery-executor-policy
Open

fix: document execute_recovery permissionless executor policy and add timing tests#653
Aj-Kayvee wants to merge 1 commit into
Betta-Pay:mainfrom
Aj-Kayvee:fix/recovery-executor-policy

Conversation

@Aj-Kayvee

Copy link
Copy Markdown
Contributor

Closes #564

Problem

in both settlement and governance contracts intentionally requires no authorization from the caller. This is a standard timed-recovery pattern, but the rationale was undocumented and no tests verified the timing constraints:

Solution

Doc comments (settlement + governance )

Added detailed doc comments explaining:

  • Executor policy: intentionally permissionless — the recovery target was validated by the recovery address during , and the 7-day delay provides a cancellation window
  • Atomicity: the pending state is consumed atomically, so a second call reverts
  • Panic conditions: if delay hasn't elapsed, if no pending record

Timing / race tests (4 per contract = 8 total)

Test Settlement Governance
— same error code
— verifies is after execution — same pattern
— same error code
— same error code

Ancillary fixes

  • ****: fixed unclosed delimiter (missing to close the macro block)
  • ****: fixed 5-tuple destructure → to match 's 4-tuple return type

Test results

… timing tests

Both settlement and governance contracts intentionally skip require_auth
on execute_recovery. The recovery target is validated by the recovery
address during initiate_recovery, and the 7-day delay provides a window
for the current admin set to cancel. Once the delay passes, anyone may
execute.

Add detailed doc comments explaining this policy and 4 timing/race tests
per contract:
- execute_recovery_rejects_before_delay (Betta-Pay#9)
- execute_recovery_clears_pending_record
- execute_recovery_after_cancel_panics (Betta-Pay#8)
- execute_recovery_second_call_panics (Betta-Pay#8)

Also fixes an unclosed proptest! delimiter in payments.rs and a 5-tuple
destructure in admin_tests.rs.

Closes Betta-Pay#564
@drips-wave

drips-wave Bot commented Aug 26, 2026

Copy link
Copy Markdown

@Aj-Kayvee Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Settlement execute_recovery is callable by anyone with no auth

1 participant