Skip to content

fix: record pause timestamp to enforce max pause duration - #1874

Merged
famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
Whitehouse-orl:fix/issue-1792-fix-pause-match-does-not-record-the-pause
Oct 23, 2026
Merged

famvilianity-eng merged 1 commit into
StellarCheckMate:mainfrom
Whitehouse-orl:fix/issue-1792-fix-pause-match-does-not-record-the-pause

Conversation

@Whitehouse-orl

Copy link
Copy Markdown
Contributor

Overview

This PR fixes pause_match so it records the ledger sequence at which a match is paused, and uses that timestamp to enforce MAX_PAUSE_DURATION in resume_match and admin_resolve_stalled_match. Previously the Paused state carried no start time, so the max-pause-duration constant could not be applied.

Related Issue

Changes

⏸️ Pause Timestamp Tracking

  • [MODIFY] contracts/escrow/src/types.rs

    • Added a paused_at_ledger: u32 field to the match data so the pause start ledger is persisted alongside the Paused state.
  • [MODIFY] contracts/escrow/src/state_machine.rs

    • Set paused_at_ledger when transitioning a match to Paused.
    • Clear/reset the field on resume so stale timestamps are not reused.
  • [MODIFY] contracts/escrow/src/lib.rs

    • pause_match now stores the current ledger sequence in paused_at_ledger.
    • resume_match and admin_resolve_stalled_match read paused_at_ledger and enforce MAX_PAUSE_DURATION.
  • [MODIFY] contracts/escrow/src/tests/admin_stall_resolution.rs

    • Added a test covering the pause timestamp being recorded and the max-pause-duration enforcement path.

Verification Results

cargo test -p escrow admin_stall_resolution
✅ pause timestamp recorded and max-pause-duration enforcement covered
Acceptance Criteria Status
Pause start ledger is recorded on transition to Paused ✅ paused_at_ledger set in pause_match
MAX_PAUSE_DURATION is enforced using the recorded timestamp ✅ Checked in resume_match and admin_resolve_stalled_match
Test added for the new behavior ✅ Added in admin_stall_resolution.rs

Closes #1792

@famvilianity-eng
famvilianity-eng merged commit 957175a into StellarCheckMate:main Oct 23, 2026
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.

Fix: pause_match does not record the pause timestamp, making max-pause-duration enforcement impossible

2 participants