var img = document.createElement('img'); img.src = "https://terradocs.matomo.cloud//piwik.php?idsite=3&rec=1&url=https://docs.warp.money" + location.pathname; img.style = "border:0"; img.alt = "tracker"; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(img,s);
Skip to main content

Job state

Owner side

  1. An owner creates a job with an execute message, conditions, and a reward. Upon successful creation, the job enters the Pending status.
  2. While in the Pending state, an owner can update a job's message or increase the reward amount of the job.
  3. Owners can also delete a job while in the Pending state. When a job is deleted, its state becomes Cancelled.
Job-Status

_25
_25
create_job()
_25
_25
│◄─────────────┐
_25
│ │
_25
▼ │
_25
┌───────┐ │
_25
┌─────│Pending├─┬──► update_job()
_25
│ └───┬───┘ │
_25
│ │ │
_25
│ │ └──► delete_job() ───┐
_25
│ │ │
_25
│ │ ▼
_25
│ ▼ ┌───────┐ ┌─────────┐
_25
│ evict_job()───► │Evicted│ │Cancelled│
_25
│ └───────┘ └─────────┘
_25
_25
└─► execute_job() ──────┐
_25
_25
│ ┌──────┐
_25
│ │Failed│
_25
▼ └──────┘
_25
┌────────┐
_25
│Executed│
_25
└────────┘

Keeper side

  1. A keeper can attempt to execute any job with a Pending status if they believe the job's conditions have been met.
  2. If the job's conditions aren't yet met, the job remains in the queue, and its status is unchanged.
  3. Jobs only remain active in the queue based on their duration, which is specified during job creation. Job duration is a variable in fee estimation. When a job's duration runs out, it is Evicted.
  4. If a job fails during execution, its status becomes Failed.
  5. If the job's conditions are met, the job's execute message gets sent, and the rewards included for executing the job are sent to the keeper. The job's status becomes Executed.
Job-Status

_25
_25
create_job()
_25
_25
│◄─────────────┐
_25
│ │
_25
▼ │
_25
┌───────┐ │
_25
┌─────│Pending├─┬──► update_job()
_25
│ └───┬───┘ │
_25
│ │ │
_25
│ │ └──► delete_job() ───┐
_25
│ │ │
_25
│ │ ▼
_25
│ ▼ ┌───────┐ ┌─────────┐
_25
│ evict_job()───► │Evicted│ │Cancelled│
_25
│ └───────┘ └─────────┘
_25
_25
└─► execute_job() ──────┐
_25
_25
│ ┌──────┐
_25
│ │Failed│
_25
▼ └──────┘
_25
┌────────┐
_25
│Executed│
_25
└────────┘

Owner side

  1. An owner creates a job with an execute message, conditions, and a reward. Upon successful creation, the job enters the Pending status.
  2. While in the Pending state, an owner can update a job's message or increase the reward amount of the job.
  3. Owners can also delete a job while in the Pending state. When a job is deleted, its state becomes Cancelled.

Keeper side

  1. A keeper can attempt to execute any job with a Pending status if they believe the job's conditions have been met.
  2. If the job's conditions aren't yet met, the job remains in the queue, and its status is unchanged.
  3. Jobs only remain active in the queue based on their duration, which is specified during job creation. Job duration is a variable in fee estimation. When a job's duration runs out, it is Evicted.
  4. If a job fails during execution, its status becomes Failed.
  5. If the job's conditions are met, the job's execute message gets sent, and the rewards included for executing the job are sent to the keeper. The job's status becomes Executed.
Job-Status

_25
_25
create_job()
_25
_25
│◄─────────────┐
_25
│ │
_25
▼ │
_25
┌───────┐ │
_25
┌─────│Pending├─┬──► update_job()
_25
│ └───┬───┘ │
_25
│ │ │
_25
│ │ └──► delete_job() ───┐
_25
│ │ │
_25
│ │ ▼
_25
│ ▼ ┌───────┐ ┌─────────┐
_25
│ evict_job()───► │Evicted│ │Cancelled│
_25
│ └───────┘ └─────────┘
_25
_25
└─► execute_job() ──────┐
_25
_25
│ ┌──────┐
_25
│ │Failed│
_25
▼ └──────┘
_25
┌────────┐
_25
│Executed│
_25
└────────┘