You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At this moment some of our queries are fragile to the fact that, technically, multiple settlements could happen in a single block. For example, the recent query for fetching orders by transaction hash (introduced in #1194) whose raw SQL query assumes block number is unique per settlement.
We have included a todo with a rough sketch of how to handle this which I will also paste here.
with target_block_number as (
SELECT block_number from settlements where tx_hash = $1
),
with next_log_index as (
SELECT log_index from settlements
WHERE block_number > target_block_number
ORDER BY block_number ascLIMIT1
)
"SELECT ", ORDERS_SELECT,
"FROM ", ORDERS_FROM,
"JOIN trades t \ ON t.order_uid = o.uid \ JOIN settlements s \ ON s.block_number = t.block_number \ WHERE s.tx_hash = $1 "ANDt.log_index BETWEEN s.log_indexAND next_log_index,
Up until this moment, we do not yet have a single instance of multiple settlements in a single block (cf Settlements Table) so this issue is not of immediate concern. However, with the introduction of multiple solver accounts (#1010) we may see this sooner than expected.
At this moment some of our queries are fragile to the fact that, technically, multiple settlements could happen in a single block. For example, the recent query for fetching orders by transaction hash (introduced in #1194) whose raw SQL query assumes block number is unique per settlement.
We have included a todo with a rough sketch of how to handle this which I will also paste here.
Up until this moment, we do not yet have a single instance of multiple settlements in a single block (cf Settlements Table) so this issue is not of immediate concern. However, with the introduction of multiple solver accounts (#1010) we may see this sooner than expected.
The text was updated successfully, but these errors were encountered: