2.3.4 Overload
Our rule for overload is: reject at the edge, and never discard an accepted order. If a card cannot accept an order now, it tells the client immediately. The order has no stamp. The client sends the same bytes again.
Three limits of each card
- Rate limit of the session. Each session has a token bucket on the card. If the bucket is empty, the card answers Rate. One client cannot use all the capacity of a card.
- Credit window. A card can hold a fixed number of accepted orders that have no decision. If all credits are in use, the card answers Credits.
- Barrier. Near some batch operations, the card stops new orders for a short time. It answers Barrier.
The credit window makes overload safe. An accepted order always has a position in the table of the card. The card always makes a decision for each accepted order: release or rejection.
What the client does
| Answer | Meaning | What the client does |
|---|---|---|
| ACK | The card accepted the order | It waits for the receipt |
| Rate | The bucket of the session is empty | It sends again after some milliseconds |
| Credits | The card is full now | It sends again after some milliseconds |
| Barrier | Short stop near a batch | It sends again after some milliseconds |
| LATE | A stamp was too slow | It sends the same order again |
The official client does this automatically. A rejection costs time only. It does not use your nonce or your funds. With two or three doors, a rejection at one door does not stop your order: another door delivers it.
How the pressure moves back
one site is slow
-> batches wait for FINAL
-> the matcher of each site stops new batches
-> the cards keep their credits
-> the cards answer Credits
-> clients send again
No step removes accepted work to make space. Only the number of rejections increases, and clients see them immediately. If two of six sites are dark, the exchange stops. Safety comes before continuity.
What overload does not do
- It does not change the order of accepted orders.
- It does not sell a position in the list. There is no fee auction.
- It does not hide rejections.
Section 3.2 gives the measured throughput of the testnet.