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 = truebefore 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
| Record | Stores |
|---|---|
VigilSubscription | Subscriber 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. |
Ingestor | OAS-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
| Variant | Purpose |
|---|---|
RegisterVigilSubscription | Open a subscription. |
UpdateVigilSubscription | Update an existing subscription. |
CancelVigilSubscription | Cancel a subscription. |
DepositVigilGas | Top up the gas tank. |
WithdrawVigilGas | Withdraw from the gas tank (subject to settlement). |
EventDelivery | Ingestor submits a verified event. |
RegisterIngestor | Register as an ingestor. |
UpdateIngestorStake | Adjust an ingestor’s bond. |
DeregisterIngestor | Deregister and reclaim the bond. |
SlashIngestor | Slash an ingestor for proven misbehaviour. |
Event validation
EventDelivery validation is deterministic:
- Vigils is active in chain config and the activation height has been reached.
- Subscription exists, is active, and is not expired.
- Event source matches the subscription source and is enabled by chain config.
- Typed filter evaluates true within bounded depth and width limits.
- Proof kind matches the source kind and passes deterministic source-specific checks.
(subscription_id, event_id)has not been delivered (replay protection).- Per-epoch subscription rate limit has capacity.
- Gas tank covers callback gas and ingestor fee.
- Subscription bond and ingestor bond satisfy minimums.
- Ingestor is active and supports the source kind.
Callback semantics
Accepted deliveries schedule callbacks forblock_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.
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.
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).
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
| Method | Returns |
|---|---|
sigil_getVigilSubscription | Subscription record. |
sigil_listVigilSubscriptionsBySubscriber | All subscriptions by a DID. |
sigil_getVigilDelivery | Delivery record by (subscription_id, event_id). |
sigil_getIngestor | Ingestor record. |
sigil_listIngestors | Active 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.