Skip to content

Fix recovery target validation at execution - #636

Open
Seunfunmi-319509 wants to merge 14 commits into
Betta-Pay:mainfrom
Seunfunmi-319509:fix/469-revalidate-recovery-execution
Open

Fix recovery target validation at execution#636
Seunfunmi-319509 wants to merge 14 commits into
Betta-Pay:mainfrom
Seunfunmi-319509:fix/469-revalidate-recovery-execution

Conversation

@Seunfunmi-319509

Copy link
Copy Markdown

Fixes #469

Re-validate the pending recovery target immediately before changing the admin, preventing corrupted pending state from installing a zero address. Recovery execution remains intentionally permissionless: any caller may execute it once the ledger timestamp reaches execute_after.

The execution check compares the current ledger timestamp directly with the stored execution timestamp, and regression coverage demonstrates that execute_after - 1 is rejected while the exact timestamp succeeds. A corrupted zero target is also rejected at execution.

Tests:

  • cargo test -p settlement_contract recovery_ passes (3 tests).
  • cargo test --workspace was run in the Rust 1.85 container but currently reports unrelated pre-existing snapshot/TTL/event failures in both contracts.

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@Seunfunmi-319509 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

@Seunfunmi-319509

Copy link
Copy Markdown
Author

kindly review

oshowunm and others added 8 commits August 27, 2026 14:02
Resolve duplicate imports in admin.rs, unused variables, duplicate
discriminant values (AlreadyPaused 15→17), missing deployer/executor
args in tests, Symbol→IntoVal conversion, and test snapshot updates
across governance and settlement contracts.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
- timelock tests: re-enable mock_all_auths before execute calls since
  execute now requires executor auth (issue Betta-Pay#561)
- payments proptests: account for network_fee clamping when fees exceed
  gross amount (issue Betta-Pay#683)
- reregistered_merchant test: accept that re-registration clears the
  ArchivedMerchant tombstone (issue Betta-Pay#685)
- set_settlement_rule event test: remove incorrect bootstrap_fallback
  assertion since _set_settlement_rule does not emit that event

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…ly path

calculate_fee_split is a read-only path and does not emit events
(issue Betta-Pay#691). Verify fee values directly instead of checking for
BOOTSTRAP_FALLBACK_EVENT.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
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.

execute_recovery does not re-validate the pending target or executor

1 participant