IRONQ

Permissionless Cranks

Anyone can call these to maintain the system and earn rewards

Cranks are permissionless instructions — anyone can call them. They replace centralized monitoring with economic incentives.

reclaim_expired

Expires a claimed job that has passed its deadline. The caller earns a crank reward.

Requirements:

  • Job must be Claimed
  • Current time > deadline

Effects:

  1. Slash: slash_amount = worker_stake * slash_rate_bps / 10000
  2. Crank reward: crank_reward = slash_amount * crank_reward_bps / 10000
  3. Creator share: slash_amount - crank_reward

If retry_count < max_retries:

  • Job re-opens as Open (reward stays in vault for next worker)
  • retry_count incremented
  • Worker still slashed, cranker still paid

If retries exhausted:

  • Full reward returned to creator
  • Status: Expired (terminal)

In both cases:

  • Worker's stake_amount reduced by slash_amount
  • Worker's jobs_failed incremented
  • Worker's active_jobs decremented

close_job

Closes a terminal job account and its result account (if any), reclaiming rent.

Requirements:

  • Job must be in a terminal state: Completed, Expired, or Cancelled

Effects:

  • Job account rent returned to creator
  • JobResult account rent returned to the worker who submitted it
  • Both accounts are closed

Example: Slashing Math

With slash_rate_bps = 1000 (10%) and crank_reward_bps = 2000 (20% of slash):

  • Worker staked 100 tokens -> slashed 10 tokens
  • Cranker gets 2 tokens (20% of 10)
  • Creator gets 8 tokens (remaining slash)
  • Creator also gets their original reward back (if terminal expiry)