diff --git a/src/message_suggestions_for_actions.md b/src/message_suggestions_for_actions.md index 90210bd..523a15b 100644 --- a/src/message_suggestions_for_actions.md +++ b/src/message_suggestions_for_actions.md @@ -164,4 +164,12 @@ Mostro also handles messages with the `CantDo` action for various reasons. The d User exceeds the allowed request rate. - **invalid-fiat-currency:** - Prevents proceeding with unrecognized fiat currencies. \ No newline at end of file + Prevents proceeding with unrecognized fiat currencies. + +- **maintenance-mode:** + Mostro is in maintenance mode and is not accepting new orders or takes right now. Your existing orders are not affected and can still be completed or canceled. Please try again later. + +- **unknown:** + Mostro rejected the action for a reason this client does not recognize yet. Please update your client. + +> **Forward compatibility.** `CantDoReason` is serialized in `snake_case` (`maintenance_mode`, `invalid_trade_index`, …). Since `mostro-core` 0.14.6 the enum carries a `#[serde(other)] Unknown` catch-all: a reason a client does not know deserializes to `unknown` instead of failing to parse the whole `cant_do` payload. Clients built against older `mostro-core` fail to parse unknown reasons, so a daemon operator should only enable features that emit new reasons (such as maintenance mode) once the clients it serves have caught up. \ No newline at end of file diff --git a/src/other_events.md b/src/other_events.md index b88a4cb..c697bbd 100644 --- a/src/other_events.md +++ b/src/other_events.md @@ -121,6 +121,10 @@ This event contains specific data about a Mostro instance. The instance is ident "pow_first_contact", "0" ], + [ + "maintenance_mode", + "false" + ], [ "protocol_version", "1" @@ -251,6 +255,14 @@ These tags advertise the node's anti-abuse-bond configuration so clients can sho **Disambiguation.** When `bond_enabled` is absent from the event, the daemon predates the bond feature; treat the node as not enforcing bonds. When `bond_enabled = "false"`, the daemon supports the feature but the operator has not enabled it on this instance. When `bond_enabled = "true"`, the remaining six bond tags are present and clients should expect bond messages on this node — [`pay-bond-invoice`](./pay_bond_invoice.md) for the bonded user and [`add-bond-invoice`](./add_bond_invoice.md) for the payout recipient on a slashed trade. +### Maintenance mode tag + +- `maintenance_mode`: `"true"` while the operator has put the instance in maintenance mode, otherwise `"false"`. Always emitted on daemons that support the feature; daemons that predate it omit the tag, which clients should treat as `"false"`. + +While `maintenance_mode = "true"` the instance rejects [`new-order`](./new_sell_order.md), [`take-sell`](./take_sell.md) and [`take-buy`](./take_buy.md) with a `cant-do` whose reason is `maintenance_mode` (see [Cant Do Reasons](./message_suggestions_for_actions.md#cant-do-reasons)). Every action on an order that already exists — paying the hold invoice, `fiat-sent`, `release`, `cancel`, disputes, ratings, adding invoices — keeps working, so open trades can finish normally. The typical use is draining open escrow before the operator migrates the instance to a different Lightning node. + +Clients SHOULD read this tag and warn the user before they compose or take an order on an instance in maintenance mode, rather than letting the user mine proof of work for a request that will be rejected. The tag flips back to `"false"` when the operator re-opens the instance; the info event is republished immediately on each change and then at the usual interval. + ## Information about the Relays Where Events Are Published The operator of a Mostro instance decides which relays the events from that instance are published to. This information can be accessed in events [kind 10002](https://github.com/nostr-protocol/nips/blob/master/65.md), which are published by the Mostro instances.