Problem
PollResultCode conflates the generator's verdict (should a discrete order be posted?) with observed fill state (PARTIALLY_FILLED / FILLED). The two fill variants can never be returned by any handler's poll(); they are synthesised only by ComposableCoW after poll() returns SUCCESS. The conflation also forces a false choice between "postable" and "partially filled", which is the root of the partiallyFillable stranding bug.
Current
src/interfaces/IConditionalOrder.sol L71-90 defines a seven-variant PollResultCode and a PollResult carrying filledAmount. BaseConditionalOrder.poll (L37-57) and all five order types only ever emit SUCCESS / WAIT_TIMESTAMP / WAIT_BLOCK / TRY_NEXT_BLOCK / INVALID; PARTIALLY_FILLED / FILLED and a non-zero filledAmount are produced only in ComposableCoW.getTradeableOrderWithSignature (L167-185). checkOrder likewise declares a return space it cannot produce.
Proposed
Split into a handler-facing verdict enum, for example GeneratorResultCode { POST, WAIT_TIMESTAMP, WAIT_BLOCK, TRY_NEXT_BLOCK, INVALID } returned by poll(), and an orthogonal fill overlay (for example FillStatus { NONE, PARTIALLY_FILLED, FILLED } plus filledAmount) composed into the public PollResult by ComposableCoW. Handlers lose the unreachable variants and the dead filledAmount field; fill state gains a place that can coexist with a POST verdict, which is what lets a partially filled partiallyFillable order keep being posted.
Scope
src/interfaces/IConditionalOrder.sol, src/BaseConditionalOrder.sol, src/ComposableCoW.sol, the checkOrder return type, tests, and docs. All five order types are unchanged (they never used the fill half). An ABI change, folded into the already-breaking PR.
Notes
Design decision from PR #1 review, and the frame for the partiallyFillable stranding fix. Handlers being unaffected is evidence the fill half was never load-bearing for them.
Problem
PollResultCodeconflates the generator's verdict (should a discrete order be posted?) with observed fill state (PARTIALLY_FILLED/FILLED). The two fill variants can never be returned by any handler'spoll(); they are synthesised only byComposableCoWafterpoll()returnsSUCCESS. The conflation also forces a false choice between "postable" and "partially filled", which is the root of thepartiallyFillablestranding bug.Current
src/interfaces/IConditionalOrder.solL71-90 defines a seven-variantPollResultCodeand aPollResultcarryingfilledAmount.BaseConditionalOrder.poll(L37-57) and all five order types only ever emitSUCCESS/WAIT_TIMESTAMP/WAIT_BLOCK/TRY_NEXT_BLOCK/INVALID;PARTIALLY_FILLED/FILLEDand a non-zerofilledAmountare produced only inComposableCoW.getTradeableOrderWithSignature(L167-185).checkOrderlikewise declares a return space it cannot produce.Proposed
Split into a handler-facing verdict enum, for example
GeneratorResultCode { POST, WAIT_TIMESTAMP, WAIT_BLOCK, TRY_NEXT_BLOCK, INVALID }returned bypoll(), and an orthogonal fill overlay (for exampleFillStatus { NONE, PARTIALLY_FILLED, FILLED }plusfilledAmount) composed into the publicPollResultbyComposableCoW. Handlers lose the unreachable variants and the deadfilledAmountfield; fill state gains a place that can coexist with aPOSTverdict, which is what lets a partially filledpartiallyFillableorder keep being posted.Scope
src/interfaces/IConditionalOrder.sol,src/BaseConditionalOrder.sol,src/ComposableCoW.sol, thecheckOrderreturn type, tests, and docs. All five order types are unchanged (they never used the fill half). An ABI change, folded into the already-breaking PR.Notes
Design decision from PR #1 review, and the frame for the
partiallyFillablestranding fix. Handlers being unaffected is evidence the fill half was never load-bearing for them.