Skip to content

Conversation

@rockysingh
Copy link
Contributor

@rockysingh rockysingh commented Jan 6, 2026

Reviewer Notes

Rewrites download-live2 command with HTTP transport (instead of gRPC) to avoid deadlock issues, adds inline validation with signature statistics, and implements automatic day rollover with resumable state.

Changes

DownloadDaysV3.java - Transport Fix

  • Switched from gRPC to HTTP transport for GCS downloads
  • Switched from virtual threads to platform threads (ConcurrentDownloadManagerVirtualThreadsV3)
  • Fixes deadlocks after ~6 minutes of high-concurrency downloads caused by virtual threads pinning carrier threads in gRPC/Netty synchronized blocks

DownloadLive2.java - Complete Rewrite

  • Switched from gRPC to HTTP transport for GCS downloads (avoids virtual thread deadlocks)
  • Switched from ConcurrentDownloadManagerVirtualThreads to ConcurrentDownloadManagerVirtualThreadsV3 (platform threads)
  • Added --start-date option to specify starting date (format: YYYY-MM-DD)
  • Auto-detects current day from mirror node if no start date specified
  • Inline full block validation as blocks are downloaded
  • Signature statistics tracking with CSV output (signature_statistics.csv)
  • Automatic day rollover: finalizes .tar.zstd archive at midnight and starts new day
  • State file saved to outputDir/validateCmdStatus.json (compatible with validate commands)
  • Resume support via state file with periodic saves

LiveDownloader.java

  • Switched from gRPC to HTTP transport
  • Switched to ConcurrentDownloadManagerVirtualThreadsV3

Documentation

  • Documented state file behavior and interaction with validate commands

Build

Test plan

  • Run download-live2 with --start-date to catch up from a specific date
  • Verify blocks are validated inline (check logs for validation messages)
  • Verify signature statistics are written to CSV
  • Verify day rollover creates proper .tar.zstd archives
  • Verify state file is saved and resume works after restart
  • Verify validate-with-stats can read state file written by download-live2

@rockysingh rockysingh requested review from a team as code owners January 6, 2026 22:51
@rockysingh rockysingh requested a review from AlfredoG87 January 6, 2026 22:51
@rockysingh rockysingh force-pushed the 1845-fix-addressbook-bugs branch 3 times, most recently from 24ea9f8 to f64c33c Compare January 6, 2026 23:06
Copy link
Contributor

@AlfredoG87 AlfredoG87 left a comment

Choose a reason for hiding this comment

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

Looks good but is failing CI Checks

@rockysingh rockysingh force-pushed the 1845-fix-addressbook-bugs branch from f64c33c to eebe7a0 Compare January 10, 2026 01:33
2. Switched from virtual threads to platform threads and from gRPC to HTTP transport because virtual threads pin carrier threads when hitting synchronized blocks in gRPC/Netty, causing deadlocks after ~6 minutes of high-concurrency downloads.
3. DownloadLive2.java - Complete Rewrite

     - HTTP transport + V3 manager - Same stable configuration as download-days-v3
     - Auto-detect today from mirror node if no state file exists
     - Simplified live flow:
       - Queries mirror node for latest block → determines current day
       - Downloads blocks sequentially with validation
       - Writes to .tar.zstd_partial via ConcurrentTarZstdWriter
       - Automatic day rollover with archive finalization
       - State persistence for resumability

Signed-off-by: Rocky Thind <[email protected]>
2. Switched from virtual threads to platform threads and from gRPC to HTTP transport because virtual threads pin carrier threads when hitting synchronized blocks in gRPC/Netty, causing deadlocks after ~6 minutes of high-concurrency downloads.
3. DownloadLive2.java - Complete Rewrite

     - HTTP transport + V3 manager - Same stable configuration as download-days-v3
     - Auto-detect today from mirror node if no state file exists
     - Simplified live flow:
       - Queries mirror node for latest block → determines current day
       - Downloads blocks sequentially with validation
       - Writes to .tar.zstd_partial via ConcurrentTarZstdWriter
       - Automatic day rollover with archive finalization
       - State persistence for resumability

Signed-off-by: Rocky Thind <[email protected]>
@rockysingh rockysingh force-pushed the 1845-fix-addressbook-bugs branch from fd58771 to 9c69085 Compare January 10, 2026 01:40
@rockysingh rockysingh self-assigned this Jan 10, 2026
@rockysingh rockysingh added the Block Node Tools Additional tools related to, but not part of, the Block Node label Jan 10, 2026
@rockysingh rockysingh added this to the 0.28.0 milestone Jan 10, 2026
@rockysingh rockysingh removed this from Hiero CLI Jan 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Block Node Tools Additional tools related to, but not part of, the Block Node

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants