Skip to content

feat: improve scanning speed#112

Merged
SWvheerden merged 5 commits into
tari-project:mainfrom
SWvheerden:sw_change_scanning
Apr 7, 2026
Merged

feat: improve scanning speed#112
SWvheerden merged 5 commits into
tari-project:mainfrom
SWvheerden:sw_change_scanning

Conversation

@SWvheerden
Copy link
Copy Markdown
Contributor

Description

Motivation and Context

How Has This Been Tested?

What process can a PR reviewer use to test or verify this change?

Breaking Changes

  • None
  • Requires data directory on base node to be deleted
  • Requires hard fork
  • Other - Please specify

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the blockchain scanning logic to use an asynchronous streaming approach. The BlockchainScanner trait and its gRPC and HTTP implementations now return a tokio::sync::mpsc::Receiver instead of a single result vector, allowing for more efficient processing of scanned blocks. The HTTP scanner specifically adopts a producer-consumer model using tokio::spawn and rayon for concurrent downloading and processing. Additionally, the ScanCoordinator has been updated to handle these streaming results and includes new logic for partial scan modes. One piece of feedback is to remove a dbg! macro used for timing that was left in the coordinator code.

Comment thread minotari/src/scan/coordinator.rs Outdated
@SWvheerden SWvheerden marked this pull request as ready for review April 7, 2026 09:16
@SWvheerden
Copy link
Copy Markdown
Contributor Author

/gemini review

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the blockchain scanning interface to use asynchronous streaming via mpsc channels for both gRPC and HTTP implementations. It introduces retry logic with exponential backoff for HTTP requests and updates the ScanCoordinator to handle the new streaming architecture. Feedback identifies a potential memory issue in gRPC height collection, a bug in progress tracking within the coordinator, and the need to move partial scan limit checks inside the processing loop. Additionally, it is recommended to remove commented-out code and ensure consistent retry logic across all scanner implementations.

Comment thread minotari-scanning/src/scanning/grpc/scanner.rs
Comment thread minotari/src/scan/coordinator.rs
Comment thread minotari/src/scan/coordinator.rs
Comment thread minotari/src/scan/coordinator.rs Outdated
Comment thread minotari-scanning/src/scanning/grpc/scanner.rs Outdated
@SWvheerden SWvheerden requested a review from martinserts April 7, 2026 10:23
@SWvheerden SWvheerden merged commit 2ab1e53 into tari-project:main Apr 7, 2026
2 checks passed
@SWvheerden SWvheerden deleted the sw_change_scanning branch April 7, 2026 10:42
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