Repository navigation
fix(tessera): Rework Tessera to use keep_alive - #46
Conversation
There was a problem hiding this comment.
Summary
This PR drops the tessera-freshness template and replaces it with a file-level keep_alive import. The import points at a new tessera-quote-publication keep-alive template. Each slot it writes the current slot to offset 120 and clears the used buy and sell depth at offsets 0 and 8, which is what the maker's republication does on mainnet. The registry counts, the README and the llm_context text are updated to match. The tests now drive the shipped keep-alive import, and a new test checks that a republication gives back the depth that swaps used up.
Overall this is a clear improvement in usability: callers no longer have to schedule a freshness override every 4 slots. The new tests are well targeted: the write-set check, the freshness-limit boundary, and the restored depth.
Concerns
- Lost capability: a stale maker can no longer be simulated on an overridden market. The "Stale maker" scenario and the "Make the quote stale" recipe are removed. Keep-alive overwrites
last_update_slotevery slot, so even a custom raw override at offset 120 is undone in the next slot. The only stale path left is a market that no override touches, and that market cannot also be repriced or thinned. This is a real loss for testing router fallback, e.g. "Tessera at price X goes stale". Please call it out explicitly in the PR or README, or consider a template that stops keep-alive for one market. - The buy-side reset at offset 0 is never exercised.
tessera_keep_alive_restores_the_depth_swaps_use_upchecks only the sell side (offset 8). A buy-direction check would confirm that offset 0 really is the used buy depth in quote atoms. - Duplicate troubleshooting entry. The README has two
Custom(65535)rows ("did not override" and "did not halt") with different explanations. Merging them into one row that lists both causes would read better. - Wording. "younger than its grace period, which keep-alive keeps it" is ungrammatical. It appears in both the README and
overrides.yaml.
| keep_alive: | ||
| - template: tessera-quote-publication | ||
| address: { type: override } | ||
| values: { last_update_slot: $slot, buy_depth_used: 0, sell_depth_used: 0 } |
There was a problem hiding this comment.
Every Tessera template, tessera-halt included, now enrols its market in keep-alive for the rest of the network's life. That makes a stale quote impossible to produce on any market a scenario touches. Before this PR, tessera-freshness with a negative offset covered that case, and the "Stale maker" scenario relied on it. Is this regression intended? If so, please document it. Otherwise consider an opt-out, such as a template that stops keep-alive for one market.
|
|
||
| The formulas hold for a quote younger than its grace period (see | ||
| [How a quote ages](#how-a-quote-ages)) and with neutral quote-start configs. The five quote-start configs at offset 1136 can lower a fill or make it skip leading levels. Which | ||
| The formulas hold for a quote younger than its grace period, which keep-alive keeps it (see |
There was a problem hiding this comment.
Grammar: "younger than its grace period, which keep-alive keeps it". Suggest: "…a quote younger than its grace period, as keep-alive keeps it (see …)". The same phrasing appears in overrides.yaml in the tessera-price llm_context.
| | Symptom | Fix | | ||
| | ----------------------------------------------------- | ------------------------------------------------------------------------------------- | | ||
| | `Custom(65535)` after a price, depth or curve change | The quote is stale. Add `tessera-freshness` with `last_update_slot: 0` in that slot | | ||
| | `Custom(65535)` on a market you did not override | Expected: nothing republishes a market no override names, so it went stale | |
There was a problem hiding this comment.
This row and the next one both start with Custom(65535) on a market…, but each gives a different cause. A reader matching on the symptom has to read both. Consider one row: "Custom(65535): the market was never overridden, so it aged past its limit, or the maker pulled that side upstream."
No description provided.