This repository was archived by the owner on Jan 27, 2026. It is now read-only.
Improvement: chainsync asynchronism#340
Closed
gsegatti wants to merge 1 commit into
Closed
Conversation
Contributor
gsegatti
commented
May 24, 2025
- Like Improvement: concurrent node invitation #294 and Improvement: more orchestrator asynchronism #295.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR improves the asynchronism in the chainsync functionality and related contract interactions by refining error types, enhancing error handling, and introducing concurrent processing for node synchronization.
- Updated error return types in compute registry and compute pool contracts to include Send + Sync.
- Enhanced error handling in the compute pool’s is_node_blacklisted function.
- Refactored chainsync code to perform concurrent node syncing using futures::stream::iter.
- Added the futures dependency in Cargo.toml.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/shared/src/web3/contracts/implementations/compute_registry_contract.rs | Updated error return type to enforce thread-safety with Send + Sync. |
| crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs | Improved error handling for node blacklist checks. |
| crates/discovery/src/chainsync/sync.rs | Refactored sync_single_node to use async join and concurrent processing with for_each_concurrent. |
| crates/discovery/Cargo.toml | Included futures dependency to support asynchronous stream operations. |
Comments suppressed due to low confidence (3)
crates/shared/src/web3/contracts/implementations/compute_pool_contract.rs:187
- Consider using a consistent error conversion helper to wrap these string errors with more contextual information.
let first_value = result.first().ok_or("Empty response when checking if node is blacklisted")?;
crates/discovery/src/chainsync/sync.rs:65
- Consider using the log crate (e.g., error!) for error reporting instead of eprintln, in order to maintain consistent logging throughout the code.
eprintln!("Error retrieving node info: {}", e);
crates/discovery/src/chainsync/sync.rs:110
- [nitpick] It may be beneficial to include additional context (e.g., node identifier) in the error logs within the concurrent stream to improve debugging clarity.
futures::stream::iter(nodes).for_each_concurrent(10, |node| {
Member
|
See other PR for feedback - unfortunately have to close this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.