Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing race condition for analysis #906

Merged
merged 4 commits into from
Sep 26, 2023

Conversation

slundqui
Copy link
Contributor

Analysis script had a race condition with the data collection script. Specifically, if the analysis script queried data from a block after pool_info was written, but before transactions and wallet deltas was written, the analysis script would potentially miss transactions.

Also adding in helper function useful for debugging to gather and filter hyperdrive events directly from the chain.

@vercel
Copy link

vercel bot commented Sep 26, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elf-simulations ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2023 10:34pm

@slundqui slundqui merged commit 01080d5 into delvtech:main Sep 26, 2023
6 checks passed
@slundqui slundqui deleted the load_wallet_hotfix branch September 26, 2023 22:40
@slundqui slundqui mentioned this pull request Sep 29, 2023
slundqui added a commit that referenced this pull request Sep 30, 2023
Previously, we look at the minimum block number of transactions, wallet
deltas, and pool info to see the last block updated. However, there's a
case where a large number of blocks tick up without any transactions. In
this case, the next transaction will result in analysis attempting to
process a large number of blocks, which breaks the analysis pipeline.

This PR resolves this issue, along with the race condition solved in
#906 by ensuring we
write pool_info as the last item, and using pool_info as the table to
see how far along the data process is.

This also deprecates all current wallet info tables from the db in favor
of using wallet deltas, as current wallet info needed pool_info data for
its calculations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants