A replace request that has passed signature / authorization / parsing
validation and is ready to be turned into a (CancelOrder, CreateOrder)
pair by the bulk-replace orchestrator. Splitting validation from
dispatch lets orchestrate_bulk_replace be unit-tested with a mocked
engine sender.
Per-phase deadline for the bulk-replace handler. Unlike
ENGINE_RESPONSE_TIMEOUT (which is the per-message budget on the
singular endpoints), this is the budget for all legs in a phase
combined. Keeps worst-case bulk latency bounded even if a single
legβs response is hung. Phase 1 and Phase 2 each get their own
deadline of this size, so a 50-leg bulk is bounded by roughly
2 Γ this duration end-to-end.
Build an OrderAction::CancelOrder message targeting this replaceβs
pre-existing order. symbol is intentionally empty β the engine resolves
it from order_id in its per-wallet order index (see how
cancel_order() does it in this file).
Run signature verification, agent authorization, symbol parsing,
trading-allowed checks, and price/size parsing + precision checks.
Returns a ValidatedReplace on success, or a pre-populated
BulkOrderResult carrying the rejection reason on any failure.