Worker
Tracks a registered worker's state and statistics
The Worker account represents a registered worker in a queue.
Seeds: ["worker", queue, wallet] — one registration per worker per queue.
Fields
| Field | Type | Description |
|---|---|---|
queue | Pubkey | Parent queue |
wallet | Pubkey | Worker's signing wallet |
stake_amount | u64 | Tokens currently staked |
jobs_completed | u32 | Lifetime successful completions |
jobs_failed | u32 | Lifetime failures (slashes) |
total_earned | u64 | Lifetime reward earnings |
active_jobs | u8 | Currently held jobs |
max_concurrent_jobs | u8 | Hard cap (snapshotted from queue config) |
is_active | bool | Active flag |
registered_at | i64 | Unix timestamp |
Notes
max_concurrent_jobsis copied from the queue's config at registration time. If the admin later changes the queue'smax_concurrent_jobs, existing workers keep their original value. New workers get the updated value.- A worker cannot
deregisterwhileactive_jobs > 0. All held jobs must complete or expire first. - Workers can
increase_stakeat any time to add more tokens. stake_amountdecreases when the worker is slashed (viareclaim_expiredorresolve_disputewhere worker loses).