Minka Ledger Docs
Explanations

About Intents Expiry

DateResponsibleChanges
July 31, 2023@Branko DurdevicInitial version

Introduction

A lot can happen during processing of an intent that can cause it to pause temporarily or even stop completely, especially when communicating with outside services like bridges. If an intent is not processed in time for whatever reason, it will be expired. This means that processing will never be finished and the intent will be aborted. As a consequence, the entire thread that the intent is a part of will also be aborted.

Processing

Ledger continuously monitors the system for expired intents looking at the created moment which is the custom.moment of the signature with custom.status = 'created'. If an intent has no created moment, it will not be aborted as part of the expiration process. If the elapsed time is greater than the threshold and the intent is still in pending status, the entire thread is aborted which means all the intents will get an aborted signature with core.intent-expired reason and end up in the aborted status. An intent that is not pending, but still not in a final status like completed or rejected (eg. if it is committed), will not be expired.

An intent is not guaranteed to be aborted if it is expired, it only becomes eligible to be aborted and will be picked up by the next iteration of the expiry process. This process is run constantly, but it is still possible that intent processing continues between becoming expired and getting picked up by the process.

The expiry signature is of the form:

{
  "custom": {
    "detail": "Intent j50DjJE9kWYtbNEYC expired",
    "moment": "2023-07-30T22:35:02.262Z",
    "reason": "core.intent-expired",
    "status": "aborted"
  },
  "digest": "a36394c187c81f829ef3bb3df7e1a1c2e4afb65b14469a40401ef08a7314c63c",
  "method": "ed25519-v2",
  "public": "hrbD8DkjISL0t66M/rLtTZRqXC7N2P+gXYW5OohAIk4=",
  "result": "pfRiROjKuOinZ9gYzIqLlpDDdxavExJ1SGuPF8CLn/6/gZAA+eOAI1v+W11f2c7kPXkaKHSdJBiZcijyO41gBQ=="
}

Configuration

To configure expiry, the data.config.intentExpiryThresholdMinutes property needs to be set to the number of minutes after which an intent should be expired.

{
  "hash": "...",
  "data": {
    "handle": "ledger-handle",
    "signer": "ledger-signer",
    "access": [ ... ],
    "config": { 
      "dtc.intentExpiryMinutes": 60 
    }
  }
  "meta": {
    ...
  }
}

On this page