oasisprotocol / nexus

Official indexer for the Oasis Network.
Apache License 2.0
13 stars 4 forks source link

test determinism for evm tokens analyzer #345

Open pro-wh opened 1 year ago

pro-wh commented 1 year ago

It's particularly nice for debugging, run comparisons, test writing etc, if the sql statements are ordered deterministically. Maybe you can sort staleTokens before this for loop? Or probably even better, make getStaleTokens() return ordered results by adding an ORDER BY token_address to the underlying db query.

_Originally posted by @mitjat in https://github.com/oasisprotocol/oasis-indexer/pull/344#discussion_r1127038703_

pro-wh commented 1 year ago

currently the "stale" tokens are maintained in an index so they're probably ordered by runtime, token_address. might as well make this explicit. if this later causes tokens at higher addresses to starve, we'll have to come up with something else.