There are four different orderings that we need to consider when fetching transaction data from the archive DB-
Blocks: blocks need to be ordered as per the canonical chain. For the ones pending ones you’ll need to select based on consensus rules which I believe is handled in the archive node API
Transactions within a block have a sequence. There is a sequence_no column in blocks_zkapp_commands table that gives you the ordering
Account updates within a zkapp transaction have a sequence. The ids are stored as an array dictating the order. zkapp_account_updates_ids column in zkapp_commands table
Events/actions within an account update have a sequence. Same as account updates, ids are stored as array in zke.element_ids column in zkapp_events table
It doesn’t seem like the queries in the archive API consider 2, 3, and 4
We need to expose these details in the graphQL response to ensure clients have the information they need to correctly process actions.
Relates to: https://github.com/o1-labs/o1js/issues/1872
We need to expose these details in the graphQL response to ensure clients have the information they need to correctly process actions.