Skip to content

fix: let recovery veto scheduled admin operations - #676

Open
Akinsuyiphilip wants to merge 2 commits into
Betta-Pay:mainfrom
Akinsuyiphilip:fix/501-recovery-veto-timelock
Open

fix: let recovery veto scheduled admin operations#676
Akinsuyiphilip wants to merge 2 commits into
Betta-Pay:mainfrom
Akinsuyiphilip:fix/501-recovery-veto-timelock

Conversation

@Akinsuyiphilip

Copy link
Copy Markdown

Closes #501

Summary

Align the settlement administrative timelock with the recovery window and make
pending recovery an emergency veto over scheduled administrative operations.

Problem

Scheduled upgrades and admin transfers previously became executable after
48 hours, while recovery required seven days before it could be executed. A
compromised administrator could therefore schedule a malicious upgrade or
admin transfer and have it execute before the recovery address had a chance to
intervene.

This defeated recovery's intended role as a safeguard against compromised
administrative credentials.

Changes

  • Increase the minimum settlement scheduled-operation delay from 48 hours to
    seven days.
  • Reject execution of scheduled administrative operations while recovery is
    pending.
  • Preserve the veto until recovery is either cancelled or executed.
  • Document the timelock/recovery timing relationship and threat model.
  • Add a regression test covering the recovery/timelock race.

Security behavior

Once recovery is initiated, pending scheduled administrative operations cannot
execute, including upgrades and admin transfers. This remains true even if the
operation's nominal execution time has elapsed. The operation can only proceed
after the pending recovery is cancelled; if recovery executes, administrative
state changes accordingly and the stale scheduled operation remains blocked by
the recovery state transition.

The seven-day timelock also ensures that, absent an already-pending recovery,
the recovery window is not longer than the delay before a scheduled operation
can execute.

Testing

Added:

  • recovery_vetoes_scheduled_operation_before_timelock_expiry

Validation performed:

cargo test --workspace

4 common tests passed
59 governance tests passed
88 settlement tests passed
All doc-tests passed

Akinsuyiphilip and others added 2 commits August 27, 2026 16:21
Align the settlement timelock with the seven-day recovery window and reject scheduled execution while recovery is pending, preventing compromised-admin upgrades and transfers from racing past recovery.

Generated with Codebuff 🤖

Co-Authored-By: Codebuff <noreply@codebuff.com>
@drips-wave

drips-wave Bot commented Aug 29, 2026

Copy link
Copy Markdown

@Akinsuyiphilip 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.

Recovery window (7d) is longer than the timelock (48h), so recovery can't veto scheduled upgrades

1 participant