fix(lifi): harden recovery and fill lifecycle - #117
Conversation
|
Reviewed the recovery/lifecycle changes end to end. Build is green, the 1. Verify the recovery scope against the LI.FI API (potential silent no-op)
If the server does not return non-exclusive matched orders for Please confirm with LI.FI that active matched orders (including non-exclusive limit orders) are returned by 2. A recovered, capacity-blocked order can be dropped on a transient error after recovery ends
It is an asymmetry (the same order is caught if it fails during recovery, lost if it fails after) that a hardening change should probably close. Not permanent and not fund-threatening, but worth fixing. 3. More than 1050 active orders in one status wedges quoting permanentlyThe offset cap ( 4. (low) Live-order overflow during recovery is best-effort
Nits
|
Initialize recovery before WebSocket delivery and classify deterministic strategy input rejections as terminal.
|
Re-reviewed at 369cdd8. The recovery-barrier redesign correctly closes the dropped-retry gap from my last review (the worker now holds the barrier until the retry FIFO drains, and the new regression test reproduces exactly that scenario), the seen-ring compaction is fixed, and moving 1. New in this update: a webhook strategy error can wedge recovery permanentlyThe new permanent-error classification only protects the default strategy:
So during recovery, a webhook that deterministically errors on one order (say a persistent 4xx on a malformed input, instead of the contractual 2.
|
oxsteins
left a comment
There was a problem hiding this comment.
Reviewed through 4e28200. Every finding from my earlier comments is fixed and verified: the recovery barrier now holds until the capacity-retry FIFO drains (with the regression test reproducing the exact drop scenario), strategy failures are bounded to three attempts per order per recovery session while chain/RPC failures stay fail-closed, webhook 400/422 responses are classified permanent through the typed status error, quotesAdded is verified range-for-range against the re-vendored spec so a partial acknowledgement keeps the pair tracked and retried, and the seen-ring compaction plus the smaller cleanups are in. Full race suite passes.
Two non-blocking notes for the record: worth confirming on the first order-dev deploy that a matched non-exclusive order actually comes back from GET /orders?exclusiveFor=<executor> (the design now documents this assumption, the live check would close it), and merge ordering with #115 needs coordination since both PRs touch run.go, solver.go, and the LI.FI completion path.
Approving.
No description provided.