Vigils is Sigil’s event-driven autonomous contract layer. A Vigil is an opt-in contract that owns one or more subscriptions. A staked ingestor submits an EventDelivery transaction for a verified event, the executor runs semantic validation against the subscription’s source, filter, proof, replay key, rate limit, gas tank, bond, and ingestor support, and a callback schedules deterministically.

Invariants

  • MACA remains deterministic: semantic validation and apply have no network I/O, no wall-clock read, no randomness, no subprocess, no background task.
  • Existing transaction-triggered contracts are unchanged. A contract must explicitly set accepts_vigil_callbacks = true before it can be targeted.
  • Existing transaction IDs and storage layouts remain append-only. Vigils adds new transaction variants, new state keys, and a new callback queue.
  • Callback execution is deferred to the start of the next block and ordered by (subscription_id, event_id).

State

RecordStores
VigilSubscriptionSubscriber DID, callback contract, callback method, typed source, typed filter, gas tank, bond, per-callback gas cap, per-epoch delivery cap, lifecycle heights, status, epoch delivery counter.
IngestorOAS-rooted DID, slashable bond, supported source kinds, fee per delivery, reputation, registration height, status.
VigilDeliveryRecord(subscription_id, event_id), ingestor DID, delivery height, status, proof hash.

Transactions

VariantPurpose
RegisterVigilSubscriptionOpen a subscription.
UpdateVigilSubscriptionUpdate an existing subscription.
CancelVigilSubscriptionCancel a subscription.
DepositVigilGasTop up the gas tank.
WithdrawVigilGasWithdraw from the gas tank (subject to settlement).
EventDeliveryIngestor submits a verified event.
RegisterIngestorRegister as an ingestor.
UpdateIngestorStakeAdjust an ingestor’s bond.
DeregisterIngestorDeregister and reclaim the bond.
SlashIngestorSlash an ingestor for proven misbehaviour.

Event validation

EventDelivery validation is deterministic:
  1. Vigils is active in chain config and the activation height has been reached.
  2. Subscription exists, is active, and is not expired.
  3. Event source matches the subscription source and is enabled by chain config.
  4. Typed filter evaluates true within bounded depth and width limits.
  5. Proof kind matches the source kind and passes deterministic source-specific checks.
  6. (subscription_id, event_id) has not been delivered (replay protection).
  7. Per-epoch subscription rate limit has capacity.
  8. Gas tank covers callback gas and ingestor fee.
  9. Subscription bond and ingestor bond satisfy minimums.
  10. Ingestor is active and supports the source kind.

Callback semantics

Accepted deliveries schedule callbacks for block_height + 1. The callback runs under the existing WASM contract executor with:
  • The subscriber DID as caller.
  • The declared callback method.
  • The event payload as arguments.
  • The subscription’s gas limit.
Reverts are recorded as Reverted; successful callbacks are recorded as Delivered.

Chain configuration

VigilsParams controls:
  • active — whether Vigils is enabled.
  • activation_height — block at which the substrate goes live.
  • enabled_sources — list of allowed event source kinds.
  • min_subscription_bond, min_ingestor_bond.
  • max_callback_gas, max_per_epoch_deliveries.
Operators tune the parameters through a governance proposal.

Event sources

The launch event source catalogue covers:
  • Chain-internal events (block finality, validator set change, governance proposal lifecycle).
  • Contract-internal events (within an organisation zone).
  • Storage-pinning marketplace events.
  • Compute marketplace events.
  • Labor market milestone events.
  • Vigil-of-vigil chains (one Vigil’s callback can drive another).
The full catalogue and per-source proof formats live in docs/specs/vigils/EVENT_SOURCE_CATALOG.md.

Ingestor economics

Ingestors stake a bond and earn a fee per accepted delivery. The fee market is local to each source kind. Reputation accrues from accepted deliveries and is debited by slashing events.

RPC

MethodReturns
sigil_getVigilSubscriptionSubscription record.
sigil_listVigilSubscriptionsBySubscriberAll subscriptions by a DID.
sigil_getVigilDeliveryDelivery record by (subscription_id, event_id).
sigil_getIngestorIngestor record.
sigil_listIngestorsActive ingestors filtered by supported source.

Implementation

  • Spec: docs/specs/vigils/SPECIFICATION.md.
  • Threat model: docs/specs/vigils/THREAT_MODEL.md.
  • Operator guide: docs/specs/vigils/INGESTOR_OPERATOR_GUIDE.md.
  • Types: node/sigil-core/src/vigils.rs.
  • Executor: node/sigil-node/src/executor_vigils.rs.