Ask
quote must accept a stateOverlay parameter.
The interpreter's eval4 takes a stateOverlay, and post-H01 the on-chain calculate path (RaindexV6.calculateOrderIO(..., stateOverlay)) does too. But the interface's quote entrypoint IRaindexV6.quote2(QuoteV2) has no stateOverlay — the raindex impl is forced to pass new bytes32[](0), so quotes can only ever be evaluated against fresh/empty store state. Callers should be able to pass a stateOverlay to quote and simulate an order's calculate against arbitrary interpreter state.
Shape
Breaking interface addition → new interface version IRaindexV7 (coexists with IRaindexV6):
quote3(QuoteV3 quoteConfig) where QuoteV3 adds a bytes32[] stateOverlay field, or
quote3(QuoteV2 quoteConfig, bytes32[] stateOverlay).
Overlay format matches the interpreter's: [key0, val0, key1, val1, …] (identical to the calculate kvs). The raindex impl already threads stateOverlay internally — quote3 just forwards the caller-supplied one instead of new bytes32[](0).
Motivation (one example, not the only use)
The H01 fix (rainlanguage/raindex#2627, audit rainlanguage/raindex#2617) threads same-owner calculate writes within a takeOrders4 batch via stateOverlay. quote2 (empty overlay) can't reproduce that, so it over-states availability for a later same-owner order in a batch. With a stateOverlay on quote, a caller can pass the accumulated state and quote accurately. More generally, exposing the overlay lets callers simulate against any state.
References
Ask
quotemust accept astateOverlayparameter.The interpreter's
eval4takes astateOverlay, and post-H01 the on-chain calculate path (RaindexV6.calculateOrderIO(..., stateOverlay)) does too. But the interface's quote entrypointIRaindexV6.quote2(QuoteV2)has nostateOverlay— the raindex impl is forced to passnew bytes32[](0), so quotes can only ever be evaluated against fresh/empty store state. Callers should be able to pass astateOverlayto quote and simulate an order's calculate against arbitrary interpreter state.Shape
Breaking interface addition → new interface version
IRaindexV7(coexists withIRaindexV6):quote3(QuoteV3 quoteConfig)whereQuoteV3adds abytes32[] stateOverlayfield, orquote3(QuoteV2 quoteConfig, bytes32[] stateOverlay).Overlay format matches the interpreter's:
[key0, val0, key1, val1, …](identical to the calculatekvs). The raindex impl already threadsstateOverlayinternally —quote3just forwards the caller-supplied one instead ofnew bytes32[](0).Motivation (one example, not the only use)
The H01 fix (rainlanguage/raindex#2627, audit rainlanguage/raindex#2617) threads same-owner calculate writes within a
takeOrders4batch viastateOverlay.quote2(empty overlay) can't reproduce that, so it over-states availability for a later same-owner order in a batch. With astateOverlayon quote, a caller can pass the accumulated state and quote accurately. More generally, exposing the overlay lets callers simulate against any state.References