Fix Statecheck Race
We've observed some cases while running the state checks where we get the error Did not find pool in Midgard (Exists in Thornode)
. Intuitively it seems this is likely a race due to the pool_events
table not guaranteed to be up to date with the latest height in block_log
. This change simply compares at one block previous to the last height recorded in block_log
, which anecdotally seems to resolve the race in our observation.
If my assumption above is correct, is it safe to assume that the pool_events
table will never lag the latest height in block_log
by more than one block?