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

Added async to discover factories #230

Merged
merged 4 commits into from
Dec 5, 2024
Merged

Conversation

molaco
Copy link
Contributor

@molaco molaco commented Nov 4, 2024

I have added a stream to process block logs asyncronously in discover_factories. I had to change some types and lifetimes and add some dependencies. I originally implemented this without using amms Factory and was a lot faster maybe i have messed sth up with the lifetimes. I also did some implementations using fututres unordered but they did not seem to increase performance.

@0xDmtri
Copy link
Contributor

0xDmtri commented Nov 8, 2024

Looks good imho. Can I ask you why did u pick stream and not just tokio::spawn() and then collect and join handles with appropriate rate limit? Also probably will be better to use tracing::error!() than eprintln!.

@molaco
Copy link
Contributor Author

molaco commented Nov 8, 2024

@0xDmtri i used the stream because i thought that maybe in the future the whole process from factory to pairs and pool info could be done in one go. But you probably need to filter the factories and pairs so i dont think its possible. I have changed it and used FututresUnordered instead because it seems a simpler and works great. I also added tracing for the task errors. Let me know if there are any issues.

@0xKitsune 0xKitsune merged commit 8ad7d05 into darkforestry:main Dec 5, 2024
1 of 2 checks passed
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.

3 participants