Skip to content

Fixing race condition for analysis#906

Merged
slundqui merged 4 commits intodelvtech:mainfrom
slundqui:load_wallet_hotfix
Sep 26, 2023
Merged

Fixing race condition for analysis#906
slundqui merged 4 commits intodelvtech:mainfrom
slundqui:load_wallet_hotfix

Conversation

@slundqui
Copy link
Copy Markdown

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
Copy Markdown

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
@slundqui slundqui deleted the load_wallet_hotfix branch September 26, 2023 22:40
@slundqui slundqui mentioned this pull request Sep 29, 2023
slundqui pushed 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.
ghost-smith-re45 added a commit to ghost-smith-re45/agent0 that referenced this pull request Sep 28, 2025
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
delvtech/agent0#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.
danna-6389d added a commit to danna-6389d/agent03 that referenced this pull request Oct 28, 2025
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
delvtech/agent0#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