Skip to content

Contract Pause & Suspension Mechanism #833

Description

@DokaIzk

Title: feat: implement contract pause/suspension for maintenance and incident response

Labels: enhancement operations
Complexity: medium
Branch: feat/contract-pause-suspension


Problem Context

When a contract is compromised or needs maintenance, operators need to temporarily pause indexing without deleting historical data. A pause/suspension mechanism enables rapid incident response.


Scope

Included:

  • pause() method on TrackedContract: stops new events but keeps history
  • suspension_reason field for audit trail
  • Suspension scheduled: pause until, then auto-resume
  • Webhook notification on pause/resume
  • Admin UI to pause/resume

Not included:

  • Automatic pause on error thresholds

Implementation Guidelines

Model updates:

class TrackedContract(models.Model):
    # ... existing fields ...
    is_paused = models.BooleanField(default=False)
    paused_at = models.DateTimeField(null=True)
    pause_reason = models.TextField(blank=True)
    resume_at = models.DateTimeField(null=True)

Constraints:

  • Paused contracts don't receive new events
  • Historical data remains queryable
  • Auto-resume via Celery task

Acceptance Criteria

  • pause() method stops indexing
  • resume() method restarts indexing
  • Pause reason logged
  • Auto-resume at scheduled time
  • Historical data still queryable


Activity

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

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions