Design a scheme for ordering EVM trace objects according to their execution within a transaction.
- The key requirement is that you don't have all the traces within the transaction up front. You might only have one trace out of 5 (or 1,000). So, if you were to use this scheme to order 3/5 traces, then insert the remaining 2, the order should still work as expected without needing to update the first 3.
- Ideally, the scheme would determine a value for each trace that can be used in a SQL
ORDER BY
clause. The value could be of any data type - integer, float, text (e.g. sorted lexicographically), or something more exotic.
Here's an example of a trace_filter
request and response ([Alchemy sandbox link](https://sandbox.alchemy.com/?network=ETH_MAINNET&method=trace_filter&body.id=1&body.jsonrpc=2.0&body.method=trace_filter&body.params%5B0%5D.fromBlock=0xc26f54&body.params%5B0%5D.toBlock=0xc26f54&body.params%5B0%5D.toAddress%5B0%5D=0x000000000000abe945c436595ce765a8a261317b&