Commit 4e379e4
committed
Rebase missing-order reconciliation gate onto monotonic receipt time
`handle_missing_order` had a recency gate comparing the order's venue
`ts_last` against `self.clock` now - a cross-axis compare that #4376
hardened against underflow but left on the trading clock. Under a
custom live/sandbox clock factory the trading clock is not wall-paced
(it can run accelerated or sit on a foreign epoch), so that window did
not measure the real settling time it was meant to, and a corrupt
far-future `ts_last` could stall the order's reconciliation.
Drop the venue-`ts_last` gate. The missing-order settling window is now
solely the monotonic `order_local_activity` recency gate (the
`RecencyMap` from the recency-map consolidation), which measures real
receipt-time elapsed at any clock speed. This also removes the
warn-and-defer arm #4376 added for a far-future `ts_last`: with the
cross-axis gate gone there is no longer a failure mode to warn about -
the order simply reconciles once the real grace expires.
Making local activity the sole gate exposed an ordering bug in the
`LiveNode` dispatch path: acknowledgement events (`Accepted` et al)
stamped local activity and then immediately wiped it via
`clear_recon_tracking`, so a just-accepted order omitted by a lagging
venue report could be falsely rejected as NOT_FOUND_AT_VENUE. The
per-order-event tracking now lives in
`ExecutionManager::observe_order_event`, which clears first and stamps
after - matching the ordering `observe_execution_report` already used -
and the node's batch accept/cancel arms are reordered the same way.
Audit of the remaining live timers for the same class: the cache-purge
intervals are deliberately left on the ExecutionEngine clock-timer path
so they stay controlled by the injected Clock for custom-clock callers;
a comment and a conversion test now pin that. Data-engine, order
emulator, and core timing stay domain/deterministic, and
`snapshot_positions_interval_secs` is left as-is (no live monotonic
replacement).
The missing-order test becomes a differential paused-time case: with a
far-future venue `ts_last` present throughout, recent local activity
defers, and after the monotonic grace expires reconciliation proceeds.
It tracks the accepted event through `observe_order_event` - the exact
`LiveNode` call - and a dedicated regression test covers the
just-accepted-order deferral end to end.
Coded by an LLM.1 parent f52ad86 commit 4e379e4
4 files changed
Lines changed: 146 additions & 62 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1461 | 1461 | | |
1462 | 1462 | | |
1463 | 1463 | | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
| 1468 | + | |
| 1469 | + | |
| 1470 | + | |
| 1471 | + | |
| 1472 | + | |
| 1473 | + | |
| 1474 | + | |
| 1475 | + | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
| 1488 | + | |
| 1489 | + | |
| 1490 | + | |
| 1491 | + | |
| 1492 | + | |
| 1493 | + | |
| 1494 | + | |
1464 | 1495 | | |
1465 | 1496 | | |
1466 | 1497 | | |
| |||
1670 | 1701 | | |
1671 | 1702 | | |
1672 | 1703 | | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
| 1704 | + | |
| 1705 | + | |
| 1706 | + | |
1699 | 1707 | | |
1700 | 1708 | | |
1701 | 1709 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
504 | 508 | | |
505 | 509 | | |
506 | 510 | | |
| |||
1285 | 1289 | | |
1286 | 1290 | | |
1287 | 1291 | | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1288 | 1298 | | |
1289 | 1299 | | |
1290 | 1300 | | |
| |||
1293 | 1303 | | |
1294 | 1304 | | |
1295 | 1305 | | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
1296 | 1312 | | |
1297 | 1313 | | |
1298 | 1314 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1161 | 1161 | | |
1162 | 1162 | | |
1163 | 1163 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
1175 | | - | |
1176 | | - | |
1177 | | - | |
1178 | | - | |
1179 | | - | |
1180 | | - | |
1181 | | - | |
1182 | | - | |
1183 | | - | |
1184 | | - | |
1185 | | - | |
1186 | | - | |
| 1164 | + | |
1187 | 1165 | | |
1188 | 1166 | | |
1189 | 1167 | | |
| |||
1193 | 1171 | | |
1194 | 1172 | | |
1195 | 1173 | | |
1196 | | - | |
| 1174 | + | |
| 1175 | + | |
1197 | 1176 | | |
1198 | 1177 | | |
1199 | 1178 | | |
| 1179 | + | |
1200 | 1180 | | |
1201 | 1181 | | |
1202 | 1182 | | |
1203 | 1183 | | |
1204 | | - | |
1205 | 1184 | | |
1206 | 1185 | | |
1207 | 1186 | | |
| 1187 | + | |
1208 | 1188 | | |
1209 | 1189 | | |
1210 | 1190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7617 | 7617 | | |
7618 | 7618 | | |
7619 | 7619 | | |
7620 | | - | |
7621 | | - | |
7622 | | - | |
7623 | | - | |
7624 | | - | |
| 7620 | + | |
| 7621 | + | |
| 7622 | + | |
| 7623 | + | |
| 7624 | + | |
| 7625 | + | |
| 7626 | + | |
| 7627 | + | |
7625 | 7628 | | |
7626 | | - | |
| 7629 | + | |
7627 | 7630 | | |
7628 | 7631 | | |
7629 | 7632 | | |
7630 | 7633 | | |
7631 | 7634 | | |
7632 | 7635 | | |
7633 | 7636 | | |
7634 | | - | |
| 7637 | + | |
7635 | 7638 | | |
7636 | 7639 | | |
7637 | 7640 | | |
7638 | 7641 | | |
7639 | 7642 | | |
7640 | 7643 | | |
7641 | 7644 | | |
7642 | | - | |
| 7645 | + | |
| 7646 | + | |
7643 | 7647 | | |
7644 | | - | |
| 7648 | + | |
| 7649 | + | |
| 7650 | + | |
| 7651 | + | |
| 7652 | + | |
7645 | 7653 | | |
7646 | 7654 | | |
7647 | 7655 | | |
| |||
7654 | 7662 | | |
7655 | 7663 | | |
7656 | 7664 | | |
7657 | | - | |
| 7665 | + | |
| 7666 | + | |
| 7667 | + | |
| 7668 | + | |
| 7669 | + | |
| 7670 | + | |
| 7671 | + | |
| 7672 | + | |
| 7673 | + | |
| 7674 | + | |
| 7675 | + | |
| 7676 | + | |
| 7677 | + | |
| 7678 | + | |
| 7679 | + | |
| 7680 | + | |
| 7681 | + | |
| 7682 | + | |
| 7683 | + | |
| 7684 | + | |
| 7685 | + | |
| 7686 | + | |
| 7687 | + | |
| 7688 | + | |
| 7689 | + | |
| 7690 | + | |
| 7691 | + | |
| 7692 | + | |
| 7693 | + | |
| 7694 | + | |
| 7695 | + | |
| 7696 | + | |
| 7697 | + | |
| 7698 | + | |
| 7699 | + | |
| 7700 | + | |
| 7701 | + | |
| 7702 | + | |
| 7703 | + | |
| 7704 | + | |
| 7705 | + | |
| 7706 | + | |
| 7707 | + | |
| 7708 | + | |
| 7709 | + | |
| 7710 | + | |
| 7711 | + | |
| 7712 | + | |
| 7713 | + | |
| 7714 | + | |
| 7715 | + | |
| 7716 | + | |
| 7717 | + | |
| 7718 | + | |
| 7719 | + | |
7658 | 7720 | | |
| 7721 | + | |
| 7722 | + | |
| 7723 | + | |
| 7724 | + | |
| 7725 | + | |
| 7726 | + | |
| 7727 | + | |
7659 | 7728 | | |
| 7729 | + | |
7660 | 7730 | | |
7661 | 7731 | | |
7662 | 7732 | | |
7663 | 7733 | | |
7664 | 7734 | | |
7665 | 7735 | | |
7666 | 7736 | | |
7667 | | - | |
| 7737 | + | |
| 7738 | + | |
| 7739 | + | |
| 7740 | + | |
| 7741 | + | |
| 7742 | + | |
| 7743 | + | |
| 7744 | + | |
| 7745 | + | |
| 7746 | + | |
| 7747 | + | |
7668 | 7748 | | |
7669 | 7749 | | |
7670 | 7750 | | |
| |||
0 commit comments