Skip to content

[Bug] Migration keeper reports MigrationCooldownNotMet as a failure for the full ~1-day timelock #725

Description

@collinsezedike

Summary

#557 lengthened migrate_adapter's MIN_LEDGER_GAP cooldown from ~1 minute to ~1 day. The migration keeper (packages/stellar-sdk-helpers/src/migration-keeper.ts) does not special-case the resulting MigrationCooldownNotMet rejection: it falls into the generic failure path, gets pushed to failures[], and api/v1/keepers/rebalance.ts returns HTTP 500 whenever failures.length > 0.

Motivation

While the cooldown was ~1 minute, a single MigrationCooldownNotMet failure on the run immediately after begin_migration was harmless noise, gone by the next hourly run. With the cooldown now ~1 day, every hourly run during that window hits the same rejection, producing roughly 24 consecutive HTTP 500s and failure log entries per migration. This creates sustained false-positive paging/monitoring noise during exactly the window #557 intends observers to calmly watch for a genuinely malicious begin_migration call, undermining that goal.

Proposed Solution

Special-case MigrationCooldownNotMet the same way isStaleAdapterError already is: detect it (the raw simulation error surfaces as Error(Contract, #20), matching MigrationCooldownNotMet = 20 in packages/contracts/vault/src/errors.rs) and report it as a skipped outcome with an informative reason, not a failures entry, so the keeper's HTTP status and logs correctly reflect "cooldown in progress, working as intended" rather than "something is wrong."

Scope

Field Value
Area SDK / API
Protocol affected None
Network Both
Breaking change? No

Acceptance Criteria

  • MigrationCooldownNotMet is detected and reported as skipped, not failures
  • apps/docs/operations/migration-keeper.md updated to reflect the fixed behavior
  • Test coverage for the cooldown-in-progress case reporting a skip, not a failure

Additional Context

Identified during review of #710. Not fixed there since it is a keeper/monitoring-quality issue, not a fund-safety one, and deserves its own dedicated fix and tests rather than being folded into a contract-focused PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions